diff options
587 files changed, 193056 insertions, 24447 deletions
diff --git a/Advanced_Strength_and_Applied_Elasticity/Chapter9.ipynb b/Advanced_Strength_and_Applied_Elasticity/Chapter9.ipynb index 3d23ec50..ba3e1fe4 100755 --- a/Advanced_Strength_and_Applied_Elasticity/Chapter9.ipynb +++ b/Advanced_Strength_and_Applied_Elasticity/Chapter9.ipynb @@ -1,123 +1,123 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:7853c3db6f4cd796ee2eb082e96153a72623c7508ac062b3bd0f06e348f02e54"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter9-Beams On Elastic Foundations"
- ]
- },
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Ex1-pg273"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#calculate length and maxi force per unit of length between beam & foundation \n",
- "w=0.1 ##m\n",
- "d=0.115 ##m\n",
- "l=4. ##m\n",
- "p=175. ##kN/m\n",
- "k=14*10**6. ##Pa\n",
- "E=200*10**9. ##Pa\n",
- "I=(0.1*(0.15)**3.)\n",
- "\n",
- "##deltav=(p/2*k)*derivative(x)*beta*exp**(betax)*(cos beta(x)+sin beta(x))\n",
- "##vA=(p/2k)*(2-exp**(betaa)*cos betaa - exp**(betab)*cos betab)\n",
- "\n",
- "beta=(k/(4.*E*I/12.))**(0.25)\n",
- "print'%s %.2f %s'%(\"in meter inverse is= \",beta,\"\")\n",
- "\n",
- "vmax=(p*(2-(-0.0345)-(0.0345)))/(2*14000.)\n",
- "print'%s %.2f %s'%(\"in meter is= \",vmax,\"\")\n",
- "z=k*vmax\n",
- "print'%s %.2f %s'%(\"maxi force per unit of length between beam & foundation in kN/m is= \",z,\"\")\n",
- "\n",
- "## Ans varies due to round of error\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "in meter inverse is= 0.89 \n",
- "in meter is= 0.01 \n",
- "maxi force per unit of length between beam & foundation in kN/m is= 175000.00 \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex4-pg279"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#find foundation modulus of the equivalent continuous elastic support in Pa\n",
- "a=1.5 ##m\n",
- "E=206.8*10**9 ##Pa\n",
- "K=10000. ##N/m\n",
- "I=6*10**-6 ##m**4\n",
- "P=6700 ##N\n",
- "c=0.05\n",
- "\n",
- "k=K/a\n",
- "print'%s %.2f %s'%(\"foundation modulus of the equivalent continuous elastic support in Pa is=\",k,\"\")\n",
- "\n",
- "beta=(k/(4.*E*I))**(1/4.)\n",
- "print(beta)\n",
- "\n",
- "##sigmamax=(M*c/I)=(P*c/4*beta*I)\n",
- "sigmamax=((P*c)/(4.*beta*I))\n",
- "print'%s %.2f %s'%(\"in Pa is=\",sigmamax,\"\")\n",
- "\n",
- "vmax=(P*beta)/(2.*k)\n",
- "print'%s %.2f %s'%(\"in meter is=\",vmax,\"\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "foundation modulus of the equivalent continuous elastic support in Pa is= 6666.67 \n",
- "0.191441787744\n",
- "in Pa is= 72911632.81 \n",
- "in meter is= 0.10 \n"
- ]
- }
- ],
- "prompt_number": 1
- }
- ],
- "metadata": {}
- }
- ]
+{ + "metadata": { + "name": "", + "signature": "sha256:e48bc7584793a78fba4a87aa7646e91c7da5350f8eff658edcbe9f4343b9ee57" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter9-Beams On Elastic Foundations" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex1-pg273" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#calculate length and maxi force per unit of length between beam & foundation \n", + "w=0.1 ##m\n", + "d=0.115 ##m\n", + "l=4. ##m\n", + "p=175. ##kN/m\n", + "k=14*10**6. ##Pa\n", + "E=200*10**9. ##Pa\n", + "I=(0.1*(0.15)**3.)\n", + "\n", + "##deltav=(p/2*k)*derivative(x)*beta*exp**(betax)*(cos beta(x)+sin beta(x))\n", + "##vA=(p/2k)*(2-exp**(betaa)*cos betaa - exp**(betab)*cos betab)\n", + "\n", + "beta=(k/(4.*E*I/12.))**(0.25)\n", + "print'%s %.2f %s'%(\"in meter inverse is= \",beta,\"\")\n", + "\n", + "vmax=(p*(2-(-0.0345)-(0.0345)))/(2*14000.)\n", + "print'%s %.2f %s'%(\"in meter is= \",vmax,\"\")\n", + "z=k*vmax\n", + "print'%s %.2f %s'%(\"maxi force per unit of length between beam & foundation in kN/m is= \",z,\"\")\n", + "\n", + "## Ans varies due to round of error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "in meter inverse is= 0.89 \n", + "in meter is= 0.01 \n", + "maxi force per unit of length between beam & foundation in kN/m is= 175000.00 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4-pg279" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#find foundation modulus of the equivalent continuous elastic support in Pa\n", + "a=1.5 ##m\n", + "E=206.8*10**9 ##Pa\n", + "K=10000. ##N/m\n", + "I=6*10**-6 ##m**4\n", + "P=6700 ##N\n", + "c=0.05\n", + "\n", + "k=K/a\n", + "print'%s %.2f %s'%(\"foundation modulus of the equivalent continuous elastic support in Pa is=\",k,\"\")\n", + "\n", + "beta=(k/(4.*E*I))**(1/4.)\n", + "print(beta)\n", + "\n", + "##sigmamax=(M*c/I)=(P*c/4*beta*I)\n", + "sigmamax=((P*c)/(4.*beta*I))\n", + "print'%s %.2f %s'%(\"in Pa is=\",sigmamax,\"\")\n", + "\n", + "vmax=(P*beta)/(2.*k)\n", + "print'%s %.2f %s'%(\"in meter is=\",vmax,\"\")\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "foundation modulus of the equivalent continuous elastic support in Pa is= 6666.67 \n", + "0.191441787744\n", + "in Pa is= 72911632.81 \n", + "in meter is= 0.10 \n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] }
\ No newline at end of file diff --git a/Advanced_Strength_and_Applied_Elasticity/README.txt b/Advanced_Strength_and_Applied_Elasticity/README.txt new file mode 100755 index 00000000..d6a392b5 --- /dev/null +++ b/Advanced_Strength_and_Applied_Elasticity/README.txt @@ -0,0 +1,10 @@ +Contributed By: harish sahu +Course: btech +College/Institute/Organization: iitbombay +Department/Designation: chemical engineering +Book Title: Advanced Strength and Applied Elasticity +Author: A. C. Ugural and S. K. Fenster +Publisher: Prentice Hall +Year of publication: 1981 +Isbn: 0713134364 +Edition: 2
\ No newline at end of file diff --git a/Aircraft_Propulsion/README.txt b/Aircraft_Propulsion/README.txt new file mode 100755 index 00000000..0afa70e5 --- /dev/null +++ b/Aircraft_Propulsion/README.txt @@ -0,0 +1,10 @@ +Contributed By: kumar gugloth +Course: btech +College/Institute/Organization: IIT Bombay +Department/Designation: Aerospace Engineering +Book Title: Aircraft Propulsion +Author: S. Farokhi +Publisher: J. Wiley And Sons +Year of publication: 2009 +Isbn: 978-0-470-03906-9 +Edition: 1
\ No newline at end of file diff --git a/C++_By_Example/screenshots/chapter2.png b/C++_By_Example/screenshots/chapter2.png Binary files differnew file mode 100755 index 00000000..c8c2cb0d --- /dev/null +++ b/C++_By_Example/screenshots/chapter2.png diff --git a/C++_By_Example/screenshots/chapter3.png b/C++_By_Example/screenshots/chapter3.png Binary files differnew file mode 100755 index 00000000..3c2a3a90 --- /dev/null +++ b/C++_By_Example/screenshots/chapter3.png diff --git a/C++_By_Example/screenshots/chapter4.png b/C++_By_Example/screenshots/chapter4.png Binary files differnew file mode 100755 index 00000000..9c70d8e1 --- /dev/null +++ b/C++_By_Example/screenshots/chapter4.png diff --git a/C++_By_Example_by_Greg__M._Perry/Chapter1.ipynb b/C++_By_Example_by_Greg__M._Perry/Chapter1.ipynb new file mode 100755 index 00000000..98d9cbdf --- /dev/null +++ b/C++_By_Example_by_Greg__M._Perry/Chapter1.ipynb @@ -0,0 +1,733 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:846e4f1aaa1db87dad144e6583289406d6871f19fbfd727f22b3926e50573c01" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1: Introduction to C++" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C3FIRST, Page number:52" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable Declaration\n", + "i=4\n", + "j=i+7\n", + "c='A'\n", + "x=9.087\n", + "x=x*4.5\n", + "#Result\n", + "print i,c,j,x" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "4 A 11 40.8915\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C4ST1, Page number:85" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Result\n", + "print \"C++ programming is fun!\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C++ programming is fun!\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C4ST2, Page number:86" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Declaration\n", + "tax_rate=0.08\n", + "sale=22.54\n", + "#Calculation\n", + "tax=sale*tax_rate\n", + "#Result\n", + "print \"The sales tax is :\" ,tax" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The sales tax is : 1.8032\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C4AREAC,Page number:95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Declaration\n", + "PI=3.14159\n", + "radius=5\n", + "#Calculation\n", + "area=radius*radius*PI\n", + "#Result\n", + "print \"The area is \",area\n", + "radius=20\n", + "#Calculation\n", + "area=radius*radius*PI\n", + "#Result\n", + "print \"The area is \",area" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The area is 78.53975\n", + "The area is 1256.636\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C5INIT,Page number:108" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Get input\n", + "#first=raw_input(\"Enter your first name:\")\n", + "#last=raw_input(\"Enter your last name\")\n", + "first=\"perry\"\n", + "last=\"greg\"\n", + "#Print the Initials\n", + "print \"Your initials are \",first[0],last[0] " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Your initials are p g\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C6PRE,Page number:114" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Declaration\n", + "AGE=28\n", + "MESSAGE=\"Hello, world\"\n", + "i=10\n", + "age=5\n", + "# 'AGE' is different from 'age'\n", + "i=i*AGE \n", + "#Result\n", + "print i,\" \",age,\" \",AGE,\"\\n\"\n", + "print MESSAGE " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "280 5 28 \n", + "\n", + "Hello, world\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C6INCL1,Page number:119" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Result\n", + "print \"Kelly Jane Peterson\\n\"\n", + "print \"Apartment #217\\n\"\n", + "print \"4323 East Skelly Drive\\n\"\n", + "print \"New York, New York\\n\"\n", + "print \" 10012\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Kelly Jane Peterson\n", + "\n", + "Apartment #217\n", + "\n", + "4323 East Skelly Drive\n", + "\n", + "New York, New York\n", + "\n", + " 10012\n", + "\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C6INCL3,Page number:120" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "source = \"This is fun!\"\n", + "#source is copied to message\n", + "import copy\n", + "message=copy.copy(source)\n", + "#Result\n", + "print message" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "This is fun!\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C6DEF1,Page number:121" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "MYNAME=\"Phil Ward\"\n", + "name=MYNAME\n", + "#Result\n", + "print \"My name is \",name,\"\\n\"\n", + "print \"My name is \",MYNAME,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "My name is Phil Ward \n", + "\n", + "My name is Phil Ward \n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C6DEF2,Page number:122" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#function definition\n", + "def X4(b,c,d):\n", + " return 2*b+c+3*b+c+b+c+4*b+c+b+c*c+b+c-d\n", + "b=2\n", + "c=3\n", + "d=4\n", + "e= X4 (b,c,d)\n", + "#Result\n", + "print e,\",\",b+c,\",\",b+c+b+c,\",\",b+c+b+c*c+b+c-d,\",\",X4(b,c,d)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "44 , 5 , 10 , 17 , 44\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7PRNT1,Page number:136" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Declaration\n", + "first='E'\n", + "middle='W'\n", + "last='C'\n", + "age=32\n", + "dependents=2\n", + "salary=25000.00\n", + "bonus=575.25\n", + "#Result\n", + "print \"Here are the initials: \"\n", + "print first,middle,last\n", + "print \"The age and number of dependents are \"\n", + "print age,\" \",dependents\n", + "print \"The salary and bonus are \"\n", + "print salary,\" \",bonus" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are the initials: \n", + "E W C\n", + "The age and number of dependents are \n", + "32 2\n", + "The salary and bonus are \n", + "25000.0 575.25\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7TEAM, Page number:138" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#table of team names and hits for three weeks\n", + "print \"Parrots\\tRams\\tKings\\tTitans\\tChargers\"\n", + "print \"3\\t5\\t3\\t1\\t0\"\n", + "print \"2\\t5\\t1\\t0\\t1\"\n", + "print \"2\\t6\\t4\\t3\\t0\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Parrots\tRams\tKings\tTitans\tChargers\n", + "3\t5\t3\t1\t0\n", + "2\t5\t1\t0\t1\n", + "2\t6\t4\t3\t0\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7PAY1,Page number:141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Computes and prints payroll data properly in dollars and cents.\n", + "emp_name=\"Larry Payton\"\n", + "pay_date=\"03/09/92\"\n", + "hours_worked=43\n", + "rate=7.75 #pay per hour\n", + "tax_rate=.32 #Tax percentage rate\n", + "#Compute the pay amount\n", + "gross_pay=hours_worked*rate\n", + "taxes=tax_rate*gross_pay\n", + "net_pay=gross_pay-taxes\n", + "#Results\n", + "print \"As of: \",pay_date\n", + "print emp_name,\" worked \",hours_worked,\"hours\"\n", + "print \"and got paid\",round(gross_pay,2)\n", + "print \"After taxes of: \",round(taxes,2)\n", + "print \"his take-home pay was $\",round(net_pay,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "As of: 03/09/92\n", + "Larry Payton worked 43 hours\n", + "and got paid 333.25\n", + "After taxes of: 106.64\n", + "his take-home pay was $ 226.61\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7SLTX1, Page number:146" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#getting total sale as float number.\n", + "#print \"What is the total amount of the sale?\"\n", + "#total_sale=float(raw_input()) \n", + "total_sale=50\n", + "#Compute sales tax\n", + "stax=total_sale*0.07 \n", + "#Results\n", + "print \"The sales tax for\",float(round(total_sale,2)),\"is\",round(stax,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The sales tax for 50.0 is 3.5\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7PHON1, Page number:147" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#request user's name and print it as it would appeat in a phone book\n", + "#get name\n", + "#first=raw_input(\"What is your first name?\\n\")\n", + "#last=raw_input(\"What is your last name?\\n\")\n", + "first=\"perry\"\n", + "last=\"greg\"\n", + "print \"\\n\\n\"\n", + "print \"In a phone book,your name would look like this :\\n\"\n", + "print last,\",\",first " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "\n", + "\n", + "In a phone book,your name would look like this :\n", + "\n", + "greg , perry\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7MATH, Page number:148" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Simple Addition\n", + "print \"*** Math Practice ***\\n\"\n", + "#num1=input(\"What is the first number:\")\n", + "#num2=input(\"What is the second number:\")\n", + "num1=10\n", + "num2=20\n", + "ans=num1+num2\n", + "#get user answer\n", + "#her_ans=input(\"\\nWhat do you think is the answer?\")\n", + "her_ans=30\n", + "#Result\n", + "print \"\\n\",num1,\"plus\",num2,\"is\",ans,\"\\n\\nHope you got it right!\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "*** Math Practice ***\n", + "\n", + "\n", + "10 plus 20 is 30 \n", + "\n", + "Hope you got it right!\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7PS2, Page number:150" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "message=\"Please turn on your printer.\"\n", + "#Result\n", + "print message" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Please turn on your printer.\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7PRNTF, Page number:153" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Declaration\n", + "first='E'\n", + "middle='W'\n", + "last='C'\n", + "age=32\n", + "dependents=2\n", + "salary=25000.00\n", + "bonus=575.25\n", + "#Result\n", + "print \"Here are the initials: \"\n", + "print first,\" \",middle,\" \",last,\"\\n\"\n", + "print \"The age and number of dependents are: \"\n", + "print age,\" \",dependents,\"\\n\"\n", + "print \"The salary and bonus are: \"\n", + "print \"%.6f\" %salary,\" \",\"%.6f\" %bonus" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are the initials: \n", + "E W C \n", + "\n", + "The age and number of dependents are: \n", + "32 2 \n", + "\n", + "The salary and bonus are: \n", + "25000.000000 575.250000\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C7SLTXS, Page number:156" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#prompt for a sales amount and print sales tax\n", + "#getting total sale as float number\n", + "#print \"What is the total amount of the sale?\"\n", + "#total_sale=float(raw_input()) \n", + "total_sale=10\n", + "#compute sales tax\n", + "stax=total_sale*0.07 \n", + "#Result\n", + "print \"The sales tax for\",float(round(total_sale,3)),\"is\",round(stax,3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The sales tax for 10.0 is 0.7\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/C++_By_Example_by_Greg__M._Perry/Chapter2.ipynb b/C++_By_Example_by_Greg__M._Perry/Chapter2.ipynb new file mode 100755 index 00000000..16b4b2bc --- /dev/null +++ b/C++_By_Example_by_Greg__M._Perry/Chapter2.ipynb @@ -0,0 +1,756 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:5641a94ed238f5f3bc00f944b1535145b962a2fb8c9b581876b500af4b0fc420" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2: Using C++ Operators" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C8NEG :Page 166" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "temp=-12\n", + "#Result\n", + "print -temp" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "12\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C8DIV :Page 167" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#To compute weekly pay\n", + "#Get input\n", + "#yearly=input(\"What is your annual pay?\")\n", + "yearly=38000.00\n", + "weekly=yearly/52\n", + "#Result\n", + "print \"\\nYour weekly pay is \",float(weekly)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Your weekly pay is 730.769230769\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C8AVG1 :Page 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Compute the average of three grades\n", + "grade1=87.5\n", + "grade2=92.4\n", + "grade3=79.6\n", + "#Average calculation\n", + "avg=grade1+grade2+grade3/3.0\n", + "#Result\n", + "print \"The average is: \",avg" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The average is: 206.433333333\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C8DATA :Page 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Declaration\n", + "bonus=50\n", + "salary=1400.50\n", + "#Calculation\n", + "total=salary+bonus\n", + "#Result\n", + "print \"The total is \",\"%.2f\" %total" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total is 1450.50\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C8INT1 :Page 181" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Calculate interest\n", + "days=45\n", + "principle=3500.00\n", + "interest_rate=0.155\n", + "#daily interest rate\n", + "daily_interest=interest_rate/365 \n", + "daily_interest=principle*daily_interest*days\n", + "#Update principle\n", + "principle+=daily_interest \n", + "#Result\n", + "print \"The balance you owe is:\",\"%.2f\" %principle" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The balance you owe is: 3566.88\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C9PAY1 :Page 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Calculate salesperson's pay based on his or her sales\n", + "print \"Payroll Calculation\\n\"\n", + "print \"------------------------\\n\"\n", + "#Get input\n", + "sal_name=raw_input(\"What is salesperson's last name? \")\n", + "hours=input(\"How many hours did the salesperson work? \")\n", + "total_sales=input(\"What were the total sales? \")\n", + "bonus=0\n", + "#Compute base pay\n", + "pay=4.10*float(hours) \n", + "if total_sales>8500.00:\n", + " bonus=500.00\n", + "#Result\n", + "print sal_name,\"made $\",\"%.2f\" %pay, \"\\n and got a bonus of $\",\"%.2f\" %bonus" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Payroll Calculation\n", + "\n", + "------------------------\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is salesperson's last name? Harrison\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "How many hours did the salesperson work? 40\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What were the total sales? 6050.64\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Harrison made $ 164.00 \n", + " and got a bonus of $ 0.00\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C9AGE :Page 195" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Get input\n", + "age=input(\"What is the student's age?\")\n", + "if age<10:\n", + " print \"\\n*** The age cannot be less than 10 ***\\n\"\n", + " print \"Try again...\\n\"\n", + " age=input(\"What is the student's age?\")\n", + "#Result\n", + "print \"\\nThank you. You entered a valid age.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the student's age?3\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "*** The age cannot be less than 10 ***\n", + "\n", + "Try again...\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the student's age?21\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Thank you. You entered a valid age.\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C9SQR1 :Page 197" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "##Print square of the input value if it is lessthan 180\n", + "#Get input\n", + "num=input(\"What number do you want to see the square of?\")\n", + "if num<=180:\n", + " square=num*num\n", + " print \"The square of \",num,\"is \",square,\"\\n\"\n", + " print \"\\nThank you for requesting square roots.\\n\" \n", + "num=input(\"What number do you want to see the square of?\")\n", + "if num>180:\n", + " import os\n", + " os.system('\\a')\n", + " print \"\\n* Square is not allowed for numbers over 180 *\"\n", + " print \"\\nRun this program again trying a smaller value.\"\n", + "print \"\\nThank you for requesting square roots.\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What number do you want to see the square of?45\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The square of 45 is 2025 \n", + "\n", + "\n", + "Thank you for requesting square roots.\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What number do you want to see the square of?212\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "* Square is not allowed for numbers over 180 *\n", + "\n", + "Run this program again trying a smaller value.\n", + "\n", + "Thank you for requesting square roots.\n", + "\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C9IFEL1 :Page 200" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Get input\n", + "#num=input(\"What is your answer?\\n\")\n", + "num=1\n", + "if num>0:\n", + " print \"\\nMore than 0\\n\"\n", + "else:\n", + " print \"\\nLess or equal to 0\\n\"\n", + "\n", + "print \"\\nThanks for your time.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "More than 0\n", + "\n", + "\n", + "Thanks for your time.\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C9IFEL2 :Page 200" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Test user's first initial and prints a message.\n", + "#Get input\n", + "#last=raw_input(\"\\nWhat is your last name?\\n\")\n", + "last=\"Praveen\"\n", + "#test the initial\n", + "if last[0] <= 'P':\n", + " print \"Your name is early in the alphabet.\\n\"\n", + "else:\n", + " print \"You have to wait a while for Your name to be called\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Your name is early in the alphabet.\n", + "\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C9PAY2 :Page 201" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Get input\n", + "#hours=input(\"\\nHow many hours were worked?\")\n", + "#rate=input(\"\\nWhat is the regular hourly pay?\")\n", + "hours=44\n", + "rate=0.20\n", + "#Compute pay\n", + "if hours>50:\n", + " dt=2.0*rate*float(hours-50)\n", + " ht=1.5*rate*10.0\n", + "else:\n", + " dt=0.0\n", + "#Time and a half\n", + "if hours>40:\n", + " ht=1.5*rate*float(hours-40)\n", + "#Regular pay\n", + "if hours>=40:\n", + " rp=40*rate\n", + "else:\n", + " rp=float(hours)*rate\n", + "#Payroll\n", + "pay=dt+ht+rp \n", + "#Result\n", + "print \"\\nThe pay is \",\"%.2f\" %pay" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The pay is 9.20\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C9SERV :Page 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#if...else...if\n", + "#yrs=input(\"\\nHow many years of service?\")\n", + "yrs=25\n", + "if yrs>20:\n", + " print \"\\nGive a gold watch\"\n", + "else:\n", + " if yrs>10:\n", + " print \"\\nGive a paper weight\"\n", + " else:\n", + " print \"\\nGive a pat on the back\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Give a gold watch\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C10YEAR :Page 212" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#To determine if it is Summer Olympics year\n", + "#year=input(\"\\nWhat is a year for the test?\")\n", + "year=2004\n", + "#Test the Year\n", + "if year%4==0 and year%10==0:\n", + " print \"\\nBoth Olympics and U.S. Census!\"\n", + " exit(0)\n", + "if year%4==0:\n", + " print \"\\nSummer Olympics only\"\n", + "else:\n", + " if year%10==0:\n", + " print \"\\nU.S. Census only\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Summer Olympics only\n" + ] + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C10AGE :Page 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Get input\n", + "#age=input(\"\\nWhat is your age?\\n\")\n", + "age=20\n", + "if age<10 or age>100:\n", + " print \"*** The age must be between 10 and 100 ***\\n\"\n", + "else:\n", + " print \"You entered a valid age.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "You entered a valid age.\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C10VIDEO :Page 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# -*- coding: cp1252 -*-\n", + "#Program that computes video rental amounts and gives\n", + "# appropriate discounts based on the day or customer status.\n", + "print \"\\n *** Video Rental Computation ***\\n\"\n", + "print \"--------------------------------------\\n\"\n", + "tape_charge=2.00 #Before-discount tape fee-per tape.\n", + "first_name=raw_input(\"\\nWhat is customer's first name? \")\n", + "last_name=raw_input(\"\\nWhat is customer's last name? \")\n", + "num_tapes=input(\"\\nHow many tapes are being rented? \")\n", + "val_day=raw_input(\"Is this a Value day (Y/N)?\")\n", + "sp_stat=raw_input(\"Is this a Special Status customer (Y/N)?\")\n", + "\n", + "# Calculate rental amount.\n", + "discount=0.0\n", + "if val_day=='Y' or sp_stat=='Y':\n", + " discount=0.5\n", + " x=num_tapes*tape_charge\n", + " y=discount*num_tapes\n", + " rental_amt=x-y\n", + "print \"\\n** Rental club **\\n\"\n", + "print first_name,last_name,\"rented \",num_tapes,\" tapes \"\n", + "print \"The total was \",\"%.2f\" %rental_amt\n", + "print \"The discount was \",\"%.2f\" %discount,\"per tape\\n\"\n", + "if sp_stat=='Y':\n", + " print \"\\nThank them for being a special Status customer\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " *** Video Rental Computation ***\n", + "\n", + "--------------------------------------\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "What is customer's first name? Jerry\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "What is customer's last name? Parker\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "How many tapes are being rented? 3\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Is this a Value day (Y/N)?Y\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Is this a Special Status customer (Y/N)?Y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "** Rental club **\n", + "\n", + "Jerry Parker rented 3 tapes \n", + "The total was 4.50\n", + "The discount was 0.50 per tape\n", + "\n", + "\n", + "Thank them for being a special Status customer\n", + "\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/C++_By_Example_by_Greg__M._Perry/Chapter3.ipynb b/C++_By_Example_by_Greg__M._Perry/Chapter3.ipynb new file mode 100755 index 00000000..86928d5a --- /dev/null +++ b/C++_By_Example_by_Greg__M._Perry/Chapter3.ipynb @@ -0,0 +1,1993 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4287b398ccb0083302f20bc4aac3d1bb1b1d9da46944ea5f43caac972dbf63f6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3: C++ Constructs" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C11SIZE1, Page number:232" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Size of floating-point values\n", + "import sys\n", + "x=0.0\n", + "print \"The size of floating-point variables on this computer is \"\n", + "print sys.getsizeof(x) #depends on the compiler " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The size of floating-point variables on this computer is \n", + "24\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C11COM1, Page number:233" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Illustrates the sequence point.\n", + "num=5\n", + "sq,cube=num*num,num*num*num\n", + "#Result\n", + "print \"The square of \",num,\"is\",sq\n", + "print \"and the cube is \",cube" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The square of 5 is 25\n", + "and the cube is 125\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C11ODEV, Page number:239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Uses a bitwise & to determine whether a number is odd or even.\n", + "input1=input(\"What number do you want me to test?\")\n", + "if input1&1:\n", + " print \"The number \",input1,\"is odd\"\n", + "else:\n", + " print \"The number \",input1,\"is even\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What number do you want me to test?5\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The number 5 is odd\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12WHIL1, Page number:248" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ans=raw_input(\"Do you want to continue (Y/N)\")\n", + "while ans!='Y' and ans!='N':\n", + " print \"\\nYou must type a Y or an N\\n\"\n", + " ans=raw_input( \"Do you want to continue(Y/N)?\")" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to continue (Y/N)k\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "You must type a Y or an N\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to continue(Y/N)?c\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "You must type a Y or an N\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to continue(Y/N)?s\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "You must type a Y or an N\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to continue(Y/N)?5\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "You must type a Y or an N\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to continue(Y/N)?Y\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12WHIL3, Page number:251" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Number of letters in the user's name\n", + "name=raw_input(\"What is your first name?\")\n", + "count=len(name)\n", + "print \"Your name has \",count,\"characters\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your first name?greg\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Your name has 4 characters\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12INV1, Page number:253" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print \"*** Inventory computation ***\\n\"\n", + "while True:\n", + " part_no=input(\"What is the next part number(-999 to end)?\\n\")\n", + " if part_no!=-999:\n", + " quantity=input(\"How many were bought?\\n\")\n", + " cost=input(\"What is the unit price of this item?\\n\")\n", + " ext_cost=cost*quantity\n", + " print \"\\n\",quantity,\"of #\",part_no,\"will cost\",\"%.2f\" %ext_cost,\"\\n\"\n", + " else:\n", + " break\n", + "print \"End of Inventory computation\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "*** Inventory computation ***\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next part number(-999 to end)?\n", + "213\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "How many were bought?\n", + "12\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the unit price of this item?\n", + "5.66\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "12 of # 213 will cost 67.92 \n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next part number(-999 to end)?\n", + "92\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "How many were bought?\n", + "53\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the unit price of this item?\n", + ".23\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "53 of # 92 will cost 12.19 \n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next part number(-999 to end)?\n", + "-999\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "End of Inventory computation\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12EXIT1, Page number:257" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Quits early due to exit() function.\n", + "def main():\n", + " exit(0)\n", + " print \"C++ programming is fun\"\n", + " print \"I like learning C++ by example!\\n\"\n", + " print \"C++ is a powerful language that is not difficult to learn\"\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12BRK, Page number:257" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Demonstrates the Break statement\n", + "while True:\n", + " print \"C++ is fun!\\n\"\n", + " break\n", + " user_ans=raw_input( \"Do you want to see the message again(Y/N)?\")\n", + "print \"That's all for now\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C++ is fun!\n", + "\n", + "That's all for now\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12CNT1, Page number:261" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ctr=0\n", + "while ctr<10:\n", + " print \"Computers are fun!\\n\"\n", + " ctr+=1" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n", + "Computers are fun!\n", + "\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12PASS1, Page number:263" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "stored_pass=11862\n", + "num_tries=0\n", + "while num_tries<3:\n", + " user_pass=input(\"\\nWhat is the password? (you get 3 tries...)?\")\n", + " num_tries+=1\n", + " if user_pass==stored_pass:\n", + " print \"You entered the correct password.\\n\"\n", + " print \"The cash safe is behind the picture of the ship.\"\n", + " exit()\n", + " else:\n", + " print \"You entered the wrong password.\\n\"\n", + " if num_tries==3:\n", + " print \"Sorry, you get no more chances\"\n", + " else:\n", + " print \"you get \",3-num_tries,\"more tries...\\n\"\n", + "exit(0)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "What is the password? (you get 3 tries...)?11202\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "You entered the wrong password.\n", + "\n", + "you get 2 more tries...\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "What is the password? (you get 3 tries...)?23265\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "You entered the wrong password.\n", + "\n", + "you get 1 more tries...\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "What is the password? (you get 3 tries...)?36963\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "You entered the wrong password.\n", + "\n", + "Sorry, you get no more chances\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12GRAD1, Page number:266" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Adds grades and determines whether you earned an A.\n", + "total_grade=0.0\n", + "while 1:\n", + " grade=input(\"What is your grade?(-1 to end)\")\n", + " if grade>=0.0:\n", + " total_grade+=grade\n", + " if grade==-1:\n", + " break\n", + "#Result\n", + "print \"\\n\\nYou made a total of \",\"%.1f\" %total_grade,\"points\\n\"\n", + "if total_grade>=450.00:\n", + " print \"** You made an A !!\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)87.6\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)92.4\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)78.7\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)-1\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "\n", + "You made a total of 258.7 points\n", + "\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C12GRAD2, Page number:267" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "total_grade=0.0\n", + "grade_avg=0.0\n", + "grade_ctr=0\n", + "while 1:\n", + " grade=input(\"What is your grade?(-1 to end)\")\n", + " if grade>=0.0:\n", + " total_grade+=grade\n", + " grade_ctr+=1\n", + " if grade==-1:\n", + " break\n", + "grade_avg=total_grade/grade_ctr\n", + "#Result\n", + "print \"\\n\\nYou made a total of \",'%.1f' %total_grade,\"points\\n\"\n", + "print \"Your average was \",'%.1f' %grade_avg,\"\\n\"\n", + "if total_grade>=450.00:\n", + " print \"** You made an A !!\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)67.8\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)98.7\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)67.8\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)92.4\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your grade?(-1 to end)-1\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "\n", + "You made a total of 326.7 points\n", + "\n", + "Your average was 81.7 \n", + "\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13FOR1, Page number:276" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#for loop example\n", + "for ctr in range(1,11):\n", + " print ctr,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1 \n", + "\n", + "2 \n", + "\n", + "3 \n", + "\n", + "4 \n", + "\n", + "5 \n", + "\n", + "6 \n", + "\n", + "7 \n", + "\n", + "8 \n", + "\n", + "9 \n", + "\n", + "10 \n", + "\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13FOR2, Page number:278" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Demonstrates totaling using a for loop.\n", + "total=0\n", + "for ctr in range(100,201):\n", + " total+=ctr\n", + "#Result\n", + "print \"The total is \",total" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total is 15150\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13EVOD, Page number:281" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print \"Even numbers below 21\"\n", + "#Result\n", + "for num in range(2,21,2):\n", + " print num,\" \",\n", + " print \"\\n\\nOdd numbers below 20\"\n", + "#Result\n", + "for num in range(1,21,2):\n", + " print num,\" \"," + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Even numbers below 21\n", + "2 4 6 8 10 12 14 16 18 20 \n", + "\n", + "Odd numbers below 20\n", + "1 3 5 7 9 11 13 15 17 19 \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13CNTD1, Page number:282" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for ctr in range(10,0,-1):\n", + " print ctr\n", + "print \"*** Blast off! ***\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "10\n", + "9\n", + "8\n", + "7\n", + "6\n", + "5\n", + "4\n", + "3\n", + "2\n", + "1\n", + "*** Blast off! ***\n", + "\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13FOR4, Page number:283" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "total=0.0\n", + "print \"\\n*** Grade Calculation ***\\n\"\n", + "num=input(\"How many students are there?\\n\")\n", + "for loopvar in range(0,num,1):\n", + " grade=input(\"What is the next student's grade?\\n\")\n", + " total=total+grade\n", + "avg=total/num\n", + "#Result\n", + "print \"\\n the average of this class is\",'%.1f' %avg" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "*** Grade Calculation ***\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "How many students are there?\n", + "3\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade?\n", + "8\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade?\n", + "9\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade?\n", + "7\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " the average of this class is 8.0\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13FOR6, Page number:285" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "num=5\n", + "print \"\\nCounting by 5s:\\n\"\n", + "for num in range(5,101,5):\n", + " print \"\\n\",num" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Counting by 5s:\n", + "\n", + "\n", + "5\n", + "\n", + "10\n", + "\n", + "15\n", + "\n", + "20\n", + "\n", + "25\n", + "\n", + "30\n", + "\n", + "35\n", + "\n", + "40\n", + "\n", + "45\n", + "\n", + "50\n", + "\n", + "55\n", + "\n", + "60\n", + "\n", + "65\n", + "\n", + "70\n", + "\n", + "75\n", + "\n", + "80\n", + "\n", + "85\n", + "\n", + "90\n", + "\n", + "95\n", + "\n", + "100\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13NEST1, Page number:288" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for times in range(1,4,1):\n", + " for num in range(1,6,1):\n", + " print num,\n", + " print \"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1 2 3 4 5 \n", + "\n", + "1 2 3 4 5 \n", + "\n", + "1 2 3 4 5 \n", + "\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13NEST2, Page number:289" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for outer in range(6,-1,-1):\n", + " for inner in range(1,outer,1):\n", + " print inner,\n", + " print \"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1 2 3 4 5 \n", + "\n", + "1 2 3 4 \n", + "\n", + "1 2 3 \n", + "\n", + "1 2 \n", + "\n", + "1 \n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C13FACT, Page number:291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#factorial\n", + "num=input(\"What factorial do you want to see?\")\n", + "total=1\n", + "for fact in range(1,num+1,1):\n", + " total=total*fact \n", + "print \"The factorial for \",num,\"is\",total" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What factorial do you want to see?7\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The factorial for 7 is 5040\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C14CNTD1, Page number:297" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for cd in range(10,0,-1):\n", + " for delay in range(1,10,1): #for delay in range(1,30001,1):\n", + " print \" \"\n", + " print cd,\"\\n\"\n", + "print \"*** Blast off! ***\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "10 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "9 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "8 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "7 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "6 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "5 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "4 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "3 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "2 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "1 \n", + "\n", + "*** Blast off! ***\n", + "\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C14TIM, Page number:298" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "age=input(\"What is your age?\\n\") #Get age\n", + "while age<=0:\n", + " print \"*** Your age cannot be that small ! ***\"\n", + " for outer in range(1,3,1): #outer loop\n", + " for inner in range(1,50,1): #inner loop\n", + " print \"\"\n", + " print \"\\r\\n\\n\"\n", + " age=input(\"What is your age?\\n\")\n", + "print \"Thanks, I did not think you would actually tell me your age!\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your age?\n", + "20\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thanks, I did not think you would actually tell me your age!\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C14BRAK1, Page number:299" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print \"Here are the numbers from 1 to 20\\n\"\n", + "for num in range(1,21,1):\n", + " print num,\"\\n\"\n", + " break #break statement\n", + "print \"That's all, folks!\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are the numbers from 1 to 20\n", + "\n", + "1 \n", + "\n", + "That's all, folks!\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C14BRAK2, Page number:300" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#A for loop running at the user\u2019s request.\n", + "print \"Here are the numbers from 1 to 20\\n\"\n", + "for num in range(1,21,1):\n", + " print num\n", + " ans=raw_input(\"Do you want to see another (Y/N)?\")\n", + " if ans=='N' or ans=='n':\n", + " break\n", + "print \"That's all, folks!\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are the numbers from 1 to 20\n", + "\n", + "1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "3\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "4\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "5\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "6\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "7\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "8\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "9\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "10\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Do you want to see another (Y/N)?N\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "That's all, folks!\n", + "\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C14BRAK3, Page number:302" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "total=0.0\n", + "count=0\n", + "print \"\\n*** Grade Calculation ***\\n\"\n", + "num=input(\"How many students are there?\")\n", + "for loopvar in range(1,num+1,1):\n", + " grade=input(\"What is the next student's grade? (-99 to quit)\")\n", + " if grade<0.0:\n", + " break\n", + " count+=1\n", + " total+=grade\n", + "avg=total/count\n", + "#Result\n", + "print \"The average of this class is \",'%.1f' %avg" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "*** Grade Calculation ***\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "How many students are there?10\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade? (-99 to quit)87\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade? (-99 to quit)97\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade? (-99 to quit)67\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade? (-99 to quit)89\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade? (-99 to quit)94\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next student's grade? (-99 to quit)-99\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The average of this class is 86.8\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C14CON1, Page number:305" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Demonstrates the use of the continue statement.\n", + "for ctr in range(1,11,1):\n", + " print ctr,\n", + " continue\n", + " print \"C++ programming\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1 2 3 4 5 6 7 8 9 10\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C14CON3, Page number:306" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Average salaries over $10,000\n", + "avg=0.0\n", + "total=0.0\n", + "month=1.0\n", + "count=0\n", + "while month>0.0:\n", + " month=input(\"What is the next monthly salary (-1) to quit\")\n", + " year=month*12.00\n", + " if year <= 10000.00: #Do not add low salaries\n", + " continue\n", + " if month<0.0:\n", + " break\n", + " count+=1\n", + " total+=year #Add yearly salary to total.\n", + "avg=total/float(count)\n", + "#Result\n", + "print \"\\nThe average of high salaries is $\",'%.2f' %avg" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next monthly salary (-1) to quit500\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next monthly salary (-1) to quit2000\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next monthly salary (-1) to quit750\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next monthly salary (-1) to quit4000\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next monthly salary (-1) to quit5000\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next monthly salary (-1) to quit1200\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the next monthly salary (-1) to quit-1\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The average of high salaries is $ 36600.00\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C15BEEP1, Page number:314" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def beep():\n", + " import os\n", + " os.system('\\a')\n", + "num=input(\"Please enter a number:\")\n", + "#Use multiple if statements to beep.\n", + "if num==1:\n", + " beep()\n", + "else:\n", + " if num==2:\n", + " beep()\n", + " beep()\n", + " else:\n", + " if num==3:\n", + " beep()\n", + " beep()\n", + " beep()\n", + " else:\n", + " if num==4:\n", + " beep()\n", + " beep()\n", + " beep()\n", + " beep()\n", + " else:\n", + " if num==5:\n", + " beep()\n", + " beep()\n", + " beep()\n", + " beep()\n", + " beep()\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Please enter a number:2\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C15SALE, Page number:319" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Prints daily, weekly, and monthly sales totals.\n", + "daily=2343.34\n", + "weekly=13432.65\n", + "monthly=43468.97\n", + "ans=raw_input(\"Is this the end of the month? (Y/N) :\")\n", + "if ans=='Y' or ans=='y':\n", + " day=6\n", + "else:\n", + " day=input(\"What day number , 1 through 5( for mon-fri) :\")\n", + "if day==6:\n", + " print \"The monthly total is \",'%.2f' %monthly\n", + "else:\n", + " if day==5:\n", + " print \"The weekly total is \",'%.2f' %weekly\n", + " else:\n", + " print \"The daily total is \",'%.2f' %daily " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Is this the end of the month? (Y/N) :Y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The monthly total is 43468.97\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C15DEPT1, Page number:320" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "choice=\"R\"\n", + "while choice!='S' and choice!='A' and choice!='E' and choice!='P':\n", + " print \"\\n choose your department :\"\n", + " print \"S - Sales\"\n", + " print \"A - Accounting\"\n", + " print \"E - Engineering\"\n", + " print \"P - Payroll\"\n", + " choice=raw_input( \"What is your choice? (upper case)\")\n", + "if choice=='E':\n", + " print \"Your meeting is at 2:30\"\n", + "else:\n", + " if choice=='S':\n", + " print \"Your meeting is at 8:30\"\n", + " else:\n", + " if choice=='A':\n", + " print \"Your meeting is at 10:00\"\n", + " else:\n", + " if choice=='P':\n", + " print \"your meeting has been cancelled\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " choose your department :\n", + "S - Sales\n", + "A - Accounting\n", + "E - Engineering\n", + "P - Payroll\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your choice? (upper case)E\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Your meeting is at 2:30\n" + ] + } + ], + "prompt_number": 21 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/C++_By_Example_by_Greg__M._Perry/Chapter4.ipynb b/C++_By_Example_by_Greg__M._Perry/Chapter4.ipynb new file mode 100755 index 00000000..af8938df --- /dev/null +++ b/C++_By_Example_by_Greg__M._Perry/Chapter4.ipynb @@ -0,0 +1,1073 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4df8567d0a6ab5b81136865656edfa550f51aea32b240bc480ecbc37fd6ab9bf" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4: Variable Scope and Modular Programming" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C16FUN1, Page number:338" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Function Definition\n", + "def next_fun(): \n", + " print \"Inside next_fun()\" \n", + "def third_fun(): \n", + " print \"Inside third_fun()\"\n", + "def main(): \n", + " print \"First function called main()\"\n", + " #Function Call\n", + " next_fun() \n", + " third_fun() \n", + " print \"main() is completed\"\n", + "#Function Call\n", + "main() " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "First function called main()\n", + "Inside next_fun()\n", + "Inside third_fun()\n", + "main() is completed\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C16FUN2, Page number:347" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Function Calls\n", + "def name_print():\n", + " print \"C++ is Fun!\\tC++ is Fun!\\tC++ is Fun!\"\n", + " print \" C++ i s F u n ! \\t C++ i s F u n ! \\t C++ i s F u n ! \"\n", + " reverse_print() \n", + "def reverse_print():\n", + " print \"!nuF si ++C\\t!nuF si ++C\\t!nuF si ++C\"\n", + "def one_per_line():\n", + " print \"C++\\n i\\n s\\n F\\n u\\n n\\n !\"\n", + "def main():\n", + " for ctr in range(1,6,1):\n", + " name_print() #Calls function five times.\n", + " one_per_line() #Calls the program's last function once \n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C++ is Fun!\tC++ is Fun!\tC++ is Fun!\n", + " C++ i s F u n ! \t C++ i s F u n ! \t C++ i s F u n ! \n", + "!nuF si ++C\t!nuF si ++C\t!nuF si ++C\n", + "C++ is Fun!\tC++ is Fun!\tC++ is Fun!\n", + " C++ i s F u n ! \t C++ i s F u n ! \t C++ i s F u n ! \n", + "!nuF si ++C\t!nuF si ++C\t!nuF si ++C\n", + "C++ is Fun!\tC++ is Fun!\tC++ is Fun!\n", + " C++ i s F u n ! \t C++ i s F u n ! \t C++ i s F u n ! \n", + "!nuF si ++C\t!nuF si ++C\t!nuF si ++C\n", + "C++ is Fun!\tC++ is Fun!\tC++ is Fun!\n", + " C++ i s F u n ! \t C++ i s F u n ! \t C++ i s F u n ! \n", + "!nuF si ++C\t!nuF si ++C\t!nuF si ++C\n", + "C++ is Fun!\tC++ is Fun!\tC++ is Fun!\n", + " C++ i s F u n ! \t C++ i s F u n ! \t C++ i s F u n ! \n", + "!nuF si ++C\t!nuF si ++C\t!nuF si ++C\n", + "C++\n", + " i\n", + " s\n", + " F\n", + " u\n", + " n\n", + " !\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C17GLO, Page number:356" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def do_fun():\n", + " global sales #global variable\n", + " global profit #global variable \n", + " sales = 20000.00\n", + " profit=5000.00\n", + " print \"The sales in the second function are: \",sales\n", + " print \"The profit in the second function is: \",profit\n", + " third_fun() #Call third function to show that globals are visible\n", + "def third_fun():\n", + " print \"\\nIn the third function:\"\n", + " print \"The sales in the third function are\",sales\n", + " print \"The profit in the third function is \",profit\n", + "def main():\n", + " print \"No variable defined in main()\\n\"\n", + " do_fun()\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No variable defined in main()\n", + "\n", + "The sales in the second function are: 20000.0\n", + "The profit in the second function is: 5000.0\n", + "\n", + "In the third function:\n", + "The sales in the third function are 20000.0\n", + "The profit in the third function is 5000.0\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C17GLLO, page number:358" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def pr_again():\n", + " j=5 #Local to only pr_again().\n", + " print j,\",\",z,\",\",i\n", + "global i\n", + "i=0\n", + "def main():\n", + " p=9.0 #Local to main() only\n", + " print i,\",\",p\n", + " pr_again() #Calls next function.\n", + "\n", + "global z\n", + "z=9.0\n", + "main() " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "0 , 9.0\n", + "5 , 9.0 , 0\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C17LOC1, Page number:359" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def main():\n", + " age=input(\"What is your age? \") #Variable age is local to main()\n", + " get_age()\n", + " print \"main()'s age is still\",age \n", + "def get_age():\n", + " age=input(\"What is your age again? \") #A different age. This one is local to get_age().\n", + "main() " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your age? 28\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your age again? 56\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "main()'s age is still 28\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C17LOC2, Page number:360" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def main():\n", + " for ctr in range(0,11,1): #Loop counter\n", + " print \"main()'s ctr is \",ctr,\"\\n\"\n", + " do_fun() #Call second function\n", + "\n", + "def do_fun():\n", + " for ctr in range(10,0,-1):\n", + " print \"do_fun()'s ctr is \",ctr,\"\\n\"\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "main()'s ctr is 0 \n", + "\n", + "main()'s ctr is 1 \n", + "\n", + "main()'s ctr is 2 \n", + "\n", + "main()'s ctr is 3 \n", + "\n", + "main()'s ctr is 4 \n", + "\n", + "main()'s ctr is 5 \n", + "\n", + "main()'s ctr is 6 \n", + "\n", + "main()'s ctr is 7 \n", + "\n", + "main()'s ctr is 8 \n", + "\n", + "main()'s ctr is 9 \n", + "\n", + "main()'s ctr is 10 \n", + "\n", + "do_fun()'s ctr is 10 \n", + "\n", + "do_fun()'s ctr is 9 \n", + "\n", + "do_fun()'s ctr is 8 \n", + "\n", + "do_fun()'s ctr is 7 \n", + "\n", + "do_fun()'s ctr is 6 \n", + "\n", + "do_fun()'s ctr is 5 \n", + "\n", + "do_fun()'s ctr is 4 \n", + "\n", + "do_fun()'s ctr is 3 \n", + "\n", + "do_fun()'s ctr is 2 \n", + "\n", + "do_fun()'s ctr is 1 \n", + "\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C17MULI, Page number:362" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def main():\n", + " i=10\n", + " i=20\n", + " print i,\" \",i,\"\\n\"\n", + " i=30\n", + " print i,\" \",i,\" \",i,\"\\n\" \n", + " i=10\n", + " print i,\" \",i,\" \",i \n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "20 20 \n", + "\n", + "30 30 30 \n", + "\n", + "10 10 10\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C17LOC3, Page number:367" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def pr_init(initial):\n", + " print \"Your initial is \",initial\n", + "def pr_other(age,salary):\n", + " print \"You look young for\",age,\"and \",'%.2f' %salary,\"is a lot of money\"\n", + "initial=raw_input(\"What is your initial?\")\n", + "age=input(\"What is your age?\")\n", + "salary=input(\"What is your salary?\")\n", + "pr_init(initial) #call pr_init() and pass it initial\n", + "pr_other(age,salary) #call pr_other and pass age and salary" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your initial?Jerry\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your age?30\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your salary?50000\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Your initial is Jerry\n", + "You look young for 30 and 50000.00 is a lot of money\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C17LOC4, Page number:368" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def compute_sale(gallons):\n", + " #local variable\n", + " price_per=12.45 \n", + " x=price_per*float(gallons) #type casting gallons because it was integer\n", + " print \"The total is \",'%.2f' %x\n", + "def main():\n", + " print \"Richard's Paint Service\"\n", + " gallons=input(\"How many gallons of paint did you buy?\")\n", + " compute_sale(gallons) #Function Call\n", + "main()\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Richard's Paint Service\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "How many gallons of paint did you buy?20\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total is 249.00\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C17STA2, Page number:372" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def main():\n", + " for ctr in range(1,26,1):\n", + " triple_it(ctr)\n", + "def triple_it(ctr):\n", + " total=0\n", + " ans=ctr*3\n", + " total+=ans\n", + " print \"The number \",ctr,\"multiplied by 3 is \",ans\n", + " if total>300:\n", + " print \"The total of triple numbers is over 300\"\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The number 1 multiplied by 3 is 3\n", + "The number 2 multiplied by 3 is 6\n", + "The number 3 multiplied by 3 is 9\n", + "The number 4 multiplied by 3 is 12\n", + "The number 5 multiplied by 3 is 15\n", + "The number 6 multiplied by 3 is 18\n", + "The number 7 multiplied by 3 is 21\n", + "The number 8 multiplied by 3 is 24\n", + "The number 9 multiplied by 3 is 27\n", + "The number 10 multiplied by 3 is 30\n", + "The number 11 multiplied by 3 is 33\n", + "The number 12 multiplied by 3 is 36\n", + "The number 13 multiplied by 3 is 39\n", + "The number 14 multiplied by 3 is 42\n", + "The number 15 multiplied by 3 is 45\n", + "The number 16 multiplied by 3 is 48\n", + "The number 17 multiplied by 3 is 51\n", + "The number 18 multiplied by 3 is 54\n", + "The number 19 multiplied by 3 is 57\n", + "The number 20 multiplied by 3 is 60\n", + "The number 21 multiplied by 3 is 63\n", + "The number 22 multiplied by 3 is 66\n", + "The number 23 multiplied by 3 is 69\n", + "The number 24 multiplied by 3 is 72\n", + "The number 25 multiplied by 3 is 75\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C18PASS1, Page number:381" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def moon(weight): \n", + " weight/=6 \n", + " print \"You weigh only \",weight,\"pounds on the moon !\"\n", + "def main(): \n", + " weight=input(\"How many pounds do you weigh? \")\n", + " moon(weight) #call the moon() function and pass weight\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "How many pounds do you weigh? 120\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "You weigh only 20 pounds on the moon !\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C18PASS3, Page number:383" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def main():\n", + " Igrade=raw_input(\"What letter grade do you want?\")\n", + " average=input(\"What is your current test average\")\n", + " tests=input(\"How many tests do you have left?\")\n", + " check_grade(Igrade,average,tests) #// Calls function and passes three variables by value\n", + "def check_grade(Igrade,average,tests):\n", + " if tests==0:\n", + " print \"You will get your current grade of \",Igrade\n", + " else:\n", + " if tests==1:\n", + " print \"You still have time to bring up your average of\",'%.1f' %average,\"up . Study hard !\"\n", + " else :\n", + " print \"Relax. You still have plenty of time.\" \n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What letter grade do you want?A\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your current test average1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "How many tests do you have left?3\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Relax. You still have plenty of time.\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C19AVG, Page number:398" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def calc_av(num1,num2,num3):\n", + " local_avg=(num1+num2+num3) / 3 #Holds the average for these numbers\n", + " return local_avg\n", + "print \"please type three numbers (such as 23 54 85) \"\n", + "num1=input()\n", + "num2=input()\n", + "num3=input()\n", + "avg=calc_av(num1,num2,num3) #call function and pass the numbers\n", + "print \"\\n\\nThe average is \",avg #Print the return value" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "please type three numbers (such as 23 54 85) \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "30\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "40\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "50\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "\n", + "The average is 40\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C19DOUB, Page number:401" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def doub(number):\n", + " d_num=number*2 #Doubles the number.\n", + " return d_num #Returns the result.\n", + "number=input(\"What number do you want doubled? \")\n", + "d_number= doub(number) #Assigns return value.\n", + "print number,\" doubled is \",d_number" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What number do you want doubled? 5\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "5 doubled is 10\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C19SUMD, Page number:403" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def sums(num):\n", + " sumd=0\n", + " if num<=0:\n", + " sumd=num\n", + " else:\n", + " for ctr in range(1,num+1,1):\n", + " sumd=sumd+ctr\n", + " return sumd\n", + "num=input(\"Please type a number: \")\n", + "sumd= sums(num)\n", + "print \"The sum of the digits is \" , sumd" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Please type a number: 6\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The sum of the digits is 21\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C19MINMX, Page number:404" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def maximum(num1,num2): \n", + " if num1>num2:\n", + " maxi=num1\n", + " else:\n", + " maxi=num2\n", + " return maxi\n", + "def minimum(num1,num2):\n", + " if num1>num2:\n", + " mini=num2\n", + " else:\n", + " mini=num1\n", + " return mini\n", + "print \"Please type two numbers ( such as 46 75 ) \"\n", + "num1 = input()\n", + "num2 = input()\n", + "maxi=maximum(num1,num2) #Assign the return value of each function to variables\n", + "mini=minimum(num1,num2) \n", + "print \"The minimum number is \",mini\n", + "print \"The maximum number is \", maxi" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Please type two numbers ( such as 46 75 ) \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "72\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "55\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The minimum number is 55\n", + "The maximum number is 72\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C19PRO1, Page number:409" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "tax_rate=0.07 #Assume seven percent tax rate\n", + "total_sale=input(\"What is the sale amount? \")\n", + "total_sale+=tax_rate*total_sale\n", + "print \"The total sale is \",'%.2f' %total_sale" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the sale amount? 4000\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total sale is 4280.00\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C19ASC, Page number:410" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def ascii(num):\n", + " asc_char=chr(num) #Type cast to a character\n", + " return asc_char\n", + "num=input(\"Enter an ASCII number? \")\n", + "asc_char=ascii(num) #Number is passed to the function ascii()\n", + "print \"The ASCII character for \",num,\"is \",asc_char" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter an ASCII number? 67\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The ASCII character for 67 is C\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C19NPAY, Page number:411" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def netpayfun(hours,rate,taxrate):\n", + " gross_pay=hours*rate\n", + " taxes=taxrate*gross_pay\n", + " net_pay=gross_pay-taxes\n", + " return net_pay\n", + "net_pay=netpayfun(40.0,3.50,0.20)\n", + "print \"The pay for 40 hours at $3.50/hr., and a 20% tax rate is $ \",net_pay\n", + "net_pay=netpayfun(50.0,10.00,0.30)\n", + "print \"The pay for 40 hours at $10.00/hr., and a 30% tax rate is $ \",net_pay\n", + "net_pay=netpayfun(10.0,5.00,0.10)\n", + "print \"The pay for 40 hours at $5.00/hr., and a 10% tax rate is $ \",net_pay" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The pay for 40 hours at $3.50/hr., and a 20% tax rate is $ 112.0\n", + "The pay for 40 hours at $10.00/hr., and a 30% tax rate is $ 350.0\n", + "The pay for 40 hours at $5.00/hr., and a 10% tax rate is $ 45.0\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C20OVF1, Page number:423" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "i=-15\n", + "x=-64.53\n", + "ians=abs(i) #abs() function is a built in function that returns a positive value \n", + "print \"Integer absolute value of -15 is \",ians\n", + "fans=abs(x)\n", + "print \"Float absolute value of -64.53 is \",'%.2f' %fans" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Integer absolute value of -15 is 15\n", + "Float absolute value of -64.53 is 64.53\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C20OVF2, Page number:424" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#function definition\n", + "def output(x):\n", + " if isinstance(x,int):\n", + " print x\n", + " else:\n", + " if isinstance(x,float):\n", + " print '%.2f' %x\n", + " else:\n", + " print x\n", + "#Variable Decleration\n", + "name=\"C++ By Example makes C++ easy!\"\n", + "Ivalue=2543\n", + "fvalue=39.4321\n", + "#calling function\n", + "output(name)\n", + "output(Ivalue)\n", + "output(fvalue)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C++ By Example makes C++ easy!\n", + "2543\n", + "39.43\n" + ] + } + ], + "prompt_number": 19 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/C++_By_Example_by_Greg__M._Perry/Chapter5.ipynb b/C++_By_Example_by_Greg__M._Perry/Chapter5.ipynb new file mode 100755 index 00000000..92b07a7b --- /dev/null +++ b/C++_By_Example_by_Greg__M._Perry/Chapter5.ipynb @@ -0,0 +1,184 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:1663500e8fbe5ad2cc16ca34f15e5b3a438d37780443ea138d094544e9484c86" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5: Character Input/Output and String Functions" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C22INI, Page number:452" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Get input\n", + "print \"What is your first initial?\"\n", + "initial=raw_input()\n", + "\n", + "#Check if it is an alphabet\n", + "while not initial.isalpha():\n", + " print \"That was not a valid initial!\"\n", + " print \"What is your first initial?\"\n", + " initial=raw_input()\n", + "print \"Thanks\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is your first initial?\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "p\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thanks\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C22GB, Page number:454" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Get input\n", + "#ans=raw_input(\"Are you a girl or a boy (G/B)? \") \n", + "ans=\"b\"\n", + "#convert answer to uppercase\n", + "ans=ans.upper() \n", + "if ans=='G':\n", + " print \"You look pretty today!\\n\"\n", + "else:\n", + " if ans=='B':\n", + " print \"You look handsome today!\\n\"\n", + " else:\n", + " print \"Your answer makes no sense!\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "You look handsome today!\n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C22GPS1, Page number:459" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#get book title\n", + "#book=raw_input(\"What is the book title? \") \n", + "book=\"Mary and Her Lambs\"\n", + "#print book title\n", + "print book \n", + "print \"Thanks for the book!\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mary and Her Lambs\n", + "Thanks for the book!\n", + "\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C22ABS, Page number:463" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Get input\n", + "#age1=input(\"\\nWhat is the first child's age? \")\n", + "#age2=input(\"\\nWhat is the second child's age? \")\n", + "age1=10\n", + "age2=12\n", + "diff=age1-age2 \n", + "# abs() function determines absolute value\n", + "diff=abs(diff) \n", + "#Result\n", + "print \"\\nThey are \",diff,\" years apart.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "They are 2 years apart.\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/C++_By_Example_by_Greg__M._Perry/Chapter6.ipynb b/C++_By_Example_by_Greg__M._Perry/Chapter6.ipynb new file mode 100755 index 00000000..b6b15c6a --- /dev/null +++ b/C++_By_Example_by_Greg__M._Perry/Chapter6.ipynb @@ -0,0 +1,1374 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:cfdb035454a7c5a7bad2a1fb4552e9ad41947fbc789e715d89415d3cdc5243a0" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6: Arrays and pointers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C23ARA1, Page number:482" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "s_name=\"Tri Star University\"\n", + "scores = [88.7,90.4,76.0,97.0,100.0,86.7] #integer array\n", + "average=0.0\n", + "for ctr in range(0,6,1): #computes total of scores\n", + " average+=scores[ctr]\n", + "average/=float(6) #computes the average\n", + "print \"At \",s_name,\", your class average is \",'%.2f' %average,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "At Tri Star University , your class average is 89.80 \n", + "\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C23ARA2, Page number:483" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def pr_scores(scores):\n", + " print \"Here are your scores:\\n\"\n", + " for ctr in range(0,6,1):\n", + " print '%.2f' %scores[ctr],\"\\n\" \n", + "s_name=\"Tri Star University\"\n", + "scores = [88.7,90.4,76.0,97.0,100.0,86.7] #integer array\n", + "average=0.0\n", + "pr_scores(scores) #Function call to print scores\n", + "for ctr in range(0,6,1): #computes total of scores\n", + " average+=scores[ctr]\n", + "average/=float(6) #computes the average\n", + "print \"At \",s_name,\", your class average is \",'%.2f' %average,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are your scores:\n", + "\n", + "88.70 \n", + "\n", + "90.40 \n", + "\n", + "76.00 \n", + "\n", + "97.00 \n", + "\n", + "100.00 \n", + "\n", + "86.70 \n", + "\n", + "At Tri Star University , your class average is 89.80 \n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C23ARA3, Page number:485" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "CLASS_NUM=6\n", + "def pr_scores(scores): #Function definition \n", + " print \"Here are your scores:\\n\"\n", + " for ctr in range(0,CLASS_NUM,1):\n", + " print '%.2f' %scores[ctr],\"\\n\" \n", + "s_name=\"Tri Star University\"\n", + "scores = [88.7,90.4,76.0,97.0,100.0,86.7] #Integer array\n", + "average=0.0\n", + "pr_scores(scores) #Function call to print scores\n", + "for ctr in range(0,CLASS_NUM,1): #Computes total of scores\n", + " average+=scores[ctr]\n", + "average/=float(6) #Computes the average\n", + "print \"At \",s_name,\", your class average is \",'%.2f' %average,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are your scores:\n", + "\n", + "88.70 \n", + "\n", + "90.40 \n", + "\n", + "76.00 \n", + "\n", + "97.00 \n", + "\n", + "100.00 \n", + "\n", + "86.70 \n", + "\n", + "At Tri Star University , your class average is 89.80 \n", + "\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C23ARA4, Page number:487" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "NUM_TEMPS=10\n", + "temps=[]\n", + "#Adding values into temps variable\n", + "temps.append(78.6)\n", + "temps.append(82.1)\n", + "temps.append(79.5)\n", + "temps.append(75.0)\n", + "temps.append(75.4)\n", + "temps.append(71.8)\n", + "temps.append(73.3)\n", + "temps.append(69.5)\n", + "temps.append(74.1)\n", + "temps.append(75.7)\n", + "#Print the temperatures\n", + "print \"Daily temperatures for the last \",NUM_TEMPS,\"days:\\n\"\n", + "for ctr in range(0,NUM_TEMPS,1):\n", + " print '%.2f' %temps[ctr],\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Daily temperatures for the last 10 days:\n", + "\n", + "78.60 \n", + "\n", + "82.10 \n", + "\n", + "79.50 \n", + "\n", + "75.00 \n", + "\n", + "75.40 \n", + "\n", + "71.80 \n", + "\n", + "73.30 \n", + "\n", + "69.50 \n", + "\n", + "74.10 \n", + "\n", + "75.70 \n", + "\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C23TOT, Page number:488" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "NUM=8\n", + "nums=[]\n", + "total=0\n", + "for ctr in range(0,NUM,1):\n", + " print \"Please enter the next number...\",\n", + " nums.append(input())\n", + " total+=nums[ctr]\n", + "#Prints the sum of eight values \n", + "print \"The total of the numbers is \",total,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Please enter the next number..." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "1\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Please enter the next number..." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "2\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Please enter the next number..." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "3\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Please enter the next number..." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "4\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Please enter the next number..." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "5\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Please enter the next number..." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "6\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Please enter the next number..." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "7\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Please enter the next number..." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "8\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The total of the numbers is 36 \n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C23SAL, Page number:489" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "NUM=12\n", + "sales=[] \n", + "print \"Please enter the twelve monthly sales values\\n\"\n", + "#Fill the array with input values entered by the user\n", + "for ctr in range(0,NUM,1):\n", + " print \"What are sales for month number \",ctr+1,\"?\\n\"\n", + " sales.append(input())\n", + "#for ctr in range(0,25,1):\n", + "# print \"\\n\" #Clears the screen\n", + "print \"\\n\\n*** Sales Printing Program ***\\n\"\n", + "print \"Prints any sales from the last \",NUM,\" months\\n\"\n", + "ans='Y'\n", + "while ans=='Y':\n", + " print \"For what month (1-\",NUM,\") do you want to see a sales value? \" \n", + " req_month=input()\n", + " print \"\\nMonth \",req_month,\"'s sales are\",'%.2f' %sales[req_month-1]\n", + " print \"\\nDo you want to see another (Y/N)? \"\n", + " ans=raw_input().upper()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Please enter the twelve monthly sales values\n", + "\n", + "What are sales for month number 1 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "363.25\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 2 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "433.22\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 3 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "652.36\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 4 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "445.52\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 5 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "123.45\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 6 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "780.2\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 7 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "125.36\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 8 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "425.15\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 9 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "325.96\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 10 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "109.75\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 11 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "123.65\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What are sales for month number 12 ?\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "253.84\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "\n", + "*** Sales Printing Program ***\n", + "\n", + "Prints any sales from the last 12 months\n", + "\n", + "For what month (1- 12 ) do you want to see a sales value? \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "2\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Month 2 's sales are 433.22\n", + "\n", + "Do you want to see another (Y/N)? \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For what month (1- 12 ) do you want to see a sales value? \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "5\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Month 5 's sales are 123.45\n", + "\n", + "Do you want to see another (Y/N)? \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "n\n" + ] + } + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C24HIGH, Page number:496" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "SIZE=15 #Maximum size of array\n", + "ara=[None]*SIZE #Empty Array declaration with maximum size\n", + "ara=[5,2,7,8,36,4,2,86,11,43,22,12,45,6,85]\n", + "high_val=ara[0] #initialize wit first array element\n", + "for ctr in range(1,SIZE,1):\n", + " if ara[ctr]>high_val: #Compares with rest of the elements in the array \n", + " high_val=ara[ctr] #Stores higher value in high_val\n", + "print \"The highest number in the list is \",high_val,\".\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The highest number in the list is 86 .\n", + "\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C24HILO, Page number:498" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Maximum size of array\n", + "SIZE=15 \n", + "#Initialize empty array\n", + "ara=[None]*SIZE \n", + "#Fill array with random numbers from 0 to 99\n", + "import random\n", + "for ctr in range(0,SIZE,1):\n", + " ara[ctr]=random.randint(0,99) %100 \n", + "print \"Here are the \",SIZE,\"random numbers:\\n\" \n", + "for ctr in range(0,SIZE,1):\n", + " print ara[ctr],\"\\n\" #Prints the array \n", + "print \"\\n\\n\"\n", + "#Initialize first element to both high_val and low_val\n", + "high_val=ara[0] \n", + "low_val=ara[0]\n", + "for ctr in range(1,SIZE,1):\n", + " if ara[ctr]>high_val: #Compares with rest of the elements in the array\n", + " high_val=ara[ctr] #Stores higher valure in high_val\n", + " if ara[ctr]<low_val:\n", + " low_val=ara[ctr] #Stores lower valure in low_val\n", + "print \"The highest number in the list is \",high_val,\"\\n\"\n", + "print \"The lowest number in the list is \",low_val,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are the 15 random numbers:\n", + "\n", + "81 \n", + "\n", + "96 \n", + "\n", + "31 \n", + "\n", + "1 \n", + "\n", + "34 \n", + "\n", + "53 \n", + "\n", + "70 \n", + "\n", + "9 \n", + "\n", + "23 \n", + "\n", + "89 \n", + "\n", + "51 \n", + "\n", + "73 \n", + "\n", + "53 \n", + "\n", + "85 \n", + "\n", + "79 \n", + "\n", + "\n", + "\n", + "\n", + "The highest number in the list is 96 \n", + "\n", + "The lowest number in the list is 1 \n", + "\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C24SERCH, Page number:499" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "MAX=100\n", + "def fill_parts(parts): #Function assigns first five parts to array for testing\n", + " parts[0]=12345\n", + " parts[1]=24724\n", + " parts[2]=54154\n", + " parts[3]=73496\n", + " parts[4]=83925\n", + " return parts\n", + "parts=[None]*MAX\n", + "num_parts=5 #Beginning inventory count\n", + "fill_parts(parts) #Fills the first five elements\n", + "search_part=0\n", + "while search_part != -9999:\n", + " print \"\\n\\nPlease type a part number...(-9999 ends program)\",\n", + " search_part=input()\n", + " if search_part==-9999:\n", + " break #Exits the loop if user wants \n", + " for ctr in range(0,num_parts,1): #Scans array to see whether part is in inventory\n", + " if search_part==parts[ctr]:\n", + " print \"\\nPart \",search_part,\"is already in inventory\"\n", + " break\n", + " else:\n", + " if ctr==num_parts-1:\n", + " parts[num_parts]=search_part #If not then it is added to end of the array\n", + " num_parts+=1\n", + " print search_part,\"was added to inventory\\n\"\n", + " break " + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C24SORT1, Page number:504" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "MAX=10\n", + "#Fill array with random numbers from 0 to 99\n", + "def fill_array(ara):\n", + " import random\n", + " for ctr in range(0,MAX,1):\n", + " ara[ctr]=random.randint(0,99) %100\n", + "#Prints the array ara[]\n", + "def print_array(ara):\n", + " for ctr in range(0,MAX,1):\n", + " print ara[ctr],\"\\n\"\n", + "#Sorts the array\n", + "def sort_array(ara):\n", + " for ctr1 in range(0,MAX-1,1):\n", + " for ctr2 in range(ctr1+1,MAX,1):\n", + " if ara[ctr1]>ara[ctr2]: #Swap if this part is not in order\n", + " temp=ara[ctr1] #Temporary variable to swap\n", + " ara[ctr1]=ara[ctr2]\n", + " ara[ctr2]=temp\n", + "ara=[None]*MAX\n", + "fill_array(ara)\n", + "print \"Here are the unsorted numbers:\\n\"\n", + "print_array(ara) #Prints the unsorted array\n", + "sort_array(ara) #Sorts the array in ascending order\n", + "print \"\\n\\nHere are the sorted numbers:\\n\"\n", + "print_array(ara) #Prints the sorted array" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are the unsorted numbers:\n", + "\n", + "68 \n", + "\n", + "41 \n", + "\n", + "53 \n", + "\n", + "40 \n", + "\n", + "69 \n", + "\n", + "65 \n", + "\n", + "64 \n", + "\n", + "48 \n", + "\n", + "87 \n", + "\n", + "18 \n", + "\n", + "\n", + "\n", + "Here are the sorted numbers:\n", + "\n", + "18 \n", + "\n", + "40 \n", + "\n", + "41 \n", + "\n", + "48 \n", + "\n", + "53 \n", + "\n", + "64 \n", + "\n", + "65 \n", + "\n", + "68 \n", + "\n", + "69 \n", + "\n", + "87 \n", + "\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C24SORT2, Page number:506" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "MAX=10\n", + "#Fill array with random numbers from 0 to 99\n", + "def fill_array(ara):\n", + " import random\n", + " for ctr in range(0,MAX,1):\n", + " ara[ctr]=random.randint(0,99) %100\n", + "#Prints the array ara[]\n", + "def print_array(ara):\n", + " for ctr in range(0,MAX,1):\n", + " print ara[ctr],\"\\n\"\n", + "#Sorts the array\n", + "def sort_array(ara):\n", + " for ctr1 in range(0,MAX-1,1):\n", + " for ctr2 in range(ctr1+1,MAX,1):\n", + " if ara[ctr1]<ara[ctr2]: #Swap if this part is not in order\n", + " temp=ara[ctr1] #Temporary variable to swap\n", + " ara[ctr1]=ara[ctr2]\n", + " ara[ctr2]=temp\n", + "\n", + "ara=[None]*MAX\n", + "fill_array(ara)\n", + "print \"Here are the unsorted numbers:\\n\"\n", + "print_array(ara) #Prints the unsorted array\n", + "sort_array(ara) #Sorts the array in descending order\n", + "print \"\\n\\nHere are the sorted numbers:\\n\"\n", + "print_array(ara) #Prints the newly sorted array" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here are the unsorted numbers:\n", + "\n", + "40 \n", + "\n", + "22 \n", + "\n", + "4 \n", + "\n", + "78 \n", + "\n", + "20 \n", + "\n", + "45 \n", + "\n", + "60 \n", + "\n", + "93 \n", + "\n", + "85 \n", + "\n", + "22 \n", + "\n", + "\n", + "\n", + "Here are the sorted numbers:\n", + "\n", + "93 \n", + "\n", + "85 \n", + "\n", + "78 \n", + "\n", + "60 \n", + "\n", + "45 \n", + "\n", + "40 \n", + "\n", + "22 \n", + "\n", + "22 \n", + "\n", + "20 \n", + "\n", + "4 \n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C25DISK1, Page number:533" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Two dimensional array declaration\n", + "disks= [[[] for ni in range(4)] for mi in range(2)]\n", + "#Assign values to the 2Darray\n", + "disks[0][0]=2.39\n", + "disks[0][1]=2.75\n", + "disks[0][2]=3.29\n", + "disks[0][3]=3.59\n", + "disks[1][0]=1.75\n", + "disks[1][1]=2.19\n", + "disks[1][2]=2.69\n", + "disks[1][3]=2.95\n", + "#Print the values in the array\n", + "for row in range(0,2,1):\n", + " for col in range(0,4,1):\n", + " print \"$\",'%.2f'%disks[row][col],\"\\n\"," + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "$ 2.39 \n", + "$ 2.75 \n", + "$ 3.29 \n", + "$ 3.59 \n", + "$ 1.75 \n", + "$ 2.19 \n", + "$ 2.69 \n", + "$ 2.95 \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C25DISK2, Page number:534" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Two dimensional array declaration\n", + "disks= [[[] for ni in range(4)] for mi in range(2)]\n", + "#Assign values to the 2Darray\n", + "disks[0][0]=2.39\n", + "disks[0][1]=2.75\n", + "disks[0][2]=3.29\n", + "disks[0][3]=3.59\n", + "disks[1][0]=1.75\n", + "disks[1][1]=2.19\n", + "disks[1][2]=2.69\n", + "disks[1][3]=2.95\n", + "#Print the values in the array\n", + "for row in range(0,2,1):\n", + " for col in range(0,4,1):\n", + " print \"$\",'%.2f'%disks[row][col],\"\\t\",\n", + " print \"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "$ 2.39 \t$ 2.75 \t$ 3.29 \t$ 3.59 \t\n", + "\n", + "$ 1.75 \t$ 2.19 \t$ 2.69 \t$ 2.95 \t\n", + "\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C25DISK3, Page number:535" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Two dimensional array declaration\n", + "disks= [[[] for ni in range(4)] for mi in range(2)]\n", + "#Assign values to the 2Darray\n", + "disks[0][0]=2.39\n", + "disks[0][1]=2.75\n", + "disks[0][2]=3.29\n", + "disks[0][3]=3.59\n", + "disks[1][0]=1.75\n", + "disks[1][1]=2.19\n", + "disks[1][2]=2.69\n", + "disks[1][3]=2.95\n", + "#Print the column titles.\n", + "print \"\\tSingle-sided\\tDouble-sided\\tSingle-sided\\tDouble-sided\"\n", + "print \"\\tDouble-density\\tDouble-density\\tHigh-density\\tHigh-density\"\n", + "#Print the prices\n", + "for row in range(0,2,1):\n", + " if row==0:\n", + " print \"3-1/2\\\"\\t\",\n", + " else:\n", + " print \"5-1/2\\\"\\t\",\n", + " for col in range(0,4,1):\n", + " print \"$\",'%.2f'%disks[row][col],\"\\t\\t\",\n", + " print \"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\tSingle-sided\tDouble-sided\tSingle-sided\tDouble-sided\n", + "\tDouble-density\tDouble-density\tHigh-density\tHigh-density\n", + "3-1/2\"\t$ 2.39 \t\t$ 2.75 \t\t$ 3.29 \t\t$ 3.59 \t\t\n", + "\n", + "5-1/2\"\t$ 1.75 \t\t$ 2.19 \t\t$ 2.69 \t\t$ 2.95 \t\t\n", + "\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C26SWAP, Page number:551" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Function definition\n", + "def swap_them(num1,num2):\n", + " num1,num2=num2,num1\n", + " return num1,num2\n", + "#Variable declaration\n", + "i=10\n", + "j=20\n", + "print \"\\nBefore swap, i is \",i,\"and j is \",j,\"\\n\"\n", + "i,j=swap_them(i,j) # Function call\n", + "print \"\\nAfter swap, i is \",i,\"and j is \",j,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Before swap, i is 10 and j is 20 \n", + "\n", + "\n", + "After swap, i is 20 and j is 10 \n", + "\n" + ] + } + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C27CP1, Page number:565" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable Declaration\n", + "c=\"Bettye Lou Horn\"\n", + "#Result\n", + "print \"My sister's name is \",c,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "My sister's name is Bettye Lou Horn \n", + "\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C27CP2, Page number:566" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable Declaration\n", + "c=\"Bettye Lou Horn\"\n", + "print \"My sister's maiden was \",c,\"\\n\"\n", + "#Assigns new string to c\n", + "c=\"Bettye Lou Henderson\" \n", + "#Result\n", + "print \"My sister's married name is \",c,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "My sister's maiden was Bettye Lou Horn \n", + "\n", + "My sister's married name is Bettye Lou Henderson \n", + "\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C27CP3, Page number:566" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable Declaration\n", + "c=\"Bettye Lou Horn\"\n", + "print \"My sister's maiden was \",c,\"\\n\"\n", + "c+=str(11) #makes c points to the last name\n", + "c=\"Henderson\" #Assigns new string to c\n", + "#Result\n", + "print \"My sister's married name is \",c,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "My sister's maiden was Bettye Lou Horn \n", + "\n", + "My sister's married name is Henderson \n", + "\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C27PTST1, Page number:576" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Array declaration\n", + "name=[\"George\",\"Michelle\",\"Joe\",\"Marcus\",\"Stephanie\"]\n", + "#Result\n", + "for ctr in range(0,5,1):\n", + " print \"String #\",(ctr+1),\"is\",name[ctr],\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "String # 1 is George \n", + "\n", + "String # 2 is Michelle \n", + "\n", + "String # 3 is Joe \n", + "\n", + "String # 4 is Marcus \n", + "\n", + "String # 5 is Stephanie \n", + "\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/C++_By_Example_by_Greg__M._Perry/Chapter7.ipynb b/C++_By_Example_by_Greg__M._Perry/Chapter7.ipynb new file mode 100755 index 00000000..03f3ad94 --- /dev/null +++ b/C++_By_Example_by_Greg__M._Perry/Chapter7.ipynb @@ -0,0 +1,1061 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:202cd2e1658fe1e78f5c583cd2a8c868d1e2a3fd1d27b0b500f9eefa5511c16f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7: Structures and File Input/Output" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C28ST1 :Page 592" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from collections import namedtuple\n", + "#Structure declaration and definition\n", + "struct_cd_collection = namedtuple(\"struct_cd_collection\", \"title artist num_songs price date_purch\")\n", + "#Structure for Cd Collection\n", + "cd1 = struct_cd_collection(\"Red Moon Men\", \"Sam and the Sneeds\", 12,11.95,\"02/13/92\")\n", + "\n", + "#Result\n", + "print \"Here is the CD information :\\n\\n\"\n", + "print \"Title:\",cd1.title,\"\\n\"\n", + "print \"Artist:\",cd1.artist,\"\\n\"\n", + "print \"Songs:\",cd1.num_songs,\"\\n\"\n", + "print \"Price:\",cd1.price,\"\\n\"\n", + "print \"Date purchased:\",cd1.date_purch,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Here is the CD information :\n", + "\n", + "\n", + "Title: Red Moon Men \n", + "\n", + "Artist: Sam and the Sneeds \n", + "\n", + "Songs: 12 \n", + "\n", + "Price: 11.95 \n", + "\n", + "Date purchased: 02/13/92 \n", + "\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C28ST2 :Page 593" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from collections import namedtuple\n", + "\n", + "#Structure initial declaration\n", + "students = namedtuple(\"students\", \"name age average\")\n", + "#Get data\n", + "print \"What is first student's name? \",\n", + "x=raw_input()\n", + "print \"What is the first student's age? \",\n", + "y=input()\n", + "print \"What is the first student's average ? \",\n", + "z=input()\n", + "#Assign data to the structure variable\n", + "student1=students(x,y,z)\n", + "print \"\\n\"\n", + "#Get data\n", + "print \"What is second student's name? \",\n", + "x=raw_input()\n", + "print \"What is the second student's age? \",\n", + "y=input()\n", + "print \"What is the second student's average ? \",\n", + "z=input()\n", + "#Assign data to the structure variable\n", + "student2=students(x,y,z)\n", + "#Result\n", + "print \"\\n\\nHere is the student information you entered:\\n\\n\"\n", + "print \"Student #1:\\n\"\n", + "print \"Name: \",student1.name,\"\\n\"\n", + "print \"Age: \",student1.age,\"\\n\"\n", + "print \"Average: \",'%.2f'%student1.average,\"\\n\"\n", + "print \"Student #2:\\n\"\n", + "print \"Name: \",student2.name,\"\\n\"\n", + "print \"Age: \",student2.age,\"\\n\"\n", + "print \"Average: \",'%.2f'%student2.average,\"\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is first student's name? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Larry\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is the first student's age? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "14\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is the first student's average ? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "87.67\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + "\n", + "What is second student's name? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Judy\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is the second student's age? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "15\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is the second student's average ? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "95.38\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + "\n", + "Here is the student information you entered:\n", + "\n", + "\n", + "Student #1:\n", + "\n", + "Name: Larry \n", + "\n", + "Age: 14 \n", + "\n", + "Average: 87.67 \n", + "\n", + "Student #2:\n", + "\n", + "Name: Judy \n", + "\n", + "Age: 15 \n", + "\n", + "Average: 95.38 \n", + "\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C28ST3 :Page 596" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Function definitions\n", + "def fill_structs(student_var):\n", + " #Get student data\n", + " print \"What is student's name? \",\n", + " x=raw_input()\n", + " print \"What is the student's age? \",\n", + " y=input()\n", + " print \"What is the student's average ? \",\n", + " z=input()\n", + " student_var=students(x,y,z)\n", + " return student_var\n", + "def pr_students(student_var):\n", + " print \"Name: \",student_var.name,\"\\n\",\n", + " print \"Age: \",student_var.age,\"\\n\",\n", + " print \"Average: \",student_var.average,\"\\n\",\n", + "#Structure declaration\n", + "from collections import namedtuple\n", + "students=namedtuple(\"students\",\"name age average\")\n", + "#Structure variable declaration\n", + "student1=students(\" \",0,0.0)\n", + "student2=students(\" \",0,0.0)\n", + "#Stucture variable is passed as copy to the function\n", + "student1=fill_structs(student1)\n", + "student2=fill_structs(student2)\n", + "#Result\n", + "print \"\\n\\nHere is the student information you entered:\\n\\n\"\n", + "pr_students(student1)\n", + "pr_students(student2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is student's name? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Larry\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is the student's age? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "14\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is the student's average ? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "87.67\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is student's name? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Judy\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is the student's age? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "15\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " What is the student's average ? " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "97.38\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + "\n", + "Here is the student information you entered:\n", + "\n", + "\n", + "Name: Larry \n", + "Age: 14 \n", + "Average: 87.67 \n", + "Name: Judy \n", + "Age: 15 \n", + "Average: 97.38 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C28CUST :Page 598" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Structure definition\n", + "from collections import namedtuple\n", + "customer_rec=namedtuple(\"customer_rec\",\"cust_name balance dist_rate\")\n", + "customer=customer_rec(\"Steve Thompson\",431.23,.25)\n", + "print \"Before the update\",customer.cust_name,\" has a balance of $\",'%.2f' %customer.balance,\"\\n\",\n", + "#Update the balance\n", + "customer_rec.balance=customer.balance*(1.0-customer.dist_rate)\n", + "#Result\n", + "print \"After the update\",customer.cust_name,\" has a balance of $\",'%.2f' %customer.balance,\"\\n\"," + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Before the update Steve Thompson has a balance of $ 431.23 \n", + "After the update Steve Thompson has a balance of $ 323.42 \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C28STCPY :Page 599" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Structure declaration\n", + "from collections import namedtuple\n", + "students=namedtuple(\"students\",\"st_name grade age average\")\n", + "#Structure variable declaration\n", + "std1=students(\"Joe Brown\",'A',13,91.4)\n", + "std2=students(\" \",\" \",0,0.0)\n", + "std3=students(\" \",\" \",0,0.0)\n", + "#Assigning one structure variable to another.\n", + "std2=std1\n", + "std3=std1\n", + "#Result\n", + "print \"The contents of std2:\\n\",\n", + "print std2.st_name,\", \",std2.grade,\", \",std2.age,\", \",'%.1f' %std2.average,\"\\n\\n\"\n", + "print \"The contents of std3:\\n\",\n", + "print std3.st_name,\", \",std3.grade,\", \",std3.age,\", \",'%.1f' %std3.average,\"\\n\\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The contents of std2:\n", + "Joe Brown , A , 13 , 91.4 \n", + "\n", + "\n", + "The contents of std3:\n", + "Joe Brown , A , 13 , 91.4 \n", + "\n", + "\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C30WR1 :Page 635" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#open a new file in write mode\n", + "fp = open (\"NAMES.txt\", \"w\" ) \n", + "fp.writelines(\"Michel Langston\\n\")\n", + "fp.writelines(\"Sally Redding\\n\")\n", + "fp.writelines(\"Jane Kirk\\n\")\n", + "fp.writelines(\"Stacy Wikert\\n\")\n", + "fp.writelines(\"Joe Hiquet\\n\")\n", + "#Close file\n", + "fp.close()\n", + "#Result\n", + "print \"names were written into the file\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "names were written into the file\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C30WR2 :Page 636" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Creates a file in write mode\n", + "fp = open ( \"NUMS.1.txt\", \"w\" ) \n", + "if not fp:\n", + " print \"Error opening file.\\n\"\n", + "else:\n", + " for ctr in range(1,101,1):\n", + " fp.write('%d' %ctr) #Writes number from 1-100 into the file\n", + "fp.close()\n", + "#Result\n", + "print \"ctr value is written into the file\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "ctr value is written into the file\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C30AP1 :Page 638" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#opens existing file\n", + "fp = open ( \"NAMES.txt\", \"a\" ) \n", + "#Adds to file\n", + "fp.writelines(\"Johnny Smith\\n\")\n", + "fp.writelines(\"Laura Hull \\n\")\n", + "fp.writelines(\"Mark Brown\\n\")\n", + "#Close file\n", + "fp.close()\n", + "#Result\n", + "print \"Names are added to the existing file\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Names are added to the existing file\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C30RE2 :Page 641" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#File1 to take backup\n", + "print \"What is the name of the file you want to back up? \"\n", + "in_filename=raw_input()\n", + "#File2 to copy contents\n", + "print \"What is the name of the file you want to copy \",in_filename,\"to? \"\n", + "out_filename=raw_input()\n", + "in_fp=open(in_filename,\"r\")\n", + "if not in_fp:\n", + " print \"\\n\\n*** \",in_filename,\"does not exist***\\n\"\n", + " exit(0)\n", + "else:\n", + " out_fp=open(out_filename,\"w\")\n", + " if not out_fp:\n", + " print \"\\n\\n*** Error opening \",out_filename,\"***\\n\"\n", + " exit(0)\n", + " else:\n", + " print \"\\nCopying...\\n\" #Reads from old file \n", + " for in_char in in_fp.readlines(): #and copies it to new file\n", + " out_fp.writelines(in_char)\n", + " print \"\\nThe file is copied.\\n\"\n", + "#Close all files\n", + "in_fp.close()\n", + "out_fp.close()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the name of the file you want to back up? \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "NAMES.txt\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "What is the name of the file you want to copy NAMES.txt to? \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "NEW_NAMES.txt\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Copying...\n", + "\n", + "\n", + "The file is copied.\n", + "\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C32CON :Page 664" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import *\n", + "PI = 3.14159\n", + "class Sphere: #Class declaration\n", + " def __init__(self, xcoord,ycoord,zcoord,radius):\n", + " self.r = radius\n", + " self.x = xcoord\n", + " self.y = ycoord\n", + " self.z = zcoord\n", + " \n", + " def volume(self):\n", + " return r*r*r*4*PI/3\n", + "\n", + " def surface_area(self):\n", + " return r*r*4*PI\n", + "def main():\n", + " s = Sphere(1.0,2.0,3.0,4.0) #Class object \n", + " print \"X=\",s.x,\", Y=\",s.y,\", Z=\",s.z,\", R=\",s.r #Result\n", + "\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "X= 1.0 , Y= 2.0 , Z= 3.0 , R= 4.0\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C32DES :Page 665" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import *\n", + "PI = 3.14159\n", + "#Class declaration\n", + "class Sphere: \n", + " def __init__( self,xcoord,ycoord,zcoord,radius):\n", + " self.r = radius\n", + " self.x = xcoord\n", + " self.y = ycoord\n", + " self.z = zcoord\n", + " def __del__(self):\n", + " print \"Sphere(\",self.x,\",\" ,self.y,\",\",self.z,\",\",self.r,\") destroyed\"\n", + " def volume(self):\n", + " return self.r*self.r*self.r*4*PI/3\n", + " def surface_area(self):\n", + " return self.r*self.r*4*PI\n", + "def main():\n", + " #Class object\n", + " s = Sphere(1.0,2.0,3.0,4.0) \n", + " #Result\n", + " print \"X=\",s.x,\", Y=\",s.y,\", Z=\",s.z,\", R=\",s.r \n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "X= 1.0 , Y= 2.0 , Z= 3.0 , R= 4.0\n", + "Sphere( 1.0 , 2.0 , 3.0 , 4.0 ) destroyed\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C32MEM :Page 667" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import *\n", + "PI = 3.14159\n", + "#Class declaration\n", + "class Sphere: \n", + " def __init__( self,xcoord,ycoord,zcoord,radius):\n", + " self.r = radius\n", + " self.x = xcoord\n", + " self.y = ycoord\n", + " self.z = zcoord\n", + " def __del__(self):\n", + " print \"Sphere(\",self.x,\",\" ,self.y,\",\",self.z,\",\",self.r,\") destroyed\"\n", + " def volume(self):\n", + " return self.r*self.r*self.r*4*PI/3\n", + " def surface_area(self):\n", + " return self.r*self.r*4*PI\n", + "def main():\n", + " #Class object\n", + " s = Sphere(1.0,2.0,3.0,4.0) \n", + " #Result\n", + " print \"X=\",s.x,\", Y=\",s.y,\", Z=\",s.z,\", R=\",s.r \n", + " print \"The volume is \",s.volume(),\"\\n\",\n", + " print \"The surface area is \",s.surface_area(),\"\\n\",\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "X= 1.0 , Y= 2.0 , Z= 3.0 , R= 4.0\n", + "The volume is 268.082346667 \n", + "The surface area is 201.06176 \n", + "Sphere( 1.0 , 2.0 , 3.0 , 4.0 ) destroyed\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C32MEM1 :Page 668" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import *\n", + "PI = 3.14159\n", + "#Class declaration\n", + "class Sphere: \n", + " def __init__( self,xcoord,ycoord,zcoord,radius):\n", + " self.r = radius\n", + " self.x = xcoord\n", + " self.y = ycoord\n", + " self.z = zcoord\n", + " def __del__(self):\n", + " print \"Sphere(\",self.x,\",\" ,self.y,\",\",self.z,\",\",self.r,\") destroyed\"\n", + " def volume(self):\n", + " return self.r*self.r*self.r*4*PI/3\n", + " def surface_area(self):\n", + " return self.r*self.r*4*PI\n", + "def main():\n", + " #Class object\n", + " s = Sphere(1.0,2.0,3.0,4.0) \n", + " #Result\n", + " print \"X=\",s.x,\", Y=\",s.y,\", Z=\",s.z,\", R=\",s.r \n", + " print \"The volume is \",s.volume(),\"\\n\", \n", + " print \"The surface area is \",s.surface_area(),\"\\n\",\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "X= 1.0 , Y= 2.0 , Z= 3.0 , R= 4.0\n", + "The volume is 268.082346667 \n", + "The surface area is 201.06176 \n", + "Sphere( 1.0 , 2.0 , 3.0 , 4.0 ) destroyed\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C32MEM1A :Page 669" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import *\n", + "PI = 3.14159\n", + "#Class declaration\n", + "class Sphere: \n", + " def __init__( self,xcoord,ycoord,zcoord,radius):\n", + " self.r = radius\n", + " self.x = xcoord\n", + " self.y = ycoord\n", + " self.z = zcoord\n", + " def __del__(self):\n", + " print \"Sphere(\",self.x,\",\" ,self.y,\",\",self.z,\",\",self.r,\") destroyed\"\n", + " def volume(self):\n", + " return self.r*self.r*self.r*4*PI/3\n", + " def surface_area(self):\n", + " return self.r*self.r*4*PI\n", + "def main():\n", + " #Class object\n", + " s = Sphere(1.0,2.0,3.0,4.0) \n", + " #Result\n", + " print \"X=\",s.x,\", Y=\",s.y,\", Z=\",s.z,\", R=\",s.r \n", + " print \"The volume is \",(s.r*s.r*s.r*4*PI/3),\"\\n\", #volume() function is expanded here\n", + " print \"The surface area is \",s.surface_area(),\"\\n\",\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "X= 1.0 , Y= 2.0 , Z= 3.0 , R= 4.0\n", + "The volume is 268.082346667 \n", + "The surface area is 201.06176 \n", + "Sphere( 1.0 , 2.0 , 3.0 , 4.0 ) destroyed\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C32DEF :Page 671" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import *\n", + "PI = 3.14159\n", + "#Class declaration\n", + "class Sphere: \n", + " def __init__( self,xcoord,ycoord=2.0,zcoord=2.5,radius=1.0):\n", + " self.r = radius\n", + " self.x = xcoord\n", + " self.y = ycoord\n", + " self.z = zcoord\n", + " def __del__(self):\n", + " print \"Sphere(\",self.x,\",\" ,self.y,\",\",self.z,\",\",self.r,\") destroyed\"\n", + " def volume(self):\n", + " return self.r*self.r*self.r*4*PI/3\n", + " def surface_area(self):\n", + " return self.r*self.r*4*PI\n", + "def main():\n", + " #Class objects\n", + " s = Sphere(1.0) \n", + " t = Sphere(1.0,1.1)\n", + " u = Sphere(1.0,1.1,1.2)\n", + " v = Sphere(1.0,1.1,1.2,1.3)\n", + " #Result\n", + " print \"s: X=\",s.x,\", Y=\",s.y,\", Z=\",s.z,\", R=\",s.r \n", + " print \"The volume is \",s.volume(),\"\\n\", \n", + " print \"The surface area is \",s.surface_area(),\"\\n\",\n", + " print \"t: X=\",t.x,\", Y=\",t.y,\", Z=\",t.z,\", R=\",t.r \n", + " print \"The volume is \",t.volume(),\"\\n\", \n", + " print \"The surface area is \",t.surface_area(),\"\\n\",\n", + " print \"u: X=\",u.x,\", Y=\",u.y,\", Z=\",u.z,\", R=\",u.r \n", + " print \"The volume is \",u.volume(),\"\\n\", \n", + " print \"The surface area is \",u.surface_area(),\"\\n\",\n", + " print \"v: X=\",v.x,\", Y=\",v.y,\", Z=\",v.z,\", R=\",v.r \n", + " print \"The volume is \",v.volume(),\"\\n\", \n", + " print \"The surface area is \",v.surface_area(),\"\\n\",\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "s: X= 1.0 , Y= 2.0 , Z= 2.5 , R= 1.0\n", + "The volume is 4.18878666667 \n", + "The surface area is 12.56636 \n", + "t: X= 1.0 , Y= 1.1 , Z= 2.5 , R= 1.0\n", + "The volume is 4.18878666667 \n", + "The surface area is 12.56636 \n", + "u: X= 1.0 , Y= 1.1 , Z= 1.2 , R= 1.0\n", + "The volume is 4.18878666667 \n", + "The surface area is 12.56636 \n", + "v: X= 1.0 , Y= 1.1 , Z= 1.2 , R= 1.3\n", + "The volume is 9.20276430667 \n", + "The surface area is 21.2371484 \n", + "Sphere( 1.0 , 2.0 , 2.5 , 1.0 ) destroyed\n", + "Sphere( 1.0 , 1.1 , 2.5 , 1.0 ) destroyed\n", + "Sphere( 1.0 , 1.1 , 1.2 , 1.0 ) destroyed\n", + "Sphere( 1.0 , 1.1 , 1.2 , 1.3 ) destroyed\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "C32OVCON :Page 673" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import *\n", + "PI = 3.14159\n", + "#Class declaration\n", + "class Sphere: \n", + " def __init__( self,xcoord,ycoord,zcoord,radius):\n", + " self.r = radius\n", + " self.x = xcoord\n", + " self.y = ycoord\n", + " self.z = zcoord\n", + " def __del__(self):\n", + " print \"Sphere(\",self.x,\",\" ,self.y,\",\",self.z,\",\",self.r,\") destroyed\"\n", + " def volume(self):\n", + " return self.r*self.r*self.r*4*PI/3\n", + " def surface_area(self):\n", + " return self.r*self.r*4*PI\n", + "def main():\n", + " #Class object\n", + " s = Sphere(1.0,2.0,3.0,4.0) \n", + " #Result\n", + " print \"X=\",s.x,\", Y=\",s.y,\", Z=\",s.z,\", R=\",s.r \n", + " print \"The volume is \",(s.r*s.r*s.r*4*PI/3),\"\\n\", #volume() function is expanded here\n", + " print \"The surface area is \",s.surface_area(),\"\\n\",\n", + "main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "X= 1.0 , Y= 2.0 , Z= 3.0 , R= 4.0\n", + "The volume is 268.082346667 \n", + "The surface area is 201.06176 \n", + "Sphere( 1.0 , 2.0 , 3.0 , 4.0 ) destroyed\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming/README.txt b/Computer_Concepts_and_C_Programming/README.txt new file mode 100755 index 00000000..9d7dcb17 --- /dev/null +++ b/Computer_Concepts_and_C_Programming/README.txt @@ -0,0 +1,10 @@ +Contributed By: yogeswaran palaniappan +Course: be +College/Institute/Organization: Sona college of technology +Department/Designation: computer science +Book Title: Computer Concepts and C Programming +Author: R.Rajaram +Publisher: Scitecch Publications (india) Pvt. Ltd. Chennai-600017 +Year of publication: 2001 +Isbn: 8187328274 +Edition: 1e
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_1.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_1.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_10.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_10.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_11.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_11.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_12.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_12.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_13.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_13.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_14.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_14.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_15.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_15.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_2.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_2.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_3.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_3.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_4.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_4.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_5.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_5.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_6.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_6.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_7.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_7.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_8.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_8.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_9.ipynb new file mode 100755 index 00000000..db2cb5a6 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter10_9.ipynb @@ -0,0 +1,711 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2d2127f6a5ebfde55eb11899a94f93b6aeee78155a32ab8e434ae8b263ad3b3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "10 : ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.2.1,page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "value = [6]\n",
+ "\n",
+ "for index in range(0,6):\n",
+ " print \"Enter Integer\"\n",
+ " value.append(int(input()))\n",
+ "for index in range(0,7):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 6\n",
+ "Integer = 12\n",
+ "Integer = 6\n",
+ "Integer = 7\n",
+ "Integer = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.1, page number:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=[6,4,3,2,1]\n",
+ "for index in xrange(5):\n",
+ " print \"Integer = \",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 6\n",
+ "Integer = 4\n",
+ "Integer = 3\n",
+ "Integer = 2\n",
+ "Integer = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.3.2, page number:171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE_CONST():\n",
+ " return 123\n",
+ "def TRAILER_CONST():\n",
+ " return -7777\n",
+ "value=array.array('i',[])\n",
+ "print \"Enter upto\",MAX_SIZE_CONST(),\"using\",TRAILER_CONST(),\"as trailer :\"\n",
+ "print \"\"\n",
+ "m=0\n",
+ "for index in range(0,int(MAX_SIZE_CONST())):\n",
+ " item=int(input())\n",
+ " if(item == int(TRAILER_CONST())):\n",
+ " break\n",
+ " else:\n",
+ " value.append(item)\n",
+ " m+=1\n",
+ "for index in range(0,m):\n",
+ " print \"Integer =\",value[index]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter upto 123 using -7777 as trailer :\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-7777\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integer = 1\n",
+ "Integer = 2\n",
+ "Integer = 3\n",
+ "Integer = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.4.1, page number:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "k=0\n",
+ "sum=0.0\n",
+ "def MAX_STUD():\n",
+ " return 20\n",
+ "def ENDINP():\n",
+ " return -9999\n",
+ "mark=array.array('i',(0 for i in range(0,MAX_STUD())))\n",
+ "print \"enter upto\",MAX_STUD(),\"marks:\"\n",
+ "readin=int(input())\n",
+ "for index in range(0,MAX_STUD()):\n",
+ " if(readin != ENDINP()):\n",
+ " mark[index]=readin\n",
+ " readin=int(input())\n",
+ " k+=1\n",
+ "for index in xrange(0,k):\n",
+ " sum=sum+mark[index]\n",
+ "print \"Average Mark = \",sum/k\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter upto 20 marks:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "66\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-9999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Mark = 51.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.5.1, page number:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 10\n",
+ "#str=array.array('i',(0 for i in range(0,MAX_SIZE()+1)))\n",
+ "print \"Enter the 10 letter word.\"\n",
+ "str=raw_input()\n",
+ "r=[]\n",
+ "for letter in str:\n",
+ " r.append(letter)\n",
+ "r.reverse()\n",
+ "print \"word = \",str\n",
+ "print \"\".join(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 letter word.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "word = madurai\n",
+ "iarudam\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.6.1, page number:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "def MAX_SIZE():\n",
+ " return 20\n",
+ "size=0\n",
+ "variable =array.array('i',[])\n",
+ "while True:\n",
+ " print \"Array-size : ?\"\n",
+ " size=int(input())\n",
+ " if size>1 and size<MAX_SIZE():\n",
+ " break\n",
+ "print \"Enter Numbers:\"\n",
+ "for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ "\n",
+ "variable= array.array('i',sorted(variable))\n",
+ "\n",
+ "print \"Sorted Array is:\"\n",
+ "for k in range(0,size):\n",
+ " print variable[k],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size : ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Array is:\n",
+ "-5 0 6 7 8 9 10 14 43\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "10.7.1,page number:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "pox =[[0 for x in range(4)]for x in range(6)]\n",
+ "pox[0]=3,5,7,9,12,20\n",
+ "pox[1]=10,13,17,21,25,40\n",
+ "pox[2]=15,18,22,26,30,45\n",
+ "pox[3]=17,20,23,27,32,46\n",
+ "\n",
+ "def read_city():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which city?\"\n",
+ " city=int(input())\n",
+ " if city == 0:\n",
+ " exit(1)\n",
+ " if city<4 or city>4 :\n",
+ " running=False\n",
+ " return city\n",
+ "def read_year():\n",
+ " running=True\n",
+ " while running:\n",
+ " print \"Which year?\"\n",
+ " year=int(input())\n",
+ " if year>1950 or year<2000 :\n",
+ " running=False\n",
+ " return year\n",
+ "def pop(x,y):\n",
+ " global pox\n",
+ " return pox[x-1][(y-1950)/10]\n",
+ "\n",
+ "def output_city():\n",
+ " if city == 1:\n",
+ " return \"Madurai\"\n",
+ " elif city == 2:\n",
+ " return \"Madras\"\n",
+ " elif city == 3:\n",
+ " return \"Bombay\"\n",
+ " elif city == 4:\n",
+ " return \"Calcutta\"\n",
+ " \n",
+ "runnable=True\n",
+ "city=read_city()\n",
+ "while runnable :\n",
+ " year=read_year()\n",
+ " print \"Population in \",year,\"of\",output_city(),\"is\",pop(city,year),\"Lakhs\"\n",
+ " city =read_city()\n",
+ " if city == 0:\n",
+ " runnable=False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Which year?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Population in 1990 of Bombay is 30 Lakhs\n",
+ "Which city?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_1.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_1.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_10.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_10.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_11.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_11.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_12.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_12.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_13.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_13.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_14.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_14.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_15.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_15.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_2.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_2.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_3.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_3.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_4.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_4.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_5.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_5.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_6.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_6.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_7.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_7.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_8.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_8.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_9.ipynb new file mode 100755 index 00000000..a7a687c2 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter11_9.ipynb @@ -0,0 +1,404 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92c507d5a01a7a0413aaf810859ecb2e4626113fce440f0c32977c3febad1c75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "11:HANDLING OF CHARACTER STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.2.1, page number:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=['m','a','d','u','r','a','i']\n",
+ "print \"\".join(inform)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.3.1,page number:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.4.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "inform=\"Thiagaragar\"\n",
+ "numb=int(input(\"No. Of Char To Print \"))\n",
+ "print 'print format = %.0',numb,'s'\n",
+ "print inform[0:numb]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. Of Char To Print 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "print format = %.0 6 s\n",
+ "Thiaga\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.5.1,page number:183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "array1='Thiagarajar Engg'\n",
+ "array2=(array1 + '.')[:-1]\n",
+ "print \"array1 = \",array1\n",
+ "print \"array2 = \",array2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 = Thiagarajar Engg\n",
+ "array2 = Thiagarajar Engg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.6.1,page number:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "userInput = raw_input(\"Enter Int: \")\n",
+ "if userInput.isdigit():\n",
+ " print \"Number = \"+userInput\n",
+ "else:\n",
+ " print userInput,\"is not int type\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Int: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.7.1,page number:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "first=\"Thiagrajar\"\n",
+ "second=first+\" Engg.\"\n",
+ "\n",
+ "print \"first = \",first\n",
+ "print \"second = \",second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "first = Thiagrajar\n",
+ "second = Thiagrajar Engg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.8.1,page number:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "string1 = \"Hello\"\n",
+ "print \"len of str is\",len(string1)\n",
+ "string2 = \" There\"\n",
+ "print \"string1+string2 is\",string1+string2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " len of str is 5\n",
+ "string1+string2 is Hello There\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "11.12.1, page number:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i=20\n",
+ "size=0\n",
+ "str1 =[]\n",
+ "str2=[]\n",
+ "def readSize():\n",
+ " global size\n",
+ " size=int(input(\"Enter number of strings : \"))\n",
+ " if size<1 or size>i :\n",
+ " readSize()\n",
+ " return\n",
+ "def readArray():\n",
+ " global size\n",
+ " global str1\n",
+ " print \"Enter the Strings..\"\n",
+ " for k in range(0,size):\n",
+ " m=raw_input()\n",
+ " str1.append(m)\n",
+ " return\n",
+ "def displayArray1():\n",
+ " for index in range(0,size):\n",
+ " print str1[index]\n",
+ " return\n",
+ "def displayArray2():\n",
+ " for index in range(0,size):\n",
+ " print str2[index]\n",
+ " return\n",
+ "def sortedArray():\n",
+ " global str1\n",
+ " global str2\n",
+ " str2= sorted(str1)\n",
+ " return\n",
+ "\n",
+ "readSize()\n",
+ "readArray()\n",
+ "print \"The unsorted array is..\"\n",
+ "displayArray1()\n",
+ "sortedArray()\n",
+ "print \"The sorted array is..\"\n",
+ "displayArray2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of strings : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Strings..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "page\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diskette\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eprom\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "random\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unsorted array is..\n",
+ "computer\n",
+ "page\n",
+ "diskette\n",
+ "eprom\n",
+ "binary\n",
+ "random\n",
+ "The sorted array is..\n",
+ "binary\n",
+ "computer\n",
+ "diskette\n",
+ "eprom\n",
+ "page\n",
+ "random\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_1.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_1.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_10.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_10.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_11.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_11.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_12.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_12.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_13.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_13.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_14.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_14.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_15.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_15.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_2.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_2.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_3.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_3.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_4.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_4.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_5.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_5.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_6.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_6.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_7.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_7.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_8.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_8.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_9.ipynb new file mode 100755 index 00000000..f5e720e1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter12_9.ipynb @@ -0,0 +1,436 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fddb630ff591f8acea671441a1ef2200894f84585416ff0fca0f361802a87050"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "12:USER DEFINED FUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.4.1, page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",leng*width"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16.8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 734.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.1, page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def change_index():\n",
+ " index=5\n",
+ "index=3\n",
+ "print \"index = \",index\n",
+ "change_index()\n",
+ "print \"index = \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "index = 3\n",
+ "index = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.5.2, page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def get_a_value():\n",
+ " return float(input())\n",
+ "def calc_area():\n",
+ " global leng,width\n",
+ " return leng*width\n",
+ "print \"Enter the Length..\"\n",
+ "leng=get_a_value()\n",
+ "print \"Enter the Width..\"\n",
+ "width=get_a_value()\n",
+ "print \"Area = \",calc_area()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Length..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Width..\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.6.1, page number:197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def print_value(k):\n",
+ " print k\n",
+ "numb=5\n",
+ "print \"Value of Expression : \",\n",
+ "print_value(numb*3+2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Expression : 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.7.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def TOL():\n",
+ " return 0.0001\n",
+ "def sqrt(n):\n",
+ " if n>0.0:\n",
+ " guess=0.0\n",
+ " guess=n/2.0\n",
+ " while True:\n",
+ " if ((guess*guess-n) > TOL()) or ((guess*guess-n) < -TOL()):\n",
+ " temp=guess+n/guess\n",
+ " guess=temp/2.0\n",
+ " else:\n",
+ " break\n",
+ " return guess\n",
+ " else:\n",
+ " return -1.0\n",
+ " \n",
+ "numb=float(input(\"Enter number..\"))\n",
+ "print \"Square Root of\",numb,\"is\",sqrt(numb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number..17.1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square Root of 17.1 is 4.13521500873\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.8.1, page number:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "year=0\n",
+ "def leap(n):\n",
+ " return (n%4 == 0)and(n%100 != 0)or(n%400 == 0)\n",
+ "year=int(input(\"Enter Year..\"))\n",
+ "if leap(year):\n",
+ " print year,\"is leap year\"\n",
+ "else:\n",
+ " print year,\"is not leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year..1984\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1984 is leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.1, page number:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def input_value():\n",
+ " return input()\n",
+ "def area(l,w):\n",
+ " return l*w\n",
+ "print \"Length = \"\n",
+ "length=input_value();\n",
+ "print \"Width = \"\n",
+ "width=input_value();\n",
+ "print \"Area = \",area(length,width)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width = \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 296.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "12.9.2, page number:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "value=1\n",
+ "def power(n,e):\n",
+ " global value\n",
+ " if(e<0):\n",
+ " return 0\n",
+ " for index in range(0,e):\n",
+ " if(index < e):\n",
+ " value*=n\n",
+ " index+=1\n",
+ " return value\n",
+ " \n",
+ "number=int(input(\"Enter Integer...\"))\n",
+ "exponent=int(input(\"Enter Exponent...\"))\n",
+ "while True:\n",
+ " if (exponent<0):\n",
+ " exponent=input(\"Enter a Non-Negative Integer :\")\n",
+ " else:\n",
+ " break\n",
+ "print number,\"raised to \",exponent,\" = \",power(number,exponent)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer...4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Exponent...2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 raised to 2 = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_1.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_1.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_10.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_10.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_11.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_11.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_12.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_12.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_13.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_13.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_14.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_14.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_15.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_15.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_2.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_2.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_3.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_3.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_4.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_4.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_5.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_5.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_6.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_6.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_7.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_7.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_8.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_8.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_9.ipynb new file mode 100755 index 00000000..0c43b667 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter13_9.ipynb @@ -0,0 +1,125 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ba129031b3dd7ed7efce1207bad751b6003f133c0f192eb72df391881da05bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "13:STRUCTURE AND UNIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.2.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \" \")\n",
+ "real = MyStruct(\" \",\"320.17\")\n",
+ "integer=integer._replace(fees=real.fees)\n",
+ "real=real._replace(regno=integer.regno)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",integer.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.3.1, page number:203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "\n",
+ "student = MyStruct(\"1234\", \"320.17\")\n",
+ "\n",
+ "print \"Reg.no : \",student.regno,\",Reg.no : \",student.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg.no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "13.4.1, page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from collections import namedtuple\n",
+ "MyStruct = namedtuple(\"MyStruct\", \"regno fees\")\n",
+ "\n",
+ "integer = MyStruct(\"1234\", \"320.17\")\n",
+ "real = MyStruct(\"\",\"\")\n",
+ "real=real._replace(regno=integer.regno,fees=integer.fees)\n",
+ "\n",
+ "print \"Reg_no : \",real.regno,\",Reg.no : \",real.fees"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reg_no : 1234 ,Reg.no : 320.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_1.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_1.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_10.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_10.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_11.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_11.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_12.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_12.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_13.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_13.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_14.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_14.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_15.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_15.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_2.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_2.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_3.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_3.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_4.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_4.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_5.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_5.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_6.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_6.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_7.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_7.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_8.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_8.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_9.ipynb new file mode 100755 index 00000000..39ea0685 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter15_9.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1653abf733b2f9f179249fa6301d56a0dc1802cab84a3f5e0ff6ee96488fe3f6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "15:FILES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.4.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c[-1] == '.':\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming language is modern and advanced;\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming language is modern and advanced;\n",
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "it enables addressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "it enables addressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.9.1, Page number:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def EOF():\n",
+ " return -1\n",
+ "while True:\n",
+ " print \"Enter Text\"\n",
+ " c = raw_input()\n",
+ " print 'Text entered is:'\n",
+ " print c\n",
+ " if c != EOF():\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "madurai is a great city ,meenakshi temple is in the heart,millions of pilgrims visit the temple every year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.10.1,page numebr:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Key in Text:\"\n",
+ "f = open('myfile','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text is:\"\n",
+ "f = open('myfile','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Key in Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text is:\n",
+ "Madurai city is famous for its historical mounaments and archives,every visitor must see these places.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.12.1,page numebr:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def file_output(x):\n",
+ " f=open(x,\"r\")\n",
+ " print f.read()\n",
+ "original = open('stud_rec','w')\n",
+ "copy = open('image','a')\n",
+ "\n",
+ "original.write(\"Tirupparankundram\\n\")\n",
+ "copy.write(\"Tirupparankundram\\n\")\n",
+ "\n",
+ "original.close()\n",
+ "copy.close()\n",
+ "\n",
+ "print \"After adding input,stud_rec has: \"\n",
+ "file_output(\"stud_rec\")\n",
+ "print \"After append,image contains:\"\n",
+ "file_output(\"image\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After adding input,stud_rec has: \n",
+ "Tirupparankundram\n",
+ "\n",
+ "After append,image contains:\n",
+ "Tirupparankundram\n",
+ "Tirupparankundram\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.14.1,page number:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type in the Text:\"\n",
+ "f = open('madurai','w')\n",
+ "c=str(raw_input())\n",
+ "f.write(c)\n",
+ "print \"The text read as:\"\n",
+ "f = open('madurai','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in the Text:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The text read as:\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.16.1,page number:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "import sys\n",
+ "import fileinput\n",
+ "import string\n",
+ "\n",
+ "print \"Madurai Contains :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()\n",
+ "\n",
+ "s = open(\"madurai_1\").read()\n",
+ "s = s.replace('temple', 'shrine')\n",
+ "f = open(\"madurai_1\", 'w')\n",
+ "f.write(s)\n",
+ "f.close()\n",
+ "\n",
+ "print \"Modified File now reads :\"\n",
+ "f = open('madurai_1','r')\n",
+ "print f.read()\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Madurai Contains :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi temple has no age\n",
+ "\n",
+ "Modified File now reads :\n",
+ "Madurai is an ancient city,ruled by pandyas,Tirumalai nayakar was the last prominent ruler who left many monuments; but meenakshi shrine has no age\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "15.18.1,page number:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import re\n",
+ "print \"Enter a stream of characters with integers embedded\"\n",
+ "c=raw_input()\n",
+ "print \"Integr is : \",re.sub(\"[^0-9]\", \"\", c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a stream of characters with integers embedded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ab+&473.tce\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integr is : 473\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_1.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_1.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_10.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_10.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_11.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_11.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_12.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_12.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_13.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_13.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_14.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_14.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_15.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_15.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_2.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_2.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_3.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_3.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_4.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_4.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_5.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_5.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_6.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_6.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_7.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_7.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_8.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_8.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_9.ipynb new file mode 100755 index 00000000..3371a2b1 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter5_9.ipynb @@ -0,0 +1,50 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fc199f6967bdaa418c011f64a9259bafc6cecf83675a6e55fed36bd7ff1a9671"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "5:C PROGRAMMING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "5.3,page number:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Welcome to C programming.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to C programming.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_1.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_1.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_10.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_10.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_11.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_11.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_12.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_12.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_13.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_13.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_14.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_14.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_15.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_15.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_2.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_2.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_3.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_3.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_4.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_4.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_5.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_5.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_6.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_6.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_7.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_7.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_8.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_8.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_9.ipynb new file mode 100755 index 00000000..4c020690 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter6_9.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47d59a62b2c6bacca8aa43f556c3c49e598b6b0b52b3cecb75f5587ebd7d9f66"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "6:CONSTANTS,VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.1,page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m=4\n",
+ "n=6\n",
+ "p=8\n",
+ "result = m+n\n",
+ "print \"m+n=\",result\n",
+ "result = int (m/n)\n",
+ "print \"m/n=\",result\n",
+ "result = m*p\n",
+ "print \"m*p=\",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m+n= 10\n",
+ "m/n= 0\n",
+ "m*p= 32\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.2,page number:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "result= round(m+n-p*m+p/n,0)\n",
+ "print \"m=\",m,\",n=\",n,\",p=\",p\n",
+ "print \"m + n - p * m + p / n = \",result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= 4 ,n= 6 ,p= 8\n",
+ "m + n - p * m + p / n = -21.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.3,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 4\n",
+ "n = 6\n",
+ "print \" 6 mod 4 = \",n%m\n",
+ "print \"The modulus operator is : %\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6 mod 4 = 2\n",
+ "The modulus operator is : %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "6.3.4,page number:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = -4\n",
+ "n = 6\n",
+ "p = 8\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p\n",
+ "print \"gives\"\n",
+ "m=-m\n",
+ "n=-n\n",
+ "p=-p\n",
+ "print \"m=\",m,\" n=\",n,\" p=\",p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m= -4 n= 6 p= 8\n",
+ "gives\n",
+ "m= 4 n= -6 p= -8\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_1.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_1.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_10.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_10.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_11.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_11.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_12.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_12.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_13.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_13.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_14.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_14.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_15.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_15.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_2.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_2.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_3.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_3.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_4.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_4.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_5.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_5.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_6.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_6.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_7.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_7.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_8.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_8.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_9.ipynb new file mode 100755 index 00000000..e3d4fa14 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter7_9.ipynb @@ -0,0 +1,114 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:748883adf9987fa80917596c14388a91ad8fe34d417a5435c22239cebb03b99e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "7.OPERATORS AND EXPRESSION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.1,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number = 19+9\n",
+ "print \"The month of Februry has\",number,\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The month of Februry has 28 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.4.2,page number:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "number=15\n",
+ "total=number*4\n",
+ "print total,\"is 4 times greater than\",number,\"number.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60 is 4 times greater than 15 number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "7.8.1,page number:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "m = 2\n",
+ "n = 12.34\n",
+ "result=m*n\n",
+ "print m,\"*\",n,\"=\",result\n",
+ "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
+ "print m,\"*\",n,\"=\",round(result)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 * 12.34 = 24.68\n",
+ "24.68 in scientific notation is 2.47E+01\n",
+ "2 * 12.34 = 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_1.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_1.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_10.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_10.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_11.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_11.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_12.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_12.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_13.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_13.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_14.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_14.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_15.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_15.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_2.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_2.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_3.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_3.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_4.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_4.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_5.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_5.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_6.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_6.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_7.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_7.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_8.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_8.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_9.ipynb new file mode 100755 index 00000000..02731f67 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter8_9.ipynb @@ -0,0 +1,139 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ca261b12dda6340bfb56a529d7d5db69661ff51a7fd92655edb700a9cae8e3b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "8.MANAGING INPUT AND OUTPUT OPERATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.1.1,page number:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"tce\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tce\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.2.1,page number:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Text :\"\n",
+ "str=raw_input()\n",
+ "print \"Text entered is:\\n\",str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text entered is:\n",
+ "C programming Language is modern and advanced;it enables adressing bits and bytes.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "8.3.1,page number:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter an Integer :\"\n",
+ "number=int(input())\n",
+ "print \"The Square Of \",number,\"is\",number*number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an Integer :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Square Of 6 is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_1.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_1.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_1.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_10.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_10.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_10.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_11.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_11.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_11.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_12.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_12.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_12.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_13.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_13.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_13.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_14.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_14.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_14.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_15.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_15.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_15.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_2.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_2.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_2.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_3.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_3.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_3.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_4.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_4.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_4.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_5.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_5.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_5.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_6.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_6.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_6.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_7.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_7.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_7.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_8.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_8.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_8.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_9.ipynb b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_9.ipynb new file mode 100755 index 00000000..c59dc853 --- /dev/null +++ b/Computer_Concepts_and_C_Programming_by_R.Rajaram/chapter9_9.ipynb @@ -0,0 +1,832 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cf6bdce268b89df5f08741df390466a4ba8e95dbdba72ee30279eb61d19897af"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "9 : DECISION MAKING,BREAKING BRANCHING AND LOOPING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.1.1,page number:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Type an Integer\"\n",
+ "numb=int(input())\n",
+ "if numb<=5:\n",
+ " print \"Good Choice!\"\n",
+ "print \"Thank You!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type an Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Choice!\n",
+ "Thank You!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.2.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter year : \"\n",
+ "year= int(input())\n",
+ "if year%4 == 0 and year%100 != 0 or year%400 == 0:\n",
+ " print year,\"is a leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter year : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.1,page number:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Year :\"\n",
+ "year=int(input())\n",
+ "if year%4 == 0 :\n",
+ " if year % 100 != 0:\n",
+ " print year,\"is leap year\"\n",
+ " else:\n",
+ " if year%400 == 0:\n",
+ " print year,\" is leap year\"\n",
+ "else:\n",
+ " print year,\"is not a leap year\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Year :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1990 is not a leap year\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.3.2,page number:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number\"\n",
+ "numb =int(input())\n",
+ "if numb<=100:\n",
+ " if numb>=30:\n",
+ " print numb,\"lies between 30-100\"\n",
+ " else:\n",
+ " print numb,\"is outside 30-100\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40 lies between 30-100\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.4.1,page number : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter choice of city(1-4)\"\n",
+ "city = int(input())\n",
+ "if city == 1:\n",
+ " print \"Madurai\"\n",
+ "elif city == 2:\n",
+ " print \"Chennai\"\n",
+ "elif city == 3:\n",
+ " print \"Mumbai\"\n",
+ "elif city == 4:\n",
+ " print \"Calcutta\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter choice of city(1-4)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mumbai\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.5.1,page number:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "numb=int(input(\"Enter the number\"))\n",
+ "if numb == 0:\n",
+ " print \"prints case0\"\n",
+ "elif numb == 1:\n",
+ " print \"prints case1\"\n",
+ "elif numb == 2:\n",
+ " print \"prints case2\" \n",
+ "else:\n",
+ " print"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "prints case2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.6.1,page number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import array\n",
+ "i =20\n",
+ "variable =array.array('i',[])\n",
+ "size = 0\n",
+ "\n",
+ "def get_array_size():\n",
+ " print \"Array-size :\"\n",
+ " global size\n",
+ " size=int(input())\n",
+ " if size<1 or size>i :\n",
+ " get_array_size()\n",
+ " \n",
+ "def input_fetch():\n",
+ " global size\n",
+ " global variabless\n",
+ " for k in range(0,size):\n",
+ " m=int(input())\n",
+ " variable.append(m)\n",
+ " return\n",
+ "\n",
+ "def sort_list():\n",
+ " global variable\n",
+ " variable= array.array('i',sorted(variable))\n",
+ " \n",
+ " return\n",
+ " \n",
+ "def output():\n",
+ " for k in range(0,size):\n",
+ " print variable[k],\n",
+ " return\n",
+ "\n",
+ "def even(number):\n",
+ " if number/2 == 0:\n",
+ " return 1\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "get_array_size()\n",
+ "input_fetch()\n",
+ "sort_list()\n",
+ "print \"The sorted list is :\"\n",
+ "output()\n",
+ "print \"\\nMedian : \",\n",
+ "\n",
+ "median=round((variable[(size/2)-1]+variable[size/2])/2,3) if even(size) else float(variable[size/2])\n",
+ "print median"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array-size :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sorted list is :\n",
+ "-4 0 5 6 6 7 8 13 17 25 \n",
+ "Median : 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.8.1,page number:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "index = 1\n",
+ "while index<12:\n",
+ " print \"This is line \",index\n",
+ " index+=1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line 1\n",
+ "This is line 2\n",
+ "This is line 3\n",
+ "This is line 4\n",
+ "This is line 5\n",
+ "This is line 6\n",
+ "This is line 7\n",
+ "This is line 8\n",
+ "This is line 9\n",
+ "This is line 10\n",
+ "This is line 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.1,page number:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer\"\n",
+ "total_sum=0\n",
+ "numb=int(input())\n",
+ "while numb>0:\n",
+ " digit=numb %10\n",
+ " total_sum+=digit\n",
+ " numb/=10\n",
+ "print \"Sum is \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1776\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum is 21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.9.2,page number:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter Integer:\"\n",
+ "numb=int(input())\n",
+ "print numb,\"is reversed as \",\n",
+ "while numb>0:\n",
+ " digit=numb%10\n",
+ " print digit,\n",
+ " numb/=10\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234 is reversed as 4 3 2 1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.1,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "for index in range(1,11):\n",
+ " print \" line \",index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ " line 7\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.2,page number:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Result\"\n",
+ "print \"Index Index Squared\"\n",
+ "print \"_____ _____________\"\n",
+ "for index in range(1,11):\n",
+ " print index,\" \",index*index"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result\n",
+ "Index Index Squared\n",
+ "_____ _____________\n",
+ "1 1\n",
+ "2 4\n",
+ "3 9\n",
+ "4 16\n",
+ "5 25\n",
+ "6 36\n",
+ "7 49\n",
+ "8 64\n",
+ "9 81\n",
+ "10 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.10.3,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "total_sum=0\n",
+ "value=100\n",
+ "for index in range(1,value+1):\n",
+ " total_sum+=index\n",
+ "print \"Sum of 1 to \",value,\" = \",total_sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of 1 to 100 = 5050\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "9.11.1,page number:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def exceptive():\n",
+ " for index in range(1,90):\n",
+ " if index%5 == 0:\n",
+ " continue\n",
+ " print index\n",
+ "exceptive()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "26\n",
+ "27\n",
+ "28\n",
+ "29\n",
+ "31\n",
+ "32\n",
+ "33\n",
+ "34\n",
+ "36\n",
+ "37\n",
+ "38\n",
+ "39\n",
+ "41\n",
+ "42\n",
+ "43\n",
+ "44\n",
+ "46\n",
+ "47\n",
+ "48\n",
+ "49\n",
+ "51\n",
+ "52\n",
+ "53\n",
+ "54\n",
+ "56\n",
+ "57\n",
+ "58\n",
+ "59\n",
+ "61\n",
+ "62\n",
+ "63\n",
+ "64\n",
+ "66\n",
+ "67\n",
+ "68\n",
+ "69\n",
+ "71\n",
+ "72\n",
+ "73\n",
+ "74\n",
+ "76\n",
+ "77\n",
+ "78\n",
+ "79\n",
+ "81\n",
+ "82\n",
+ "83\n",
+ "84\n",
+ "86\n",
+ "87\n",
+ "88\n",
+ "89\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Discrete_Mathematics_and_its_Applications/screenshots/2.png b/Discrete_Mathematics_and_its_Applications/screenshots/2.png Binary files differnew file mode 100755 index 00000000..fd868e09 --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications/screenshots/2.png diff --git a/Discrete_Mathematics_and_its_Applications/screenshots/4.png b/Discrete_Mathematics_and_its_Applications/screenshots/4.png Binary files differnew file mode 100755 index 00000000..f4be65e0 --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications/screenshots/4.png diff --git a/Discrete_Mathematics_and_its_Applications/screenshots/5.png b/Discrete_Mathematics_and_its_Applications/screenshots/5.png Binary files differnew file mode 100755 index 00000000..1e863da6 --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications/screenshots/5.png diff --git a/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chap2.ipynb b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chap2.ipynb new file mode 100755 index 00000000..45cacac5 --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chap2.ipynb @@ -0,0 +1 @@ +{"nbformat_minor": 0, "cells": [{"source": "# 02 Basic Structures: Sets, Functions, Sequences, Sums and Matrices", "cell_type": "markdown", "metadata": {}}, {"source": "##Example 01: Page 156", "cell_type": "markdown", "metadata": {}}, {"execution_count": 3, "cell_type": "code", "source": "#To generate a sequence a_n=1/n\ni=1.0 #floating point division\nn=input(\"enter the number of terms in the sequence\");\nprint \"a_n=1/n\"\nprint \"when n=\",n,\"a_n is\"\nfor i in range(1,n+1): #iteration till the number of terms specified by the user\n a=1.0/i\n print \"1/\",i,\",\",\nprint \"\\n\"\nfor i in range(1,n+1): #iteration till the number of terms specified by the user\n a=1.0/i\n print a,\",\",\n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "enter the number of terms in the sequence5\na_n=1/n\nwhen n= 5 a_n is\n1/ 1 , 1/ 2 , 1/ 3 , 1/ 4 , 1/ 5 , \n\n1.0 , 0.5 , 0.333333333333 , 0.25 , 0.2 ,\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 02 Basic Structures: Sets, Functions, Sequences, Sums and Matrices", "cell_type": "markdown", "metadata": {}}, {"source": "##Example 02: Page 157", "cell_type": "markdown", "metadata": {}}, {"execution_count": 5, "cell_type": "code", "source": "n=input(\"Enter the number of terms in the sequence to generate the geometric progression\");\ni=1\nprint\"the list of terms\",\nfor i in range (n+1):print\"b\",i,\",\",\nprint \"begins with\", \nfor i in range (n+1): #iterate for the number of terms given as input\n b_n=(-1)**i\n print b_n,\nprint\"\\n\",\"the list of terms\",\nfor i in range (n+1):print\"c\",i,\",\",\nprint \"begins with\", \nfor i in range (n+1): #iterate for the number of terms given as input\n c_n=2*(5**i)\n print c_n,\nprint\"\\n\",\"the list of terms\",\nfor i in range (n+1):print\"c\",i,\",\",\nprint \"begins with\",\nfor i in range (n+1): #iterate for the number of terms given as input\n d_n=6.0*((1.0/3.0)**i)\n print d_n, #prints the fraction values in decimals. Floating point division\n\n \n \n \n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number of terms in the sequence to generate the geometric progression5\nthe list of terms b 0 , b 1 , b 2 , b 3 , b 4 , b 5 , begins with 1 -1 1 -1 1 -1 \nthe list of terms c 0 , c 1 , c 2 , c 3 , c 4 , c 5 , begins with 2 10 50 250 1250 6250 \nthe list of terms c 0 , c 1 , c 2 , c 3 , c 4 , c 5 , begins with 6.0 2.0 0.666666666667 0.222222222222 0.0740740740741 0.0246913580247\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 02 Basic Structures: Sets, Functions, Sequences, Sums and Matrices", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 03: Page 157", "cell_type": "markdown", "metadata": {}}, {"execution_count": 6, "cell_type": "code", "source": "n=input(\"Enter the number terms in the sequence\");\ns_n=-1+4*n\nt_n=7-3*n\ni=0\nprint \"The list of terms\",\nfor i in range(n):\n print \"s\",i,\",\",\nprint \"begins with\",\nfor i in range(n):\n print -1+4*i,\nprint \"\\nThe list of terms\",\nfor i in range(n):\n print \"t\",i,\",\",\nprint \"begins with\",\nfor i in range(n):\n print 7-3*i,\n \n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number terms in the sequence5\nThe list of terms s 0 , s 1 , s 2 , s 3 , s 4 , begins with -1 3 7 11 15 \nThe list of terms t 0 , t 1 , t 2 , t 3 , t 4 , begins with 7 4 1 -2 -5\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 02 Basic Structures: Sets, Functions, Sequences, Sums and Matrices", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 05: Page 158", "cell_type": "markdown", "metadata": {}}, {"execution_count": 9, "cell_type": "code", "source": "a=[2,0,0,0] #assigning a[0]=2 (Given)\n\nfor i in range(1,4):#iteration to run till a[3]\n a[i]=a[i-1]+3\n print \"a[\",i,\"]\",a[i]", "outputs": [{"output_type": "stream", "name": "stdout", "text": "a[ 1 ] 5\na[ 2 ] 8\na[ 3 ] 11\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 02 Basic Structures: Sets, Functions, Sequences, Sums and Matrices", "cell_type": "markdown", "metadata": {}}, {"source": "##Example 06: Page 158", "cell_type": "markdown", "metadata": {}}, {"execution_count": 11, "cell_type": "code", "source": "a=[3,5,0,0] #assingning a[0],a[1] to the given values\n\nfor i in range(2,4): # iterations to find the successive values. If values are to be found for further terms the for loop \"stop\" has to be modified\n a[i]=a[i-1]-a[i-2]\n print \"a[\",i,\"]\",a[i]", "outputs": [{"output_type": "stream", "name": "stdout", "text": "a[ 2 ] 2\na[ 3 ] -3\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"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}}, {"source": "# 02 Basic Structures: Sets, Functions, Sequences, Sums and Matrices", "cell_type": "markdown", "metadata": {}}, {"source": "##Example 08: Page 159 ", "cell_type": "markdown", "metadata": {}}, {"execution_count": 3, "cell_type": "code", "source": "n=1\nresult=0\nnumber=input(\"Enter the number\");\nfor i in range(1,number):\n n=n+i*n \nprint \"The factorial of\",number,\"is\",n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number5\nThe factorial of 5 is 120\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 02 Basic Structures: Sets, Functions, Sequences, Sums and Matrices", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 09: Page 159", "cell_type": "markdown", "metadata": {}}], "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/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter1.ipynb b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter1.ipynb new file mode 100755 index 00000000..84bcf1ef --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter1.ipynb @@ -0,0 +1 @@ +{"nbformat_minor": 0, "cells": [{"source": "# 01 The Foundations: Logic and Proofs\n", "cell_type": "markdown", "metadata": {}}, {"source": "# #Example 01:Page 02", "cell_type": "markdown", "metadata": {}}, {"execution_count": 1, "cell_type": "code", "source": "print \"The following sentences are Propositions\" #Proposition should be a declarative sentence or should result in either a YES or a NO.\n\nprint \"1. Washington D.C is the capital of the United States of America\\n2. Toronto is the capital of Canada\\n3. 1+1=2.\\n4. 2+2=3.\" #Since these statements are declarative and they answer the question YES or NO they are called propositions.\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "The following sentences are Propositions\n1. Washington D.C is the capital of the United States of America\n2. Toronto is the capital of Canada\n3. 1+1=2.\n4. 2+2=3.\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 01 The Foundations: Logic and Proofs", "cell_type": "markdown", "metadata": {}}, {"source": "# #Example 02:Page 02", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "print \"1. What time is it? \\n2. Read this carefully. \\n3. x+1=2.\\n4. x+y=Z.\"\nprint\"Sentences 1 and 2 are not propositions since they are not declarative. Sentences 3 and 4 are neither true nor false and so they are not propositions.\"\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "1. What time is it? \n2. Read this carefully. \n3. x+1=2.\n4. x+y=Z.\nSentences 1 and 2 are not propositions since they are not declarative. Sentences 3 and 4 are neither true nor false and so they are not propositions.\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 01 The Foundations: Logic and Proofs", "cell_type": "markdown", "metadata": {}}, {"source": "# #Example 03:Page 03", "cell_type": "markdown", "metadata": {}}, {"execution_count": 9, "cell_type": "code", "source": "print \"Propositon p=Michael's PC runs Linux.\"\nprint \"\\n Negation of p is ~p : It is not the case that Michael's PC runs Linux.\"\nprint \"\\n Negation of p is ~p : Michae's PC does not run.\"#Negation is opposite of the truth value of the proposition expressed with \"it is not the case that\" or with \"not\".\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Propositon p=Michael's PC runs Linux.\n\n Negation of p is ~p : It is not the case that Michael's PC runs Linux.\n\n Negation of p is ~p : Michae's PC does not run.\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 01 The Foundations: Logic and Proofs", "cell_type": "markdown", "metadata": {}}, {"source": "# #Example 04:Page 03", "cell_type": "markdown", "metadata": {}}, {"execution_count": 10, "cell_type": "code", "source": "print \"Let p=Vandana's smartphone has at least 32GB of memory.\"\nprint \"The negation of p is ( ~p ) :It is not the case that Vandana's smartphone has at least 32GB of memory.\"\nprint \"Or in simple English ( ~p ): Vandana's smartphone does not have at least 32GB of memory.\"\nprint \"Or even more simple as ( ~p ): Vandana's smartphone has less than 32GB of memory.\"\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Let p=Vandana's smartphone has at least 32GB of memory.\nThe negation of p is ( ~p ) :It is not the case that Vandana's smartphone has at least 32GB of memory.\nOr in simple English ( ~p ): Vandana's smartphone does not have at least 32GB of memory.\nOr even more simple as ( ~p ): Vandana's smartphone has less than 32GB of memory.\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 01 The Foundations: Logic and Proofs", "cell_type": "markdown", "metadata": {}}, {"source": "# #Example 05:Page 04", "cell_type": "markdown", "metadata": {}}, {"execution_count": 11, "cell_type": "code", "source": "p=\"Rebecca's PC has more than 16GB free hard disk space\"\nq=\"The processor in Rebecca's PC runs faster than 1GHz\"\nprint \"Let p,q be two propositions\"\nprint \"Let p=\",p,\"\\n\",\"Let q=\",q\nprint \"Conjunction of p^q is : \"+p+\" and \"+q #conjunction combines two propositons with \"and\"\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Let p,q be two propositions\nLet p= Rebecca's PC has more than 16GB free hard disk space \nLet q= The processor in Rebecca's PC runs faster than 1GHz\nConjunction of p^q is : Rebecca's PC has more than 16GB free hard disk space and The processor in Rebecca's PC runs faster than 1GHz\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 01 The Foundations: Logic and Proofs", "cell_type": "markdown", "metadata": {}}, {"source": "# #Example 06:Page 05", "cell_type": "markdown", "metadata": {}}, {"execution_count": 12, "cell_type": "code", "source": "p=\"Rebecca's PC has more than 16GB free hard disk space\"\nq=\"The processor in Rebecca's PC runs faster than 1GHz\"\nprint \"Let p,q be two propositions\"\nprint \"Let p=\",p,\"\\n\",\"Let q=\",q\nprint \"Disjunction of p\\/q is : \"+p+\" or \"+q #unavailability of cup symbol. So \\/\n#Disjunction combines two propositons using OR \n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Let p,q be two propositions\nLet p= Rebecca's PC has more than 16GB free hard disk space \nLet q= The processor in Rebecca's PC runs faster than 1GHz\nDisjunction of p\\/q is : Rebecca's PC has more than 16GB free hard disk space or The processor in Rebecca's PC runs faster than 1GHz\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 01 The Foundations: Logic and Proofs", "cell_type": "markdown", "metadata": {}}, {"source": "# #Example 07:Page 07", "cell_type": "markdown", "metadata": {}}, {"execution_count": 14, "cell_type": "code", "source": "p=\"Maria learns discrete mathematics\"\nq=\"Maria will find a good job\"\nprint\"Let p=\",p,\"\\n\",\"Let q=\",q\nprint\"p->q is : \"+\"If \"+p+\" then \"+q #p->q p implies q means If P then Q.\nprint\"p->q is also expressed as :\",q,\" when \",p\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Let p= Maria learns discrete mathematics \nLet q= Maria will find a good job\np->q is : If Maria learns discrete mathematics then Maria will find a good job\np->q is also expressed as : Maria will find a good job when Maria learns discrete mathematics\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "", "cell_type": "markdown", "metadata": {}}, {"source": "", "cell_type": "markdown", "metadata": {}}, {"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/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter3.ipynb b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter3.ipynb new file mode 100755 index 00000000..0ce61f7d --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter3.ipynb @@ -0,0 +1 @@ +{"nbformat_minor": 0, "cells": [{"source": "# 03 Algorithms", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 03: Page 195", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "def binarysearch(a,num): #function definition with its parameters 'a' is the inputlist\n #and 'num' number to be found\n\n first=0 #initially the first position is zero\n last=len(a)-1 #initially the last position is the total length of the inputlist-1\n found=False #boolean value to indicate if the number to be searched is found or not.\n\n while first<=last and not found:\n midpoint=(first+last)//2 #dividing the inputlist into two halves and comparing the number to be found with the midpoint.\n\n if a[midpoint]==num: #If the number to be found is equal to the midpoint returns the position.\n found=True\n else:\n if num<a[midpoint]: #if the number to be found is less than the midpoint\n #then the first half of the divided input list is taken for further computation.\n\n last=midpoint-1 #by assigning the last number of the first half(number before the midpoint) to the variable last.\n\n\n else:\n first=midpoint+1 #if the number to be found is greater than the midpoint\n #then the second half of the divided input list is taken for further computation.\n #by assigning the first number of the second half(number following the midpoint) to the variable first.\n\n return midpoint #returns the position of the number found in the list. \n\n\n\nnumlist=[1, 23, 5, 6, 7, 8, 10, 12, 13, 15, 16, 18, 19, 20, 22] #List of inputs\nprint \"Found number 19 at the position\",(binarysearch(numlist, 19)) #Printing the position of the number to be found by a function call.\n #The function binarysearch is called along with its parameters, inputlist\n #and the number to be found.\n\n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Found number 19 at the position 12\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 03 Algorithms", "cell_type": "markdown", "metadata": {}}, {"source": "##Example 04: Page 196", "cell_type": "markdown", "metadata": {}}, {"execution_count": null, "cell_type": "code", "source": "input_list1=[3,2,4,1,5] #List to be sorted\ndef bubblesort(input_list1): #Function definition\n unsorted=True\n n=-1\n while unsorted:\n for j in range(0,len(input_list1)-1): #based on the truth value proceedings are done\n unsorted=False \n if (input_list1[j]>input_list1[j+1]): #algorithm is followed\n temp=input_list1[j+1]\n input_list1[j+1]=input_list1[j]\n input_list1[j]=temp\n n=n+1\n print n,\"pass\",input_list1\n else:\n unsorted=True\nprint bubblesort(input_list1)\n", "outputs": [], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 03 Algorithms", "cell_type": "markdown", "metadata": {}}, {"source": "##Example 05: Page 198", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "#To perform insertionsort\ndef sort_insertion(inputlist):\n\n for i in range(1,len(inputlist)):\n\n val_current = inputlist[i]\n pos = i \n \n # check backwards through sorted list for proper pos of val_current\n while((pos > 0) and (inputlist[pos-1] > val_current)):\n inputlist[pos] = inputlist[pos-1]\n pos = pos-1\n \n if pos != i:\n inputlist[pos] = val_current \n print(inputlist)\n return inputlist\ninputlist = [3,2,4,1,5]\nprint sort_insertion(inputlist)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "[2, 3, 4, 1, 5]\n[1, 2, 3, 4, 5]\n[1, 2, 3, 4, 5]\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "", "cell_type": "markdown", "metadata": {}}, {"source": "", "cell_type": "markdown", "metadata": {}}], "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/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter4.ipynb b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter4.ipynb new file mode 100755 index 00000000..cbe9f3bd --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter4.ipynb @@ -0,0 +1 @@ +{"nbformat_minor": 0, "cells": [{"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 03: Page 239", "cell_type": "markdown", "metadata": {}}, {"execution_count": 1, "cell_type": "code", "source": "#To find the quotient and remainder \ndividend=101\ndivisor=11\nquotient=dividend/divisor #To find quotient\nremainder=dividend%divisor #To find remainder\ndividend=(divisor*quotient)+remainder\nprint \"The quotient when\",dividend,\"is divided by\",divisor,\"is\",quotient,\"=\",dividend,\"div\",divisor,\"and the remainder is\",remainder,\"=\",dividend,\"mod\",divisor\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "The quotient when 101 is divided by 11 is 9 = 101 div 11 and the remainder is 2 = 101 mod 11\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 04: Page 240", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "#To find the quotient and remainder\ndividend=-11\ndivisor=3\nquotient=dividend/divisor\nremainder=dividend%divisor\ndividend=(divisor*quotient)+remainder\nprint \"The quotient when\",dividend,\"is divided by\",divisor,\"is\",quotient,\"=\",dividend,\"div\",divisor,\"and the remainder is\",remainder,\"=\",dividend,\"mod\",divisor\n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "The quotient when -11 is divided by 3 is -4 = -11 div 3 and the remainder is 1 = -11 mod 3\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 01: Page 246", "cell_type": "markdown", "metadata": {}}, {"execution_count": 3, "cell_type": "code", "source": "#To convert binary to decimal equivalent\nbinary_num= raw_input('enter a number: ')\ndecimal = 0\nfor digit in binary_num:\n decimal = decimal*2 + int(digit)\n\nprint decimal\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "enter a number: 101011111\n351\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 03: Page 247", "cell_type": "markdown", "metadata": {}}, {"execution_count": 5, "cell_type": "code", "source": "#To convert decimal to hexadecimal\ndec= raw_input('enter a number: ')\n\nprint \"The conversion of\",dec,\"to hexadeimal is\",int(dec,16)\n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "enter a number: 2AE0B\nThe conversion of 2AE0B to hexadeimal is 175627\n"}], "metadata": {"scrolled": true, "collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 04: Page 247", "cell_type": "markdown", "metadata": {}}, {"execution_count": 6, "cell_type": "code", "source": "#To compute decimal to octal\nnumbers= []\ndec=input(\"Enter a number\");\nnum=dec\nwhile dec!=0:\n \n rem=dec%8\n dec=dec/8\n numbers.append(rem)\nprint \"The decimal number\",num,\"is converted to its octal equivalent : \",\nfor i in reversed(numbers):\n print i,\n \n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter a number12345\nThe decimal number 12345 is converted to its octal equivalent : 3 0 0 7 1\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 05: Page 248", "cell_type": "markdown", "metadata": {}}, {"execution_count": 7, "cell_type": "code", "source": "#To convert Decimal to hexadecimal\nnum=[]\ndef ChangeHex(n): #function to convert\n if (n < 0):\n num.append(\"\")\n elif (n<=1):\n num.append(n)\n else: #for numbers greater than 9\n x =(n%16)\n if (x < 10):\n num.append(x) \n if (x == 10):\n num.append(\"A\")\n if (x == 11):\n num.append(\"B\")\n if (x == 12):\n num.append(\"C\")\n if (x == 13):\n num.append(\"D\")\n if (x == 14):\n num.append(\"E\")\n if (x == 15):\n num.append(\"F\")\n ChangeHex( n / 16 )\ndec_num=input(\"Enter the decimal number which is to be converted to hexadecimal\");\nChangeHex(dec_num)\nprint \"The hexadecimal equivalent of decimal\",dec_num,\"is\",\nfor i in reversed(num):\n print i,\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the decimal number which is to be converted to hexadecimal177130\nThe hexadecimal equivalent of decimal 177130 is 0 2 B 3 E A\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 06: Page 249", "cell_type": "markdown", "metadata": {}}, {"execution_count": 9, "cell_type": "code", "source": "#Compute Decimal to Binary\narray=[]\ndef conv(n):\n if n==0:\n print ''\n else:\n array.append(str(n%2)) #to compute remainder and append it to the result\n return conv(n/2) \ndec_num=input(\"Enter a decimal number\")\nconv(dec_num)\nprint \"The binary equivalent of decimal\",dec_num,\"is\",\nfor i in reversed(array):\n print i,\n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter a decimal number241\n\nThe binary equivalent of decimal 241 is 1 1 1 1 0 0 0 1\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 06: Page 249", "cell_type": "markdown", "metadata": {}}, {"execution_count": 10, "cell_type": "code", "source": "#To compute the binary addition\ndef binAdd(bin1, bin2): #function to add two binary numbers\n if not bin1 or not bin2:#checks if both the numbers are binary\n return '' \n\n maxlen = max(len(bin1), len(bin2))\n\n bin1 = bin1.zfill(maxlen) #zfill fills with zero to fill the entire width\n bin2 = bin2.zfill(maxlen)\n\n result = ''\n carry = 0\n\n i = maxlen - 1\n while(i >= 0):\n s = int(bin1[i]) + int(bin2[i])#adding bit by bit\n if s == 2: #1+1\n if carry == 0:\n carry = 1\n result = \"%s%s\" % (result, '0')\n else:\n result = \"%s%s\" % (result, '1')\n elif s == 1: # 1+0\n if carry == 1:\n result = \"%s%s\" % (result, '0')\n else:\n result = \"%s%s\" % (result, '1')\n else: # 0+0\n if carry == 1:\n result = \"%s%s\" % (result, '1')\n carry = 0 \n else:\n result = \"%s%s\" % (result, '0') \n\n i = i - 1;\n\n if carry>0:\n result = \"%s%s\" % (result, '1')\n return result[::-1]\nbin1 = raw_input('enter the first number: ')\nbin2 = raw_input('enter the second number: ')\nprint \"The sum of binary numbers\",bin1,\"and\",bin2,\"is\",binAdd(bin1,bin2)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "enter the first number: 1110\nenter the second number: 1011\nThe sum of binary numbers 1110 and 1011 is 11001\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 02: Page 258", "cell_type": "markdown", "metadata": {}}, {"execution_count": 21, "cell_type": "code", "source": "#to find the prime factors\n\ndef prime_factors(n):\n i = 2\n factors = []\n while i * i <= n:\n if n % i: #modulp division to check of the number is prime or not\n i += 1\n else:\n n //= i\n factors.append(i) #append those numbers which readily divides the given number\n if n > 1:\n factors.append(n)\n return factors\nnumber=input(\"Enter the number for which the prime factors have to be found\");\na=prime_factors(number)\nprint a\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number for which the prime factors have to be found100\n[2, 2, 5, 5]\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 03: Page 258", "cell_type": "markdown", "metadata": {}}, {"execution_count": 22, "cell_type": "code", "source": "#To say if a number is prime or not\nglobals() ['count']=0\nn=input(\"Enter the number\");\nfor i in range(2,n):#number thats not divisible by other than one and itself. so from 2 to n (n-1 in python for loop)\n if n%i==0:\n count=count+1\n num=i\nif count==0:\n print n,\"is prime\" \nelse:\n print n,\"is not prime because its divisible by\",num\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number101\n101 is prime\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 04: Page 259", "cell_type": "markdown", "metadata": {}}, {"execution_count": 23, "cell_type": "code", "source": "#to find the prime factors\n\ndef prime_factors(n):\n i = 2\n factors = []\n while i * i <= n:\n if n % i: #modulp division to check of the number is prime or not\n i += 1\n else:\n n //= i\n factors.append(i) #append those numbers which readily divides the given number\n if n > 1:\n factors.append(n)\n return factors\nnumber=input(\"Enter the number for which the prime factors have to be found\");\na=prime_factors(number)\nprint a\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number for which the prime factors have to be found7007\n[7, 7, 11, 13]\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 10: Page 263", "cell_type": "markdown", "metadata": {}}, {"execution_count": 24, "cell_type": "code", "source": "#To compute GCD\ndef gcd(a,b):#fuction computes gcd\n if b > a:\n return gcd(b,a)\n r = a%b\n if r == 0:\n return b\n return gcd(r,b)\nn1=input(\"Enter the first number\");\nn2=input(\"Enter the second number\");\nprint \"GCD(\",n1,\",\",n2,\") is\",gcd(n1,n2)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the first number24\nEnter the second number36\nGCD( 24 , 36 ) is 12\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 11: Page 263", "cell_type": "markdown", "metadata": {}}, {"execution_count": 25, "cell_type": "code", "source": "#To compute GCD\ndef gcd(a,b):#fuction computes gcd\n if b > a:\n return gcd(b,a)\n r = a%b\n if r == 0:\n return b\n return gcd(r,b)\nn1=input(\"Enter the first number\");\nn2=input(\"Enter the second number\");\nprint \"GCD(\",n1,\",\",n2,\") is\",gcd(n1,n2)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the first number17\nEnter the second number22\nGCD( 17 , 22 ) is 1\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 16: Page 268", "cell_type": "markdown", "metadata": {}}, {"execution_count": 26, "cell_type": "code", "source": "#to find gcd using euclidean algorithm\ndef gcd(a,b):#euclidean algithm definition\n x=a\n y=b\n while y!=0:\n r=x%y\n x=y\n y=r\n print \"gcd(\",a,\",\",b,\")is\",x\nnum1=input(\"Enter the first number\");\nnum2=input(\"Enter the second number\");\ngcd(num1,num2)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the first number414\nEnter the second number662\ngcd( 414 , 662 )is 2\n"}], "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 04 Number Theory and Cryptography", "cell_type": "markdown", "metadata": {"collapsed": true}}, {"source": "## Example 17: Page 270", "cell_type": "markdown", "metadata": {}}, {"execution_count": 1, "cell_type": "code", "source": "#to find gcd using euclidean algorithm\ndef gcd(a,b):#euclidean algithm definition\n x=a\n y=b\n while y!=0:\n r=x%y\n x=y\n y=r\n print \"gcd(\",a,\",\",b,\")is\",x\nnum1=input(\"Enter the first number\");\nnum2=input(\"Enter the second number\");\ngcd(num1,num2)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the first number252\nEnter the second number198\ngcd( 252 , 198 )is 18\n"}], "metadata": {"collapsed": false, "trusted": false}}], "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/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter5.ipynb b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter5.ipynb new file mode 100755 index 00000000..67acd929 --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter5.ipynb @@ -0,0 +1 @@ +{"nbformat_minor": 0, "cells": [{"source": "# 05 Induction and Recursion", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 01: Page 346", "cell_type": "markdown", "metadata": {}}, {"execution_count": 1, "cell_type": "code", "source": "#to compute the recursive functions\ndef f(n):\n\n if n==0:\n return 3\n else:\n n=n-1\n result=2*f(n)+3 #recursive call\n return result\nfor num in range(1,5):\n r=f(num)\n print \"The value of f(\",num,\") is\",r #Prints the result for individual instance\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "The value of f( 1 ) is 9\nThe value of f( 2 ) is 21\nThe value of f( 3 ) is 45\nThe value of f( 4 ) is 93\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 05 Induction and Recursion", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 01: Page 361", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "#To compute the factorial of a given number using recursion\ndef factorial(n):\n if n==0:\n return 1\n else:\n return n*factorial(n-1) #recursive function call\nnum=input(\"Enter a number whose factorial is to be found\");\nprint \"The factorial of\",num,\"is\",factorial(num);\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter a number whose factorial is to be found4\nThe factorial of 4 is 24\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 05 Induction and Recursion", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 02: Page 361", "cell_type": "markdown", "metadata": {}}, {"execution_count": 3, "cell_type": "code", "source": "#To compute power using recursive algorithm\ndef power(a,n):\n if n==0:\n return 1\n else:\n return a*power(a,n-1) #recursive call algorithm\nnum=input(\"Enter the number\");\np=input(\"Enter the power\");\nprint \"The value of\",num,\"to the power\",p,\"is\",power(num,p);\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number5\nEnter the power4\nThe value of 5 to the power 4 is 625\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 05 Induction and Recursion", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 03: Page 362", "cell_type": "markdown", "metadata": {}}, {"execution_count": 5, "cell_type": "code", "source": "#To compute gcd using modular recursion\ndef gcd(a,b):\n if a==0:\n return b\n else:\n return gcd(b%a,a) #recursive call\n\nnum1=input(\"Enter the first number\")\nnum2=input(\"Enter the second number\")\nprint \"The gcd of\",num1,\",\",num2,\"is\",gcd(num1,num2)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the first number5\nEnter the second number8\nThe gcd of 5 , 8 is 1\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 05 Induction and Recursion", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 04: Page 362", "cell_type": "markdown", "metadata": {}}, {"execution_count": 4, "cell_type": "code", "source": "#To compute mpower function using recursion\ndef mpower(b,n,m):\n if n==0:\n return 1\n else:\n if n%2==0:\n return ((mpower(b,n/2,m))**2) % m #recursive call\n else:\n return ((mpower(b,n/2,m)**2)%m*(b%m))%m #recursive call\nnumber=input(\"Enter the number\")\npower=input(\"Enter the power\")\nmodulo=input(\"Enter the modulo number\");\nprint \"The answer of mpower(\",number,\",\",power,\",\",modulo,\") is\",mpower(number,power,modulo)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number2\nEnter the power5\nEnter the modulo number3\nThe answer of mpower( 2 , 5 , 3 ) is 2\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 05 Induction and Recursion", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 09: Page 367", "cell_type": "markdown", "metadata": {}}, {"execution_count": 5, "cell_type": "code", "source": "def msort2(x): #function for merge sort\n if len(x) < 2:\n return x\n result = [] \n mid = int(len(x)/2) #divides the elements into halves\n y = msort2(x[:mid])\n z = msort2(x[mid:])\n while (len(y) > 0) and (len(z) > 0):\n if y[0] > z[0]:\n result.append(z[0]) #merges to append the elements\n z.pop(0)\n else:\n result.append(y[0])\n y.pop(0)\n result += y\n result += z\n return result\nl=[]\nr=[]\nl=raw_input(\"enter the numbers to be merge sorted\").split(\",\")\nr=msort2(l)\nprint \"Ther Merge sort is\", r\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "enter the numbers to be merge sorted8,2,4,6,9,7,10,1,5,3\nTher Merge sort is ['1', '10', '2', '3', '4', '5', '6', '7', '8', '9']\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/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter6.ipynb b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter6.ipynb new file mode 100755 index 00000000..aceb73dc --- /dev/null +++ b/Discrete_Mathematics_and_its_Applications_by_Kenneth_S.Rosen/chapter6.ipynb @@ -0,0 +1 @@ +{"nbformat_minor": 0, "cells": [{"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 01: Page 386", "cell_type": "markdown", "metadata": {}}, {"execution_count": 1, "cell_type": "code", "source": "n=2 #number of employees\nr=12 #number of office rooms\nways_alloc_sanchez=12\nways_alloc_patel=11\n\n#By PRODUCT RULE\nprint \"Total ways to assign offices to these employees is\",ways_alloc_sanchez*ways_alloc_patel\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Total ways to assign offices to these employees is 132\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 02: Page 386", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "alphabets=26 #Total number of alphabets\nposint=100 #Total positive numbers not beyond 100\n\n#number of chairs to be labelled with a alphabet and an integer using product rule\nprint \"Total number of chairs that can be labelled with an alphabet and an integer is\",alphabets*posint\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Total number of chairs that can be labelled with an alphabet and an integer is 2600\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 03: Page 386", "cell_type": "markdown", "metadata": {}}, {"execution_count": 3, "cell_type": "code", "source": "mc=32 #total number of microcomputers\nport=24 #total number of ports in each microcomputer\n\n#total number of different ports to a microcomputer in the center are found using product rule\n\nprint \"total number of ports\",mc*port\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "total number of ports 768\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 04: Page 386", "cell_type": "markdown", "metadata": {}}, {"execution_count": 4, "cell_type": "code", "source": "bits=2 #possible bits either 0 or 1\nns=7 #number of bits in the string (ie). length of the string\n # 7 bits are capable of taking either 0 or 1 so by PRODUCT RULE\nprint \"Total different bit strings of lenth seven are\",bits**ns\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Total different bit strings of lenth seven are 128\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 05: Page 387", "cell_type": "markdown", "metadata": {}}, {"execution_count": 7, "cell_type": "code", "source": "letters=26 #number of letters in english alphabet\nno_of_letters=3 #number of letters \nchoices=10 #number of choices for each letter\nresult=1#in order to avoid junk values. Assigned it to 1.\nfor i in range(0,no_of_letters):\n result=result*letters*choices\nprint \"The total number of choices are\",result", "outputs": [{"output_type": "stream", "name": "stdout", "text": "The total number of choices are 17576000\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 01: Page 407", "cell_type": "markdown", "metadata": {}}, {"execution_count": 10, "cell_type": "code", "source": "def permutation(n,r): #function definition\n \n i=n\n result=1\n for i in range((n-r)+1,n+1): #computing the permutation\n result=result*i\n \n return result\n\nprint \"The number of ways to select 3 students from a group of 5 students to line up for a picture is \",permutation(5,3) #function call\nprint \"The number of ways to select 5 students from a group of 5 students to line up for a picture is \",permutation(5,5) #function call\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "The number of ways to select 3 students from a group of 5 students to line up for a picture is 60\nThe number of ways to select 5 students from a group of 5 students to line up for a picture is 120\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 04: Page 409", "cell_type": "markdown", "metadata": {}}, {"execution_count": 1, "cell_type": "code", "source": "def permutation(n,r): #function definition\n \n i=n\n result=1\n for i in range((n-r)+1,n+1): #permutation computation\n result=result*i\n return result\nnum=input(\"Enter the number of people\")\nperm=input(\"Enter the prizes\")\nprint \"The number of ways to decide the prize winners is\",permutation(num,perm) #function call\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number of people100\nEnter the prizes3\nThe number of ways to decide the prize winners is 970200\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 05: Page 409", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "def permutation(n,r):\n \n i=n\n result=1\n for i in range((n-r)+1,n+1):\n result=result*i\n \n return result\nnum=input(\"Enter the number of runners\")\nperm=input(\"Enter the number of prizes\")\nprint \"The number of ways to decide the prize winners is\",permutation(num,perm)\n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number of runners8\nEnter the number of prizes3\nThe number of ways to decide the prize winners is 336\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 06: Page 409", "cell_type": "markdown", "metadata": {}}, {"execution_count": 3, "cell_type": "code", "source": "def calc(n):\n \n i=n\n result=1\n for i in range(1,n): #find the number of ways to decide the path. since the first city us decided. The for loop is from 1 to n\n result=result*i\n \n return result\nnum=input(\"Enter the number of cities\") \nprint \"The number of possible ways to decide the path is\",calc(num)\n\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number of cities8\nThe number of possible ways to decide the path is 5040\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 10: Page 410", "cell_type": "markdown", "metadata": {}}, {"execution_count": 5, "cell_type": "code", "source": "def combination(n,r): #combination function\n i=n\n numerator=1\n denominator=1\n for i in range((n-r)+1,n+1):#computes the value of the numerator \n numerator=numerator*i\n for j in range (1,r+1): #computes the value of the denominator\n denominator=denominator*j\n result=numerator/denominator #computes result\n return result\nnum=input(\"Enter the number of elements\")\ncomb=input(\"Enter the combinations\")\nprint \"The number of combinations are \",combination(num,comb)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number of elements4\nEnter the combinations2\nThe number of combinations are 6\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 12: Page 412", "cell_type": "markdown", "metadata": {}}, {"execution_count": 7, "cell_type": "code", "source": "def combination(n,r): #function definition for combination\n i=n\n numerator=1\n denominator=1\n for i in range((n-r)+1,n+1):\n numerator=numerator*i\n for j in range (1,r+1):\n denominator=denominator*j\n result=numerator/denominator\n return result\nnum=input(\"Enter the number of members in a team\")\ncomb=input(\"Enter the number of players\")\nprint \"The number of combinations are \",combination(num,comb) #function call\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the number of members in a team10\nEnter the number of players5\nThe number of combinations are 252\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 13: Page 412", "cell_type": "markdown", "metadata": {}}, {"execution_count": 8, "cell_type": "code", "source": "def combination(n,r): #function definition\n i=n\n numerator=1\n denominator=1\n for i in range((n-r)+1,n+1):\n numerator=numerator*i\n for j in range (1,r+1):\n denominator=denominator*j\n result=numerator/denominator\n return result\nnum=input(\"Enter the total number of astronauts\")\ncomb=input(\"Enter the number of astronauts to be selected \")\nprint \"The total number of combinations of selected astronauts to Mars are \",combination(num,comb) #function call\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the total number of astronauts30\nEnter the number of astronauts to be selected 6\nThe total number of combinations of selected astronauts to Mars are 593775\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "# 06 Counting", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 15: Page 413", "cell_type": "markdown", "metadata": {}}, {"execution_count": 9, "cell_type": "code", "source": "def combination(n,r): #Function definition\n i=n\n numerator=1\n denominator=1\n for i in range((n-r)+1,n+1): #computation of the numerator\n numerator=numerator*i\n for j in range (1,r+1): #computation of the denominator\n denominator=denominator*j\n result=numerator/denominator\n return result\nnum1=input(\"Enter the total number of faculty in computer science department\")\ncomb1=input(\"Enter the number of faculty to be selected for computer science department\")\nnum2=input(\"Enter the total number of faculty in maths department\")\ncomb2=input(\"Enter the number of faculty to be selected for maths department\")\n\nprint \"The total number of combinations of selected faculties are \",combination(num1,comb1)*combination(num2,comb2) #Function call\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Enter the total number of faculty in computer science department9\nEnter the number of faculty to be selected for computer science department3\nEnter the total number of faculty in maths department11\nEnter the number of faculty to be selected for maths department4\nThe total number of combinations of selected faculties are 27720\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/Electrical_Power_System/screenshots/Chapter01.png b/Electrical_Power_System/screenshots/Chapter01.png Binary files differnew file mode 100755 index 00000000..2ecc4131 --- /dev/null +++ b/Electrical_Power_System/screenshots/Chapter01.png diff --git a/Electrical_Power_System/screenshots/Chapter02.png b/Electrical_Power_System/screenshots/Chapter02.png Binary files differnew file mode 100755 index 00000000..979f183d --- /dev/null +++ b/Electrical_Power_System/screenshots/Chapter02.png diff --git a/Electrical_Power_System/screenshots/Chapter03.png b/Electrical_Power_System/screenshots/Chapter03.png Binary files differnew file mode 100755 index 00000000..71f99131 --- /dev/null +++ b/Electrical_Power_System/screenshots/Chapter03.png diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter01.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter01.ipynb new file mode 100755 index 00000000..bf7fc600 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter01.ipynb @@ -0,0 +1,77 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 01 : Fundamentals of power System"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1, Page No 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Sb=100.0\t\t# base value of power(MVA)\n",
+ "Vb=33.0\t\t\t# base value of voltage (Kv)\n",
+ "\n",
+ "#Calculations\n",
+ "Vbl=Vb*110.0/32\n",
+ "Vbm=Vbl*32.0/110\n",
+ "Zp_ut=0.08*100*32*32/(110*33*33)\n",
+ "Zp_u_l=50*100/(Vbl**2)\n",
+ "Zp_um1=0.2*100*30*30.0/(30*33*33)\n",
+ "Zp_um2=0.2*100*30*30.0/(20*33*33)\n",
+ "Zp_um3=0.2*100*30*30.0/(50*33*33)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Base value of voltage in line = %.2f kV\" %Vbl)\n",
+ "print(\"Base value of voltage in motor circuit=%.0f kV\" %Vbm)\n",
+ "print(\"p.u value of reactance transformer =%.5f p.u\" %Zp_ut)\n",
+ "print(\"p.u value of impedence of line=%.4f p.u\" %Zp_u_l)\n",
+ "print(\"p.u value of reactance of motor 1 =%.4f p.u\" %Zp_um1)\n",
+ "print(\"p.u value of reactance of motor 2 =%.3f p.u\" %Zp_um2)\n",
+ "print(\"p.u value of reactance of motor 3 =%.4f p.u\" %Zp_um3)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base value of voltage in line = 113.44 kV\n",
+ "Base value of voltage in motor circuit=33 kV\n",
+ "p.u value of reactance transformer =0.06839 p.u\n",
+ "p.u value of impedence of line=0.3886 p.u\n",
+ "p.u value of reactance of motor 1 =0.5510 p.u\n",
+ "p.u value of reactance of motor 2 =0.826 p.u\n",
+ "p.u value of reactance of motor 3 =0.3306 p.u\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter02.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter02.ipynb new file mode 100755 index 00000000..269565a5 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter02.ipynb @@ -0,0 +1,281 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 02 : Line Constant Calculations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2, Page No 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "GMD=0.7788*0.8/(2*100)\n",
+ "Mgmd=((1.6*3.2*1.6)**(1.0/3))\n",
+ "\n",
+ "#Calculations\n",
+ "Z=2*(10**-4)*1000*math.log(2.015/.003115)\n",
+ "\n",
+ "#Results\n",
+ "print(\"The self GMD of the conductor =%.6f metres\" %GMD)\n",
+ "print(\"The mutual GMD of the conductor =%.3f metres \" %Mgmd)\n",
+ "print(\"Inductance =%.3f mH/km\\n\" %Z)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The self GMD of the conductor =0.003115 metres\n",
+ "The mutual GMD of the conductor =2.016 metres \n",
+ "Inductance =1.294 mH/km\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3, Page No 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "r=1\n",
+ "D11=r**1\n",
+ "D12=2*r\n",
+ "D14=4*r\n",
+ "\n",
+ "#Calculations\n",
+ "D13=math.sqrt(16-4)*r\n",
+ "Ds1=((1*2*2*math.sqrt(3)*4*2*math.sqrt(3)*2*2)**(1.0/7))*r\n",
+ "Ds7=((2*1*2*2**2*2*2)**(1.0/7))*r #we get this after Taking r outside the 1/7th root\n",
+ "Ds=((((1*2*2*math.sqrt(3)*4*2*math.sqrt(3)*2*2)**(1.0/7))**6)*((2*1*2*2**2*2*2)**(1.0/7)))**(1.0/7)*r\n",
+ "Dseq=((.7788)**(1.0/7))*Ds\n",
+ "\n",
+ "#Results\n",
+ "print(\"Dseq.= %.2fr\" %Dseq)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dseq.= 2.18r\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4, Page No 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "GMDa=0.001947\t\t\t\t# GMD of conductor in group A\n",
+ "\n",
+ "#Calculations\n",
+ "DSA=((.001947*6*12*.001947*6*6*0.001947*6*12)**(1.0/9))\n",
+ "DSB=math.sqrt(5*(10**-3)*.7788*6)\n",
+ "Dae=math.sqrt((9**2)+6**2)\n",
+ "Dcd=math.sqrt((12**2)+9**2)\n",
+ "DMA=((9*10.81*10.81*9*15*10.81)**(1.0/6))\n",
+ "LA=2*(10**-7)*(10**6)*math.log(DMA/DSA)\n",
+ "LB=2*(10**-7)*(10**6)*math.log(DMA/DSB)\n",
+ "Tot=LA+LB\n",
+ "\n",
+ "#Results\n",
+ "print(\"inductance of line A,LA=%.3f mH/km\" %LA)\t\t#Answers don't match due to difference in rounding off of digits\n",
+ "print(\"inductance of line B,LB=%.1f mH/km\" %LB)\t\t#Answers don't match due to difference in rounding off of digits\n",
+ "print(\"total inductance of line =%.2f mH/km\" %Tot)\t#Answers don't match due to difference in rounding off of digits\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "inductance of line A,LA=0.621 mH/km\n",
+ "inductance of line B,LB=0.9 mH/km\n",
+ "total inductance of line =1.47 mH/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page No 32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "GMDc=1.266*0.7788*(10**-2)\t\t# self GMD of each conductor\n",
+ "Dbc=math.sqrt((4**2)+(.75**2))\n",
+ "Dab=Dbc\n",
+ "\n",
+ "#Calculations\n",
+ "Dab=math.sqrt((4**2)+(8.25**2))\n",
+ "Daa=math.sqrt((8**2)+(7.5**2))\n",
+ "Dm1=(Dbc*8*7.5*9.1685)**(1.0/4)\n",
+ "Dm2=(Dbc*Dbc*9.1685*9.1685)**(1.0/4)\n",
+ "Dm3=Dm1\n",
+ "Dm=((Dm1*Dm2*Dm3)**(1.0/3))\n",
+ "Ds1=math.sqrt(GMDc*Daa)\t\t# self GMD of each phase\n",
+ "Ds3=Ds1\n",
+ "Ds2=math.sqrt(GMDc*9)\n",
+ "Ds=((Ds1*Ds2*Ds3)**(1.0/3))\n",
+ "Z=2*(10**-4)*(1000)*math.log(Dm/Ds)\n",
+ "\n",
+ "#Results\n",
+ "print(\"inductance=%.3f mH/km/phase\\n\" %Z)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "inductance=0.607 mH/km/phase\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6, Page No 33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "GMDs=.0069\t\t#self GMD of the conductor\n",
+ "Dab=math.sqrt((3**2)+.5**2)\n",
+ "Dbc=Dab\n",
+ "Dac=6.0\n",
+ "\n",
+ "#Calculations\n",
+ "Dab=math.sqrt((3**2)+6**2)\n",
+ "Daa=math.sqrt((6**2)+5.5**2)\n",
+ "Dm1=((3.04*6*5.5*6.708)**.25)\n",
+ "Dm2=((3.04*3.04*6.708*6.708)**.25)\n",
+ "Dm=4.89\n",
+ "Ds1=math.sqrt(GMDs*Daa)\n",
+ "Ds2=0.2217\n",
+ "Ds=.228\n",
+ "Z=2*(10**-7)*(10**6)*math.log(Dm/Ds)\n",
+ "\n",
+ "#Results\n",
+ "print(\"inductance =%.3f mH/km\" %Z)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "inductance =0.613 mH/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7, Page No 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ds=math.sqrt(0.025*.4*.7788)\n",
+ "\n",
+ "#Calculations\n",
+ "Dm=((6.5*13.0*6.5)**(1.0/3))\n",
+ "Z=2*(10**-4)*1000*math.log(Dm/Ds)\n",
+ "\n",
+ "#Results\n",
+ "print(\"inductance =%.3f mH/km/phase\" %Z)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "inductance =0.906 mH/km/phase\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter03.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter03.ipynb new file mode 100755 index 00000000..e0c0fd23 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter03.ipynb @@ -0,0 +1,142 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 03 : Capacitance of Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1, Page No 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Dm=2.015 \t\t# mutual GMD of conductors(m)\n",
+ "r=0.4 \t\t\t# radius of conductor(cm)\n",
+ "\n",
+ "#Calculations\n",
+ "C=10**-9*1000.0/(18*math.log(201.5/.4)) \n",
+ "Ic=132*1000.0*8.928*314*(10**-9)/math.sqrt(3.0)\n",
+ "\n",
+ "#Results\n",
+ "print(\"capacitance =%.13f F/km\" %C) #Answers don't match due to different representation\n",
+ "print(\"charging current=%.4f amp/km\" %Ic) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "capacitance =0.0000000089288 F/km\n",
+ "charging current=0.2136 amp/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2, Page No 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "GMDm=6.61 \t\t#mutual GMD(m)\n",
+ "\n",
+ "#Calculations\n",
+ "Ds1=math.sqrt(1.25*(10**-2)*10.965) \n",
+ "Ds3=Ds1 \n",
+ "Ds2=math.sqrt(1.25*(10**-2)*9) \n",
+ "Ds=((Ds1*Ds2*Ds3)**.333333) \n",
+ "C=1/(18*math.log(GMDm/Ds)) \n",
+ "Ic=220*1000*314*.01905*(10**-6)/math.sqrt(3) \n",
+ "\n",
+ "#Results\n",
+ "print(\"capacitance =%.6f micro-Farad/km\" %C) \n",
+ "print(\"charging current =%.2f amp/km\" %Ic)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "capacitance =0.019057 micro-Farad/km\n",
+ "charging current =0.76 amp/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3, Page No 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "GMD=8.19 \n",
+ "\n",
+ "#Calculations\n",
+ "Ds=math.sqrt(2.25*(10**-2)*.4) \n",
+ "C=1/(18*math.log(GMD/Ds)) \n",
+ "Ic=220*1000*314*C*(10**-6)/math.sqrt(3) \n",
+ "\n",
+ "#Results\n",
+ "print(\"capacitance per km =%.5f micro-Farad\" %C) \n",
+ "print(\"charging current =%.3f amp\" %Ic) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "capacitance per km =0.01246 micro-Farad\n",
+ "charging current =0.497 amp\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter04.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter04.ipynb new file mode 100755 index 00000000..e3b7281e --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter04.ipynb @@ -0,0 +1,589 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Performance of Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1, Page No 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "R=0.496\t\t# resistance\n",
+ "X=1.536\n",
+ "Vr=2000.0\n",
+ "\n",
+ "#Calculations\n",
+ "Z=(10*2*2/(11*11)) + complex(30)*2*2/(11*11)\n",
+ "Zt=(.04+(1.3*2*2/(11*11))) + complex(0.125,(4.5*2*2/(11*11)))#Transformer impedence\n",
+ "Il=250*1000.0/2000\t# line current(amps.)\n",
+ "Pl=Il*Il*R\t\t\t#line loss(kW)\n",
+ "Po=250*0.8\t\t\t# output(kW)\n",
+ "cosr=0.8\t\t\t# power factor\n",
+ "sinr=0.6\n",
+ "n=200*100.0/(200+7.7)\n",
+ "Vs=(Vr*cosr+Il*R)+complex(Vr*sinr+Il*X)\n",
+ "V=math.sqrt((1662**2)+ (1392**2))\n",
+ "\n",
+ "#Results\n",
+ "print(\"efficiency= %.1f percent \" %n)\n",
+ "print(\"Sending end voltage,|Vs|=%.0f volts\" %V)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "efficiency= 96.3 percent \n",
+ "Sending end voltage,|Vs|=2168 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2, Page No 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "print(\"when load is star connected\")\n",
+ "Vln=400/math.sqrt(3.0)\t\t# Line to neutral voltage(V)\n",
+ "Z=complex(7,11)\t\t\t\t\t#Impedence per phase\n",
+ "Il=231/Z\t\t\t\t\t\t# line current(amp.)\n",
+ "I=abs(231/Z)\n",
+ "Pi=3*I*I*7\n",
+ "Po=3*I*I*6\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"power input =%.0f watts\\n\" %Pi)\t\t#Answers don't match due to difference in rounding off of digits\n",
+ "print(\"power output=%.0f watts\\n\" %Po)\t#Answers don't match due to difference in rounding off of digits\n",
+ "print(\"when load is delta connected\\n\")\n",
+ "Ze=complex(2,3)\t\t# equivalent impedence(ohm)\n",
+ "Zp=complex(3,5)\t\t# impedence per phase\n",
+ "il=231/Zp\t\t\t#Line current(amps.)\n",
+ "IL=abs(il)\n",
+ "pi=3*IL*IL*3\n",
+ "po=3*IL*IL*2\n",
+ "\n",
+ "#Results\n",
+ "print(\"power input=%.1f watts\" %pi)\t\t\t#Answers don't match due to difference in rounding off of digits\n",
+ "print(\"power output = %.0f watts \" %po)\t\t#Answers don't match due to difference in rounding off of digits"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when load is star connected\n",
+ "power input =6592 watts\n",
+ "\n",
+ "power output=5650 watts\n",
+ "\n",
+ "when load is delta connected\n",
+ "\n",
+ "power input=14125.0 watts\n",
+ "power output = 9417 watts \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3, Page No 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "a=100/.5\n",
+ "Xl=2*(10**-7)*math.log(100/.5)\t\t#inductance(H/meter)\n",
+ "XL=20*(1000)*Xl\t\t\t\t\t\t# inductance of 20 km length \n",
+ "R=6.65\t\t\t\t\t\t\t\t# resistance(ohm)\n",
+ "Rc=20*1000/(58.0*90)\t\t\t\t# resistance of copper(ohm)\n",
+ "I=10*1000/(33*.8*math.sqrt(3))\t\t# the current(amps.)\n",
+ "\n",
+ "#Calculations\n",
+ "Pl=3*I*I*Rc/(10**6)\t\t\t\t\t#loss (MW)\n",
+ "n=10.0/(10+Pl)\n",
+ "print(\"Efficiency=%.4f percent \" %n)\n",
+ "Vr=19052\n",
+ "cosr=.8\t\t\t\t#power factor\n",
+ "sinr=.6\n",
+ "Vs=abs(((Vr*cosr+I*Rc) +complex(Vr*sinr+ I*R)))\n",
+ "\n",
+ "#Results\n",
+ "print(\"Vs =%.0f volts\\n\" %Vs)\t#Answer don't match due to difference in rounding off of digits\n",
+ "Reg=(Vs-Vr)*100/Vr\n",
+ "print(\"Regulation =%.2f percent\" %Reg)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency=0.9479 percent \n",
+ "Vs =28965 volts\n",
+ "\n",
+ "Regulation =52.03 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page No 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "IR=(400)/((math.sqrt(3)*complex(6.3,9)))\n",
+ "\n",
+ "#Calculations\n",
+ "IY=231*complex(math.cos(math.radians(-120)),math.sin(math.radians(-120)))/8.3\n",
+ "IB=231*complex(math.cos(math.radians(120)),math.sin(math.radians(120)))/complex(6.3,-8)\n",
+ "In=abs((IR +IY +IB))\t\t#Neutral current\n",
+ "print(\"Neutral current =%.2f amps\\n\" %In)\n",
+ "VR=abs(IR*complex(6,9))\n",
+ "VY=abs(IY*(8))\n",
+ "VB=abs(IB*complex(6,-8))\n",
+ "\n",
+ "#Results\n",
+ "print(\"Voltage across Phase R =%.1f volts \\n\" %VR)\n",
+ "print(\"Voltage across Phase Y =%.2f volts \\n\" %VY)\n",
+ "print(\"Voltage across Phase B =%.0f volts \\n\" %VB)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neutral current =45.18 amps\n",
+ "\n",
+ "Voltage across Phase R =227.4 volts \n",
+ "\n",
+ "Voltage across Phase Y =222.65 volts \n",
+ "\n",
+ "Voltage across Phase B =227 volts \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5, Page No 73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "R=100*.1\t\t#Resistance of line (ohm)\n",
+ "Xl=2*(10**-7)*100*1000*math.log(200/.75)\t#inductance of line\n",
+ "X2=Xl*314\t\t\t\t\t\t\t\t\t#inductive reactance\n",
+ "C=2*(math.pi*100)*8.854*(10**-12)*100*1000*(10**6)/(math.log(200/.75))\t# capacitance per phase (micro farad)\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"Using Nominal-T method\\n\")\n",
+ "Ir=20*1000.0/(math.sqrt(3)*66*.8)\n",
+ "Vr=66*1000/math.sqrt(3)\n",
+ "Vc=complex((38104*.8+ Ir*5),(38104*.6+ Ir*17.55))\t# voltage across condenser\n",
+ "Ic=complex(314*(Vc)*.9954*(10**-6))\n",
+ "ise=Ir+Ic\n",
+ "Is=abs(Ir+Ic)\n",
+ "Vs=abs(Vc + (ise*complex(5,17.53)))\n",
+ "VR=abs(Vs*complex(-3199)/complex(5,-3181))# no load recieving end voltage\n",
+ "Reg=(VR-Vr)*100.0/Vr\n",
+ "Pl=3*(Ir*Ir*5 + Is*Is*5)/1000000\n",
+ "n=20*100/(20+Pl)\n",
+ "print(\"percent regulation=%.1f \" %Reg)\n",
+ "print(\"percent efficiency=%.1f \\n\" %n)\n",
+ "print(\"Using Nominal-pi method\\n\")\n",
+ "Ir1=218.68*complex(.8,-.6)\n",
+ "Ic1=complex(314*.4977*(10**-6)*Vr)\n",
+ "Il=Ir1+Ic1\n",
+ "vs1=Vr+Il*complex(10,35.1)\n",
+ "Vs1=abs(vs1)\n",
+ "Vr1=Vs1*complex(-6398)/complex(10,-6363)\n",
+ "VR1=abs(Vr1)\t\t\t# no load recieving end voltage\n",
+ "Reg2=(VR1-Vr)*100/Vr\n",
+ "IL=abs(Ir1+Ic1)\n",
+ "Loss=3*IL*IL*10\n",
+ "n=20*100/21.388\n",
+ "\n",
+ "#Results\n",
+ "print(\"percent regulation=%.2f \" %Reg2)\n",
+ "print(\"percent efficiency=%.1f \" %n)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Using Nominal-T method\n",
+ "\n",
+ "percent regulation=18.2 \n",
+ "percent efficiency=93.0 \n",
+ "\n",
+ "Using Nominal-pi method\n",
+ "\n",
+ "percent regulation=18.23 \n",
+ "percent efficiency=93.5 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6, Page No 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import cmath\n",
+ "#initialisation of variables\n",
+ "R=0.2\n",
+ "L=1.3\n",
+ "C=0.01*(10**-6)\n",
+ "\n",
+ "#Calculations\n",
+ "z=complex(R,(L*314.0*(10**-3)))\t\t# serie impedence\n",
+ "y=complex(314.0*C)\t\t# shunt admittance\n",
+ "Zc=cmath.sqrt(z/y)\t\t# characterstic impedence\n",
+ "Y=cmath.sqrt(y*z)\n",
+ "Vr=132*1000/math.sqrt(3.0)\n",
+ "Ir=0\n",
+ "Vin=(Vr + Ir*Zc)/2\t\t\t# incident voltage to neutral at the recieving end\n",
+ "\n",
+ "#Results\n",
+ "print(\"Vr =%.3f volts \\n\" %Vr)\t\t#Answer don't match due to difference in rounding off of digits\n",
+ "print(\"(i)The incident voltage to neutral at the recieving end {0:.5f}+{1:.5f}i\".format(Vin.real, Vin.imag))\t#Answer don't match due to difference in rounding off of digits\n",
+ "Vin2=(Vr - Ir*Zc)/2\t\t\t\t\t\t# The reflected voltage to neutral at the recieving end\n",
+ "print(\"(ii)The reflected voltage to neutral at the recieving end{0:.5f}+{1:.5f}i\".format(Vin2.real, Vin2.imag))\t\t#Answer don't match due to difference inrounding off of digits\n",
+ "Vrp=Vr*cmath.exp(.2714*120*(10**-3))*cmath.exp(complex(1.169*120*(10**-3))/1000.0)#Taking Vrp=Vr+\n",
+ "Vrm=Vr*cmath.exp(-0.0325)*cmath.exp(complex(-.140))/1000\t\t\t#Taking Vrm=Vr-\n",
+ "v1=Vrm/2\t\t\t\t # reflected voltage to neutral at 120 km from the recieving end\n",
+ "phase_v1=math.degrees(math.atan(v1.imag/v1.real))\n",
+ "v2=Vrp/2\t\t\t #incident voltage to neutral at 120 km from the recieving end\n",
+ "phase_v2=math.degrees(math.atan(v2.imag/v2.real))#Phase angle of v2\n",
+ "print(\"(iii) reflected voltage to neutral at 120 km from the recieving end =%.2f at angle of %.2f\" %(abs(v1),phase_v1))\n",
+ "print(\"incident voltage to neutral at 120 km from the recieving end = %.2f at angle of %.2f\" %(abs(v2),phase_v2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vr =76210.236 volts \n",
+ "\n",
+ "(i)The incident voltage to neutral at the recieving end 38105.11777+0.00000i\n",
+ "(ii)The reflected voltage to neutral at the recieving end38105.11777+0.00000i\n",
+ "(iii) reflected voltage to neutral at 120 km from the recieving end =32.07 at angle of 0.00\n",
+ "incident voltage to neutral at 120 km from the recieving end = 39372.08 at angle of 0.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7 Page No 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ir=40.0*1000/(math.sqrt(3)*132*.8)\n",
+ "Vr=132.0*1000/math.sqrt(3)\n",
+ "\n",
+ "#Calculations\n",
+ "Zc=380*complex(math.cos(math.radians(-13.06)),math.sin(math.radians(-13.06)))\n",
+ "IR=Ir*complex(math.cos(math.radians(-38.8)),math.sin(math.radians(-38.8)))\n",
+ "Vsp=(Vr+IR*Zc)*(1.033*complex(math.cos(math.radians(8.02)),math.sin(math.radians(8.02))))/2\n",
+ "Vsm=(Vr-IR*Zc)*(0.968*complex(math.cos(math.radians(8.02)),math.sin(math.radians(8.02))))/2\n",
+ "vs=Vsp+ Vsm\n",
+ "Vs=abs(vs)\n",
+ "ise=(Vsp-Vsm)/Zc\n",
+ "Is=abs(ise)\n",
+ "P=3*Vs*Is*math.cos(math.radians(33.72))/10**6\n",
+ "n=40*100/P\n",
+ "\n",
+ "#Results\n",
+ "print(\"efficiency=%.1f\" %n)\t\t#Answer don't match due to difference in rounding off of digits"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "efficiency=92.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8, Page No 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import cmath\n",
+ "#initialisation of variables\n",
+ "yl=complex(0.2714,1.169)*120*(10**-3)\n",
+ "Ir=40*1000/(math.sqrt(3)*132*.8)\n",
+ "A=cmath.cosh(yl)\n",
+ "\n",
+ "#Calculations\n",
+ "phase_A=math.degrees(math.atan(A.imag/A.real)) #Phase angle of A\n",
+ "IR=Ir*complex(math.cos(math.radians(-38.8)),math.sin(math.radians(-38.8)))\n",
+ "Vr=132*1000/math.sqrt(3)\n",
+ "Zc=380*complex(math.cos(math.radians(-13.06)),math.sin(math.radians(-13.06)))\n",
+ "B=Zc*cmath.sinh(yl)\n",
+ "phase_B=math.degrees(math.atan(B.imag/B.real)) #Phase angle of B\n",
+ "Vs=(A*Vr+B*IR)\n",
+ "f=abs(B)\n",
+ "d=abs(Vs)\n",
+ "C=cmath.sinh(yl)/Zc\n",
+ "phase_C=math.degrees(math.atan(C.imag/C.real)) #Phase angle of C\n",
+ "D=cmath.cosh(yl)\n",
+ "phase_D=math.degrees(math.atan(D.imag/D.real))\t\t#Phase angle of D\n",
+ "\n",
+ "#Results\n",
+ "print(\"A=%.2f at an angle of %.2f \" %(abs(A),phase_A))\n",
+ "print(\"B=%.1f at an angle of %.0f \" %(abs(B),phase_B))\n",
+ "print(\"C=%.2f at an angle of %.2f \" %(abs(C),phase_C))\n",
+ "print(\"D=%.2f at an angle of %.2f \" %(abs(D),phase_D))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A=0.99 at an angle of 0.26 \n",
+ "B=54.6 at an angle of 64 \n",
+ "C=0.00 at an angle of -89.92 \n",
+ "D=0.99 at an angle of 0.26 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9 Page No 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ir=218.7*complex(0.8,-0.6)\n",
+ "Ic1=complex(314)*0.6*(10**-6)*76200\n",
+ "Il=Ic1+Ir\n",
+ "Vs=76200 + Il*complex(24,48.38)\n",
+ "\n",
+ "#Calculations\n",
+ "phase_Vs=math.degrees(math.atan(Vs.imag/Vs.real))\n",
+ "Pl=3*24*abs(Il)*abs(Il)/1000000.0 #The Loss(MW)\n",
+ "n=40*100/(40+Pl)\n",
+ "print(\"Using Nominal- pi method\")\n",
+ "print(\"Vs=%.0f volts at an angle of %.2f \\n\" %(abs(Vs),phase_Vs))\n",
+ "print(\"efficiency=%.2f percent\" %n)\n",
+ "print(\"\\nUsing Nominal-T method\")\n",
+ "Vc=76200*complex(0.8,0.6)+218.7*complex(12,24.49)\n",
+ "Ic=complex(314)*1.2*(10**-6)*complex(63584,51076.0)\n",
+ "Is=complex(199.46,23.95)\n",
+ "Vs=(Vc + Is*complex(12,24.49))/1000.0\n",
+ "phase_Vs=math.degrees(math.atan(Vs.imag/Vs.real))\t#Phase angle of Vs\n",
+ "Pl1=3*12*((200.89**2)+ 218.7**2)/1000000 #The loss(MW)\n",
+ "n1=40*100/(40+Pl1)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Vs=%.2f at an angle of %.2f \" %(abs(Vs),phase_Vs))\n",
+ "print(\"efficiency=%.2f percent\\n\" %n1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Using Nominal- pi method\n",
+ "Vs=87299 volts at an angle of 3.95 \n",
+ "\n",
+ "efficiency=91.28 percent\n",
+ "\n",
+ "Using Nominal-T method\n",
+ "Vs=86.25 at an angle of 40.70 \n",
+ "efficiency=92.65 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.10 Page No 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import cmath\n",
+ "#initialisation of variables\n",
+ "R=0.1557*160\n",
+ "GMD=(3.7*6.475*7.4)**(1.0/3)\n",
+ "Z1=2*(10**-7)*math.log(560/0.978)*160*1000\n",
+ "XL=63.8\n",
+ "\n",
+ "#Calculations\n",
+ "C=(10**-9)*2*(10**6)*math.pi*160*1000.0/(36*math.pi*math.log(560/.978))\n",
+ "Z=math.sqrt((0.1557**2)+.39875**2)*complex(math.cos(math.radians(68.67)),math.sin(math.radians(68.67)))\n",
+ "jwC=complex(314)*1.399*(10**-6)/160.0\n",
+ "Zc=cmath.sqrt(Z/jwC)\n",
+ "y=cmath.sqrt(Z*jwC)\n",
+ "yl=y*160\n",
+ "A=cmath.cosh(yl)\n",
+ "B=Zc*cmath.sinh(yl)\n",
+ "C=cmath.sinh(yl)/Zc\n",
+ "Ir=50000/(math.sqrt(3)*132)\n",
+ "Vs=(A*76.208) +(B*(10**-3)*Ir*complex(math.cos(math.radians(-36.87)),math.sin(math.radians(-36.87))))\n",
+ "VS=152.34\n",
+ "Is=C*76.208*(10**3) +(A*Ir*complex(math.cos(math.radians(-36.87)),math.sin(math.radians(-36.87))))\n",
+ "Ps=3*abs(Vs)*abs(Is)*math.cos(math.radians(33.96))\n",
+ "pf=math.cos(math.radians(33.96))\n",
+ "Vnl=abs(Vs)/abs(A)\n",
+ "reg=(Vnl-76.208)*100/76.208\n",
+ "n=50000*.8*100/abs(Ps)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Vs line to line =%.2f kV\\n\" %VS)\n",
+ "print(\"sending end current Is(A){0:.5f}+{1:.5f}i\".format(Is.real, Is.imag)) #Answer don't match due to difference in rounding off of digits\n",
+ "print(\"sending end power=%.0f kW\" %Ps)\n",
+ "print(\"sending end p.f =%.3f\" %pf)\n",
+ "print(\"percent regulation=%.1f \" %reg)\n",
+ "print(\"percent efficency=%.1f \" %n)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vs line to line =152.34 kV\n",
+ "\n",
+ "sending end current Is(A)211.28696+-129.31797i\n",
+ "sending end power=55350 kW\n",
+ "sending end p.f =0.829\n",
+ "percent regulation=17.2 \n",
+ "percent efficency=72.3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter05.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter05.ipynb new file mode 100755 index 00000000..15a3f816 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter05.ipynb @@ -0,0 +1,175 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 05 : High Voltage DC Transmission"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1, Page No 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Vo=3*math.sqrt(2)*110/math.pi\n",
+ "\n",
+ "#Calculations \n",
+ "Vd=Vo*(math.cos(math.radians(0))+math.cos(math.radians(15)))/2.0 \n",
+ "Vd1=Vo*(math.cos(math.radians(30)) + math.cos(math.radians(45)))/2.0 \n",
+ "Vd2=Vo*(math.cos(math.radians(45)) + math.cos(math.radians(60)))/2.0 \n",
+ "\n",
+ "#Results\n",
+ "print(\"(a)For a=0, Vd=%.2f kV\" %Vd) \n",
+ "print(\"(b)For a=30,Vd=%.2f kV\" %Vd1) \n",
+ "print(\"(c)For a=45,Vd=%.2f kV\" %Vd2) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For a=0, Vd=146.02 kV\n",
+ "(b)For a=30,Vd=116.85 kV\n",
+ "(c)For a=45,Vd=89.66 kV\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2, Page No 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "\n",
+ "#Calculations\n",
+ "VL=(100.0*2*math.pi)/(3*math.sqrt(2.0)*(math.cos(math.radians(30)) + math.cos(math.radians(45)))) \n",
+ "print(\"VL=%.2f kV\" %VL) #Answers don't match due to difference in rounding off of digits\n",
+ "Tr=VL/110.0\n",
+ "\n",
+ "#Results \n",
+ "print(\"tap ratio=%.2f \" %Tr) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VL=94.14 kV\n",
+ "tap ratio=0.86 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3, Page No 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variablesVd=100000\n",
+ "Id=800.0 # current\n",
+ "\n",
+ "#Calculations\n",
+ "X=((3*math.sqrt(2.0)*94.115*0.866*1000.0/math.pi)-Vd)*math.pi/(3.0*Id)\n",
+ "\n",
+ "#Results\n",
+ "print(\"effective reactance per phase , X=%.2f ohm\\n\" %X)\t#Answer don't match due to difference in rounding off of digits"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "effective reactance per phase , X=143.89 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page No 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "a=15.0\n",
+ "d0=10.0\n",
+ "y=15.0\n",
+ "X=15.0\n",
+ "R=10.0\n",
+ "\n",
+ "#Calculations\n",
+ "Id=(3*math.sqrt(2)*120*(math.cos(math.radians(a))-math.cos(math.radians(d0+y)))*1000.0)/((R+(3.0*2*X)/math.pi)*math.pi)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Id=%.2f amp.\" %Id)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Id=249.99 amp.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter06.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter06.ipynb new file mode 100755 index 00000000..7c65aca2 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter06.ipynb @@ -0,0 +1,248 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 06 : Corona"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page No 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "t=21.0 # air temperature\n",
+ "b=73.6 # air pressure\n",
+ "do=3.92*73.6/(273+t)\n",
+ "m=0.85\n",
+ "r=0.52\n",
+ "d=250.0\n",
+ "\n",
+ "#Calculations\n",
+ "Vd=21.1*m *do*r*math.log(250/.52)\n",
+ "vd=math.sqrt(3)*Vd\n",
+ "m=0.7\n",
+ "vv=21.1*m*do*r*(1+(0.3/math.sqrt(r*do)))*math.log(250/0.52)\n",
+ "Vv=vv*math.sqrt(3)\n",
+ "Vvg=Vv*0.8/0.7\n",
+ "\n",
+ "#Results\n",
+ "print(\"critical disruptive line to line voltage=%.2f kV \" %vd)\n",
+ "print(\"visual critical voltage for local corona=%.2f kV \" %vv)\n",
+ "print(\"visual critical voltage for general corona=%.2f kV \" %Vvg)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical disruptive line to line voltage=97.89 kV \n",
+ "visual critical voltage for local corona=66.09 kV \n",
+ "visual critical voltage for general corona=130.83 kV \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2, Page No 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables \n",
+ "d=2.5 \n",
+ "di=3.0 # internal diameter\n",
+ "do=9.0 # external diameter\n",
+ "ri=di/2.0 # internal radius\n",
+ "ro=do/2.0 # external diameter\n",
+ "\n",
+ "#Calculations\n",
+ "g1max=20/(1.25*math.log(ri/(d/2))+0.208*1.5*math.log(ro/ri)) \n",
+ "\n",
+ "#Results\n",
+ "print(\"g1max=%.0f kV/cm\" %g1max) \n",
+ "print(\"Since the gradient exceeds 21.1/kV/cm , corona will be present.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "g1max=35 kV/cm\n",
+ "Since the gradient exceeds 21.1/kV/cm , corona will be present.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page No 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "m=1.07\n",
+ "r=0.625\n",
+ "\n",
+ "#Calculations\n",
+ "V=21*m *r*math.log(305.0/0.625)\n",
+ "Vl=V*math.sqrt(3.0)\n",
+ "\n",
+ "#Results\n",
+ "print(\"critical disruptive voltage=%.0f kV \" %V)\n",
+ "print(\"since operating voltage is 110 kV , corona loss= 0 \")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical disruptive voltage=87 kV \n",
+ "since operating voltage is 110 kV , corona loss= 0 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page No 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "r=0.5\n",
+ "\n",
+ "#Calculations\n",
+ "V=21*r*math.log(100.0/0.5)\n",
+ "\n",
+ "#Results\n",
+ "print(\"critical disruptive voltage=%.1f kV\" %V)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical disruptive voltage=55.6 kV\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page No 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "D=1.036 \t # conductor diameter(cm)\n",
+ "d=2.44\t #delta spacing(m)\n",
+ "r=D/2 \t #radius(cm)\n",
+ "\n",
+ "#Calculations\n",
+ "Ratio=d*100.0/r \n",
+ "j=r/(d*100.0) \n",
+ "Rat2=math.sqrt(j) \n",
+ "t=26.67 \t #temperature\n",
+ "b=73.15 # barometric pressure\n",
+ "mv=0.72 \n",
+ "V=63.5 \n",
+ "f=50.0\t #frequency\n",
+ "do=3.92*b/(273+t) #do=dell\n",
+ "vd=21.1*.85*do*r*math.log(Ratio) \n",
+ "print(\"critical disruptive voltage=%.2f kV\" %vd) \n",
+ "Vv=21.1*mv*do*r*(1+(0.3/math.sqrt(r*do)))*math.log(Ratio) \n",
+ "Pl=241*(10**-5)*(f+25)*Rat2*((V-vd)**2)/do #power loss\n",
+ "Vd=0.8*vd \n",
+ "Pl2=241*(10**-5)*(f+25)*Rat2*((V-Vd)**2)*160/do #loss per phase /km\n",
+ "Total=3.0*Pl2\n",
+ "\n",
+ "#Results \n",
+ "print(\"visual critical voltage=%.0f kV\" %Vv) \n",
+ "print(\"Power loss=%.3f kW/phase/km\" %Pl) \n",
+ "print(\"under foul weather condition ,\") \n",
+ "print(\"critical disruptive voltage=%.2f kV\" %Vd) \n",
+ "print(\"Total loss=%.0f kW\\n\"%Total) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical disruptive voltage=54.72 kV\n",
+ "visual critical voltage=66 kV\n",
+ "Power loss=0.672 kW/phase/km\n",
+ "under foul weather condition ,\n",
+ "critical disruptive voltage=43.77 kV\n",
+ "Total loss=1626 kW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter07.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter07.ipynb new file mode 100755 index 00000000..6d47fe5f --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter07.ipynb @@ -0,0 +1,214 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 07 : Mechanical Design of Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page No 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "sf=5.0\t #Factor of safety\n",
+ "d=0.95\t # conductor dia(cm)\n",
+ "\n",
+ "#Calculations\n",
+ "Ws=4250.0/sf # working stress(kg/cm_2)\n",
+ "A=math.pi*(d**2)/4.0 # area (cm_2)\n",
+ "Wp=40.0*d*(10**-2) #wind pressure (kg/cm)\n",
+ "W=math.sqrt((.65**2)+(0.38**2)) # Total effective weight(kg/m)\n",
+ "T=850.0*A # working tension (kg)\n",
+ "c=T/W\n",
+ "l=160.0\n",
+ "d=l**2/(8*800)\n",
+ "\n",
+ "#Results\n",
+ "print(\"sag, d=%.0f metres \" %d)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sag, d=4 metres \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page No 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "D=1.95 + 2.6\t\t\t# overall diameter(cm)\n",
+ "A=4.55*(10**-2)\t\t\t# area(m_2)\n",
+ "d=19.5\t\t\t\t\t#diameter of conductor(mm)\n",
+ "r=d/2.0\t\t\t\t\t#radius of conductor(mm)\n",
+ "\n",
+ "#Calculations\n",
+ "Wp=A*39 #wind pressure(kg/m_2)\n",
+ "t=13 #ice coating(mm)\n",
+ "US=8000.0 # ultimate strength(kg)\n",
+ "Aice=math.pi*(10**-6)*((r+t)**2 - r**2)#area section of ice (m_2)\n",
+ "Wice=Aice*910\n",
+ "W=(math.sqrt((.85+Wice)**2 + Wp**2))# total weight of ice (kg/m)\n",
+ "T=US/2.0 # working teansion (kg)\n",
+ "c=T/W\n",
+ "l=275 #length of span(m)\n",
+ "Smax=l*l/(8*c)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Maximum sag=%.1f metres\\n\" %Smax)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum sag=6.4 metres\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page No 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "#initialisation of variables\n",
+ "A=13.2\t\t\t\t# cross section of conductor (mm_2)\n",
+ "Ar=4.1*(10**-3)\t\t# projected area\n",
+ "Wp=Ar*48.82\t\t\t# wind loadind /m(kg/m)\n",
+ "w=0.115\n",
+ "\n",
+ "#Calculations\n",
+ "W=math.sqrt((.1157**2)+(Wp**2))# effective loading per metre(kg)\n",
+ "q1=W/0.115\n",
+ "b=w/A\n",
+ "f1=21.0\t\t#working stress\n",
+ "T1=f1*A\n",
+ "c=T1/W\n",
+ "l=45.7\n",
+ "S=l*l/(8*c)\n",
+ "dT=32.2-4.5# difference in temperature\n",
+ "E=1.26*(10000)\n",
+ "a=16.6*(10**-6)\n",
+ "d=8.765*(10**-3)\n",
+ "K=f1-((l*d*q1)**2)*E/(24*f1*f1)\n",
+ "p=numpy.polynomial.polynomial.polyval3d(-84.23,0,-14.44,1)\n",
+ "r=numpy.roots(p)\n",
+ "f2= 14.823332# accepted value of f2\n",
+ "T=f2*A\n",
+ "c=T/w\n",
+ "d1=l*l/(8*c)\n",
+ "\n",
+ "#Results\n",
+ "print(\"sag at 32.2 Celsius , d=%.4f metres\" %d1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sag at 32.2 Celsius , d=0.1534 metres\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4 Page No 165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "T=2000.0 # working tension (kg)\n",
+ "w=1.0 \n",
+ "c=T/w \n",
+ "h=90-30 \n",
+ "l=300.0 #span(m)\n",
+ "\n",
+ "#Calculations\n",
+ "a=(l/2)-(c*h/l) \n",
+ "b=550.0 \n",
+ "d1=a*a/(2*c) \n",
+ "d2=(400**2)/(2*c) # sag at 400 metres(m)\n",
+ "Hm=d2-d1 #height of mid point with respect to A\n",
+ "Cl=30+Hm\n",
+ "\n",
+ "#Results \n",
+ "print(\"The clearance between the conductor and water level midway between the towers= %.3f metres \" %Cl) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The clearance between the conductor and water level midway between the towers= 54.375 metres \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter08.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter08.ipynb new file mode 100755 index 00000000..c168b80f --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter08.ipynb @@ -0,0 +1,60 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 08 : Overhead Line Insulators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1, Page No 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "E3=17.5\n",
+ "\n",
+ "#Calculations\n",
+ "E1=64*E3/89.0\n",
+ "E2=9*E1/8.0\n",
+ "E=E1+E2+E3\n",
+ "\n",
+ "#Results\n",
+ "print(\"the maximum voltage that the string of the suspension insulators can withstand=%.2f kV\\n\" %E)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the maximum voltage that the string of the suspension insulators can withstand=44.24 kV\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter09.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter09.ipynb new file mode 100755 index 00000000..c026f288 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter09.ipynb @@ -0,0 +1,358 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 09 : Insulated Cables"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page No 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V=85.0 # working voltage (kV)\n",
+ "gmax=65.0 # dielectric strength of insulating material (kV/cm)\n",
+ "\n",
+ "#Calculations\n",
+ "r=V/gmax\n",
+ "d=2*r\n",
+ "D=2.6*math.e\n",
+ "\n",
+ "#Results\n",
+ "print(\"Diameter of the sheath =%.2f cm\\n\" %D)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter of the sheath =7.07 cm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page No 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "e1=4.0\n",
+ "e2=4.0\n",
+ "e3=2.5\n",
+ "g1max=50.0\n",
+ "g2max=40.0\n",
+ "g3max=30.0\n",
+ "r=0.5\t\t# radius (cm)\n",
+ "\n",
+ "#Calculations\n",
+ "r1=r*e1*g1max/(e2*g2max)\n",
+ "r2=r1*e2*g2max/(e3*g3max)\n",
+ "V=66.0\n",
+ "lnc=(V-((r*g1max*math.log(r1/r))+(r1*g2max*math.log(r2/r1))))\n",
+ "m=lnc/(r2*g3max)\n",
+ "R=r2*(math.e**m)\n",
+ "D=2*R\n",
+ "\n",
+ "#Results\n",
+ "print(\"minimum internal diameter of the lead sheath,D=%.2f cms \" %D)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum internal diameter of the lead sheath,D=7.52 cms \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3, Page No 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "r=0.5 \t#radius of conductor(cm)\n",
+ "g1max=34.0\n",
+ "er=5.0\n",
+ "r1=1.0\n",
+ "R=7.0/2 #external dia(cm)\n",
+ "\n",
+ "#Calculations\n",
+ "g2max=(r*g1max)/(er*r1)\n",
+ "V=((r*g1max*math.log(r1/r))+(r1*g2max*math.log(R/r1)))\n",
+ "V=V/(math.sqrt(2.0))\n",
+ "\n",
+ "#Results\n",
+ "print(\"Maximum safe working volltage ,V =%.2f kV r.m.s\\n\" %V)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum safe working volltage ,V =11.34 kV r.m.s\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page No 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "r=0.9\n",
+ "r1=1.25\n",
+ "\n",
+ "#Calculations\n",
+ "r2=r1+.35\n",
+ "r3=r2+.35 # radius of outermost layer\n",
+ "Vd=20.0 # voltage difference (kV)\n",
+ "g1max=Vd/(r*math.log(r1/r))\n",
+ "g2max=Vd/(r1*math.log(r2/r1))\n",
+ "g3max=(66-40)/(r2*math.log(r3/r2))\n",
+ "\n",
+ "#Results\n",
+ "print(\"g1max =%.1f kV/cm\" %g1max)\n",
+ "print(\"g2max =%.2f kV/cm\" %g2max)\n",
+ "print(\"g3max =%.0f kV/cm\" %g3max)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "g1max =67.6 kV/cm\n",
+ "g2max =64.81 kV/cm\n",
+ "g3max =82 kV/cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5, Page No 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V=20.0 #voltage (kV)\n",
+ "w=314.0\n",
+ "\n",
+ "#Calculations\n",
+ "C=2*3.04*10**-6\t\t\t#capacitance per phase(micro-farad)\n",
+ "KVA=V*V*w*C*1000.0\n",
+ "\n",
+ "#Results\n",
+ "print(\"3-phase kVA required =%.0f kVA\" %KVA) \t#Answer don't match due to difference in rounding off of digits"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3-phase kVA required =764 kVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6, Page No 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "C1=0.208\n",
+ "C2=0.096\n",
+ "Cx=3.0*C1\n",
+ "w=314.0\n",
+ "V=10.0\n",
+ "\n",
+ "#Calculations\n",
+ "Cy=(C1+ 2*C2)\n",
+ "Co=((1.5*Cy)-(Cx/6))\n",
+ "C=Co/2.0\n",
+ "\n",
+ "#Results\n",
+ "print(\"(i)Capacitance between any two conductors=%.3f micro-Farad/km\" %C)\n",
+ "c=((2*C2 + ((2/3)*C1)))\n",
+ "print(\"(ii)Capacitance between any two bunched conductors and the third conductor=%.2f micro-Farad/km\" %c)\n",
+ "I=V*w*Co*1000*(10**-6)/math.sqrt(3)\n",
+ "print(\"(iii)the charging current per phase per km =%.3f A\" %I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Capacitance between any two conductors=0.248 micro-Farad/km\n",
+ "(ii)Capacitance between any two bunched conductors and the third conductor=0.19 micro-Farad/km\n",
+ "(iii)the charging current per phase per km =0.899 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 Page No 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "rm=(2.28/2)-(.152/2)# mean radius of sheath (cm)\n",
+ "d=5.08\n",
+ "a=d/rm\n",
+ "w=314.0\n",
+ "\n",
+ "#Calculations\n",
+ "Xm=2*(10**-7)*math.log(a) # mutual inductance (H/m)\n",
+ "Xm2=2000*Xm\n",
+ "V=w*Xm2*400\n",
+ "\n",
+ "#Results\n",
+ "print(\"Voltage induced =%.2f volts \\n\" %V)#Answer don't match exactly due to difference in rounding off of digits i between calculations"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage induced =78.54 volts \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8, Page No 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "R=2*0.1625\n",
+ "Rs=2*2.14\n",
+ "M=314.0\n",
+ "\n",
+ "#Calculations\n",
+ "w=6.268*10**-4\n",
+ "r=Rs*M*M*w*w/(R*((Rs**2)+(M*M*w*w)))\n",
+ "\n",
+ "#Results\n",
+ "print(\"ratio=%.4f \" %r)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ratio=0.0278 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter10.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter10.ipynb new file mode 100755 index 00000000..4e68db1a --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter10.ipynb @@ -0,0 +1,230 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Voltage Control "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1, Page No 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V=1.0 \t#voltage (p.u)\n",
+ "Pa=0.5\t\t#active power at A (p.u)\n",
+ "Pr=0.375\t# reactive power at A(p.u)\n",
+ "\n",
+ "#Calculations\n",
+ "Xca=0.075+0.04\t# reactance between C and A \n",
+ "Pl=((Pa**2)+(Pr**2))*Xca/(V**2)\n",
+ "pac=1.5\n",
+ "prc=2.0\n",
+ "Pta=0.5+1.5\t\t# total active power between E and C \n",
+ "Ptr=Pr+Pl+2.0\t# reactive power between E and C \n",
+ "Xt=.05+.025\t\t#total reactance beteween E an C \n",
+ "Pl2=((2*2)+(2.4199**2))# loss (p.u)\n",
+ "Pat=200.0\n",
+ "Prt=315.9\n",
+ "pf=0.5349\n",
+ "\n",
+ "#Results\n",
+ "print(\"Total active power supplied by generator =%.0f MW \" %Pat)\n",
+ "print(\"Total reactive power supplied by generator =%.1f MW \" %Prt)\n",
+ "print(\"p.f of the generator =%.4f \\n\" %pf)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total active power supplied by generator =200 MW \n",
+ "Total reactive power supplied by generator =315.9 MW \n",
+ "p.f of the generator =0.5349 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2, Page No 236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "l1=150\n",
+ "tstr=1\n",
+ "load2=72.65\n",
+ "R=30.0\n",
+ "\n",
+ "#Calculations\n",
+ "P=(l1*(10**6))/3\n",
+ "X=80\n",
+ "Q=(load2*(10**6))/3\n",
+ "Vs=(230*(10**3))/math.sqrt(3)\n",
+ "Vr=Vs\n",
+ "ts2=1/(1-(((R*P)+(X*Q))/(Vs*Vr)))\n",
+ "ts=math.sqrt(ts2)\n",
+ "\n",
+ "#Results\n",
+ "print(\"ts=%.2f p.u\\n\" %ts)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ts=1.11 p.u\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3, Page No 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "A=0.895\n",
+ "Vr=215.0\n",
+ "B=182.5\n",
+ "\n",
+ "#Calculations\n",
+ "x=A*(Vr**2)/B\n",
+ "y=78.6-1.4//B-A\n",
+ "p=math.degrees(math.acos(0.9))\n",
+ "X1=x/50.0\n",
+ "Vs=265*182.5/215\n",
+ "Vr1=Vs/A\n",
+ "Reg=100*(Vr1-Vr)/Vr\n",
+ "print(\"(i) sending end voltage (kV)=%.1f kV\" %Vs)\n",
+ "print(\"recieving end voltage =%.0f kV\" %Vr1)\n",
+ "print(\"Regulation = %.2f percent\" %Reg)\n",
+ "Vs1=236.0\n",
+ "Q=Vs1*Vr/B\n",
+ "QP=0.25*50\n",
+ "PR=0.50*50\n",
+ "cosQ=0.958\n",
+ "\n",
+ "#Results\n",
+ "print(\"(ii)QP(MVAr)=%.1f MV Ar\" %QP)\n",
+ "print(\" PR(MVAr)=%.0f MV Ar\" %PR)\n",
+ "print(\"CosQ=%.3f \\n\" %cosQ)\n",
+ "MN=4.55\n",
+ "Sbmax=MN*50\n",
+ "print(\"maximum power transmitted =%.1f MW\" %Sbmax)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) sending end voltage (kV)=224.9 kV\n",
+ "recieving end voltage =251 kV\n",
+ "Regulation = 16.90 percent\n",
+ "(ii)QP(MVAr)=12.5 MV Ar\n",
+ " PR(MVAr)=25 MV Ar\n",
+ "CosQ=0.958 \n",
+ "\n",
+ "maximum power transmitted =227.5 MW\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.4, Page No 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "#initialisation of variables\n",
+ "a=0\n",
+ "b=73.3\n",
+ "A=1.0\n",
+ "B=20.88\n",
+ "Vs=66.0\n",
+ "Vr=66.0\n",
+ "Load=75.0\n",
+ "\n",
+ "#Calculations\n",
+ "p=numpy.polynomial.polynomial.polyval2d(14624,400,1)\n",
+ "r=numpy.roots(p)\n",
+ "Qr=- 40.701538\n",
+ "C=-Qr + (75*.6/.8)\n",
+ "Smax=(Vr**2)*(1-math.cos(math.radians(b)))/B\n",
+ "\n",
+ "#Results\n",
+ "print(\"The phase modifier capacity =%.2f MV Ar\" %C)\n",
+ "print(\"Maximum power transmitted ,Pmax =%.2f MW\" %Smax)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The phase modifier capacity =96.95 MV Ar\n",
+ "Maximum power transmitted ,Pmax =148.67 MW\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter11.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter11.ipynb new file mode 100755 index 00000000..6e179df1 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter11.ipynb @@ -0,0 +1,102 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 : Neutral Grounding"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.1, Page No 251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "C1=2*math.pi*(10**-9)/(36*math.pi*math.log((4*4*8)**(1.0/3)/(10*(10**-3))))\n",
+ "\n",
+ "#Calculations\n",
+ "C=C1*192*(10**9) #capacitance per phase (micro farad)\n",
+ "L=(10)**6.0/(3*314*314*C)\n",
+ "V=132.0 #voltage (kV)\n",
+ "MVA=V*V/(3.0*314*L)\n",
+ "\n",
+ "#Results\n",
+ "print(\"inductance ,L=%.2f H\" %L)\n",
+ "print(\"MVA rating of suppressor coil =%.3f MVA per coil\" %MVA)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "inductance ,L=1.97 H\n",
+ "MVA rating of suppressor coil =9.379 MVA per coil\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.2, Page No 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "wL=1.0/(3*314*(10)**-6)\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"(i)inductive reactance for 100 percent of the length of line=%.1f ohms\" %wL)\n",
+ "wL=10.0**6/(3*314*.9)\n",
+ "\n",
+ "#Results\n",
+ "print(\"(ii)inductive reactance for 90percent of the length of line=%.1f ohms\" %wL)\n",
+ "wL=1.0/(3*314*(10)**-6)/.8\n",
+ "print(\"(iii)inductive reactance for 80 percent of the length of line=%.1f ohms\" %wL)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)inductive reactance for 100 percent of the length of line=1061.6 ohms\n",
+ "(ii)inductive reactance for 90percent of the length of line=1179.5 ohms\n",
+ "(iii)inductive reactance for 80 percent of the length of line=1327.0 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter12.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter12.ipynb new file mode 100755 index 00000000..d1d032ac --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter12.ipynb @@ -0,0 +1,302 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 : Thyristors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.1, Page No 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "L=2*(10**-7)*math.log(100/.75)\t\t#inductance per unit length\n",
+ "C=2*math.pi*(10**-9)/(36*math.pi*math.log(100.0/0.75))\t#Capacitance per phase per unit length (F/m)\n",
+ "Z1=math.sqrt(L/C)\n",
+ "E=11000.0\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"(i)the natural impedence of line=%.0f ohms\" %Z1)\n",
+ "Il=E/(math.sqrt(3)*Z1) #line current(amps)\n",
+ "print(\"(ii)line current =%.1f amps\" %Il)\n",
+ "R=1000.0\n",
+ "Z2=R\n",
+ "E1=2*Z2*E/((Z1+Z2)*math.sqrt(3))\n",
+ "Pr=3*E1*E1/(R*1000) #Rate of power consumption\n",
+ "Vr=(Z2-Z1)*E/(math.sqrt(3)*(Z2+Z1)*1000)\t\t#Reflected voltage\n",
+ "Er=3*Vr*Vr*1000/Z1\t\t\t\t\t\t\t\t#rate of reflected voltage\n",
+ "print(\"(iii)rate of energy absorption =%.1f kW\" %Pr)\n",
+ "print(\"rate of reflected energy =%.1f kW\" %Er)\n",
+ "print(\"(iv)Terminating resistance should be equal to surge impedence of line =%.0f ohms\" %Z1)\n",
+ "L=.5*(10**-8)\n",
+ "C=10**-12\n",
+ "Z=math.sqrt(L/C)\t\t# surge impedence\n",
+ "VR=2*Z*11/((Z1+Z)*math.sqrt(3))\n",
+ "Vrl=(Z-Z1)*11/((Z1+Z)*math.sqrt(3))\n",
+ "PR1=3*VR*VR*1000/(Z)\n",
+ "d=Vrl\n",
+ "Prl=3*d*d*1000.0/Z1\n",
+ "\n",
+ "#Results\n",
+ "print(\"(v)Refracted power =%.1f kW\" %PR1)\n",
+ "print(\"Reflected power =%.1f kW\" %Prl)\n",
+ "##Answer don't match exactly due to difference in rounding off of digits i between calculations\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)the natural impedence of line=294 ohms\n",
+ "(ii)line current =21.6 amps\n",
+ "(iii)rate of energy absorption =289.2 kW\n",
+ "rate of reflected energy =122.9 kW\n",
+ "(iv)Terminating resistance should be equal to surge impedence of line =294 ohms\n",
+ "(v)Refracted power =257.9 kW\n",
+ "Reflected power =154.3 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.2, Page No 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Xlc=0.3*(10**-3)\t\t# inductance of cable(H)\n",
+ "Xcc=0.4*(10**-6)\t\t# capacitance of cable (F)\n",
+ "Xlo=1.5*(10**-3)\t\t#inductance of overhead line(H)\n",
+ "Xco=.012*(10**-6)\t\t# capacitance of overhead line (F)\n",
+ "\n",
+ "#Calculations\n",
+ "Znc=math.sqrt((Xlc/Xcc))\n",
+ "Znl=math.sqrt((Xlo/Xco))\n",
+ "\n",
+ "#Results\n",
+ "print(\"Natural impedence of cable=%.2f ohms \" %Znc)\n",
+ "print(\"Natural impedence of overhead line=%.1f ohms \" %Znl)\n",
+ "E=2*Znl*15/(353+27)\n",
+ "print(\"voltage rise at the junction due to surge =%.2f kV \" %E)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Natural impedence of cable=27.39 ohms \n",
+ "Natural impedence of overhead line=353.6 ohms \n",
+ "voltage rise at the junction due to surge =27.91 kV \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.3, Page No 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Z1=600.0\n",
+ "Z2=800.0\n",
+ "Z3=200.0\n",
+ "E=100.0\n",
+ "\n",
+ "#Calculations\n",
+ "E1=2*E/(Z1*((1/Z1)+(1/Z2)+(1/Z3)))\n",
+ "Iz2=E1*1000.0/Z2\n",
+ "Iz3=E1*1000.0/Z3\n",
+ "\n",
+ "#Results\n",
+ "print(\"Transmitted voltage =%.2f kV \" %E1)\n",
+ "print(\"The transmitted current in line Z2=%.2f amps \" %Iz2)\n",
+ "print(\"The transmitted current in line Z3=%.1f amps \" %Iz3)\n",
+ "\n",
+ "#Answer don't match exactly due to difference in rounding off of digits i between calculations"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transmitted voltage =42.11 kV \n",
+ "The transmitted current in line Z2=52.63 amps \n",
+ "The transmitted current in line Z3=210.5 amps \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.4 Page No 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Z=350.0 \t#surge impedencr (ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "C=3000.0*(10**-12)\t# earth capacitance(F) \n",
+ "t=2.0*(10**-6)\n",
+ "E=500.0\n",
+ "E1=2*E*(1-math.exp((-1*t/(Z*C))))\n",
+ "\n",
+ "#Results\n",
+ "print(\"the maximum value of transmitted voltage=%.2f kV \" %E1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the maximum value of transmitted voltage=851.14 kV \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.5, Page No 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Z=350.0 \t\t#surge impedencr (ohms)\n",
+ "L=800*(10**-6) \n",
+ "t=2*(10**-6)\n",
+ "E=500.0\n",
+ "\n",
+ "#Calculations\n",
+ "E1=E*(1-math.exp((-1*t*2*Z/L)))\n",
+ "\n",
+ "#Results\n",
+ "print(\"The maximum value of transmitted voltage=%.1f kV \" %E1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum value of transmitted voltage=413.1 kV \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.6, Page No 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "eo=50.0\n",
+ "x=50.0\n",
+ "R=6.0\n",
+ "Z=400.0\n",
+ "G=0\n",
+ "v=3*(10**5)\n",
+ "e=2.68\n",
+ "\n",
+ "#Calculations\n",
+ "e1=(eo*(e**((-1/2)*R*x/Z)))\n",
+ "# answess does not match due to the difference in rounding off of digits. \n",
+ "print(\"(i)the value of the Voltage wave when it has travelled through a distance 50 Km=%.1f kV \" %e1)\n",
+ "Pl=e1*e1*1000.0/400\n",
+ "io=eo*1000.0/Z\n",
+ "t=x/v\n",
+ "H=-(50*125*400*((e**-0.75)-1))/(6.0*3*10**5)\n",
+ "\n",
+ "#Results\n",
+ "print(\"(ii)Power loss=%.3fkW \\n heat loss=%.3f kJ\" %(Pl,H))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)the value of the Voltage wave when it has travelled through a distance 50 Km=23.9 kV \n",
+ "(ii)Power loss=1424.550kW \n",
+ " heat loss=0.726 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter13.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter13.ipynb new file mode 100755 index 00000000..b99fc5a9 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter13.ipynb @@ -0,0 +1,868 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 : Symmetrical Components and fault calculations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.1, Page No 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Va=100.0*complex(math.cos(math.radians(0)),math.sin(math.radians(0)))\n",
+ "Vb=33.0*complex(math.cos(math.radians(-100)),math.sin(math.radians(-100)))\n",
+ "Vc=38.0*complex(math.cos(math.radians(176.5)),math.sin(math.radians(176.5)))\n",
+ "L=1.0*(math.cos(math.radians(120)) + math.sin(math.radians(120)))\n",
+ "\n",
+ "#Calculations\n",
+ "Va1=((Va + L*Vb + (L**2)*Vc))/3\n",
+ "Va2=((Va + L*Vc + (L**2)*Vb))/3\n",
+ "Vco=((Va + Vb + Vc))/3\n",
+ "\n",
+ "#Results\n",
+ "print( \"Va1= {0:.5f}+{1:.5f}i\".format(Va1.real, Va1.imag))\n",
+ "print( \"Va2= {0:.5f}+{1:.5f}i\".format(Va2.real, Va2.imag))\n",
+ "print( \"Vco= {0:.5f}+{1:.5f}i\".format(Vco.real, Vco.imag))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Va1= 30.94033+-3.86151i\n",
+ "Va2= 28.44975+-1.16829i\n",
+ "Vco= 18.78016+-10.05960i\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2, Page No 303"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ia=complex(500,150)\t\t# Line current in phase a\n",
+ "Ib=complex(100,-600)\t# Line current in phase b\n",
+ "Ic=complex(-300,600)\t# Line current in phase c\n",
+ "\n",
+ "#Calculations\n",
+ "L=complex(math.cos(math.radians(120)),math.sin(math.radians(120)))\n",
+ "Iao=(Ia+Ib+Ic)/3\n",
+ "Ia1=(Ia+Ib*L+(L**2)*Ic)/3\n",
+ "Ia2=(Ia+(L**2)*Ib +(L*Ic))/3\n",
+ "\n",
+ "#Results\n",
+ "print( \"Iao(amps)= {0:.5f}+{1:.5f}i\".format(Iao.real, Iao.imag))\n",
+ "print( \"Ia1(amps)= {0:.5f}+{1:.5f}i\".format(Ia1.real, Ia1.imag))\n",
+ "print( \"Ia2(amps)= {0:.5f}+{1:.5f}i\".format(Ia2.real, Ia2.imag))\n",
+ "# Answer in the book is not correct.wrong calculation in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Iao(amps)= 100.00000+50.00000i\n",
+ "Ia1(amps)= 546.41016+165.47005i\n",
+ "Ia2(amps)= -146.41016+-65.47005i\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.3, Page No 314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ea=1.0\n",
+ "Z1=complex(0.25)\n",
+ "Z2=complex(.35)\n",
+ "Zo=complex(0.1)\n",
+ "Ia1=Ea/(Z1+Z2+Zo)\n",
+ "L=-complex(0.5,0.866)\n",
+ "Ia2=Ia1\n",
+ "Iao=Ia2\n",
+ "\n",
+ "#Calculations\n",
+ "Ia=Ia1+Ia2+Iao\n",
+ "Ib=25*1000/((math.sqrt(3)*13.2))\n",
+ "If=Ib*abs(Ia)\n",
+ "Va1=Ea-(Ia1*Z1)\n",
+ "Va2=-Ia2*Z2\n",
+ "Va0=-Iao*Zo\n",
+ "Va=Va1+Va2+Va0\n",
+ "Vb1=(L**2)*Va1\n",
+ "Vb2=L*Va2\n",
+ "Vbo=Va0\n",
+ "Vco=Va0\n",
+ "Vc1=L*Va1\n",
+ "Vc2=(L**2)*Va2\n",
+ "Vb=Vb1+Vb2+Vbo\n",
+ "Vc=Vco+Vc1+Vc2\n",
+ "Vab=Va-Vb\n",
+ "Vac=Va-Vc\n",
+ "Vbc=Vb-Vc\n",
+ "vab=(13.2*abs(Vab))/math.sqrt(3)\n",
+ "vac=(13.2*abs(Vac))/math.sqrt(3)\n",
+ "vbc=(13.2*abs(Vbc))/math.sqrt(3)\n",
+ "\n",
+ "#Results\n",
+ "print(\"fault current (amps)= %.2f\" %If)#Answer don't match due to difference in rounding off of digits\n",
+ "print(\"Vab(kV)= {0:.5f}+{1:.5f}i\" .format(Vab.real, Vab.imag))\t\t#Answer don't match due to difference in rounding off of digits\n",
+ "print(\"Vac(kV)= {0:.5f}+{1:.5f}i\" .format(Vac.real, Vac.imag))\t\t#Answer don't match due to difference in rounding off of digits\n",
+ "print(\"Vbc(kV)= {0:.5f}+{1:.5f}i\" .format(Vbc.real, Vbc.imag))\t\t#Answer don't match due to difference in rounding off of digits\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fault current (amps)= 4686.28\n",
+ "Vab(kV)= 0.21426+-0.98971i\n",
+ "Vac(kV)= 0.21431+0.98971i\n",
+ "Vbc(kV)= 0.00005+1.97943i\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4 Page No 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ea=1.0\n",
+ "L=complex(math.cos(math.radians(120)),math.sin(math.radians(120)))\n",
+ "Z1=complex(0.25)\n",
+ "Z2=complex(0.35)\n",
+ "Ia1=Ea/(Z1+Z2)\n",
+ "Ia2=-Ia1\n",
+ "Iao=0\n",
+ "\n",
+ "#Calculations\n",
+ "Ib1=(L**2)*Ia1\n",
+ "Ib2=L*Ia2\n",
+ "Ibo=0\n",
+ "Ib=Ib1+Ib2 +Ibo\n",
+ "Iba=1093\n",
+ "If=Iba*abs(Ib)\n",
+ "Va1=Ea-(Ia1*Z1)\n",
+ "Va2=-Ia2*Z2\n",
+ "Vao=0\n",
+ "Va=Va1+Va2+Vao\n",
+ "Vb=(L**2)*Va1+L*Va2\n",
+ "Vc=Vb\n",
+ "Vab=Va-Vb\n",
+ "Vac=Va-Vc\n",
+ "Vbc=Vb-Vc\n",
+ "\n",
+ "#Results\n",
+ "vab=(abs(Vab)*13.2)/math.sqrt(3)\n",
+ "vbc=(abs(Vbc)*13.2)/math.sqrt(3)\n",
+ "vac=(abs(Vac)*13.2)/math.sqrt(3)\n",
+ "print(\"fault current (amps)= %.2f\" %If)#Answer don't match due to difference in rounding off of digits\n",
+ "print(\"Vab(kV)= {0:.5f}+{1:.5f}i\" .format(vab.real, vab.imag))\t\t#Answer don't match due to difference in rounding off of digits\n",
+ "print(\"Vac(kV)= {0:.5f}+{1:.5f}i\" .format(vac.real, vac.imag))\t\t#Answer don't match due to difference in rounding off of digits\n",
+ "print(\"Vbc(kV)= {0:.5f}+{1:.5f}i\" .format(vbc.real, vbc.imag))\t\t#Answer don't match due to difference in rounding off of digits"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fault current (amps)= 3155.22\n",
+ "Vab(kV)= 13.33679+0.00000i\n",
+ "Vac(kV)= 13.33679+0.00000i\n",
+ "Vbc(kV)= 0.00000+0.00000i\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.5, Page No 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ea=complex(1,0)\n",
+ "Zo=complex(0.1)\n",
+ "Z1=complex(0.25)\n",
+ "Z2=complex(0.35)\n",
+ "\n",
+ "#Calculations\n",
+ "Ia1=Ea/(Z1+(Zo*Z2/(Zo+Z2)))\n",
+ "Va1=Ea-Ia1*Z1\n",
+ "Va2=Va1\n",
+ "Vao=Va2\n",
+ "Ia2=-Va2/Z2\n",
+ "Iao=-Vao/Zo\n",
+ "I=Ia2+Iao\n",
+ "If=3*Iao # fault current\n",
+ "Ib=1093 # base current\n",
+ "Ifl=abs(If*Ib)\n",
+ "print(\"fault current (amps)= %.2f\" %Ifl) #Answer don't match due to difference in rounding off of digits\n",
+ "Va=3*Va1\n",
+ "Vb=0\n",
+ "Vc=0\n",
+ "Vab=abs(Va)*13.2/math.sqrt(3)\n",
+ "Vac=abs(Va)*13.2/math.sqrt(3)\n",
+ "Vbc=abs(Vb)*13.2/math.sqrt(3)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Vab(kV)= {0:.5f}+{1:.5f}i\" .format(Vab.real, Vab.imag))\t\t\n",
+ "print(\"Vac(kV)= {0:.5f}+{1:.5f}i\" .format(Vac.real, Vac.imag))\t\t\n",
+ "print(\"Vbc(kV)= {0:.5f}+{1:.5f}i\" .format(Vbc.real, Vbc.imag))\t\t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fault current (amps)= 7780.68\n",
+ "Vab(kV)= 5.42514+0.00000i\n",
+ "Vac(kV)= 5.42514+0.00000i\n",
+ "Vbc(kV)= 0.00000+0.00000i\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.6, Page No 335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Vbl=13.8*115/13.2\t\t\t\t# base voltage on the line side of transformer(kV)\n",
+ "Vbm=120*13.2/115\t\t\t\t# base voltage on the motor side of transformer(kV)\n",
+ "Xt=10*((13.2/13.8)**2)*30/35.0\t# percent reactance of transformer\n",
+ "Xm=20*((12.5/13.8)**2)*30.0/20\t# percent reactance of motor\n",
+ "Xl=80*30*100.0/(120.0*120)\t\t#percent reactance of line \n",
+ "Xn=2*3*30*100/(13.8*13.8)\t\t# neutral reactance\n",
+ "Xz=200*30*100.0/(120.0*120)\n",
+ "\n",
+ "#Calculations\n",
+ "Zn=complex(0.146)\t\t\t\t# negative sequence impedence\n",
+ "Zo=.06767\t\t\t\t\t\t# zero sequence impedence\n",
+ "Z=complex(0.3596)\t\t\t\t#total impedence\n",
+ "Ia1=1.0/Z\n",
+ "Ia2=Ia1\n",
+ "Iao=Ia2\n",
+ "If1=3*Ia1\n",
+ "Ib=30*1000/(math.sqrt(3)*13.8)\n",
+ "Ibl=30*1000/(math.sqrt(3)*120)\n",
+ "Ifc=Ibl*abs(If1)\n",
+ "Z1=complex(0.146)\n",
+ "Z2=Z1\n",
+ "IA1=1.0/(Z1+Z2)\n",
+ "IA2=-IA1\n",
+ "L=complex(math.cos(math.radians(120)),math.sin(math.radians(120)))\n",
+ "IAo=0\n",
+ "IB=(L**2)*IA1 + L*IA2\n",
+ "IC=-IB\n",
+ "IF=abs(IB)*Ibl\n",
+ "Zo=complex(0.06767)\n",
+ "ia1=1/(Z1+(Zo*Z2/(Zo+Z2)))\n",
+ "ia2=ia1*Zo/(Z2+Zo)\n",
+ "iao=complex(3.553)\n",
+ "If2=3*iao\n",
+ "IF2=abs(If2*Ibl)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Fault Current (i)L-G fault, If=%.0f amps \" %Ifc)\n",
+ "print(\"(ii)L-L fault ,If=%.1f amps\" %IF)\n",
+ "print(\"(iii)L-L-G, If =%.0f amps\" %IF2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fault Current (i)L-G fault, If=1204 amps \n",
+ "(ii)L-L fault ,If=856.2 amps\n",
+ "(iii)L-L-G, If =1538 amps\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.8 Page No 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "vx=3.0\t\t# percent reactance of the series element\n",
+ "sinr=0.6\n",
+ "\n",
+ "#Calculations\n",
+ "V=vx*sinr\n",
+ "\n",
+ "#Results\n",
+ "print(\"Percent drop of volts=%.1f percent\" %V)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percent drop of volts=1.8 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.9, Page No 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Sb=8.0\t\t# Base MVA\n",
+ "\n",
+ "#Calculations\n",
+ "Zeq=(complex(0.15))*(complex(0.315))/(complex(0.465))\n",
+ "Scc=abs(Sb/Zeq)\n",
+ "\n",
+ "#Results\n",
+ "print(\"short circuit capacity=%.2f MVA\" %Scc)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "short circuit capacity=78.73 MVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.10 Page No 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "X=1200*100.0/800\t\t# percent reactance of other generating station\n",
+ "Xc=0.5*1200/(11.0*11)\n",
+ "\n",
+ "#Calculations\n",
+ "Sc=1200*100.0/86.59\t\t# short circuit MVA of the bus\n",
+ "Xf=119.84\t\t\t\t# equivalent fault impedence between F and neutral bus \n",
+ "MVA=1200*100.0/Xf\n",
+ "\n",
+ "#Results\n",
+ "print(\"short circuit capacity of each station=%.0f MVA\" %MVA)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "short circuit capacity of each station=1001 MVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.11 Page No 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Sb=100.0 # base power (MVA)\n",
+ "\n",
+ "#Calculations\n",
+ "SC=Sb/0.14\n",
+ "\n",
+ "#Results\n",
+ "print(\"S.C. MVA =%.2f MVA \" %SC)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "S.C. MVA =714.29 MVA \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.12 Page No 344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ib=50*1000.0/(math.sqrt(3.0)*13.2)# base current (amps.)\n",
+ "Vf=12.5/13.5\t\t# the Prefault Voltage (p.u)\n",
+ "Xf=(complex(0.3))*(complex(0.2))/(complex(0.5))\t# Fault impedence(p.u)\n",
+ "\n",
+ "#Calculations\n",
+ "If=0.9469/(Xf)\t\t#Fault current (p.u)\n",
+ "Ifl=30*1000.0/((math.sqrt(3)*12.5*.8))\t#full load current (amps)\n",
+ "Il=1732*(complex(math.cos(math.radians(36.8)),math.sin(math.radians(36.8))))/2186.0\t\t#load current(p.u)\n",
+ "Ifm=3*(If)/5.0\t\t# fault current supplied by motor (p.u)\n",
+ "Ifg=2*(If)/5.0\t\t# fault current supplied by generator (p.u)\n",
+ "Ig=abs(Ifg +Il)\t\t#Net current supplied by generator during fault(p.u)\n",
+ "Im=abs(Ifm-Il)\t\t#Net current supplied by motor during fault(p.u)\n",
+ "Igf=Ig*2186\n",
+ "Imf=Im*2186\n",
+ "Ifc=2186*If\n",
+ "\n",
+ "#Results\n",
+ "print(\"Fault current from the generator =%.3f amps\" %Igf)\n",
+ "print(\"Fault current from the motor =%.3f amps\" %Imf)\n",
+ "print(\"Fault current (amps) = {0:.5f}+{1:.5f}i\" .format(Ifc.real, Ifc.imag))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fault current from the generator =8351.308 amps\n",
+ "Fault current from the motor =9022.600 amps\n",
+ "Fault current (amps) = 17249.36167+0.00000i\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.13, Page No 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Sb=75.0 \t\t\t# Base MVA\n",
+ "\n",
+ "#Calculations\n",
+ "Xpu=0.15*Sb/15.0\t# p.u reactance of the generator\n",
+ "Xt=complex(-0.08)\t#p.u reactanceof the transformer\n",
+ "X=9.75/112.0\n",
+ "Xa=X*33*33/75.0\n",
+ "\n",
+ "#Results\n",
+ "print(\"The reactance of the reactor =%.3f ohms\" %Xa)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reactance of the reactor =1.264 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.14, Page No 346"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "\n",
+ "Z1eq= complex((((8+5)*(8+5+12.0))/(100.0*(13+25))))\n",
+ "Z2eq=Z1eq\n",
+ "Zoeq=complex((5*45)*(10^-2)/(5+45))\n",
+ "Ea=1\n",
+ "\n",
+ "#Calculations\n",
+ "Ia1=Ea/(Z1eq+ ((Zoeq*Z2eq)/(Zoeq+Z2eq)))\n",
+ "Ia2=(-Ia1*Zoeq)/(Zoeq+Z2eq)\n",
+ "Iao=(-Ia1*Z2eq)/(Zoeq+Z2eq)\n",
+ "Va1=Ea-(Ia1*Z1eq)\n",
+ "Va2=-Ia2*Z2eq\n",
+ "Vao=Va2\n",
+ "Ia=0\n",
+ "Ib=complex(-0.5 ,0.866)*Ia1 + (complex(-0.5,0.866)*Ia2) + Iao\n",
+ "Ic=complex(-0.5 ,0.866)*Ia1 + complex(-0.5 ,0.866)*Ia2 + Iao\n",
+ "ia1=Ia1*25/38\n",
+ "IA1=complex(ia1)\n",
+ "ia2=Ia2*25/38\n",
+ "IA2=complex(-ia2)\n",
+ "IA=IA1 + IA2\n",
+ "IB=IA1*complex(-0.5 ,0.866) + IA2*complex(-0.5 ,0.866)\n",
+ "IC=IA1*complex(-0.5 ,0.866) + IA2*complex(-0.5 ,0.866)\n",
+ "Va=Va1+Va2+Vao\n",
+ "Vb=0\n",
+ "Vc=0\n",
+ "Vab=.2564-Vb\n",
+ "Vbc=Vb-Vc\n",
+ "Vca=Vc-.2564\n",
+ "VA1=Ea-IA1*complex(.05)\n",
+ "VA2=-IA2*complex(0.05)\n",
+ "VA=VA1+VA2\n",
+ "VB=((complex(-0.5 ,0.866)*VA1) +(complex(-0.5 ,0.866)*VA2))\n",
+ "VC=VA1*complex(-0.5 ,0.866) + VA2*complex(-0.5 ,0.866)\n",
+ "VAB=VA-VB\n",
+ "VBC=VB-VC\n",
+ "VCA=VC-VA\n",
+ "\n",
+ "#Results\n",
+ "#Answers don't match due to difference in rounding off of digits\n",
+ "print(\"fault currents ,Ia= %.2f\" %Ia)\n",
+ "print(\"Ib= {0:.5f}+{1:.5f}i\" .format(Ib.real, Ib.imag))\t\n",
+ "print(\"Ic= {0:.5f}+{1:.5f}i\" .format(Ic.real, Ic.imag))\t\t\t#Calculation in book is wrong.\n",
+ "print(\"IA= {0:.5f}+{1:.5f}i\" .format(IA.real, IA.imag))\t\n",
+ "print(\"IB= {0:.5f}+{1:.5f}i\" .format(IB.real, IB.imag))\t\n",
+ "print(\"IC= {0:.5f}+{1:.5f}i\" .format(IC.real, IC.imag))\t\n",
+ "print(\"Voltages at fault point\")\n",
+ "print(\"Vab(p.u)= %.2f\" %Vab)\n",
+ "print(\"Vbc(p.u)= %.2f\" %Vbc)\n",
+ "print(\"Vca(p.u)= %.2f\" %Vca)\n",
+ "print(\"VAB= {0:.5f}+{1:.5f}i\" .format(VAB.real, VAB.imag))\t\n",
+ "print(\"VBC= {0:.5f}+{1:.5f}i\" .format(VBC.real, VBC.imag))\t\n",
+ "print(\"VCA= {0:.5f}+{1:.5f}i\" .format(VCA.real, VCA.imag))\t\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fault currents ,Ia= 0.00\n",
+ "Ib= 0.01390+-0.00802i\n",
+ "Ic= 0.01390+-0.00802i\n",
+ "IA= 7.69231+0.00000i\n",
+ "IB= -3.84615+6.66154i\n",
+ "IC= -3.84615+6.66154i\n",
+ "Voltages at fault point\n",
+ "Vab(p.u)= 0.26\n",
+ "Vbc(p.u)= 0.00\n",
+ "Vca(p.u)= -0.26\n",
+ "VAB= 0.92308+-0.53292i\n",
+ "VBC= 0.00000+0.00000i\n",
+ "VCA= -0.92308+0.53292i\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.15, Page No 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Ia1=complex(-0.8,-2.6) + complex(0.8,-0.4)\n",
+ "Ia2=complex(-3)\n",
+ "Iao=complex(-3)\n",
+ "A=complex(-0.8,-2.6) + complex(0.8,2)\n",
+ "a=.8\n",
+ "b=.6\n",
+ "\n",
+ "#Calculations\n",
+ "Ipf=complex(a,b)\n",
+ "Isfc=3*Ia1\n",
+ "iA1=complex(0.8,-4)\n",
+ "iA2=complex(-1)\n",
+ "iAo=0\n",
+ "IA1=complex(iA1)\n",
+ "IA2=complex(-iA2)\n",
+ "IA=IA1 + IA2\n",
+ "L=complex(math.cos(math.radians(120)),math.sin(math.radians(120)))\n",
+ "IB=(L**2)*IA1 + IA2*L\n",
+ "IC=(L**2)*IA2 + IA1*L\n",
+ "\n",
+ "#Results\n",
+ "print(\"(i) pre- fault current in line a = {0:.5f}+{1:.5f}i\" .format(Ipf.real, Ipf.imag))\t\n",
+ "print(\"(ii) the subtransient fault current in p.u= {0:.5f}+{1:.5f}i\" .format(Isfc.real, Isfc.imag))\t\n",
+ "print(\"IA= {0:.5f}+{1:.5f}i\" .format(IA.real, IA.imag))\t\n",
+ "print(\"IB= {0:.5f}+{1:.5f}i\" .format(IB.real, IB.imag))\t\n",
+ "print(\"IC= {0:.5f}+{1:.5f}i\" .format(IC.real, IC.imag))\t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) pre- fault current in line a = 0.80000+0.60000i\n",
+ "(ii) the subtransient fault current in p.u= 0.00000+-9.00000i\n",
+ "IA= 1.80000+-4.00000i\n",
+ "IB= -4.36410+2.17321i\n",
+ "IC= 2.56410+1.82679i\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.16, Page No 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "S_C_MVA=0.5/.05\n",
+ "\n",
+ "#Results\n",
+ "print(\"S.C.MVA=%.2f MVA\" %S_C_MVA)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "S.C.MVA=10.00 MVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.17, Page No 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "vab=2000.0\n",
+ "vbc=2800.0\n",
+ "vca=2500.0\n",
+ "vb=2500.0\t\t# base voltage (V)\n",
+ "\n",
+ "#Calculations\n",
+ "Vab=vab/vb\t\t# per unit voltages \n",
+ "Vbc=vbc/vb\n",
+ "Vca=vca/vb\n",
+ "a=math.degrees(math.acos(((1.12**2)-((.8**2)+1))/(2*.8)))\n",
+ "b=136.11348\n",
+ "Vlab=Vab*complex(math.cos(math.radians(76.06)),math.sin(math.radians(76.06)))\t\t# line voltage \n",
+ "Vlca=Vca*complex(math.cos(math.radians(180)),math.sin(math.radians(180)))\t\t# line voltage \n",
+ "Vlbc=Vbc*complex(math.cos(math.radians(-43.9)),math.sin(math.radians(-43.9)))# line voltage \n",
+ "L=1*complex(math.cos(math.radians(120)),math.sin(math.radians(120)))\n",
+ "Vab1=(Vlab +(L*Vlbc) + ((L**2)*Vlca))/3.0 \t# symmetrical component of line voltage \n",
+ "Vab2=(Vlab +(L*Vlca) + ((L**2)*Vlbc))/3.0 # symmetrical component of line voltage \n",
+ "Vabo=0# symmetrical component of line voltage \n",
+ "Van1=Vab1*complex(math.cos(math.radians(-30)),math.sin(math.radians(-30)))\n",
+ "Van2=Vab2*complex(math.cos(math.radians(30)),math.sin(math.radians(30)))\n",
+ "Ia1=Van1/(1*complex(math.cos(math.radians(0)),math.sin(math.radians(0))))\n",
+ "Ia2=Van2/(1*complex(math.cos(math.radians(0)),math.sin(math.radians(0))))\n",
+ "VA1=complex(-Van1)\n",
+ "VA2=complex(Van2)\n",
+ "VA=VA1+ VA2\n",
+ "VB1=(L**2)*VA1\n",
+ "VB2=(L)*VA2\n",
+ "VB=VB1 + VB2\n",
+ "VC2=(L**2)*VA2\n",
+ "VC1=(L)*VA1\n",
+ "VC=VC1 + VC2\n",
+ "VAB=VA-VB\n",
+ "VBC=VB-VC\n",
+ "VCA=VC-VA\n",
+ "IA=VA\n",
+ "IB=VB\n",
+ "IC=VC\n",
+ "phase_IA=math.degrees(math.atan(IA.imag/IA.real))\n",
+ "phase_IB=math.degrees(math.atan(IB.imag/IB.real))\n",
+ "phase_IC=math.degrees(math.atan(IC.imag/IC.real))\n",
+ "\n",
+ "#Results\n",
+ "print(\"VAB= {0:.5f}+{1:.5f}i\" .format(VAB.real, VAB.imag))\t\n",
+ "print(\"VBC= {0:.5f}+{1:.5f}i\" .format(VBC.real, VBC.imag))\t\n",
+ "print(\"VCA= {0:.5f}+{1:.5f}i\" .format(VCA.real, VCA.imag))\t\n",
+ "print(\"IA(p.u)=%.2f at an agle of %.1f\" %(abs(IA),phase_IA))\n",
+ "print(\"IB(p.u)=%.2f at an agle of %.1f\" %(abs(IB),phase_IB))\n",
+ "print(\"IC(p.u)=%.2f at an agle of %.1f\" %(abs(IC),phase_IC))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VAB= -0.77661+-1.80702i\n",
+ "VBC= -0.77644+1.19272i\n",
+ "VCA= 1.55305+0.61429i\n",
+ "IA(p.u)=1.12 at an agle of 46.1\n",
+ "IB(p.u)=1.00 at an agle of 90.0\n",
+ "IC(p.u)=0.80 at an agle of -13.9\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter8_1.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter14.ipynb index d91fc639..f411d65f 100755 --- a/Electronic_Devices_and_Circuits/Chapter8_1.ipynb +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter14.ipynb @@ -12,7 +12,7 @@ "level": 1,
"metadata": {},
"source": [
- "Chapter 08 : BJT specifications and performance"
+ "Chapter 14 : Protective Relayes"
]
},
{
@@ -20,7 +20,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.2, Page No 313"
+ "Example 14.1, Page No 366"
]
},
{
@@ -29,14 +29,17 @@ "input": [
"import math\n",
"#initialisation of variables\n",
- "P2=25.0*10**-3#when frequency increase to 20KHz\n",
- "P1=50.0*10**-3#when signal frequency is 5KHz\n",
+ "If=4000.0\t# fault current \n",
+ "I=5*1.25\t# operating current of relay \n",
"\n",
"#Calculations\n",
- "Po=10*math.log((P2/P1),10)\n",
+ "CT=400.0/5\t# CT ratio\n",
+ "PSM=If/(I*CT)\t# plug setting multiplier\n",
"\n",
"#Results\n",
- "print(\" output power change in decibels is %.2f dB \" %Po)"
+ "print(\"PSM =%.2f\" %PSM)\n",
+ "print(\"operating time for PSM=8 is 3.2sec.\")\n",
+ "print(\"actual operating time = 1.92 sec.\")\n"
],
"language": "python",
"metadata": {},
@@ -45,7 +48,9 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- " output power change in decibels is -3.01 dB \n"
+ "PSM =8.00\n",
+ "operating time for PSM=8 is 3.2sec.\n",
+ "actual operating time = 1.92 sec.\n"
]
}
],
@@ -56,7 +61,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.3, Page No 314"
+ "Example 14.2, Page No 369"
]
},
{
@@ -64,16 +69,20 @@ "collapsed": false,
"input": [
"import math\n",
- "\n",
"#initialisation of variables\n",
- "v1=1# output voltage measured at 5KHz\n",
- "v2=.707# output voltage measure at 20kHz\n",
+ "Z=1000.0*complex(math.cos(math.radians(60)),math.sin(math.radians(60))) #impedence\n",
+ "X=math.cos(math.radians(50))*1000*math.cos(math.radians(60))\n",
+ "Xl=1000.0*math.cos(math.radians(60))\n",
+ "Xc=Xl-X\n",
"\n",
"#Calculations\n",
- "Po=20*math.log((v2/v1),10)\n",
+ "C=1000000.0/(314.0*Xc)\n",
"\n",
"#Results\n",
- "print(\" output power change is %.2f dB \" %Po)"
+ "#Answers don't match due to difference in rounding off of digits\n",
+ "print(\"X= %.2f\" %X)\n",
+ "print(\"Xc= %.2f\" %Xc)\n",
+ "print(\"C(micro farads)= %.2f\" %C)"
],
"language": "python",
"metadata": {},
@@ -82,7 +91,9 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- " output power change is -3.01 dB \n"
+ "X= 321.39\n",
+ "Xc= 178.61\n",
+ "C(micro farads)= 17.83\n"
]
}
],
@@ -93,7 +104,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.4 Page No 317"
+ "Example 14.3, Page No 384"
]
},
{
@@ -101,24 +112,25 @@ "collapsed": false,
"input": [
"import math\n",
- "\n",
"#initialisation of variables\n",
- "Ic=1.0*10**-3\n",
- "hfe=50.0\n",
- "hie=1.3*10**3\n",
- "fT=250.0*10**6\n",
- "Cbc=5.0*10**-12\n",
- "Rc=8.2*10**3\n",
- "Rl=100.0*10**3\n",
+ "Isec1=4000.0/40# secondary current(amps)\n",
+ "PSM=100.0/5# PSM if 100% setting is used\n",
+ "Isec2=4000.0/40\n",
+ "PSM2=100.0/6.25#PSM if setting used is 125%\n",
+ "TMSb=0.72/2.5\n",
"\n",
"#Calculations\n",
- "Ie=Ic\n",
- "Av=(hfe*((Rc*Rl)/(Rc+Rl)))/hie\n",
- "Cbe=(6.1*Ie)/fT\n",
- "Cin=(Cbe+(1+Av)*Cbc)*10**9\n",
+ "PSM1=5000.0/(6.25*40)\n",
+ "to=2.2\n",
+ "tb=to*TMSb\n",
+ "PSMa=5000/(6.25*80)\n",
+ "TMS=1.138/3\n",
+ "PSMa1=6000/(6.25*80)\n",
+ "ta=(2.6*.379)\n",
"\n",
"#Results\n",
- "print(\" input capacitance when the circuit operated as CE is %.2fnF \"%Cin)"
+ "print(\"Actual operating time of realy at b=%.3f sec\" %tb)\n",
+ "print(\"Actual operating time of realy at a=%.3f sec \" %ta)"
],
"language": "python",
"metadata": {},
@@ -127,7 +139,8 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- " input capacitance when the circuit operated as CE is 1.49nF \n"
+ "Actual operating time of realy at b=0.634 sec\n",
+ "Actual operating time of realy at a=0.985 sec \n"
]
}
],
@@ -138,7 +151,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.5, Page No 319"
+ "Example 14.4 Page No 399"
]
},
{
@@ -147,31 +160,15 @@ "input": [
"import math\n",
"#initialisation of variables\n",
- "R1=100*10**3\n",
- "R2=47.0*10**3\n",
- "Re=4.7*10**3\n",
- "Cbc=5.0*10**-12\n",
- "Cbe=24.4*10**-12\n",
- "hfe=50\n",
- "hie=1.3*10**3\n",
- "hib=24.5\n",
- "rs=hib\n",
- "rs=600.0\n",
+ "Vph=6600/(math.sqrt(3))\n",
+ "Ifull=5000/(math.sqrt(3)*6.6)\n",
"\n",
"#Calculations\n",
- "print(\" common emitter circuit\")\n",
- "Rb=(R1*R2)/(R1+R2)\n",
- "Zi=(Rb*hie)/(Rb+hie)\n",
- "Cin=1.48*10**-9\n",
- "f2=1/(2*3.14*Cin*((rs*Zi)/(rs+Zi)))\n",
- "print(\"input-capacitance upper cutoff frequency is %dHz \" %f2)\n",
- "print(\"common base circuit\")\n",
- "Zi=(Re*hib)/(Re+hib)\n",
- "Cin=(Cbe+Cbc)\n",
- "f2=(1/(2*3.14*Cin*((rs*Zi)/(rs+Zi))))*10**-6\n",
+ "Ib=Ifull*.25\n",
+ "x=Ib*800.0/Vph\n",
"\n",
"#Results\n",
- "print(\" input capacitance upper cutoff when operating as CB circuit with base bypassed to ground is %.2f MHz \" %f2)"
+ "print(\"Percent of the winding remains unprotected = %.2f \" %x)"
],
"language": "python",
"metadata": {},
@@ -180,10 +177,7 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- " common emitter circuit\n",
- "input-capacitance upper cutoff frequency is 265447Hz \n",
- "common base circuit\n",
- " input capacitance upper cutoff when operating as CB circuit with base bypassed to ground is 231.25 MHz \n"
+ "Percent of the winding remains unprotected = 22.96 \n"
]
}
],
@@ -194,7 +188,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.6 Page No 322"
+ "Example 14.5, Page No 399"
]
},
{
@@ -203,17 +197,16 @@ "input": [
"import math\n",
"#initialisation of variables\n",
- "fT=50.0*10**6\n",
- "hfe=50.0\n",
- "f2o=60.0*10**3\n",
- "Rc=10.0*10**3\n",
+ "Iph=10000.0/math.sqrt(3)\t# phase voltage of alternator(V)\n",
+ "x=1.8*100*10*1000.0/(5*Iph)\n",
"\n",
"#Calculations\n",
- "fae=fT/hfe\n",
- "C4=(1.0/(2*3.14*f2o*Rc))*10**12\n",
+ "print(\"(i) percent winding which remains unprotected=%.2f \" %x)\n",
+ "Ip=Iph*.2\n",
+ "R=1.8*1000.0/(5*Ip)\n",
"\n",
"#Results\n",
- "print(\"capacitance required for C4 to give 60kHz upper cutoff frequency is %.2f pF \" %C4)"
+ "print(\"(ii)minimum value of earthing resistance required to protect 80 percent of winding =%.4f ohms\" %R)"
],
"language": "python",
"metadata": {},
@@ -222,7 +215,8 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- "capacitance required for C4 to give 60kHz upper cutoff frequency is 265.39 pF \n"
+ "(i) percent winding which remains unprotected=62.35 \n",
+ "(ii)minimum value of earthing resistance required to protect 80 percent of winding =0.3118 ohms\n"
]
}
],
@@ -233,7 +227,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.8 Page No 326"
+ "Example 14.6, Page No 400"
]
},
{
@@ -241,22 +235,19 @@ "collapsed": false,
"input": [
"import math\n",
- "\n",
"#initialisation of variables\n",
- "ton=100.0*10**-9\n",
- "Rs=600.0\n",
- "Rb=4.7*10**3\n",
+ "Ic=360-320 # the difference current (amp)\n",
+ "Io=40*5/400.0\n",
"\n",
"#Calculations\n",
- "C1=(ton/Rs)*10**12\n",
- "print(\" suitable speed up capacitor is %dpF \" %C1)\n",
- "C1=160*10**-12#standard value\n",
- "PWmin=(5*Rs*C1)\n",
- "SWmin=5*Rb*C1\n",
- "fmax=1/(PWmin+SWmin)\n",
+ "Avg=(360+320)/2 # average sum of two currents\n",
+ "Iavg=340*5/400.0\n",
+ "Ioc=.1*Iavg +0.2\n",
"\n",
"#Results\n",
- "print(\"maximum signal frequency is %.2f Hz \" %(fmax/1000))"
+ "print(\"operating current=%.3f amp. \" %Ioc)\n",
+ "print(\"since current through operating coil is %.3f amp. \" %Io)\n",
+ "print(\"therefore Relay will not operate \")"
],
"language": "python",
"metadata": {},
@@ -265,8 +256,9 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- " suitable speed up capacitor is 166pF \n",
- "maximum signal frequency is 235.85 Hz \n"
+ "operating current=0.625 amp. \n",
+ "since current through operating coil is 0.500 amp. \n",
+ "therefore Relay will not operate \n"
]
}
],
@@ -277,7 +269,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.9, Page No 330"
+ "Example 14.7 Page No 403"
]
},
{
@@ -286,27 +278,13 @@ "input": [
"import math\n",
"#initialisation of variables\n",
- "R1=30.0*10**3\n",
- "R2=30.0*10**3\n",
- "rs=30.0*10**3\n",
- "f2=40.0*10**3\n",
- "f1=100.0\n",
- "k=1.37*10**-23\n",
- "R=10.0*10**3\n",
- "Av=600.0\n",
- "Ri=3.0*10**3\n",
+ "Il=400*6.6/33.0\t\t# line current on star side of PT(amps)\n",
"\n",
"#Calculations\n",
- "Rb=(R1*R2)/(R1+R2)\n",
- "Rg=(rs*Rb)/(rs+Rb)\n",
- "T=(273+25)\n",
- "B=f2-f1\n",
- "en=math.sqrt(4*k*T*B*R)\n",
- "eni=en*((Ri/(Ri+Rg)))\n",
- "eno=(Av*eni)*10**6\n",
+ "Ic=5/math.sqrt(3.0)\t\t# current in CT secondary \n",
"\n",
"#Results\n",
- "print(\"noise output voltage is %.2f uV \" %eno)"
+ "print(\" The CT ratio on HT will be %d : %.3f\" %(Il,Ic))"
],
"language": "python",
"metadata": {},
@@ -315,7 +293,7 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- "noise output voltage is 353.44 uV \n"
+ " The CT ratio on HT will be 80 : 2.887\n"
]
}
],
@@ -326,27 +304,24 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.10 Page No 331"
+ "Example 14.8, Page No 404"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
- "import math \n",
- "\n",
+ "import math\n",
"#initialisation of variables\n",
- "Ic=30.0*10**-6\n",
- "Vce=5.0\n",
- "eno=354.0*10**-6\n",
- "NF=10.0\n",
- "F=2.51#F=antilog(NF/10)\n",
+ "Il=10000.0/((math.sqrt(3.0))*132)\n",
+ "ILV=10000/((math.sqrt(3.0))*6.6)\n",
"\n",
"#Calculations\n",
- "Vn=((math.sqrt(F))*eno)*10**6\n",
+ "a=5.0/math.sqrt(3.0)\n",
"\n",
"#Results\n",
- "print(\"total noise output volateg for amplifier is %.2f uV \" %Vn)"
+ "print(\"Ratio of CT on LV side is %.3f : %.3f\" %(ILV,a))\n",
+ "print(\"Ratio of CT on HT side is %.3f : %d\" %(Il,5))"
],
"language": "python",
"metadata": {},
@@ -355,7 +330,8 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- "total noise output volateg for amplifier is 560.84 uV \n"
+ "Ratio of CT on LV side is 874.773 : 2.887\n",
+ "Ratio of CT on HT side is 43.739 : 5\n"
]
}
],
@@ -366,7 +342,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.11 Page No 333"
+ "Example 14.9 Page No 404"
]
},
{
@@ -375,18 +351,22 @@ "input": [
"import math\n",
"#initialisation of variables\n",
- "Pd25=625.0*10**-3\n",
- "D=5.0*10**-3\n",
- "Vce=10.0\n",
- "T2=55.0\n",
+ "Vs=110.0\n",
+ "I=1.0\n",
"\n",
"#Calculations\n",
- "Pdt2=Pd25-D*(T2-25)\n",
- "Pd=Pdt2\n",
- "Ic=Pd/Vce\n",
+ "R2=Vs/(complex(3, -math.sqrt(3))*I)\n",
+ "c=abs(R2)\n",
+ "print(\"R2=%.2f ohms\" %c)\n",
+ "R1=2*c\n",
+ "d=abs(R1)\n",
+ "C=(10**6)/(0.866*d*314)\n",
+ "print(\"R1=%.2f ohms \" %R1)\n",
+ "print(\"C=%.1f micro farads \" %C)\n",
+ "Vt=d*complex(-0.5,-0.866) + complex(c,-55 )\n",
"\n",
"#Results\n",
- "print(\" maximum Ic level is %.2fA \" %(Ic*1000))\n"
+ "print(\" Voltage across the terminals of the relay will be (V)= {0:.5f}+{1:.5f}i\" .format(Vt.real, Vt.imag))"
],
"language": "python",
"metadata": {},
@@ -395,7 +375,10 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- " maximum Ic level is 47.50A \n"
+ "R2=31.75 ohms\n",
+ "R1=63.51 ohms \n",
+ "C=57.9 micro farads \n",
+ " Voltage across the terminals of the relay will be (V)= 0.00000+-109.99839i\n"
]
}
],
@@ -406,7 +389,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.13 Page No 335"
+ "Example 14.10 Page No 272"
]
},
{
@@ -414,25 +397,20 @@ "collapsed": false,
"input": [
"import math\n",
- "\n",
"#initialisation of variables\n",
- "Pd=80.0\n",
- "Vce=60.0\n",
+ "Ic=5*0.25\t\t# operating current(amp)\n",
+ "Vsec=5.0/1.25\t# secondary voltage(V)\n",
+ "Bm=1.4\n",
+ "f=50\n",
+ "N=50\n",
"\n",
"#Calculations\n",
- "Ic=Pd/Vce\n",
- "print(\"point 1 Vce=60 and Ic= %.2f A\" %Ic)\n",
- "Vce=40.0\n",
- "Ic=Pd/Vce\n",
- "print(\"point 2 Vce=40 and Ic= %.2f A\" %Ic)\n",
- "Vce=20.0\n",
- "Ic=Pd/Vce\n",
- "print(\" point 3 Vce=20 and Ic= %.2f A\" %Ic)\n",
- "Vce=10.0\n",
- "Ic=Pd/Vce\n",
+ "V=15*Vsec\n",
+ "A=60/(4.44*Bm*f*N)\n",
"\n",
"#Results\n",
- "print(\" point 4 Vce=10 and Ic= %.2f A\" %Ic)\n"
+ "print(\"The knee point must be slightly higher than =%.3f V \" %V)\n",
+ "print(\"Area of cross section=%.6f m_2 \" %A)"
],
"language": "python",
"metadata": {},
@@ -441,10 +419,8 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- "point 1 Vce=60 and Ic= 1.33 A\n",
- "point 2 Vce=40 and Ic= 2.00 A\n",
- " point 3 Vce=20 and Ic= 4.00 A\n",
- " point 4 Vce=10 and Ic= 8.00 A\n"
+ "The knee point must be slightly higher than =60.000 V \n",
+ "Area of cross section=0.003861 m_2 \n"
]
}
],
@@ -455,7 +431,7 @@ "level": 2,
"metadata": {},
"source": [
- "Example 8.14, Page No 339"
+ "Example 14.11 Page No 273"
]
},
{
@@ -463,21 +439,13 @@ "collapsed": false,
"input": [
"import math\n",
- "\n",
"#initialisation of variables\n",
- "Vce=20.0\n",
- "Ic=1.0\n",
- "T2=90.0\n",
- "T1=25.0\n",
"\n",
"#Calculations\n",
- "Q=Vce*Ic\n",
- "Qcs=.4\n",
- "Qjc=1#from table\n",
- "Qsa=((T2-T1)/Q)-(Qjc+Qcs)\n",
+ "o_p=5*5*(.1+.1) +5\n",
"\n",
"#Results\n",
- "print(\"Qsa= %.2f \" %Qsa)"
+ "print(\" VA output of CT =%.0f VA\\n \" %o_p)\n"
],
"language": "python",
"metadata": {},
@@ -486,7 +454,8 @@ "output_type": "stream",
"stream": "stdout",
"text": [
- "Qsa= 1.85 \n"
+ " VA output of CT =10 VA\n",
+ " \n"
]
}
],
diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter15.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter15.ipynb new file mode 100755 index 00000000..f6a5df58 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter15.ipynb @@ -0,0 +1,238 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : Circuit Breakers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.1, Page No 486"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "i=5.0\n",
+ "L=5*(10**6)\n",
+ "C=0.01\n",
+ "\n",
+ "#Calculations\n",
+ "e=i*math.sqrt(L/C)\n",
+ "\n",
+ "#Results\n",
+ "print(\"The voltage appearing across the pole of C.B.=%.2f V \" %e)\n",
+ "R=0.5*math.sqrt(L/C)\n",
+ "print(\"The value of resistance to be used across contacts, R=%.2f ohms\" %R)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage appearing across the pole of C.B.=111803.40 V \n",
+ "The value of resistance to be used across contacts, R=11180.34 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.2, Page No 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Vnl=132*math.sqrt(2)/math.sqrt(3) #peak value of peak to neutral voltage(kV)\n",
+ "Vr1=Vnl*.95 #recovery voltage (kV)\n",
+ "\n",
+ "#Calculations\n",
+ "Vr=102.4*.916 # active recovery voltage(kV)\n",
+ "Vrmax=2.0*Vr\n",
+ "fn=16.0*(10**3)\n",
+ "t=1.0/(2*fn)\n",
+ "RRRV=Vrmax*(10**-6)/t\n",
+ "\n",
+ "#Results\n",
+ "print(\"Rate of rise of restriking voltage, RRRV = %.0f kV/micro-sec \" %RRRV)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of rise of restriking voltage, RRRV = 6 kV/micro-sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.3, Page No 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Vm=132*math.sqrt(2)/math.sqrt(3)\n",
+ "K1=0.9\n",
+ "K2=1.5\n",
+ "K=K1*K2\n",
+ "sinq=0.92\n",
+ "\n",
+ "#Calculations\n",
+ "Vr=K*Vm*sinq\n",
+ "fn=16*(10**3)\n",
+ "RRRV=2*Vr*(10**-6)*fn*2\n",
+ "\n",
+ "#Results\n",
+ "print(\"Average rate of rise of restriking voltage,RRRV=%.3f kV/micro-sec\" %RRRV)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average rate of rise of restriking voltage,RRRV=8.567 kV/micro-sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.4 Page No 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "In=1500.0\n",
+ "\n",
+ "#Calculations\n",
+ "Ib=2000/(math.sqrt(3.0)*33.0)\n",
+ "Im=2.55*Ib\n",
+ "Is=Ib\n",
+ "\n",
+ "#Results\n",
+ "print(\"rated normal current=%.0f amps\" %In)\n",
+ "print(\"Breaking current=%.2f KA\" %Ib)\n",
+ "print(\"Making current =%.2f kA\" %Im)\n",
+ "print(\"Short time rating for 3 sec=%.2f kA \" %Is)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rated normal current=1500 amps\n",
+ "Breaking current=34.99 KA\n",
+ "Making current =89.23 kA\n",
+ "Short time rating for 3 sec=34.99 kA \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.5, Page No 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "MVA=10.0\n",
+ "Is=MVA*1000/(math.sqrt(3)*13.8)\n",
+ "print(\"(i)sustained short circuit current in the breaker =%.0f amps\" %Is)\n",
+ "MVA1=100.0\n",
+ "Isc=MVA1*1000.0/(math.sqrt(3)*13.8)\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"(ii)initial symmetrical r.m.s current in the breaker r.m.s=%.0f amps\" %Isc)\n",
+ "Im=math.sqrt(2)*Isc\n",
+ "print(\"(iii)maximum possible d.c component of the short circuit current in the breaker =%.0f amps\" %Im)\n",
+ "Im2=1.6*Isc\n",
+ "print(\"(iv)momentary current rating of the breaker=%.0f amps\" %Im2)\n",
+ "Ib=1.2*Isc\n",
+ "print(\"(v)the current to be interrupted by the breaker =%.0f amps\" %Ib)\n",
+ "KVA=math.sqrt(3)*13.8*5016\n",
+ "\n",
+ "#Results\n",
+ "print(\"(vi)the interupting =%.0f KVA\"%KVA)\n",
+ "#Answers don't match due to difference in rounding off of digits"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)sustained short circuit current in the breaker =418 amps\n",
+ "(ii)initial symmetrical r.m.s current in the breaker r.m.s=4184 amps\n",
+ "(iii)maximum possible d.c component of the short circuit current in the breaker =5917 amps\n",
+ "(iv)momentary current rating of the breaker=6694 amps\n",
+ "(v)the current to be interrupted by the breaker =5020 amps\n",
+ "(vi)the interupting =119894 KVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter17.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter17.ipynb new file mode 100755 index 00000000..1abe533b --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter17.ipynb @@ -0,0 +1,448 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17 : Power System Synchronous Stability"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.1, Page No 542"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "H=9.0\n",
+ "G=20.0\t\t# machine Rating(MVA)\n",
+ "KE=H*G\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"(a)K.E stored in the rotor =%.0f MJ \" %KE)\n",
+ "Pi=25000*.735\n",
+ "PG=15000.0\n",
+ "Pa=(Pi-PG)/(1000.0)\n",
+ "f=50.0\n",
+ "M=G*H/(math.pi*f)\n",
+ "a=Pa/M\n",
+ "print(\"(b) The accelerating power =%.3f MW \" %Pa)\n",
+ "print(\"Acceleration =%.3f rad/sec_2\" %a)\n",
+ "t=15.0/50\n",
+ "dele=math.sqrt(5.89)*t/2\n",
+ "Del=dele**2\n",
+ "k=2.425*math.sqrt(Del)*60/4*math.pi\n",
+ "speed=1504.2\n",
+ "\n",
+ "#Results\n",
+ "print(\"(c)Rotor speed at the end of 15 cycles = %.1f r.p.m\" %speed)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)K.E stored in the rotor =180 MJ \n",
+ "(b) The accelerating power =3.375 MW \n",
+ "Acceleration =2.945 rad/sec_2\n",
+ "(c)Rotor speed at the end of 15 cycles = 1504.2 r.p.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.2, Page No 545"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V1=1.1\n",
+ "V2=1\n",
+ "X=.5\n",
+ "cosdo=0.8\n",
+ "G=1.0\n",
+ "H=3.0\n",
+ "f=50.0\n",
+ "\n",
+ "#Calculations\n",
+ "M=G*H/(math.pi*f)\n",
+ "dPe=V1*V2*cosdo/X\n",
+ "fn=(((dPe)/M)**.5)/6.28\n",
+ "sind0=0.75\n",
+ "d0=math.degrees(math.asin(sind0))\n",
+ "dPe2=V1*V2*math.cos(math.radians(d0))/X\n",
+ "fn2=(((dPe2)/M)**.5)/6.28\n",
+ "\n",
+ "#Results\n",
+ "print(\"(i)fn=%.2f Hz \" %fn)\n",
+ "print(\"(i)fn(Hz)=%.2f Hz \" %fn2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)fn=1.53 Hz \n",
+ "(i)fn(Hz)=1.39 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.3, Page No 551"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "a=0.25\t\t#sindo=.25\n",
+ "do=math.degrees(math.asin(a))\t#\n",
+ "b=0.5\t\t#sindc=.5\n",
+ "\n",
+ "#Calculations\n",
+ "dc=math.degrees(math.asin(b))\n",
+ "c=math.cos(math.radians(do))+.5*do*math.pi/180.0\n",
+ "dm=dc\n",
+ "e=1\n",
+ "while e >.0001 :\n",
+ " dm=dm+.1\n",
+ " e=abs(c-(((.5*dm*math.pi)/180)+math.cos(math.radians(dm))))\n",
+ "\t\n",
+ "#Results\n",
+ "print(\"dm approximately found to be %d degree\" %dm)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dm approximately found to be 46 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.4 Page No 551"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "sindo=.5\n",
+ "d0=math.degrees(math.asin(sindo))*math.pi/180.0\n",
+ "r1=.2\n",
+ "r2=.75\n",
+ "\n",
+ "#Calculations\n",
+ "sindm=.5/.75\n",
+ "d=math.degrees(math.asin(sindm))\n",
+ "cosdm=math.cos(math.radians(d))\n",
+ "dm=math.pi*(180-(math.degrees(math.asin(sindm))))/180\n",
+ "Dc=((.5*(dm-d0))-(r2*cosdm)-(r1*math.cos(math.radians(d0))))/(r2-r1)\n",
+ "dc=math.degrees(math.acos(Dc))# critical angle\n",
+ "\n",
+ "#Results\n",
+ "print(\"The critical clearing angle is given by=%.2f degrees\" %dc)#Answers don't match due to difference in rounding off of digits"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The critical clearing angle is given by=70.33 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.5, Page No 552"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "ZA=0.375\n",
+ "ZB=0.35\n",
+ "ZC=0.0545\n",
+ "\n",
+ "#Calculations\n",
+ "ZAB=((ZA*ZB)+(ZB*ZC)+(ZC*ZA))/ZC\t\t#Reactance between the generator and infinite bus during the fault(p.u)\n",
+ "Zgbf=complex(0.3)+ complex(0.55/2) + complex(.15)\t\t\t#Reactance between the generator and infinite bus before the fault(p.u)\n",
+ "Zgb=complex(0.3)+ complex(0.55) + complex(.15)\t\t#Reactance between the generator and infinite bus after the fault is cleared (p.u)\n",
+ "Pmaxo=1.2*1.0/abs(Zgbf)# Maximum power output Before the fault(p.u)\n",
+ "Pmax1=1.2*1.0/abs(ZAB)# Maximum power output during the fault(p.u)\n",
+ "Pmax2=1.2*1.0/abs(Zgb)# Maximum power output after the fault(p.u)\n",
+ "r1=Pmax1/Pmaxo\n",
+ "r2=Pmax2/Pmaxo\n",
+ "Ps=1.0\n",
+ "sindo=Ps/Pmaxo\n",
+ "do=math.degrees(math.asin(sindo))\n",
+ "d0=math.degrees(math.asin(sindo))*math.pi/180\n",
+ "sindm=1/Pmax2\n",
+ "cosdm=math.cos(math.radians((math.degrees(math.asin(sindm)))))\n",
+ "Dm=math.pi*(180-(math.degrees(math.asin(sindm))))/180\n",
+ "Dc=(((sindo*(Dm-d0))-(r2*cosdm))-(r1*math.cos(math.radians(do))))/(r2-r1)\n",
+ "dc=math.degrees(math.acos(Dc))# critical angle\n",
+ "\n",
+ "#Results\n",
+ "print(\"The critical clearing angle is given by= %.1f \" %dc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The critical clearing angle is given by= 48.7 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.6, Page No 558"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Pm=complex(0.12) + complex(0.035) + ((complex(.25)*complex(0.3))/complex(0.55))\n",
+ "Pm1=0\n",
+ "Pm2=1.1*1/.405\n",
+ "r1=0\n",
+ "\n",
+ "#Calculations\n",
+ "r2=2.716/3.775\n",
+ "d0=(math.degrees(math.asin(1/3.775)))\n",
+ "dM=(180-math.degrees(math.asin(1/2.716)))\n",
+ "do=d0*math.pi/180\n",
+ "dm=dM*math.pi/180\n",
+ "dc=math.degrees(math.acos((((dm-do)*math.sin(math.radians(d0)))-(r1*math.cos(math.radians(d0)))+(r2*math.cos(math.radians(dM))))/(r2-r1)))\n",
+ "\n",
+ "#Results\n",
+ "print(\"dc=%.2f\" %dc)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc=90.61\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.7 Page No 572"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Pc=0\n",
+ "V=0.98\n",
+ "\n",
+ "#Calculations\n",
+ "Qc=V**2*((1/.4)-(1/1.1))/2\n",
+ "R=V**2*((1/.4)+(1/1.1))/2\n",
+ "Q=-(.98**2*((1.1-.4)/.44)/2) + (.98**2)*1.5/(2*.44)\n",
+ "\n",
+ "#Results\n",
+ "print(\"(i)Q=%.2f MVAr\" %(abs(Q)*100))\n",
+ "P=0.25\n",
+ "Q2=-((1.637**2)-(.25**2))**.5 + .7639\n",
+ "print(\"(ii)Q=%.4f p.u\" %Q2)\n",
+ "Q3=-((1.637**2)-(.5**2))**.5 + .7639\n",
+ "print(\"(iii)Q=%.4f p.u\" %Q3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Q=87.31 MVAr\n",
+ "(ii)Q=-0.8539 p.u\n",
+ "(iii)Q=-0.7949 p.u\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.10 Page No 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Pm=3.0\n",
+ "r1Pm=1.2\n",
+ "r2Pm=2\n",
+ "H=3\n",
+ "f=60\n",
+ "Dt=.02\n",
+ "Pe=1.5\n",
+ "Do=math.degrees(math.asin(1.5/3))\n",
+ "do=Do/57.33\n",
+ "wo=0\n",
+ "d=0\n",
+ "K10=0\n",
+ "\n",
+ "#Calculations\n",
+ "l10=62.83*(1.5-1.2*math.sin(do))*.02\n",
+ "K20=(377.5574-376.992)*.02\n",
+ "l20=62.83*(1.5-1.2*math.sin(do))*.02\n",
+ "K30=(377.5574-376.992)*.02\n",
+ "l30=62.83*(1.5-1.2*math.sin(.5296547))*.02\n",
+ "K40=l30*0.02\n",
+ "l40=62.83*(1.5-1.2*math.sin(.5353094))*.02\n",
+ "d1=.53528\n",
+ "Dwo=(3*1.13094+2*1.123045+1.115699)/6\n",
+ "w1=wo+Dwo\n",
+ "d1=.53528\n",
+ "print(\"Runga-Kutta method-\\n\")\n",
+ "print(\"w1=%.6f \\nd1=%.5f\\n\" %(w1,d1))\n",
+ "d7=1.026\n",
+ "w7=6.501\n",
+ "wp=376.992+6.501\n",
+ "K17=(wp-376.992)*0.02\n",
+ "l17=62.83*(1.5-1.2*math.sin(1.026))*.02\n",
+ "K27=(6.501+.297638)*0.02\n",
+ "l27=62.83*(1.5-1.2*math.sin(1.09101))*.02\n",
+ "K37=(6.501+.2736169)*0.02\n",
+ "l37=62.83*(1.5-1.2*math.sin(1.0939863))*.02\n",
+ "K47=(6.501+.545168)*0.02\n",
+ "l47=62.83*(1.5-1.2*math.sin(1.16149))*.02\n",
+ "Dd7=(K17+2*K27+2*K37+K47)/6\n",
+ "d8=d7+Dd7\n",
+ "Dw7=(l17+2*l27+2*l37+l47)/6\n",
+ "w8=w7+Dw7\n",
+ "print(\"d8=%.5f rad.\\nw8=%.4frad/sec\\n\\n\" %(d8,w8))\n",
+ "print(\"using Euler`s Modified Method-\\n\")\n",
+ "d0=0\n",
+ "d10=.524\n",
+ "w=62.83*(1.5-1.2*math.sin(.524))\n",
+ "d11=d10+0\n",
+ "w11=w*.02\n",
+ "d=1.13094\n",
+ "dav=(0+d)/2\n",
+ "wav=(56.547+56.547)/2\n",
+ "d01=.524+.56547*.02\n",
+ "w11=0+56.547*0.02\n",
+ "\n",
+ "#Results\n",
+ "print(\"d01=%.4f\\nw11=%.5f\" %(d01,w11))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Runga-Kutta method-\n",
+ "\n",
+ "w1=1.125768 \n",
+ "d1=0.53528\n",
+ "\n",
+ "d8=1.16165 rad.\n",
+ "w8=7.0479rad/sec\n",
+ "\n",
+ "\n",
+ "using Euler`s Modified Method-\n",
+ "\n",
+ "d01=0.5353\n",
+ "w11=1.13094\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter18.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter18.ipynb new file mode 100755 index 00000000..379c3e7a --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter18.ipynb @@ -0,0 +1,326 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 : Load Flows"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.1, Page No 605"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "#initialisation of variables\n",
+ "Y=[[complex(3,-12),complex(-2,8),complex(-1,4),0],\n",
+ " [complex(-2,8), complex(3.666,-14.664), complex(-0.666,2.6664),complex(-1,4)],\n",
+ " [complex(-1,4), complex(-0.666,2.6664), complex(3.666,-14.664), complex(-2,8)],\n",
+ " [0,complex(-1,4), complex(-2,8),complex(3,-12)]]\n",
+ "P2=-.5\n",
+ "P3=-.4\n",
+ "P4=-.3\n",
+ "Q4=-.1\n",
+ "Q3=-.3\n",
+ "Q2=-.2\n",
+ "V2=1.0\n",
+ "V3=1.0\n",
+ "V4=1.0\n",
+ "V10=1.06\n",
+ "V30=1.0\n",
+ "V40=1\n",
+ "\n",
+ "#Calculations\n",
+ "V21=(((complex(P2,-Q2))/V2)-Y[2][1]*V10-Y[1][2]*V30-Y[1][3]*V40)/(Y[1][1])\n",
+ "V21acc=1+1.6*(V21-1)\n",
+ "print(\"V21acc= {0:.5f}{1:.5f}i\".format(V21acc.real, V21acc.imag))\n",
+ "V31=((complex(P3,-Q3)/V3)-Y[2][0]*V10-Y[2][1]*V21acc-Y[2][3]*V40)/(Y[2][2])\n",
+ "V31acc=1+1.6*(V31-1)\n",
+ "print(\"V31acc= {0:.5f}{1:.5f}i\".format(V31acc.real, V31acc.imag))\n",
+ "V41=((complex(P4,-Q4)/V4)-Y[3][1]*V21acc-Y[3][2]*V31acc)/(Y[3][3])\n",
+ "V41acc=1+1.6*(V41-1)\n",
+ "\n",
+ "#Results\n",
+ "print(\"V41acc= {0:.5f}{1:.5f}i\".format(V41acc.real, V41acc.imag))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V21acc= 0.40236-0.04634i\n",
+ "V31acc= 0.81149-0.04688i\n",
+ "V41acc= 0.45822-0.10923i\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.2, Page No 606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "\n",
+ "Y=[[complex(3,-12),complex(-2,8),complex(-1,4),0],[complex(-2,8),complex(3.666,14.664),complex(-0.666,2.6664),complex(-1,4)],[complex(-1,4), complex(-.666,2.6664),complex(3.666,-14.664),complex(-2,8)],[0,complex(-1,4),complex(-2,8), complex(3,-12)]]\n",
+ "P2=.5\n",
+ "P3=-.4\n",
+ "P4=-.3\n",
+ "Q4=-.1\n",
+ "Q3=-.3\n",
+ "V3=1\n",
+ "V4=1\n",
+ "V1=1.06\n",
+ "V2=1.04\n",
+ "V30=1\n",
+ "V40=1\n",
+ "\n",
+ "#Calculations\n",
+ "Q2=-((V2*(Y[1][0]*V1+Y[1][1]*V2+Y[1][2]*V3+Y[1][3]*V4))).imag\n",
+ "V21=((complex(P2,-Q2)/V2)-Y[1][0]*V1-Y[1][2]*V30-Y[1][3]*V40)/(Y[1][1])\n",
+ "d=math.degrees(math.atan(0.0291473/1.0472868))\n",
+ "V21=1.04*complex(math.cos(math.radians(d)),math.sin(math.radians(d)))\n",
+ "\n",
+ "#Results\n",
+ "print(\"The value of V21 is= {0:.5f}+{1:.5f}i\".format(V21.real, V21.imag))\n",
+ "V31=((complex(P3,-Q3)/V3)-Y[2][0]*V1-Y[2][1]*V21-Y[2][3]*V40)/(Y[2][2])\n",
+ "print(\"The value of V31 is= {0:.5f}+{1:.5f}i\".format(V31.real, V31.imag))\n",
+ "V41=((complex(P4,-Q4)/V4)-Y[3][1]*V21-Y[3][2]*V31)/Y[3][3]\n",
+ "print(\"The value of V41 is= {0:.5f}+{1:.5f}i\".format(V41.real, V41.imag))\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V21 is= 1.03960+0.02893i\n",
+ "The value of V31 is= 0.99805+-0.01564i\n",
+ "The value of V41 is= 0.99817+-0.02235i\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.3, Page No 607"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "\n",
+ "Y=[[complex(3,-12),complex(-2,8),complex(-1,4),0],[complex(-2,8),complex(3.666,14.664),complex(-0.666,2.6664),complex(-1,4)],[complex(-1,4), complex(-.666,2.6664),complex(3.666,-14.664),complex(-2,8)],[0,complex(-1,4),complex(-2,8), complex(3,-12)]]\n",
+ "P2=.5\n",
+ "P3=-.4\n",
+ "P4=-.3\n",
+ "Q4=-.1\n",
+ "Q3=-.3\n",
+ "V3=1\n",
+ "V4=1\n",
+ "V1=1.06\n",
+ "V2=1\n",
+ "V30=1\n",
+ "V40=1\n",
+ "Q2=.2\n",
+ "V3=1\n",
+ "\n",
+ "#Calculations\n",
+ "V21=((complex(P2,-Q2)/V2)-Y[1][0]*V1-Y[1][2]*V30-Y[1][3]*V40)/(Y[1][1])\n",
+ "V31=((complex(P3,-Q3)/V3)-Y[2][0]*V1-Y[2][1]*V21-Y[2][3]*V40)/(Y[2][2])\n",
+ "V41=((complex(P4,-Q4)/V4)-Y[3][1]*V21-Y[3][2]*V31)/Y[3][3]\n",
+ "\n",
+ "#Results\n",
+ "print(\"The value of V21 is= {0:.5f}+{1:.5f}i\".format(V21.real, V21.imag))\n",
+ "print(\"The value of V31 is= {0:.5f}+{1:.5f}i\".format(V31.real, V31.imag))\n",
+ "print(\"The value of V41 is= {0:.5f}+{1:.5f}i\".format(V41.real, V41.imag))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V21 is= -0.91620+-0.52133i\n",
+ "The value of V31 is= 0.64242+-0.11561i\n",
+ "The value of V41 is= 0.10915+-0.27242i\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.4 Page No 615"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V1=1.06\n",
+ "G11=6.25\n",
+ "G12=-1.25\n",
+ "G21=G12\n",
+ "G13=-5\n",
+ "G31=G13\n",
+ "G22=2.916\n",
+ "G23=-1.666\n",
+ "G32=G23\n",
+ "G33=6.666\n",
+ "B11=18.75\n",
+ "B12=-3.75\n",
+ "B21=B12\n",
+ "B13=-15\n",
+ "B31=B13\n",
+ "B22=8.75\n",
+ "B23=-5\n",
+ "B32=B23\n",
+ "B33=20\n",
+ "e1=1.06\n",
+ "e2=1\n",
+ "e3=1\n",
+ "f1=0\n",
+ "f2=0\n",
+ "f3=0\n",
+ "\n",
+ "#Calculations\n",
+ "P2=e2*(e1*G21+f1*B21) +f2*(f1*G21-e1*B21) +e2*(e2*G22+f2*B22)+f2*(f2*G22-e2*B22)+e2*(e3*G23+f3*B23)+f2*(f3*G23-e3*B23)\n",
+ "P3=-.3\n",
+ "Q2=-.225\n",
+ "Q3=-.9\n",
+ "dP2=.2-(-.225)\n",
+ "dP3=-.6-(-.3)\n",
+ "dQ2=0-(-.225)\n",
+ "dQ3=-.25-(-.9)\n",
+ "a1=2*e2*G22+e1*G21+f1*B21+e3*G23+f3*B23#a1=dP2/de2\n",
+ "a2=2*e3*G33+e1*G31+f1*B31+e3*G32+f2*B32#a2=dP3/de3\n",
+ "b1=2*f2*G22 +f1*G21-e1*B21+f3*G23-e3*B23#b1=dP2/df2\n",
+ "b2=20.9#dP3/df3\n",
+ "a3=e2*G23-f2*B23#dP2/de3\n",
+ "a4=-1.666\t\t#dP3/de2\n",
+ "b3=-5\t\t\t#dP2/df3\n",
+ "b4=-5\t\t\t#dP3/df2\n",
+ "c1=2*e2*B22-f1*G21+e1*B21-f3*G23+e3*B23#dQ2/de2\n",
+ "c2=19.1\t\t\t#dQ3/de3\n",
+ "c3=-2.991\t\t#dQ2/df2\n",
+ "c4=-6.966\t\t#dQ3/df3\n",
+ "\n",
+ "#Results\n",
+ "print(\"set of linear equations at the end of first iteration are\")\n",
+ "print(\"%.3fde2 %.3fde3+ %.3fdf2 %.3fdf3 = %.3f\" %(2.846,-1.666,8.975,-5,2.75))\n",
+ "print(\"%.3fde2 +%.3fde3 %.3fdf2 +%.3fdf3 = %.3f\" %(-1.666,6.366,-5,20.90,-.3))\n",
+ "print(\"%.3fde2 %.3fde3 %.3fdf2 +%.3fdf3 = %.3f\" %(8.525,-5,-2.991,1.666,.225))\n",
+ "print(\"%.3fde2 +%.3fde3+ %.3fdf2 %.3fdf3 = %.3f\" %(-5,19.1,1.666,-6.966,.65))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "set of linear equations at the end of first iteration are\n",
+ "2.846de2 -1.666de3+ 8.975df2 -5.000df3 = 2.750\n",
+ "-1.666de2 +6.366de3 -5.000df2 +20.900df3 = -0.300\n",
+ "8.525de2 -5.000de3 -2.991df2 +1.666df3 = 0.225\n",
+ "-5.000de2 +19.100de3+ 1.666df2 -6.966df3 = 0.650\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.5, Page No 617"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Q2=-0.225\n",
+ "dP2=0.2-(-.075)\n",
+ "dP3=-0.6-(-0.3)\n",
+ "dQ3=-0.25-(-0.9)\n",
+ "\n",
+ "#Calculations\n",
+ "dV2=1.04**2 - 1**2 #dV2=|dV2|^2\n",
+ "\n",
+ "#Results\n",
+ "print(\"set of linear equations at the end of first iteration are\")\n",
+ "print(\"%.3fde2 %.3fde3+ %.3fdf2 %.3fdf3 = %.3f\" %(2.846,-1.666,8.975,-5,2.75))\n",
+ "print(\"%.3fde2 +%.3fde3 %.3fdf2 +%.3fdf3 = %.3f\" %(-1.666,6.366,-5,20.90,-.3))\n",
+ "print(\"%.3fde2 %.3fde3 %.3fdf2 +%.3fdf3 = %.3f\" %(8.525,-5,-2.991,1.666,.225))\n",
+ "print(\"%.3fde2 +%.3fde3+ %.3fdf2 +%.3fdf3 = %.5f\" %(2,0,0,0,dV2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "set of linear equations at the end of first iteration are\n",
+ "2.846de2 -1.666de3+ 8.975df2 -5.000df3 = 2.750\n",
+ "-1.666de2 +6.366de3 -5.000df2 +20.900df3 = -0.300\n",
+ "8.525de2 -5.000de3 -2.991df2 +1.666df3 = 0.225\n",
+ "2.000de2 +0.000de3+ 0.000df2 +0.000df3 = 0.08160\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter19.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter19.ipynb new file mode 100755 index 00000000..795f9912 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter19.ipynb @@ -0,0 +1,178 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 19 : Economic Load Dispatch"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.1, Page No 643"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy as np\n",
+ "#initialisation of variables\n",
+ "#dF1/dP1=.4*P1+40 per MWhr\n",
+ "#dF2/dP2=.5*P1+30 per MWhr\n",
+ "print(\"Two equations are :\")\n",
+ "print(\"%.1f P1 %.1f P2 = %.1f\\n\" %(.4,-.5,-10))\n",
+ "print(\"%.1f P1+ %.1fP2 = %.1f\\n\" %(1,1,180))\n",
+ "A=[[.4,1],[-.5,1]]\n",
+ "B=[-10,180]\n",
+ "P1=88.89\n",
+ "P2=91.11\n",
+ "\n",
+ "#Calculations\n",
+ "F1=.2*(P1)**2 +40*P1+120\n",
+ "F2=.25*(P2)**2+30*P2+150\n",
+ "Total=F1+F2\t\t\t#Total cost\n",
+ "print(\"(a)Cost of Generation=Rs %.2f /hr\\n\" %Total)\n",
+ "P1=90\n",
+ "P2=90\n",
+ "F1=.2*(P1)**2 +40*P1+120\n",
+ "F2=.25*(P2)**2+30*P2+150\n",
+ "Total2=F1+F2\t\t#Total cost\n",
+ "savings=Total2-Total\n",
+ "\n",
+ "#Results\n",
+ "print(\"(b)Savings=Rs %.2f /hr\\n\" %savings)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Two equations are :\n",
+ "0.4 P1 -0.5 P2 = -10.0\n",
+ "\n",
+ "1.0 P1+ 1.0P2 = 180.0\n",
+ "\n",
+ "(a)Cost of Generation=Rs 10214.44 /hr\n",
+ "\n",
+ "(b)Savings=Rs 0.56 /hr\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.2, Page No 643"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "pf=10.0/8 #penalty factor\n",
+ "\n",
+ "#Calculations\n",
+ "cost=(.1*10+3)*pf\t\t#Cost of recieved power=dF1/dP1\n",
+ "\n",
+ "#Results\n",
+ "print(\"Penalty Factor = %.1f\" %pf)\n",
+ "print(\"Cost of recieved Power = Rs %.1f /MWhr\" %cost)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Penalty Factor = 1.2\n",
+ "Cost of recieved Power = Rs 5.0 /MWhr\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.4, Page No 645"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "print(\"two equations are :\")\n",
+ "print(\"%.3f P1 %.2f P2 = %.1f\" %(0.048,-.08,-2))\n",
+ "print(\"%.1f P1+ %.1fP2 = %.1f\" %(1,1,50))\n",
+ "\n",
+ "#Calculations\n",
+ "A=[[.048,-.08],[1,1]]\n",
+ "B=[-2,50]\n",
+ "P1=15.625\n",
+ "P2=34.38\n",
+ "F1=(.024*(P1)**2 +8*P1+80)*(10**6)\n",
+ "F2=(.04*(P2)**2+6*P2+120)*(10**6)\n",
+ "print(\"when load is 150MW , equations are: :\")\n",
+ "print(\"%.3f P1 %.2f P2 = %.1f\" %(.048,-.08,-2))\n",
+ "print(\"%.1f P1+ %.1fP2 = %.1f\" %(1,1,150))\n",
+ "A=[[.048,-.08],[1,1]]\n",
+ "B=[-2,150]\n",
+ "P1=78.125\n",
+ "P2=71.88\n",
+ "f1=(.024*(P1)**2 +8*P1+80)*(10**6)\n",
+ "f2=(.04*(P2)**2+6*P2+120)*(10**6)\n",
+ "Total=(F1+F2+f1+f2)*12*2/(10**6)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Total cost=Rs. %.2f\" %(Total))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "two equations are :\n",
+ "0.048 P1 -0.08 P2 = -2.0\n",
+ "1.0 P1+ 1.0P2 = 50.0\n",
+ "when load is 150MW , equations are: :\n",
+ "0.048 P1 -0.08 P2 = -2.0\n",
+ "1.0 P1+ 1.0P2 = 150.0\n",
+ "Total cost=Rs. 52652.46\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter20.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter20.ipynb new file mode 100755 index 00000000..c307f665 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter20.ipynb @@ -0,0 +1,132 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 20 : Load Frequency Control"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.1, Page No 676"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "#let x MW flows from A to B\n",
+ "#Load on station A=75+x\n",
+ "#%drop in speed =5*(75+x)/200\n",
+ "#load on station B =(30-x)\n",
+ "#%drp in speed=(30-x)*4/75\n",
+ "x=(1.6-1.875)/(.025+.12+.0533) #by manipulating equation : 5*(75+x)/200 + 3*x/25 =(30-x)*4/75 \n",
+ "\n",
+ "#Results\n",
+ "print(\"x=%.2f MW\\n\" %x)\n",
+ "print(\"which means power of magnitude %.2f MW will be from B to A\" %abs(x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x=-1.39 MW\n",
+ "\n",
+ "which means power of magnitude 1.39 MW will be from B to A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.2, Page No 676"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "x=(250*11.0)/(21.0+11)\t\t# by manipulating equation : 5x/110=5x(250-x)/210\n",
+ "P=250-x\t\t\t\t\t\t#Power shared by 210 MW unit \n",
+ "\n",
+ "#Results\n",
+ "print(\"Power supplied by 210 MW unit = %.2f MW \\n\" %P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power supplied by 210 MW unit = 164.06 MW \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.3, Page No 677"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "E=4.5*100\t\t#Energy stored at no load(MJ)\n",
+ "E1=25*.6\t\t#Energy lost by rotor(MJ)\n",
+ "\n",
+ "#Calculations\n",
+ "fnew=math.sqrt((E-E1)/E)*50\n",
+ "\n",
+ "#Results\n",
+ "print(\"New frequency will be %.2f Hz\" %fnew)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New frequency will be 49.16 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter21.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter21.ipynb new file mode 100755 index 00000000..15522b97 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter21.ipynb @@ -0,0 +1,77 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 21 : Compensation In Power Systems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.1, Page No 683"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "#initialisation of variables\n",
+ "\n",
+ "load1=complex(10,15)\t\t#load per phase(MVA)\n",
+ "SCC=250.0/3\n",
+ "V=11/math.sqrt(3)\n",
+ "P=30\n",
+ "Q=45\n",
+ "Z=(11/math.sqrt(3))**2.0/(250.0/3)\t#Equivalent short circuit impedence\n",
+ "\n",
+ "#Calculations\n",
+ "dsc=math.degrees(math.atan(5))\n",
+ "R=.0949\n",
+ "X=.4746\n",
+ "#Using equation: V**2= (Vcosd+PR/V)**2 + (Vsind+QX/V)**2, we get \n",
+ "y=numpy.polynomial.polynomial.polyval3d(51.7,0,-27.5,1)\n",
+ "X=numpy.roots(y)\n",
+ "V=5.046\n",
+ "print(\"V=%.3f\" %V)\n",
+ "dV=6.35-V\n",
+ "Ssc=250\n",
+ "#using expression ,a=dV/v=1(Pcos(dsc)+Qsin(dsc))/Ssc +j(Psin(dsc)-Qcos(dsc))/Ssc\n",
+ "\n",
+ "a=(P*math.cos(math.radians(dsc))+Q*math.sin(math.radians(dsc)))/Ssc +complex(P*math.sin(math.radians(dsc))-Q*math.cos(math.radians(dsc)))/Ssc\n",
+ "\n",
+ "#Results\n",
+ "print(\"dV/V= %.2f \" %abs(a))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V=5.046\n",
+ "dV/V= 0.28 \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter22.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter22.ipynb new file mode 100755 index 00000000..a1ea00fe --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter22.ipynb @@ -0,0 +1,268 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 22 : Power System Voltage Stability"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.2, Page No 725"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Vb=500.0\n",
+ "Sb=1000.0\n",
+ "\n",
+ "#Calculations\n",
+ "Zb=Vb**2/Sb\n",
+ "Xpu=.35*100/Zb\n",
+ "Zth=1000/5000.0\n",
+ "X=Xpu+Zth\n",
+ "V=1.0\n",
+ "Q=0\n",
+ "P=1.0\n",
+ "Eth=V+(Q*X/V)+complex(P*X/V)\n",
+ "Q=0.75\n",
+ "Eth1=V+(Q*X/V)+complex(P*X/V)\n",
+ "\n",
+ "#Results\n",
+ "print(\"(i) For p.f unity , Eth= {0:.5f}+{1:.5f}i\".format(Eth.real, Eth.imag))\n",
+ "print(\"(i) For p.f .8 , Eth= {0:.5f}+{1:.5f}i\".format(Eth1.real, Eth1.imag))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) For p.f unity , Eth= 1.34000+0.00000i\n",
+ "(i) For p.f .8 , Eth= 1.59500+0.00000i\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.3, Page No 726"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "X=.625\n",
+ "P=1.0\n",
+ "Q=0.6\n",
+ "V=1.0\n",
+ "\n",
+ "#Calculations\n",
+ "Eth=V+(Q*X/V)+complex(P*X/V)\n",
+ "Phase_Eth=math.degrees(math.atan(Eth.imag/Eth.real))\n",
+ "\n",
+ "#Results\n",
+ "print(\"Eth=%.2f at an angle %.0f degrees\" %(abs(Eth),Phase_Eth))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Eth=2.00 at an angle 0 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.4, Page No 732"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "P=0.5\n",
+ "toff=4.0\n",
+ "\n",
+ "#Calculations\n",
+ "ton=(P*toff-0*toff)/(0.8-P)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Toff= 4min .\")\n",
+ "print(\"ton(min.)=%.3f min.\" %ton)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Toff= 4min .\n",
+ "ton(min.)=6.667 min.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.6 Page No 739"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V=1.0\n",
+ "Qload=1.0*V\n",
+ "Qcap=-0.75*V**2\n",
+ "\n",
+ "#Calculations\n",
+ "Qnet=Qload+Qcap\n",
+ "VS=1-0.75*2*V # voltage sensitivity\n",
+ "\n",
+ "#Results\n",
+ "print(\"Voltage sensitivity=%.3f\" %VS)\n",
+ "print(\"since the voltage sensitivity is negative,\\nvoltage regulation by tap changing will reduce net reactive load and improive voltage stability \")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage sensitivity=-0.500\n",
+ "since the voltage sensitivity is negative,\n",
+ "voltage regulation by tap changing will reduce net reactive load and improive voltage stability \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.7, Page No 740"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Y=complex(-10)\n",
+ "n=1+0.1\n",
+ "\n",
+ "#Calculations\n",
+ "Y1=n*(n-1)*Y\n",
+ "Y2=(1-n)*Y\n",
+ "\n",
+ "#Results\n",
+ "print(\"Y1= {0:.2f}+{1:.2f}i\".format(Y1.real, Y1.imag))\n",
+ "print(\"Y2= {0:.2f}+{1:.2f}i\".format(Y2.real, Y2.imag))\n",
+ "print(\"The shunt elements equal to a reactor of 1.1V1^2 size oin the primary side and a capacitive of sixe 1V2**2 on the secondary side\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y1= -1.10+0.00i\n",
+ "Y2= 1.00+-0.00i\n",
+ "The shunt elements equal to a reactor of 1.1V1^2 size oin the primary side and a capacitive of sixe 1V2**2 on the secondary side\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.8, Page No 745"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "P=1.0\t\t#assuming\n",
+ "S1=P/.95\t#For pf .95\n",
+ "S2=P/.8\t\t#For pf .8\n",
+ "\n",
+ "#Calculations\n",
+ "dMVA=(S2-S1)*100.0/P\t\t#Increase in MVA rating \n",
+ "Q1=P*math.tan(math.radians(math.degrees(math.acos(0.95))))\t\t#Q for pf .95\n",
+ "Q2=P*math.tan(math.radians(math.degrees(math.acos(0.8))))\t\t#Q for pf .8\n",
+ "dPc=(Q2-Q1)*100.0/Q1\t\t#Percent additional Reactive Power Capability \n",
+ "\n",
+ "#Results\n",
+ "print(\"Percent additional Reactive Power Capability is %.2f\" %dPc)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percent additional Reactive Power Capability is 128.18\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter23.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter23.ipynb new file mode 100755 index 00000000..7d2d8122 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter23.ipynb @@ -0,0 +1,298 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 23 : State Estimation In Power Systems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.1, Page No 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "C1=0.02*100\n",
+ "C2=0.05\n",
+ "Fs=100\n",
+ "S1=complex(0.41,-0.11)\n",
+ "S2=complex(-0.4, 0.10)\n",
+ "S3=complex(-.105,0.11)\n",
+ "S4=complex(-.105,.11)\n",
+ "S5=complex(0.14,-.14)\n",
+ "S6=complex(-0.7,.35)\n",
+ "Z12=complex(0.08,.24)\n",
+ "Z23=complex(0.06,.18)\n",
+ "Z31=complex(0.02,.06)\n",
+ "Z21=Z12\n",
+ "Z32=Z23\n",
+ "Z13=Z31\n",
+ "\n",
+ "#Calculations\n",
+ "W1=(50*10**(-6))/((C1*abs(S1)+(C2*(Fs)))**2)\n",
+ "W2=(50*10**(-6))/((C1*abs(S2)+C2*(Fs))**2)\n",
+ "W3=(50*10**(-6))/((C1*abs(S3)+C2*(Fs))**2)\n",
+ "W4=(50*10**(-6))/((C1*abs(S4)+C2*(Fs))**2)\n",
+ "W5=(50*10**(-6))/((C1*abs(S5)+C2*(Fs))**2)\n",
+ "W6=(50*10**(-6))/((C1*abs(S6)+C2*(Fs))**2)\n",
+ "print(\"W1= %.2f\" %W1)\t\t\t#Answers for W1,W2,W3,W4,W5,W6 in the book is wrongly Calculated\n",
+ "print(\"W2= %.2f\" %W2)\t\n",
+ "print(\"W3= %.2f\" %W3)\t\n",
+ "print(\"W4= %.2f\" %W4)\t\n",
+ "print(\"W5= %.2f\" %W5)\t\n",
+ "print(\"W6= %.2f\" %W6)\t\n",
+ "a1=W1/(abs(13)**2)\n",
+ "[D]=diag([W1/(abs(Z13)**2)W2/(abs(Z31)**2)W3/(abs(Z12)**2)W4/(abs(Z21)**2)W5/(abs(Z23)**2)W6/(abs(Z32)**2)])\n",
+ "A=[-1 0 11 0 -11 -1 0-1 1 00 1 -10 -1 1]\n",
+ "B=[-1 01 01 -1-1 10 10 -1]\n",
+ "b=[1-100-11]\n",
+ "C=(B')*D#Assuming Transpose(B)D=C\n",
+ "F=(B')*D*B#Assuming Transpose(B)*D*B=F\n",
+ "G=(inv(F))*C#Assuming(BTDB)-1*(BT)*D=F\n",
+ "E1=1.05\n",
+ "E2=E1\n",
+ "E3=E1\n",
+ "invH=diag([Z31/E3Z13/E1Z12/E1Z21/E2Z23/E2Z32/E2])\n",
+ "Sm=[.41+%i*.11-.4-%i*.1-.105-%i*.11.14+%i*.14.72+%i*.37-.7+%i*.35]\n",
+ "EMo=invH*Sm\n",
+ "a=EMo-b*E1\n",
+ "E=G*a\n",
+ "\n",
+ "#Results\n",
+ "print(E,\"E=\") #Answers differs due to wrong calculation of W1,W2,W3,W4,W5,W6"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) For p.f unity , Eth= 1.34000+0.00000i\n",
+ "(i) For p.f .8 , Eth= 1.59500+0.00000i\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.3, Page No 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "X=.625\n",
+ "P=1.0\n",
+ "Q=0.6\n",
+ "V=1.0\n",
+ "\n",
+ "#Calculations\n",
+ "Eth=V+(Q*X/V)+complex(P*X/V)\n",
+ "Phase_Eth=math.degrees(math.atan(Eth.imag/Eth.real))\n",
+ "\n",
+ "#Results\n",
+ "print(\"Eth=%.2f at an angle %.0f degrees\" %(abs(Eth),Phase_Eth))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Eth=2.00 at an angle 0 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.4, Page No 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "P=0.5\n",
+ "toff=4.0\n",
+ "\n",
+ "#Calculations\n",
+ "ton=(P*toff-0*toff)/(0.8-P)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Toff= 4min .\")\n",
+ "print(\"ton(min.)=%.3f min.\" %ton)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Toff= 4min .\n",
+ "ton(min.)=6.667 min.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.6 Page No 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V=1.0\n",
+ "Qload=1.0*V\n",
+ "Qcap=-0.75*V**2\n",
+ "\n",
+ "#Calculations\n",
+ "Qnet=Qload+Qcap\n",
+ "VS=1-0.75*2*V # voltage sensitivity\n",
+ "\n",
+ "#Results\n",
+ "print(\"Voltage sensitivity=%.3f\" %VS)\n",
+ "print(\"since the voltage sensitivity is negative,\\nvoltage regulation by tap changing will reduce net reactive load and improive voltage stability \")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage sensitivity=-0.500\n",
+ "since the voltage sensitivity is negative,\n",
+ "voltage regulation by tap changing will reduce net reactive load and improive voltage stability \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.7, Page No 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Y=complex(-10)\n",
+ "n=1+0.1\n",
+ "\n",
+ "#Calculations\n",
+ "Y1=n*(n-1)*Y\n",
+ "Y2=(1-n)*Y\n",
+ "\n",
+ "#Results\n",
+ "print(\"Y1= {0:.2f}+{1:.2f}i\".format(Y1.real, Y1.imag))\n",
+ "print(\"Y2= {0:.2f}+{1:.2f}i\".format(Y2.real, Y2.imag))\n",
+ "print(\"The shunt elements equal to a reactor of 1.1V1^2 size oin the primary side and a capacitive of sixe 1V2**2 on the secondary side\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y1= -1.10+0.00i\n",
+ "Y2= 1.00+-0.00i\n",
+ "The shunt elements equal to a reactor of 1.1V1^2 size oin the primary side and a capacitive of sixe 1V2**2 on the secondary side\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.8, Page No 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "P=1.0\t\t#assuming\n",
+ "S1=P/.95\t#For pf .95\n",
+ "S2=P/.8\t\t#For pf .8\n",
+ "\n",
+ "#Calculations\n",
+ "dMVA=(S2-S1)*100.0/P\t\t#Increase in MVA rating \n",
+ "Q1=P*math.tan(math.radians(math.degrees(math.acos(0.95))))\t\t#Q for pf .95\n",
+ "Q2=P*math.tan(math.radians(math.degrees(math.acos(0.8))))\t\t#Q for pf .8\n",
+ "dPc=(Q2-Q1)*100.0/Q1\t\t#Percent additional Reactive Power Capability \n",
+ "\n",
+ "#Results\n",
+ "print(\"Percent additional Reactive Power Capability is %.2f\" %dPc)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percent additional Reactive Power Capability is 128.18\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter24.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter24.ipynb new file mode 100755 index 00000000..07826bb5 --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter24.ipynb @@ -0,0 +1,171 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 24 : Unit Commitment"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24.3, Page No 803"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Fc1=1.1\t\t\t#Fuel cost(1)=Rs 1.1/MBtu\n",
+ "Fc2=1\t\t\t#Fuel cost(2)=1/MBtu\n",
+ "Fc3=1.2\t\t\t#Fuel cost(3)=1.2/MBtu\n",
+ "P1max=600.0\n",
+ "P1=P1max\n",
+ "\n",
+ "#Calculations\n",
+ "F1=600+7.1*P1+0.00141*(P1**2)\t#For P1= Pm1ax\n",
+ "Favg1=F1*Fc1/600.0\t\t\t\t#Full load average production cost\n",
+ "P2max=450.0\n",
+ "P2=P2max\n",
+ "F2=350+7.8*P2+0.00195*(P2**2)\t#For P2= P2max\n",
+ "Favg2=F2*Fc2/450.0\t\t\t\t#Full load average production cost\n",
+ "P3max=250.0\n",
+ "P3=P3max\n",
+ "F3=80+8*P3+0.0049*(P3**2)\t\t#For P3= P3max\n",
+ "Favg3=F3*Fc3/250.0\t\t\t\t#Full load average production cost\n",
+ "\n",
+ "#Results\n",
+ "print(\"Priority List is as follows\")\n",
+ "print(\"Unit Rs/MWhr MinMW Max MW\")\n",
+ "print(\" 2 %.3f 100 %.0f \" %(Favg2,P2max))\n",
+ "print(\" 1 %.4f 60 %.0f \" %(Favg1,P1max))\n",
+ "print(\" 3 %.2f 50 %.0f \" %(Favg3,P3max))\n",
+ "Fmax1=P1max+P2max+P3max\n",
+ "Fmax2=P2max+P1max\n",
+ "Fmax3=P2max\n",
+ "print(\"Unit Commitment Scheme is follows\")\n",
+ "print(\"Combination Min.MW from Combination Max.MW from Combination\")\n",
+ "print(\"2+1+3 310 %.0f \" %Fmax1)\n",
+ "print(\"2+1 260 %.0f \" %Fmax2)\n",
+ "print(\"2 100 %.0f \" %Fmax3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Priority List is as follows\n",
+ "Unit Rs/MWhr MinMW Max MW\n",
+ " 2 9.455 100 450 \n",
+ " 1 9.8406 60 600 \n",
+ " 3 11.45 50 250 \n",
+ "Unit Commitment Scheme is follows\n",
+ "Combination Min.MW from Combination Max.MW from Combination\n",
+ "2+1+3 310 1300 \n",
+ "2+1 260 1050 \n",
+ "2 100 450 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24.4, Page No 805"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "#Calculations\n",
+ "\n",
+ "def F1(P1):\n",
+ " F1=7.1*P1+.00141*(P1^2)\n",
+ " print(\"F1(%.0f)=%.1f\" %(P1,F1))\n",
+ "\n",
+ "def F2(P2):\n",
+ " f2=7.8*P2+.00195*(P2^2)\n",
+ " print(\"f2(%.0f)=%.0f\" %(P2,f2))\n",
+ "\n",
+ "def F(P1,P2):\n",
+ " F1=7.1*P1+.00141*(P1**2)\n",
+ " F2=7.8*P2+.00195*(P2**2)\n",
+ " F=F1+F2\n",
+ " print(\"F1(%.0f)+f2(%.0f)=%.0f\" %(P1,P2,F))\n",
+ "\n",
+ "\n",
+ " \n",
+ "#Results\n",
+ "P1max=600\n",
+ "P2max=450\n",
+ "print(\"Unit Commitment using Load 500MW\")\n",
+ "F1(500)\n",
+ "print(\"\\n Since min. Power of second unit is 100MW , we find\")\n",
+ "F(400,100)\n",
+ "F(380,120)\n",
+ "F(360,140)\n",
+ "print(\"\\n Therefore for load 500 MW , the load commitment on unit 1 is 400 MW and that on 2 is 100 MW which gives min. cost\")\n",
+ "print(\"Next we increase the load by 50 MW and loading unit 1 we get, \\n\")\n",
+ "F1(550)\n",
+ "print(\"Also if we distribute a part of load to unit 2 we get ,\")\n",
+ "F(450,100)\n",
+ "F(400,150)\n",
+ "F(350,200)\n",
+ "print(\"\\n Therefore for load 550 MW , the load commitment on unit 1 is 400 MW and that on 2 is 150 MW which gives min. cost\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Unit Commitment using Load 500MW\n",
+ "F1(500)=3550.7\n",
+ "\n",
+ " Since min. Power of second unit is 100MW , we find\n",
+ "F1(400)+f2(100)=3865\n",
+ "F1(380)+f2(120)=3866\n",
+ "F1(360)+f2(140)=3869\n",
+ "\n",
+ " Therefore for load 500 MW , the load commitment on unit 1 is 400 MW and that on 2 is 100 MW which gives min. cost\n",
+ "Next we increase the load by 50 MW and loading unit 1 we get, \n",
+ "\n",
+ "F1(550)=3905.8\n",
+ "Also if we distribute a part of load to unit 2 we get ,\n",
+ "F1(450)+f2(100)=4280\n",
+ "F1(400)+f2(150)=4279\n",
+ "F1(350)+f2(200)=4296\n",
+ "\n",
+ " Therefore for load 550 MW , the load commitment on unit 1 is 400 MW and that on 2 is 150 MW which gives min. cost\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Power_System_by_C.L._Wadhwa/Chapter25.ipynb b/Electrical_Power_System_by_C.L._Wadhwa/Chapter25.ipynb new file mode 100755 index 00000000..ed59ab6b --- /dev/null +++ b/Electrical_Power_System_by_C.L._Wadhwa/Chapter25.ipynb @@ -0,0 +1,116 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 25 : Economic Scheduling of Hydrothermal Plants and Optimal Power Flows"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.1, Page No 817"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "q2=25.0\n",
+ "q3=25.0\n",
+ "q1=70-(q2+q3)\n",
+ "Wo=120.0\n",
+ "W3=50.0\n",
+ "Wi1=0\n",
+ "Wi2=0\n",
+ "W1=Wo+Wi1-q1\n",
+ "W2=W1+Wi2-q2\n",
+ "\n",
+ "#Calculations\n",
+ "PH1=9.81*(10**-3)*20*(1+(.5*.006*(120+100)))*(20-2)\n",
+ "PH2=9.81*(10**-3)*20*(1+(.5*.006*(100+75)))*(23)\t\t# Answer in the book is not Correct due to wrong calculation\n",
+ "PH3=9.81*(10**-3)*20*(1+(.5*.006*(75+50)))*(23)\n",
+ "PT1=8-PH1\n",
+ "PT2=12-PH2\n",
+ "PT3=7-PH3\n",
+ "L11=20+PT1\t\t\t#dFT/dPT=PT+20\n",
+ "L12=20+PT2\t\t\t#dF/dp=PT+20\n",
+ "L13=20+PT3\t\t\t#dF/dp=PT+20\n",
+ "#dPL/dPH=0\n",
+ "L31=L11\n",
+ "L32=L12\n",
+ "L33=L13\n",
+ "e=0.006\n",
+ "ho=0.1962\n",
+ "Rho=2\n",
+ "L21=L31*ho*(1+(.5*e*(2*Wo+Wi1-2*q1+Rho)))\n",
+ "L22=L21-L31*(.5*ho*e*(q1-Rho))-L32*(.5*ho*e*(q2-Rho))#for m=1\n",
+ "L23=L22-L32*(.5*ho*e*(q2-Rho))-L33*(.5*ho*e*(q3-Rho))#for m=2\n",
+ "G1=L22-L32*ho*(1+.5*.006*(2*100-2*25+2))\t\t#G1=dF/dq2 Answer doent match due to wrong calculation of PH2 in a book\n",
+ "G2=L23-L33*ho*(1+.5*.006*(2*W2+0-2*q3+Rho))\t\t#G1=dF/dq3\n",
+ "a=0.4\n",
+ "qnew2=q2-a*G1# Answer differs due to wrong calculation of PH2 in the book\n",
+ "qnew3=q3-a*G2\n",
+ "q1=120-50-(qnew2+qnew3)\n",
+ "\n",
+ "#Results\n",
+ "print(\"Let q2=%.0f q3=%.0f q1=%.0f\" %(q2,q3,q1))\n",
+ "print(\"W1=%.0f W2=%.0f\" %(W1,W2))\n",
+ "print(\"PH1=%.2f PH2=%.3f PH3=%.1f\" %(PH1,PH2,PH3))\n",
+ "print(\"Thermal generation during Three Intervals \\n PT1=%.2f PT2=%.2f PT3=%.1f\" %(PT1,PT2,PT3))\n",
+ "print(\"Value of L1 for the three intervals, \\n L11=%.2f L12=%.2f L13=%.1f\" %(L11,L12,L13))\n",
+ "print(\"Neglecting transmission losses we get\\n L11=L31 L12=L32 L13=L33\")\n",
+ "print(\"L21=%.3f\" %(L21))\n",
+ "print(\"For m=1 and 2 we get \\n L22=%.1f \\n L23=%.1f\" %(L22,L23))\n",
+ "print(\"Gradient Vectors \\n dF/dq2=%.2f\\n dF/dq3=%.1f\" %(G1,G2))\n",
+ "print(\"q2new=%.3f \\n q3new=%.1f\\n q1=%.0f\" %(qnew2,qnew3,q1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let q2=25 q3=25 q1=20\n",
+ "W1=100 W2=75\n",
+ "PH1=5.86 PH2=6.882 PH3=6.2\n",
+ "Thermal generation during Three Intervals \n",
+ " PT1=2.14 PT2=5.12 PT3=0.8\n",
+ "Value of L1 for the three intervals, \n",
+ " L11=22.14 L12=25.12 L13=20.8\n",
+ "Neglecting transmission losses we get\n",
+ " L11=L31 L12=L32 L13=L33\n",
+ "L21=6.975\n",
+ "For m=1 and 2 we get \n",
+ " L22=6.4 \n",
+ " L23=5.8\n",
+ "Gradient Vectors \n",
+ " dF/dq2=-0.77\n",
+ " dF/dq3=0.5\n",
+ "q2new=25.310 \n",
+ " q3new=24.8\n",
+ " q1=20\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter10_1.ipynb b/Electronic_Devices_and_Circuits/Chapter10_1.ipynb deleted file mode 100755 index b92c4b1d..00000000 --- a/Electronic_Devices_and_Circuits/Chapter10_1.ipynb +++ /dev/null @@ -1,587 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 10 : FET biasing"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.1, Page No 381"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vdd=22.0\n",
- "Rd=2.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\"when Id=0\")\n",
- "Id=0\n",
- "Vds=Vdd-Id*Rd\n",
- "print('at point A Vds = %.2f V' %Vds)\n",
- "Vds=0\n",
- "Id=Vdd/Rd\n",
- "\n",
- "#Results\n",
- "print(\"when Vds=0\")\n",
- "print('at point A Id = %.2f mA' %(Id*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Id=0\n",
- "at point A Vds = 22.00 V\n",
- "when Vds=0\n",
- "at point A Id = 11.00 mA\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.4, Page No 387"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Idss=8.0*10**-3\n",
- "Vpmax=6.0\n",
- "Vgs=2.3\n",
- "Vgsmax=6\n",
- "\n",
- "#Calculations\n",
- "Id=Idss*(1-(Vgs/Vgsmax))**2\n",
- "Idss=4*10**-3\n",
- "Vp=3\n",
- "Idmin=Idss*(1-(Vgs/Vp))**2\n",
- "\n",
- "#Results\n",
- "print('at point A Idmin = %.2f mA' %(Idmin*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "at point A Idmin = 0.22 mA\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.6 Page No 393"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vdd=25.0\n",
- "R2=1.0*10**6\n",
- "R1=3.8*10**6\n",
- "Rs=2.5*10**3\n",
- "Rd=2.5*10**3\n",
- "\n",
- "#Calculations\n",
- "Vg=(Vdd*R2)/(R1+R2)\n",
- "print(\"when Id=0\")\n",
- "Id=0\n",
- "Vgs=Vg-Id*Rs\n",
- "print(\" plot point A at Id=0\")\n",
- "print('at point A Vds = %.2f A/s' %Vds)\n",
- "Vgs=0\n",
- "Id=Vg/Rs\n",
- "print(\" plot point B Vgs=0\")\n",
- "print('at point A Id = %.2f A/s' %Id)\n",
- "Idmax=3*10**-3\n",
- "Idmin=2.3*10**-3\n",
- "Vdsmin=Vdd-Idmax*(Rd+Rs)\n",
- "Vdsmax=Vdd-Idmin*(Rd+Rs)\n",
- "\n",
- "#Results\n",
- "print('The value of Vdsmax = %.2f V' %(Vdsmax))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Id=0\n",
- " plot point A at Id=0\n",
- "at point A Vds = 0.00 A/s\n",
- " plot point B Vgs=0\n",
- "at point A Id = 0.00 A/s\n",
- "The value of Vdsmax = 13.50 V\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.7, Page No 401"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Id=3.0*10**-3\n",
- "Vgs=-2.3\n",
- "Vdsmin=10.0\n",
- "Vdd=25.0\n",
- "Vgsoff=-6\n",
- "Idss=8.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "Vgs=Vgsoff*(1-math.sqrt(Id/Idss))\n",
- "Rd=(Vdd-Vdsmin)/Id\n",
- "\n",
- "#Results\n",
- "print('The value of Td = %.2f kohm' %(Rd/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Td = 5.00 kohm\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.8 Page No 403"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Id=3.0*10**-3\n",
- "Vds=10.0\n",
- "Vdd=25.0\n",
- "Vgs=2.3\n",
- "\n",
- "#Calculations\n",
- "Rs=Vgs/Id\n",
- "Rd=((Vdd-Vds)/Id)-Rs\n",
- "\n",
- "#Results\n",
- "print('The value of Rd = %.2f ohm' %(Rd/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rd = 4.23 ohm\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.9 Page No 405"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Id=3.0*10**-3\n",
- "Vds=10.0\n",
- "Vdd=25.0\n",
- "Vg=5.2\n",
- "Vgsoff=-6\n",
- "Idss=8.0*10**-3\n",
- "R2=1.0*10**6\n",
- "\n",
- "#Calculations\n",
- "R=(Vdd-Vds)/Id#R=(Rs+Rd)/2\n",
- "Rd=R/2\n",
- "Rs=Rd\n",
- "Vgs=Id*Rs\n",
- "Vgs=Vgsoff*(1-math.sqrt(Id/Idss))\n",
- "Vs=Id*Rs\n",
- "Vg=Vs-(-Vgs)\n",
- "R1=((Vdd-Vg)*R2)/Vg\n",
- "\n",
- "#Results\n",
- "print('The value of R = %.2f Mohm' %(R1/10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R = 3.83 Mohm\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.11, Page No 412"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vee=20.0\n",
- "Id=3.0*10**-3\n",
- "Vds=9.0\n",
- "Vbe=.7\n",
- "Vb=0\n",
- "Ve=Vee-Vbe\n",
- "\n",
- "#Calculations\n",
- "Re=Ve/Id\n",
- "Re=6.8*10**3#satnadard value\n",
- "Id=Ve/Re\n",
- "Idss=16*10**-3\n",
- "Vgsoff=-8\n",
- "Vgs=Vgsoff*(1-math.sqrt(Id/Idss))\n",
- "Vs=Vb-Vgs\n",
- "Vrd=Vee-Vds-Vs\n",
- "Rd=Vrd/Id\n",
- "\n",
- "#Results\n",
- "print('The value of Rd = %.2f V' %(Rd/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rd = 2.24 V\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.12 Page No 415"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Idss=5.0*10**-3\n",
- "Vgsoff=6.0\n",
- "Rs=3.3*10**3\n",
- "Vdd=20.0\n",
- "Rd=Rs\n",
- "\n",
- "#Calculations\n",
- "print(\"when Id=0 % Vgs=Vs=0\")\n",
- "Id=0\n",
- "Vgs=0\n",
- "Vs=0\n",
- "print(\" at point A universal transfer characteristic Id/Idss and Vgs/Vgsoff=0\")\n",
- "Id=1.5*10**-3\n",
- "Vgs=Id*Rs\n",
- "y=Id/Idss\n",
- "x=Vgs/Vgsoff\n",
- "print(\" point B the universal transfer charecteristic x=.825 and y=.3\")\n",
- "Id=.2*Idss\n",
- "Vds=Vdd-Id*(Rd+Rs)\n",
- "\n",
- "#Results\n",
- "print('The value of Vds = %.2f V' %(Vds))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Id=0 % Vgs=Vs=0\n",
- " at point A universal transfer characteristic Id/Idss and Vgs/Vgsoff=0\n",
- " point B the universal transfer charecteristic x=.825 and y=.3\n",
- "The value of Vds = 13.40 V\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.13 Page No 416"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Idss=9.0*10**-3\n",
- "Vgsoff=7.0\n",
- "Vdd=22.0\n",
- "R1=4.7*10**6\n",
- "R2=1.0*10**6\n",
- "Rs=2.7*10**3\n",
- "Rd=Rs\n",
- "\n",
- "#Calculations\n",
- "Vg=(Vdd*R2)/(R1+R2)\n",
- "print(\"when Vgs=0 % Vgs/Vgsoff=0\")\n",
- "Id=Vg/Rs\n",
- "print(\"when Vgs/Vgsoff=.5\")\n",
- "Vgs=.5*(-Vgsoff)\n",
- "Id=(Vg-Vgs)/Rs\n",
- "x=Id/Idss\n",
- "print(\" point Y on universal characteristic x=.3 and Vgs/Vgsoff=.5\")\n",
- "print(\"draw voltage divider bias line through X nad Y where bisa line intersect transfer curve\")\n",
- "Id=.29*Idss\n",
- "Vds=Vdd-Id*(Rd+Rs)\n",
- "\n",
- "#Results\n",
- "print('The value of Vds= %.2f V' %(Vds))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Vgs=0 % Vgs/Vgsoff=0\n",
- "when Vgs/Vgsoff=.5\n",
- " point Y on universal characteristic x=.3 and Vgs/Vgsoff=.5\n",
- "draw voltage divider bias line through X nad Y where bisa line intersect transfer curve\n",
- "The value of Vds= 7.91 V\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.14 Page No 419"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vdd=40.0\n",
- "R2=1.0*10**6\n",
- "R1=5.6*10**6\n",
- "Rd=4.7\n",
- "\n",
- "#Calculations\n",
- "Vg=(Vdd*R2)/(R1+R2)\n",
- "print(\"from the point where the bias line intersect the transfer curve\")\n",
- "Id=6.2\n",
- "Vds=Vdd-Id*Rd\n",
- "\n",
- "#Results\n",
- "print('The value of Vds= %.2f V' %(Vds))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "from the point where the bias line intersect the transfer curve\n",
- "The value of Vds= 10.86 V\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.16, Page No 422"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "rDS=25.0\n",
- "Vgsoff=10.0\n",
- "Vds=200.0*10**-3\n",
- "Vdd=12.0\n",
- "\n",
- "#Calculations\n",
- "Id=Vds/rDS\n",
- "Rd=Vdd/Id\n",
- "Vi=-(Vgsoff+1)\n",
- "\n",
- "#Results\n",
- "print('The value of Vi= %.2f V' %(Vi))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Vi= -11.00 V\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.17, Page No 424"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vdd=50.0\n",
- "Rd=10.0\n",
- "R2=1.0*10**6\n",
- "rDS=0.25\n",
- "\n",
- "#Calculations\n",
- "Id=Vdd/Rd\n",
- "print(\" from transfer curve at Id=5 and Vgs=5.7\")\n",
- "Vgs=5.7\n",
- "R1=((Vdd-Vgs)*R2)/Vgs#use 6.8Mohm to make Vgs>5.7V to ensure that the FET is biased on\n",
- "Vds=Id*rDS\n",
- "\n",
- "#Results\n",
- "print('The value of Vds= %.2f V' %(Vds))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " from transfer curve at Id=5 and Vgs=5.7\n",
- "The value of Vds= 1.25 V\n"
- ]
- }
- ],
- "prompt_number": 12
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter10_2.ipynb b/Electronic_Devices_and_Circuits/Chapter10_2.ipynb deleted file mode 100755 index b92c4b1d..00000000 --- a/Electronic_Devices_and_Circuits/Chapter10_2.ipynb +++ /dev/null @@ -1,587 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 10 : FET biasing"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.1, Page No 381"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vdd=22.0\n",
- "Rd=2.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\"when Id=0\")\n",
- "Id=0\n",
- "Vds=Vdd-Id*Rd\n",
- "print('at point A Vds = %.2f V' %Vds)\n",
- "Vds=0\n",
- "Id=Vdd/Rd\n",
- "\n",
- "#Results\n",
- "print(\"when Vds=0\")\n",
- "print('at point A Id = %.2f mA' %(Id*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Id=0\n",
- "at point A Vds = 22.00 V\n",
- "when Vds=0\n",
- "at point A Id = 11.00 mA\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.4, Page No 387"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Idss=8.0*10**-3\n",
- "Vpmax=6.0\n",
- "Vgs=2.3\n",
- "Vgsmax=6\n",
- "\n",
- "#Calculations\n",
- "Id=Idss*(1-(Vgs/Vgsmax))**2\n",
- "Idss=4*10**-3\n",
- "Vp=3\n",
- "Idmin=Idss*(1-(Vgs/Vp))**2\n",
- "\n",
- "#Results\n",
- "print('at point A Idmin = %.2f mA' %(Idmin*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "at point A Idmin = 0.22 mA\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.6 Page No 393"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vdd=25.0\n",
- "R2=1.0*10**6\n",
- "R1=3.8*10**6\n",
- "Rs=2.5*10**3\n",
- "Rd=2.5*10**3\n",
- "\n",
- "#Calculations\n",
- "Vg=(Vdd*R2)/(R1+R2)\n",
- "print(\"when Id=0\")\n",
- "Id=0\n",
- "Vgs=Vg-Id*Rs\n",
- "print(\" plot point A at Id=0\")\n",
- "print('at point A Vds = %.2f A/s' %Vds)\n",
- "Vgs=0\n",
- "Id=Vg/Rs\n",
- "print(\" plot point B Vgs=0\")\n",
- "print('at point A Id = %.2f A/s' %Id)\n",
- "Idmax=3*10**-3\n",
- "Idmin=2.3*10**-3\n",
- "Vdsmin=Vdd-Idmax*(Rd+Rs)\n",
- "Vdsmax=Vdd-Idmin*(Rd+Rs)\n",
- "\n",
- "#Results\n",
- "print('The value of Vdsmax = %.2f V' %(Vdsmax))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Id=0\n",
- " plot point A at Id=0\n",
- "at point A Vds = 0.00 A/s\n",
- " plot point B Vgs=0\n",
- "at point A Id = 0.00 A/s\n",
- "The value of Vdsmax = 13.50 V\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.7, Page No 401"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Id=3.0*10**-3\n",
- "Vgs=-2.3\n",
- "Vdsmin=10.0\n",
- "Vdd=25.0\n",
- "Vgsoff=-6\n",
- "Idss=8.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "Vgs=Vgsoff*(1-math.sqrt(Id/Idss))\n",
- "Rd=(Vdd-Vdsmin)/Id\n",
- "\n",
- "#Results\n",
- "print('The value of Td = %.2f kohm' %(Rd/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Td = 5.00 kohm\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.8 Page No 403"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Id=3.0*10**-3\n",
- "Vds=10.0\n",
- "Vdd=25.0\n",
- "Vgs=2.3\n",
- "\n",
- "#Calculations\n",
- "Rs=Vgs/Id\n",
- "Rd=((Vdd-Vds)/Id)-Rs\n",
- "\n",
- "#Results\n",
- "print('The value of Rd = %.2f ohm' %(Rd/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rd = 4.23 ohm\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.9 Page No 405"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Id=3.0*10**-3\n",
- "Vds=10.0\n",
- "Vdd=25.0\n",
- "Vg=5.2\n",
- "Vgsoff=-6\n",
- "Idss=8.0*10**-3\n",
- "R2=1.0*10**6\n",
- "\n",
- "#Calculations\n",
- "R=(Vdd-Vds)/Id#R=(Rs+Rd)/2\n",
- "Rd=R/2\n",
- "Rs=Rd\n",
- "Vgs=Id*Rs\n",
- "Vgs=Vgsoff*(1-math.sqrt(Id/Idss))\n",
- "Vs=Id*Rs\n",
- "Vg=Vs-(-Vgs)\n",
- "R1=((Vdd-Vg)*R2)/Vg\n",
- "\n",
- "#Results\n",
- "print('The value of R = %.2f Mohm' %(R1/10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R = 3.83 Mohm\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.11, Page No 412"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vee=20.0\n",
- "Id=3.0*10**-3\n",
- "Vds=9.0\n",
- "Vbe=.7\n",
- "Vb=0\n",
- "Ve=Vee-Vbe\n",
- "\n",
- "#Calculations\n",
- "Re=Ve/Id\n",
- "Re=6.8*10**3#satnadard value\n",
- "Id=Ve/Re\n",
- "Idss=16*10**-3\n",
- "Vgsoff=-8\n",
- "Vgs=Vgsoff*(1-math.sqrt(Id/Idss))\n",
- "Vs=Vb-Vgs\n",
- "Vrd=Vee-Vds-Vs\n",
- "Rd=Vrd/Id\n",
- "\n",
- "#Results\n",
- "print('The value of Rd = %.2f V' %(Rd/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rd = 2.24 V\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.12 Page No 415"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Idss=5.0*10**-3\n",
- "Vgsoff=6.0\n",
- "Rs=3.3*10**3\n",
- "Vdd=20.0\n",
- "Rd=Rs\n",
- "\n",
- "#Calculations\n",
- "print(\"when Id=0 % Vgs=Vs=0\")\n",
- "Id=0\n",
- "Vgs=0\n",
- "Vs=0\n",
- "print(\" at point A universal transfer characteristic Id/Idss and Vgs/Vgsoff=0\")\n",
- "Id=1.5*10**-3\n",
- "Vgs=Id*Rs\n",
- "y=Id/Idss\n",
- "x=Vgs/Vgsoff\n",
- "print(\" point B the universal transfer charecteristic x=.825 and y=.3\")\n",
- "Id=.2*Idss\n",
- "Vds=Vdd-Id*(Rd+Rs)\n",
- "\n",
- "#Results\n",
- "print('The value of Vds = %.2f V' %(Vds))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Id=0 % Vgs=Vs=0\n",
- " at point A universal transfer characteristic Id/Idss and Vgs/Vgsoff=0\n",
- " point B the universal transfer charecteristic x=.825 and y=.3\n",
- "The value of Vds = 13.40 V\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.13 Page No 416"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Idss=9.0*10**-3\n",
- "Vgsoff=7.0\n",
- "Vdd=22.0\n",
- "R1=4.7*10**6\n",
- "R2=1.0*10**6\n",
- "Rs=2.7*10**3\n",
- "Rd=Rs\n",
- "\n",
- "#Calculations\n",
- "Vg=(Vdd*R2)/(R1+R2)\n",
- "print(\"when Vgs=0 % Vgs/Vgsoff=0\")\n",
- "Id=Vg/Rs\n",
- "print(\"when Vgs/Vgsoff=.5\")\n",
- "Vgs=.5*(-Vgsoff)\n",
- "Id=(Vg-Vgs)/Rs\n",
- "x=Id/Idss\n",
- "print(\" point Y on universal characteristic x=.3 and Vgs/Vgsoff=.5\")\n",
- "print(\"draw voltage divider bias line through X nad Y where bisa line intersect transfer curve\")\n",
- "Id=.29*Idss\n",
- "Vds=Vdd-Id*(Rd+Rs)\n",
- "\n",
- "#Results\n",
- "print('The value of Vds= %.2f V' %(Vds))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Vgs=0 % Vgs/Vgsoff=0\n",
- "when Vgs/Vgsoff=.5\n",
- " point Y on universal characteristic x=.3 and Vgs/Vgsoff=.5\n",
- "draw voltage divider bias line through X nad Y where bisa line intersect transfer curve\n",
- "The value of Vds= 7.91 V\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.14 Page No 419"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vdd=40.0\n",
- "R2=1.0*10**6\n",
- "R1=5.6*10**6\n",
- "Rd=4.7\n",
- "\n",
- "#Calculations\n",
- "Vg=(Vdd*R2)/(R1+R2)\n",
- "print(\"from the point where the bias line intersect the transfer curve\")\n",
- "Id=6.2\n",
- "Vds=Vdd-Id*Rd\n",
- "\n",
- "#Results\n",
- "print('The value of Vds= %.2f V' %(Vds))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "from the point where the bias line intersect the transfer curve\n",
- "The value of Vds= 10.86 V\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.16, Page No 422"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "rDS=25.0\n",
- "Vgsoff=10.0\n",
- "Vds=200.0*10**-3\n",
- "Vdd=12.0\n",
- "\n",
- "#Calculations\n",
- "Id=Vds/rDS\n",
- "Rd=Vdd/Id\n",
- "Vi=-(Vgsoff+1)\n",
- "\n",
- "#Results\n",
- "print('The value of Vi= %.2f V' %(Vi))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Vi= -11.00 V\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10.17, Page No 424"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vdd=50.0\n",
- "Rd=10.0\n",
- "R2=1.0*10**6\n",
- "rDS=0.25\n",
- "\n",
- "#Calculations\n",
- "Id=Vdd/Rd\n",
- "print(\" from transfer curve at Id=5 and Vgs=5.7\")\n",
- "Vgs=5.7\n",
- "R1=((Vdd-Vgs)*R2)/Vgs#use 6.8Mohm to make Vgs>5.7V to ensure that the FET is biased on\n",
- "Vds=Id*rDS\n",
- "\n",
- "#Results\n",
- "print('The value of Vds= %.2f V' %(Vds))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " from transfer curve at Id=5 and Vgs=5.7\n",
- "The value of Vds= 1.25 V\n"
- ]
- }
- ],
- "prompt_number": 12
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter11_1.ipynb b/Electronic_Devices_and_Circuits/Chapter11_1.ipynb deleted file mode 100755 index e211f994..00000000 --- a/Electronic_Devices_and_Circuits/Chapter11_1.ipynb +++ /dev/null @@ -1,305 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 11 : Ac analysis of FEt circuits"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.2, Page No 443"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Yos=10.0*10**-6\n",
- "Yfs=3000.0*10**-6\n",
- "R1=1.0*10**6\n",
- "R2=5.6*10**6\n",
- "Rd=2.7*10**3\n",
- "Rl=Rd\n",
- "\n",
- "#Calculations\n",
- "rd=1.0/Yos\n",
- "Zi=((R1*R2)/(R1+R2))*10**-3\n",
- "print(\"input impedance is %dKohm \" %Zi)\n",
- "Zo=(Rd*rd)/(Rd+rd)\n",
- "print(\" output inpedance is %dohm \" %Zo)\n",
- "Av=-Yfs*((Rl*rd)/(Rl+rd))\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "input impedance is 848Kohm \n",
- " output inpedance is 2629ohm \n",
- "The value of Av= -7.89 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.03, Page No 447"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Yos=10.0*10**-6\n",
- "Yfs=4000.0*10**-6\n",
- "Ig=1.0*10**-9\n",
- "Vgs=15.0\n",
- "Rs=3.3*10**3\n",
- "Rg=1.0*10**6\n",
- "Rd=4.7*10**3\n",
- "Rl=33*10**3\n",
- "\n",
- "#Calculations\n",
- "rd=1.0/Yos\n",
- "Rgs=(Vgs/Ig)\n",
- "Zg=(Rgs*(1+Yfs*Rs))\n",
- "Zi=Rg\n",
- "Zd=rd+Rs+(Yfs*Rs*rd)\n",
- "Zo=(Rd*Zd)/(Rd+Zd)\n",
- "Av=-(Yfs*((Rd*Rl)/(Rd+Rl)))/(1+Yfs*Rs)\n",
- "Av=-((Rd*Rl)/(Rd+Rl))/Rs\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Av= -1.25 \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.4 Page No 451"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Yfs=3000.0*10**-6\n",
- "Rgs=100.0*10**6\n",
- "rd=50.0*10**3\n",
- "Rs=5.6*10**3\n",
- "Rl=12.0*10**3\n",
- "R1=1.5*10**6\n",
- "R2=1.0*10**6\n",
- "\n",
- "#Calculations\n",
- "Zg=Rgs*(1+Yfs*((Rs*Rl)/(Rs+Rl)))\n",
- "Zi=(R1*R2)/(R1+R2)\n",
- "Zs=((1/Yfs)*rd)/((1/Yfs)+rd)\n",
- "Zo=(Rs*Rl*(1/Yfs))/(Rs*Rl+Rs*(1/Yfs)+Rl*(1/Yfs))\n",
- "Av=-(Yfs*((Rs*Rl)/(Rs+Rl)))/(1+Yfs*((Rs*Rl)/(Rs+Rl)))\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Av= -0.92 \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.5, Page No 456"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Yfs=3000.0*10**-6\n",
- "rd=50.0*10**3\n",
- "Rs=3.3*10**3\n",
- "Rd=4.7*10**3\n",
- "Rl=50.0*10**3\n",
- "rs=600.0\n",
- "\n",
- "#Calculations\n",
- "Zs=1/Yfs\n",
- "Zi=((1/Yfs)*Rs)/((1/Yfs)+Rs)\n",
- "Zd=rd\n",
- "Zo=(Rd*rd)/(Rd+rd)\n",
- "Av=Yfs*((Rd*Rl)/(Rd+Rl))\n",
- "print(\"overall volateg gain\")\n",
- "Av=(Yfs*((Rd*Rl)/(Rd+Rl))*Zi)/(rs+Zi)\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "overall volateg gain\n",
- "The value of Av= 4.32 \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.6 Page No 459"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Id=3.0*10**-3\n",
- "Vds=10.0\n",
- "Vdd=25.0\n",
- "Vgs=2.3\n",
- "\n",
- "#Calculations\n",
- "Rs=Vgs/Id\n",
- "Rd=((Vdd-Vds)/Id)-Rs\n",
- "\n",
- "#Results\n",
- "print('The value of Rd= %.2f ' %(Rd))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rd= 4233.33 \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.7 Page No 462"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Crss=1.0*10**-12\n",
- "Ciss=5.0*10**-12\n",
- "Yfs=2500.0*10**-6\n",
- "Yos=75.0*10**-6\n",
- "Rd=5.6*10**3\n",
- "Rl=100.0*10**3\n",
- "R1=3.3*10**6\n",
- "R2=1.0*10**6\n",
- "rs=600.0\n",
- "\n",
- "#Calculations\n",
- "Cgd=Crss\n",
- "Cgs=Ciss-Crss\n",
- "Av=Yfs*(((1/Yos)*Rd*Rl))/((Rd*Rl+(1/Yos)*Rd+(1/Yos)*Rl))\n",
- "Cin=Cgs+(1+Av)*Cgd\n",
- "Zi=(R1*R2)/(R1+R2)\n",
- "f2=1/(2*3.14*Cin*((rs*Zi)/(rs+Zi)))\n",
- "\n",
- "#Results\n",
- "print('The input capicitance limited = %.2f ' %(f2/10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The input capicitance limited = 18.34 \n"
- ]
- }
- ],
- "prompt_number": 6
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter11_2.ipynb b/Electronic_Devices_and_Circuits/Chapter11_2.ipynb deleted file mode 100755 index e211f994..00000000 --- a/Electronic_Devices_and_Circuits/Chapter11_2.ipynb +++ /dev/null @@ -1,305 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 11 : Ac analysis of FEt circuits"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.2, Page No 443"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Yos=10.0*10**-6\n",
- "Yfs=3000.0*10**-6\n",
- "R1=1.0*10**6\n",
- "R2=5.6*10**6\n",
- "Rd=2.7*10**3\n",
- "Rl=Rd\n",
- "\n",
- "#Calculations\n",
- "rd=1.0/Yos\n",
- "Zi=((R1*R2)/(R1+R2))*10**-3\n",
- "print(\"input impedance is %dKohm \" %Zi)\n",
- "Zo=(Rd*rd)/(Rd+rd)\n",
- "print(\" output inpedance is %dohm \" %Zo)\n",
- "Av=-Yfs*((Rl*rd)/(Rl+rd))\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "input impedance is 848Kohm \n",
- " output inpedance is 2629ohm \n",
- "The value of Av= -7.89 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.03, Page No 447"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Yos=10.0*10**-6\n",
- "Yfs=4000.0*10**-6\n",
- "Ig=1.0*10**-9\n",
- "Vgs=15.0\n",
- "Rs=3.3*10**3\n",
- "Rg=1.0*10**6\n",
- "Rd=4.7*10**3\n",
- "Rl=33*10**3\n",
- "\n",
- "#Calculations\n",
- "rd=1.0/Yos\n",
- "Rgs=(Vgs/Ig)\n",
- "Zg=(Rgs*(1+Yfs*Rs))\n",
- "Zi=Rg\n",
- "Zd=rd+Rs+(Yfs*Rs*rd)\n",
- "Zo=(Rd*Zd)/(Rd+Zd)\n",
- "Av=-(Yfs*((Rd*Rl)/(Rd+Rl)))/(1+Yfs*Rs)\n",
- "Av=-((Rd*Rl)/(Rd+Rl))/Rs\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Av= -1.25 \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.4 Page No 451"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Yfs=3000.0*10**-6\n",
- "Rgs=100.0*10**6\n",
- "rd=50.0*10**3\n",
- "Rs=5.6*10**3\n",
- "Rl=12.0*10**3\n",
- "R1=1.5*10**6\n",
- "R2=1.0*10**6\n",
- "\n",
- "#Calculations\n",
- "Zg=Rgs*(1+Yfs*((Rs*Rl)/(Rs+Rl)))\n",
- "Zi=(R1*R2)/(R1+R2)\n",
- "Zs=((1/Yfs)*rd)/((1/Yfs)+rd)\n",
- "Zo=(Rs*Rl*(1/Yfs))/(Rs*Rl+Rs*(1/Yfs)+Rl*(1/Yfs))\n",
- "Av=-(Yfs*((Rs*Rl)/(Rs+Rl)))/(1+Yfs*((Rs*Rl)/(Rs+Rl)))\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Av= -0.92 \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.5, Page No 456"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Yfs=3000.0*10**-6\n",
- "rd=50.0*10**3\n",
- "Rs=3.3*10**3\n",
- "Rd=4.7*10**3\n",
- "Rl=50.0*10**3\n",
- "rs=600.0\n",
- "\n",
- "#Calculations\n",
- "Zs=1/Yfs\n",
- "Zi=((1/Yfs)*Rs)/((1/Yfs)+Rs)\n",
- "Zd=rd\n",
- "Zo=(Rd*rd)/(Rd+rd)\n",
- "Av=Yfs*((Rd*Rl)/(Rd+Rl))\n",
- "print(\"overall volateg gain\")\n",
- "Av=(Yfs*((Rd*Rl)/(Rd+Rl))*Zi)/(rs+Zi)\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "overall volateg gain\n",
- "The value of Av= 4.32 \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.6 Page No 459"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Id=3.0*10**-3\n",
- "Vds=10.0\n",
- "Vdd=25.0\n",
- "Vgs=2.3\n",
- "\n",
- "#Calculations\n",
- "Rs=Vgs/Id\n",
- "Rd=((Vdd-Vds)/Id)-Rs\n",
- "\n",
- "#Results\n",
- "print('The value of Rd= %.2f ' %(Rd))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rd= 4233.33 \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11.7 Page No 462"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Crss=1.0*10**-12\n",
- "Ciss=5.0*10**-12\n",
- "Yfs=2500.0*10**-6\n",
- "Yos=75.0*10**-6\n",
- "Rd=5.6*10**3\n",
- "Rl=100.0*10**3\n",
- "R1=3.3*10**6\n",
- "R2=1.0*10**6\n",
- "rs=600.0\n",
- "\n",
- "#Calculations\n",
- "Cgd=Crss\n",
- "Cgs=Ciss-Crss\n",
- "Av=Yfs*(((1/Yos)*Rd*Rl))/((Rd*Rl+(1/Yos)*Rd+(1/Yos)*Rl))\n",
- "Cin=Cgs+(1+Av)*Cgd\n",
- "Zi=(R1*R2)/(R1+R2)\n",
- "f2=1/(2*3.14*Cin*((rs*Zi)/(rs+Zi)))\n",
- "\n",
- "#Results\n",
- "print('The input capicitance limited = %.2f ' %(f2/10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The input capicitance limited = 18.34 \n"
- ]
- }
- ],
- "prompt_number": 6
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter12_1.ipynb b/Electronic_Devices_and_Circuits/Chapter12_1.ipynb deleted file mode 100755 index b0fb9991..00000000 --- a/Electronic_Devices_and_Circuits/Chapter12_1.ipynb +++ /dev/null @@ -1,1196 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 12 : Small signal Amplifiers"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.1, Page No 474"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=50.0\n",
- "hie=1.0*10**3\n",
- "hib=20.0\n",
- "f1=100.0\n",
- "Rc=3.3*10**3\n",
- "\n",
- "#Calculations\n",
- "Re=Rc\n",
- "print(\" required capacitance\")\n",
- "Xc2=hib\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "print(\" voltage gain with emitter terminal completely bypassed to ground\")\n",
- "Av=-(hfe*Rc)/hie\n",
- "print(\"voltage gain when f=100\")\n",
- "Av=-(hfe*Rc)/math.sqrt(((hie**2)+((1+hfe)*Xc2)**2))\n",
- "\n",
- "#Results\n",
- "print(\" voltage gain when C2 is incorrectly selected as Xc2=Re/10\")\n",
- "Avx=-(hfe*Rc)/math.sqrt(((hie**2)+((1+hfe)*(Re/10))**2))\n",
- "print('The value of Avx= %.2f ' %(Avx))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " required capacitance\n",
- " voltage gain with emitter terminal completely bypassed to ground\n",
- "voltage gain when f=100\n",
- " voltage gain when C2 is incorrectly selected as Xc2=Re/10\n",
- "The value of Avx= -9.79 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.2, Page No 477"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=24.0\n",
- "Ve=5.0\n",
- "Vce=3.0\n",
- "Rl=120.0*10**3\n",
- "Vbe=0.7\n",
- "Rc=Rl/10.0\n",
- "\n",
- "#Calculations\n",
- "Vrc=Vcc-Vce-Ve\n",
- "Ic=Vrc/Rc\n",
- "Re=Ve/Ic#use 3.9Kohm standard value to make Ic littel less than design level\n",
- "Re=3.9*10**3\n",
- "R2=10*Re\n",
- "I2=(Ve+Vbe)/R2\n",
- "R1=(Vcc-Ve-Vbe)/I2\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f ' %(R1/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 125.21 \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.3 Page No 477"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=100.0\n",
- "Ie=1.3*10**-3\n",
- "f1=100.0\n",
- "R1=120.0*10**3\n",
- "R2=39.0*10**3\n",
- "rs=600.0\n",
- "\n",
- "#Calculations\n",
- "Rl=R1\n",
- "re=(26*10**-3)/Ie\n",
- "Xc2=re\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "hie=(1+hfe)*re\n",
- "Zi=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "C1=1/((2*3.14*f1*((Zi+rs)/10)))\n",
- "C3=1/(2*3.14*f1*((Rc+Rl)/10))\n",
- "\n",
- "#Results\n",
- "print('The value of C3= %.2f mf ' %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C3= 0.12 mf \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.5, Page No 484"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "rs=600.0\n",
- "f1=100.0\n",
- "Yfs=6000.0*10**-6\n",
- "R1=4.7*10**6\n",
- "R2=1.0*10**6\n",
- "Rd=6.8*10**3\n",
- "Rl=120*10**3\n",
- "\n",
- "#Calculations\n",
- "Xc2=1/Yfs\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "Zi=(R1*R2)/(R1+R2)\n",
- "C1=1/(2*3.14*f1*(Zi+rs)/10)\n",
- "C3=1/(2*3.14*f1*(Rd+Rl)/10)\n",
- "\n",
- "#Calculations\n",
- "print('The value of C3= %.2f mF' %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C3= 0.13 mF\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.7 Page No 489"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R1=120.0*10**3\n",
- "R2=39.0*10**3\n",
- "hie=2.0*10**3\n",
- "R7=12.0*10**3\n",
- "Zo=R7\n",
- "R5=R1\n",
- "R6=R2\n",
- "hfe=100.0\n",
- "\n",
- "#Calculations\n",
- "R3=R7\n",
- "Zl=R1\n",
- "Zi=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "Zi2=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "Av1=-(hfe*((R3*Zi2)/(R3+Zi2)))/hie\n",
- "Av2=-(hfe*((R7*Zl)/(R7+Zl)))/hie\n",
- "Av=Av1*Av2\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Av= 44180.12 \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.8 Page No 491"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Ve1=5.0\n",
- "Vce1=3.0\n",
- "Vce2=3.0\n",
- "Vbe=0.7\n",
- "Vcc=14.0\n",
- "Rl=40.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Vb2=Ve1+Vce1\n",
- "Vc1=Vb2\n",
- "Ve2=Vb2-Vbe\n",
- "Vr5=Vcc-Ve2-Vce2\n",
- "R5=Rl/10#use 3.9Kohm satandard value\n",
- "R5=3.9*10**3\n",
- "Ic2=Vr5/R5\n",
- "R6=Ve2/Ic2#use 8.2Kohm as standard and recalculate\n",
- "R6=8.2*10**3\n",
- "Ic2=Ve2/R6\n",
- "Vr3=Vcc-Vc1\n",
- "print(\" Ic1>>Ib2 %select Ic1=1mA\")\n",
- "Ic1=1*10**-3\n",
- "R3=Vr3/Ic1#use standard value as 5.6Kohm and recalculate Ic1 in order ti keep Vb2=8V\n",
- "R3=5.6*10**3\n",
- "Ic1=Vr3/R3\n",
- "R4=Ve1/Ic1\n",
- "Vr2=Ve1+Vbe\n",
- "Vr1=Vcc-Ve1-Vbe\n",
- "R2=10*R4\n",
- "I2=(Ve1+Vbe)/R2\n",
- "R1=(Vr1*R2)/Vr2\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm' %(R1/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Ic1>>Ib2 %select Ic1=1mA\n",
- "The value of R1= 67.95 kohm\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.9, Page No 493"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=50.0\n",
- "re=26.0\n",
- "R1=68.0*10**3\n",
- "R2=47.0*10**3\n",
- "rs=600.0\n",
- "f1=75.0\n",
- "R5=3.9*10**3\n",
- "Rl=40.0*10**3\n",
- "\n",
- "#Calculations\n",
- "hie=(1+hfe)*re\n",
- "Zi=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "Xc1=(Zi+rs)/10\n",
- "C1=1/(2*3.14*f1*Xc1)\n",
- "Xc2=.65*re\n",
- "Xc3=Xc2\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "C3=C2\n",
- "Xc4=(R5+Rl)/10\n",
- "C4=1/(2*3.14*f1*Xc4)\n",
- "\n",
- "#Results\n",
- "print('The value of C4= %.2f mf' %(C4*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C4= 0.48 mf\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.10, Page No 494"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=50.0\n",
- "hie=1.3*10**3\n",
- "R3=5.6*10**3\n",
- "R5=3.9*10**3\n",
- "Rl=40.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Av1=-(hfe*((R3*hie)/(R3+hie)))/hie\n",
- "Av2=-(hfe*((R5*Rl)/(R5+Rl)))/hie\n",
- "\n",
- "#Results\n",
- "print(\" overall voltage gain is Av=Av1*Av2\")\n",
- "Av=Av1*Av2\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " overall voltage gain is Av=Av1*Av2\n",
- "The value of Av= 5546.20 \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.11 Page No 497"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vp=100.0*10**-3\n",
- "Rl=100.0\n",
- "Vbe=0.7\n",
- "Vcc=20.0\n",
- "\n",
- "#Calculations\n",
- "ip=Vp/Rl\n",
- "print(\"select Ie2>ip\")\n",
- "Ie2=2.0*10**-3\n",
- "Ve1=5.0\n",
- "Vce1=3.0\n",
- "Vb2=Ve1+Vce1\n",
- "Vc1=Vb2\n",
- "Ve2=Vb2-Vbe\n",
- "R5=Ve2/Ie2#use 3.3Kohm standard value\n",
- "R5=3.3*10**3\n",
- "Ic1=1*10**-3\n",
- "Vr3=Vcc-Vb2\n",
- "R3=Vr3/Ic1\n",
- "R4=Ve1/Ic1#use 4.7Kohm standard value\n",
- "R4=4.7*10**3\n",
- "Vb1=Ic1*R4+Vbe\n",
- "R2=10*R4\n",
- "R1=((Vcc-Vb1)*R2)/Vr2\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "select Ie2>ip\n",
- "The value of R1= 120.39 kohm \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.12 Page No 498"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "rs=600.0\n",
- "Ie1=1.0*10**-3\n",
- "hfe=50.0\n",
- "R1=120.0*10**3\n",
- "R2=47.0*10**3\n",
- "f1=150.0\n",
- "Ie2=2.0*10**-3\n",
- "R5=3.3*10**3\n",
- "R3=12.0*10**3\n",
- "Rl=100.0\n",
- "\n",
- "#Calculations\n",
- "re=26*10**-3/Ie1\n",
- "hie=(1+hfe)*re\n",
- "Zi=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "Xc1=(Zi+rs)/10\n",
- "C1=1/(2*3.14*f1*Xc1)#use 6*10**-6 as standard value\n",
- "Xc2=.65*re\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "re2=26*10**-3/Ie2\n",
- "Zo=(R5*(re2+R3/hfe))/(R5+(re2+R3/hfe))\n",
- "Xc3=.65*(Rl+Zo)\n",
- "C3=1/(2*3.14*f1*Xc3)\n",
- "\n",
- "#Results\n",
- "print('The value of C3= %.2f mf' %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C3= 4.88 mf\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.13 Page No 499"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Ie2=2.0*10**-3\n",
- "hfe=50.0\n",
- "R5=3.3*10**3\n",
- "Rl=100.0\n",
- "hfc2=51.0\n",
- "R3=12.0*10**3\n",
- "\n",
- "#Calculations\n",
- "re=26*10**-3/Ie2\n",
- "hic=hfe*re\n",
- "Zi2=hic+hfc2*((Rl*R5)/(Rl+R5))\n",
- "Av1=-(hfe*((R3*Zi2)/(R3+Zi2)))/hie\n",
- "Av2=1.0\n",
- "\n",
- "#Results\n",
- "print(\"overall voltage gain is Av=Av1*Av2\")\n",
- "Av=Av1*Av2\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "overall voltage gain is Av=Av1*Av2\n",
- "The value of Av= -143.97 \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.14, Page No 503"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "vp=50.0*10**-3\n",
- "Rl=50.0\n",
- "Ve2=5.0\n",
- "Vcc=12.0\n",
- "Vbe=0.7\n",
- "hFE=70.0\n",
- "hfe=100.0\n",
- "R2=120.0*10**3\n",
- "f1=150.0\n",
- "R3=150.0*10**3\n",
- "R1=5.6*10**3\n",
- "R4=2.2*10**3\n",
- "\n",
- "#Calculations\n",
- "ip=vp/Rl\n",
- "print(\"select Ie2>ip\")\n",
- "Ie2=2*10**-3\n",
- "R4=Ve2/Ie2#use standard 2.2Kohm\n",
- "R4=2.2*10**3\n",
- "Ie2=Ve2/R4\n",
- "Ic1=1*10**-3\n",
- "Vr1=Vcc-(Vbe+Ve2)\n",
- "R1=Vr1/Ic1#use 5.6kohm and recalculate\n",
- "R1=5.6*10**3\n",
- "Ic1=Vr1/R1\n",
- "Ib1=Ic1/hFE\n",
- "hie=hfe*(26*10**-3/Ic1)\n",
- "hie2=hfe*((26*10**-3)/(2.27*10**-3))\n",
- "Zi1=(R2*hie)/(R2+hie)\n",
- "Xc1=Zi1/10\n",
- "C1=1/(2*3.14*f1*Xc1)\n",
- "Xc2=R3/100\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "Zo=(((hie2+R1)/hfe)*R4)/(((hie2+R1)/hfe)+R4)\n",
- "Xc3=Rl+Zo\n",
- "C3=1/(2*3.14*f1*Xc3)\n",
- "\n",
- "#Results\n",
- "print('The value of C3= %.2f mf' %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "select Ie2>ip\n",
- "The value of C3= 9.20 mf\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.15, Page No 407"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vgsoff=-6.0\n",
- "Idss=20.0*10**-3\n",
- "Yfs=4000.0*10**-6\n",
- "Id=2.0*10**-3\n",
- "Vcc=20.0\n",
- "Zi=500.0*10**3\n",
- "R2=560.0*10**3\n",
- "Rl=80.0*10**3\n",
- "Vbe=0.7\n",
- "Vce=3.0\n",
- "\n",
- "#Calculations\n",
- "Vgs=Vgsoff*(1-math.sqrt(Id/Idss))\n",
- "Vds=(-Vgsoff)+1-(-Vgs)\n",
- "Vr3=(Vcc-Vds)/2\n",
- "Vr4=Vr3\n",
- "R3=Vr4/Id#use 3.9kohm as standard and recalculate Vr3 and Vr4\n",
- "R4=R3\n",
- "R4=3.9*10**3\n",
- "Vr3=Id*R4\n",
- "Vr4=Vr3\n",
- "Vr2=Vr4-(-Vgs)\n",
- "Vr1=Vcc-Vr2\n",
- "R1=(Vr1*R2)/Vr2\n",
- "R6=Rl/10\n",
- "Vr5=Vr3-Vbe\n",
- "Vr6=Vcc-Vr5-Vce\n",
- "Ic2=Vr6/R6\n",
- "R5=Vr5/Ic2\n",
- "\n",
- "#Results\n",
- "print('The value of R5= %.2f kohm' %(R5/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R5= 5.74 kohm\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.16, Page No 508"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R1=2.7*10**6\n",
- "R2=560.0*10**3\n",
- "f1=150.0\n",
- "Yfs=8000.0*10**-6\n",
- "Ie=1.2*10**-3\n",
- "Rl=80.0*10**3\n",
- "R6=8.2*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi=(R1*R2)/(R1+R2)\n",
- "Xc1=Zi/10\n",
- "C1=1/(2*3.14*f1*Xc1)\n",
- "Xc2=.65/Yfs\n",
- "C2=1/(2*3.14*f1*Xc2)#use 15pF as standard value\n",
- "re=26*10**-3/Ie\n",
- "Xc3=.65*re\n",
- "C3=1/(2*3.14*f1*Xc3)\n",
- "Xc4=(R6+Rl)/10\n",
- "C4=1/(2*3.14*f1*Xc4)\n",
- "\n",
- "#Results\n",
- "print('The value of C4= %.2f mf' %(C4*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C4= 0.12 mf\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.17, Page No 509"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "re=22.0\n",
- "hfe=100.0\n",
- "R3=3.9*10**3\n",
- "Yfs=4000*10**-6\n",
- "R6=8.2*10**3\n",
- "Rl=80.*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi2=hfe*re\n",
- "Av1=-Yfs*((R3*Zi2)/(R3+Zi2))\n",
- "Av2=-(hfe*((R6*Rl)/(R6+Rl)))/Zi2\n",
- "\n",
- "#Results\n",
- "print(\"overall voltage is Av=Av1*Av2\")\n",
- "Av=Av1*Av2\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "overall voltage is Av=Av1*Av2\n",
- "The value of Av= 1902.09 \n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.18, Page No 516"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hFE=60.0\n",
- "hfe=60.0\n",
- "hie=1.4*10**3\n",
- "Rl=70.0*10**3\n",
- "Vce=3.0\n",
- "Vbe=.7\n",
- "Vcc=10.0\n",
- "\n",
- "#Calculations\n",
- "Rc2=Rl/10#use 6.8Kohm as standard value\n",
- "Vrc2=Vcc+Vbe-Vce\n",
- "Ic=Vrc2/Rc2\n",
- "Ie=Ic\n",
- "Re=(Vcc-Vbe)/(2*Ie)#use 4.7 as standard value\n",
- "Re=4.7*10**3\n",
- "Rb=Vbe/(10*(Ic/hFE))\n",
- "Rb1=Rb\n",
- "\n",
- "#Results\n",
- "print('The value of Rb= %.2f kohm ' %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb= 3.82 kohm \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.19, Page No 517"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f1=60.0\n",
- "Ie=1.13*10**-3\n",
- "hfe=60.0\n",
- "Rb=3.9*10**3\n",
- "Rl=70.0*10**3\n",
- "Rc=6.8*10**3\n",
- "\n",
- "#Calculations\n",
- "re=26*10**-3/Ie#use 20 as standard value\n",
- "re=20\n",
- "hie=hfe*re\n",
- "Zb=2*hie\n",
- "Zi=(Rb*Zb)/(Rb+Zb)\n",
- "C1=1/(2*3.14*f1*Zi)\n",
- "C2=1/(2*3.14*f1*(Rl/10))\n",
- "Av=(hfe*((Rc*Rl)/(Rc+Rl)))/(2*hie)\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Av= 154.95 \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.20, Page No 521"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=20.0\n",
- "Rl=90.0*10**3\n",
- "hfe=50.0\n",
- "hie=1.2*10**3\n",
- "hib=24.0\n",
- "Vce=3\n",
- "Vce1=Vce\n",
- "Ve=5.0\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Rc=Rl/10#use 8.2kohm as standard value\n",
- "Rc=8.2*10**3\n",
- "Vrc=Vcc-Vce-Vce1-Ve\n",
- "Ic=Vrc/Rc\n",
- "Re=Ve/Ic\n",
- "Re=4.7*10**3#use 4.7 as standard value\n",
- "R3=10*Re\n",
- "Vb1=Ve+Vbe\n",
- "I3=Vb1/R3\n",
- "Vb2=Ve+Vce+Vbe\n",
- "Vr2=Vb2-Vb1\n",
- "R2=Vr2/I3\n",
- "R1=(Vcc-Vb2)/I3\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 93.18 kohm \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.21, Page No 522"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f1=25.0\n",
- "R2=24.7*10**3\n",
- "R3=47.0*10**3\n",
- "hie=1.2*10**3\n",
- "hib=24.0\n",
- "Rc=9.0*10**3\n",
- "Rl=90*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi=(R2*R3*hie)/(R2*R3+R2*hie+R3*hie)\n",
- "C1=1/(2*3.14*f1*(Zi/10))\n",
- "C2=1/(2*3.14*f1*(hie/10))\n",
- "C3=1/(2*3.14*f1*hib)\n",
- "C4=1/(2*3.14*f1*((Rc+Rl)/10))\n",
- "\n",
- "#Results\n",
- "print('The value of C4= %.2f mF' %(C4*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C4= 0.64 mF\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.22, Page No 525"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hie=1.0\n",
- "hfe=50.0\n",
- "hoe=10.0*10**-6\n",
- "Cc=5*10**-12\n",
- "Cp=330*10**-12\n",
- "Lp=75*10**-6\n",
- "Rw=1.0\n",
- "Rl=5.0\n",
- "hfb=50.0\n",
- "fo=1.0*10**6\n",
- "\n",
- "#Calculations\n",
- "fo=1.0/(2.0*3.14*math.sqrt(Lp*(Cp+Cc)))\n",
- "print(\"resonance frequency is %3fHz \" %fo)\n",
- "Zp=Lp/((Cp+Cc)*Rw)\n",
- "Rc=(1.0/hoe)/1000\n",
- "RL=(Zp*Rc*Rl)/(Rl*Rc+Rc*Zp+Rl*Zp)\n",
- "RL1=4.7 #as standard value\n",
- "Av=(hfb*RL1)/hie\n",
- "print(\" voltage gain is %d \" %Av)\n",
- "Qp=7.6\n",
- "QL=(2*3.14*fo*Lp)/Rw\n",
- "print(\"since QL>Qp\")\n",
- "fo=1\n",
- "B=fo/Qp\n",
- "\n",
- "#Results\n",
- "print(\"bandwidth is %.2f kHz \" %(B*10**3))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "resonance frequency is 1004586.461587Hz \n",
- " voltage gain is 235 \n",
- "since QL>Qp\n",
- "bandwidth is 131.58 kHz \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.23, Page No 528"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hie=1.0*10**3\n",
- "hfe=50.0\n",
- "hoe=10.0*10**-6\n",
- "Cc=5.0*10**-12\n",
- "Cp=330.0*10**-12\n",
- "Lp=75.0*10**-6\n",
- "Rw=1.0\n",
- "Rl=5.0*10**3\n",
- "fo=1.0*10**6\n",
- "zP=224.0*10**3\n",
- "rC=100.0*10**3\n",
- "K=0.015\n",
- "Ls=50.0*10**-6\n",
- "\n",
- "\n",
- "#Calculations\n",
- "RL=(Zp*Rc)/(Rc+Zp)\n",
- "print(\"voltage gain from the input to the primary memory winding\")\n",
- "Avp=(hfe*RL)/hie\n",
- "Vsp=K*math.sqrt(Ls/Lp)\n",
- "print(\"overall voltage gain from the input to teh secondary winding\")\n",
- "Av=Avp*Vsp\n",
- "Qp=Rc/(2*3.14*fo*Lp)\n",
- "Ql=471\n",
- "Q=(Ql*Qp)/(Ql+Qp)\n",
- "B=fo/Q\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"bandwidth is %.2f kHz \" %(B/10**5))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain from the input to the primary memory winding\n",
- "overall voltage gain from the input to teh secondary winding\n",
- "bandwidth is 47.12 kHz \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.24, Page No 530"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=1.0*10**6\n",
- "L2=50.0*10**-6\n",
- "K=0.015\n",
- "L1=75*10**-6\n",
- "rs=5.0\n",
- "Rw=1.0\n",
- "Lp=100.0*10**-6\n",
- "Cp=330.0*10**-12\n",
- "Cc=5.0*10**-12\n",
- "Rc=100.0*10**3\n",
- "hfe=50.0\n",
- "hie=1.0*10**3\n",
- "\n",
- "\n",
- "#Calculations\n",
- "C2=1/(((2*3.14*f)**2)*L2)\n",
- "M=K*math.sqrt(L1*L2)\n",
- "Rs=(((2*3.14*f)**2)*(M)**2)/rs\n",
- "Rp=Rs+Rw\n",
- "Zp=Lp/((Cp+Cc)*Rp)\n",
- "Rl=(Zp*Rc)/(Zp+Rc)\n",
- "print(\"voltage gain from the input to primary winding\")\n",
- "Avp=(hfe*Rl)/hie\n",
- "Vsp=12.2*10**-3\n",
- "Vos=((2*3.14*f)*L2)/rs\n",
- "\n",
- "#Results\n",
- "print(\"overall voltage gain from the input to secondary winding \")\n",
- "Av=Avp*Vos*Vsp\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain from the input to primary winding\n",
- "overall voltage gain from the input to secondary winding \n",
- "The value of Av= 1074.71 \n"
- ]
- }
- ],
- "prompt_number": 22
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter12_2.ipynb b/Electronic_Devices_and_Circuits/Chapter12_2.ipynb deleted file mode 100755 index b0fb9991..00000000 --- a/Electronic_Devices_and_Circuits/Chapter12_2.ipynb +++ /dev/null @@ -1,1196 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 12 : Small signal Amplifiers"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.1, Page No 474"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=50.0\n",
- "hie=1.0*10**3\n",
- "hib=20.0\n",
- "f1=100.0\n",
- "Rc=3.3*10**3\n",
- "\n",
- "#Calculations\n",
- "Re=Rc\n",
- "print(\" required capacitance\")\n",
- "Xc2=hib\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "print(\" voltage gain with emitter terminal completely bypassed to ground\")\n",
- "Av=-(hfe*Rc)/hie\n",
- "print(\"voltage gain when f=100\")\n",
- "Av=-(hfe*Rc)/math.sqrt(((hie**2)+((1+hfe)*Xc2)**2))\n",
- "\n",
- "#Results\n",
- "print(\" voltage gain when C2 is incorrectly selected as Xc2=Re/10\")\n",
- "Avx=-(hfe*Rc)/math.sqrt(((hie**2)+((1+hfe)*(Re/10))**2))\n",
- "print('The value of Avx= %.2f ' %(Avx))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " required capacitance\n",
- " voltage gain with emitter terminal completely bypassed to ground\n",
- "voltage gain when f=100\n",
- " voltage gain when C2 is incorrectly selected as Xc2=Re/10\n",
- "The value of Avx= -9.79 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.2, Page No 477"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=24.0\n",
- "Ve=5.0\n",
- "Vce=3.0\n",
- "Rl=120.0*10**3\n",
- "Vbe=0.7\n",
- "Rc=Rl/10.0\n",
- "\n",
- "#Calculations\n",
- "Vrc=Vcc-Vce-Ve\n",
- "Ic=Vrc/Rc\n",
- "Re=Ve/Ic#use 3.9Kohm standard value to make Ic littel less than design level\n",
- "Re=3.9*10**3\n",
- "R2=10*Re\n",
- "I2=(Ve+Vbe)/R2\n",
- "R1=(Vcc-Ve-Vbe)/I2\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f ' %(R1/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 125.21 \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.3 Page No 477"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=100.0\n",
- "Ie=1.3*10**-3\n",
- "f1=100.0\n",
- "R1=120.0*10**3\n",
- "R2=39.0*10**3\n",
- "rs=600.0\n",
- "\n",
- "#Calculations\n",
- "Rl=R1\n",
- "re=(26*10**-3)/Ie\n",
- "Xc2=re\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "hie=(1+hfe)*re\n",
- "Zi=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "C1=1/((2*3.14*f1*((Zi+rs)/10)))\n",
- "C3=1/(2*3.14*f1*((Rc+Rl)/10))\n",
- "\n",
- "#Results\n",
- "print('The value of C3= %.2f mf ' %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C3= 0.12 mf \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.5, Page No 484"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "rs=600.0\n",
- "f1=100.0\n",
- "Yfs=6000.0*10**-6\n",
- "R1=4.7*10**6\n",
- "R2=1.0*10**6\n",
- "Rd=6.8*10**3\n",
- "Rl=120*10**3\n",
- "\n",
- "#Calculations\n",
- "Xc2=1/Yfs\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "Zi=(R1*R2)/(R1+R2)\n",
- "C1=1/(2*3.14*f1*(Zi+rs)/10)\n",
- "C3=1/(2*3.14*f1*(Rd+Rl)/10)\n",
- "\n",
- "#Calculations\n",
- "print('The value of C3= %.2f mF' %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C3= 0.13 mF\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.7 Page No 489"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R1=120.0*10**3\n",
- "R2=39.0*10**3\n",
- "hie=2.0*10**3\n",
- "R7=12.0*10**3\n",
- "Zo=R7\n",
- "R5=R1\n",
- "R6=R2\n",
- "hfe=100.0\n",
- "\n",
- "#Calculations\n",
- "R3=R7\n",
- "Zl=R1\n",
- "Zi=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "Zi2=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "Av1=-(hfe*((R3*Zi2)/(R3+Zi2)))/hie\n",
- "Av2=-(hfe*((R7*Zl)/(R7+Zl)))/hie\n",
- "Av=Av1*Av2\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Av= 44180.12 \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.8 Page No 491"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Ve1=5.0\n",
- "Vce1=3.0\n",
- "Vce2=3.0\n",
- "Vbe=0.7\n",
- "Vcc=14.0\n",
- "Rl=40.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Vb2=Ve1+Vce1\n",
- "Vc1=Vb2\n",
- "Ve2=Vb2-Vbe\n",
- "Vr5=Vcc-Ve2-Vce2\n",
- "R5=Rl/10#use 3.9Kohm satandard value\n",
- "R5=3.9*10**3\n",
- "Ic2=Vr5/R5\n",
- "R6=Ve2/Ic2#use 8.2Kohm as standard and recalculate\n",
- "R6=8.2*10**3\n",
- "Ic2=Ve2/R6\n",
- "Vr3=Vcc-Vc1\n",
- "print(\" Ic1>>Ib2 %select Ic1=1mA\")\n",
- "Ic1=1*10**-3\n",
- "R3=Vr3/Ic1#use standard value as 5.6Kohm and recalculate Ic1 in order ti keep Vb2=8V\n",
- "R3=5.6*10**3\n",
- "Ic1=Vr3/R3\n",
- "R4=Ve1/Ic1\n",
- "Vr2=Ve1+Vbe\n",
- "Vr1=Vcc-Ve1-Vbe\n",
- "R2=10*R4\n",
- "I2=(Ve1+Vbe)/R2\n",
- "R1=(Vr1*R2)/Vr2\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm' %(R1/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Ic1>>Ib2 %select Ic1=1mA\n",
- "The value of R1= 67.95 kohm\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.9, Page No 493"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=50.0\n",
- "re=26.0\n",
- "R1=68.0*10**3\n",
- "R2=47.0*10**3\n",
- "rs=600.0\n",
- "f1=75.0\n",
- "R5=3.9*10**3\n",
- "Rl=40.0*10**3\n",
- "\n",
- "#Calculations\n",
- "hie=(1+hfe)*re\n",
- "Zi=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "Xc1=(Zi+rs)/10\n",
- "C1=1/(2*3.14*f1*Xc1)\n",
- "Xc2=.65*re\n",
- "Xc3=Xc2\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "C3=C2\n",
- "Xc4=(R5+Rl)/10\n",
- "C4=1/(2*3.14*f1*Xc4)\n",
- "\n",
- "#Results\n",
- "print('The value of C4= %.2f mf' %(C4*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C4= 0.48 mf\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.10, Page No 494"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=50.0\n",
- "hie=1.3*10**3\n",
- "R3=5.6*10**3\n",
- "R5=3.9*10**3\n",
- "Rl=40.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Av1=-(hfe*((R3*hie)/(R3+hie)))/hie\n",
- "Av2=-(hfe*((R5*Rl)/(R5+Rl)))/hie\n",
- "\n",
- "#Results\n",
- "print(\" overall voltage gain is Av=Av1*Av2\")\n",
- "Av=Av1*Av2\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " overall voltage gain is Av=Av1*Av2\n",
- "The value of Av= 5546.20 \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.11 Page No 497"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vp=100.0*10**-3\n",
- "Rl=100.0\n",
- "Vbe=0.7\n",
- "Vcc=20.0\n",
- "\n",
- "#Calculations\n",
- "ip=Vp/Rl\n",
- "print(\"select Ie2>ip\")\n",
- "Ie2=2.0*10**-3\n",
- "Ve1=5.0\n",
- "Vce1=3.0\n",
- "Vb2=Ve1+Vce1\n",
- "Vc1=Vb2\n",
- "Ve2=Vb2-Vbe\n",
- "R5=Ve2/Ie2#use 3.3Kohm standard value\n",
- "R5=3.3*10**3\n",
- "Ic1=1*10**-3\n",
- "Vr3=Vcc-Vb2\n",
- "R3=Vr3/Ic1\n",
- "R4=Ve1/Ic1#use 4.7Kohm standard value\n",
- "R4=4.7*10**3\n",
- "Vb1=Ic1*R4+Vbe\n",
- "R2=10*R4\n",
- "R1=((Vcc-Vb1)*R2)/Vr2\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "select Ie2>ip\n",
- "The value of R1= 120.39 kohm \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.12 Page No 498"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "rs=600.0\n",
- "Ie1=1.0*10**-3\n",
- "hfe=50.0\n",
- "R1=120.0*10**3\n",
- "R2=47.0*10**3\n",
- "f1=150.0\n",
- "Ie2=2.0*10**-3\n",
- "R5=3.3*10**3\n",
- "R3=12.0*10**3\n",
- "Rl=100.0\n",
- "\n",
- "#Calculations\n",
- "re=26*10**-3/Ie1\n",
- "hie=(1+hfe)*re\n",
- "Zi=(R1*R2*hie)/(R1*R2+R1*hie+R2*hie)\n",
- "Xc1=(Zi+rs)/10\n",
- "C1=1/(2*3.14*f1*Xc1)#use 6*10**-6 as standard value\n",
- "Xc2=.65*re\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "re2=26*10**-3/Ie2\n",
- "Zo=(R5*(re2+R3/hfe))/(R5+(re2+R3/hfe))\n",
- "Xc3=.65*(Rl+Zo)\n",
- "C3=1/(2*3.14*f1*Xc3)\n",
- "\n",
- "#Results\n",
- "print('The value of C3= %.2f mf' %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C3= 4.88 mf\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.13 Page No 499"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Ie2=2.0*10**-3\n",
- "hfe=50.0\n",
- "R5=3.3*10**3\n",
- "Rl=100.0\n",
- "hfc2=51.0\n",
- "R3=12.0*10**3\n",
- "\n",
- "#Calculations\n",
- "re=26*10**-3/Ie2\n",
- "hic=hfe*re\n",
- "Zi2=hic+hfc2*((Rl*R5)/(Rl+R5))\n",
- "Av1=-(hfe*((R3*Zi2)/(R3+Zi2)))/hie\n",
- "Av2=1.0\n",
- "\n",
- "#Results\n",
- "print(\"overall voltage gain is Av=Av1*Av2\")\n",
- "Av=Av1*Av2\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "overall voltage gain is Av=Av1*Av2\n",
- "The value of Av= -143.97 \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.14, Page No 503"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "vp=50.0*10**-3\n",
- "Rl=50.0\n",
- "Ve2=5.0\n",
- "Vcc=12.0\n",
- "Vbe=0.7\n",
- "hFE=70.0\n",
- "hfe=100.0\n",
- "R2=120.0*10**3\n",
- "f1=150.0\n",
- "R3=150.0*10**3\n",
- "R1=5.6*10**3\n",
- "R4=2.2*10**3\n",
- "\n",
- "#Calculations\n",
- "ip=vp/Rl\n",
- "print(\"select Ie2>ip\")\n",
- "Ie2=2*10**-3\n",
- "R4=Ve2/Ie2#use standard 2.2Kohm\n",
- "R4=2.2*10**3\n",
- "Ie2=Ve2/R4\n",
- "Ic1=1*10**-3\n",
- "Vr1=Vcc-(Vbe+Ve2)\n",
- "R1=Vr1/Ic1#use 5.6kohm and recalculate\n",
- "R1=5.6*10**3\n",
- "Ic1=Vr1/R1\n",
- "Ib1=Ic1/hFE\n",
- "hie=hfe*(26*10**-3/Ic1)\n",
- "hie2=hfe*((26*10**-3)/(2.27*10**-3))\n",
- "Zi1=(R2*hie)/(R2+hie)\n",
- "Xc1=Zi1/10\n",
- "C1=1/(2*3.14*f1*Xc1)\n",
- "Xc2=R3/100\n",
- "C2=1/(2*3.14*f1*Xc2)\n",
- "Zo=(((hie2+R1)/hfe)*R4)/(((hie2+R1)/hfe)+R4)\n",
- "Xc3=Rl+Zo\n",
- "C3=1/(2*3.14*f1*Xc3)\n",
- "\n",
- "#Results\n",
- "print('The value of C3= %.2f mf' %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "select Ie2>ip\n",
- "The value of C3= 9.20 mf\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.15, Page No 407"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vgsoff=-6.0\n",
- "Idss=20.0*10**-3\n",
- "Yfs=4000.0*10**-6\n",
- "Id=2.0*10**-3\n",
- "Vcc=20.0\n",
- "Zi=500.0*10**3\n",
- "R2=560.0*10**3\n",
- "Rl=80.0*10**3\n",
- "Vbe=0.7\n",
- "Vce=3.0\n",
- "\n",
- "#Calculations\n",
- "Vgs=Vgsoff*(1-math.sqrt(Id/Idss))\n",
- "Vds=(-Vgsoff)+1-(-Vgs)\n",
- "Vr3=(Vcc-Vds)/2\n",
- "Vr4=Vr3\n",
- "R3=Vr4/Id#use 3.9kohm as standard and recalculate Vr3 and Vr4\n",
- "R4=R3\n",
- "R4=3.9*10**3\n",
- "Vr3=Id*R4\n",
- "Vr4=Vr3\n",
- "Vr2=Vr4-(-Vgs)\n",
- "Vr1=Vcc-Vr2\n",
- "R1=(Vr1*R2)/Vr2\n",
- "R6=Rl/10\n",
- "Vr5=Vr3-Vbe\n",
- "Vr6=Vcc-Vr5-Vce\n",
- "Ic2=Vr6/R6\n",
- "R5=Vr5/Ic2\n",
- "\n",
- "#Results\n",
- "print('The value of R5= %.2f kohm' %(R5/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R5= 5.74 kohm\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.16, Page No 508"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R1=2.7*10**6\n",
- "R2=560.0*10**3\n",
- "f1=150.0\n",
- "Yfs=8000.0*10**-6\n",
- "Ie=1.2*10**-3\n",
- "Rl=80.0*10**3\n",
- "R6=8.2*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi=(R1*R2)/(R1+R2)\n",
- "Xc1=Zi/10\n",
- "C1=1/(2*3.14*f1*Xc1)\n",
- "Xc2=.65/Yfs\n",
- "C2=1/(2*3.14*f1*Xc2)#use 15pF as standard value\n",
- "re=26*10**-3/Ie\n",
- "Xc3=.65*re\n",
- "C3=1/(2*3.14*f1*Xc3)\n",
- "Xc4=(R6+Rl)/10\n",
- "C4=1/(2*3.14*f1*Xc4)\n",
- "\n",
- "#Results\n",
- "print('The value of C4= %.2f mf' %(C4*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C4= 0.12 mf\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.17, Page No 509"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "re=22.0\n",
- "hfe=100.0\n",
- "R3=3.9*10**3\n",
- "Yfs=4000*10**-6\n",
- "R6=8.2*10**3\n",
- "Rl=80.*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi2=hfe*re\n",
- "Av1=-Yfs*((R3*Zi2)/(R3+Zi2))\n",
- "Av2=-(hfe*((R6*Rl)/(R6+Rl)))/Zi2\n",
- "\n",
- "#Results\n",
- "print(\"overall voltage is Av=Av1*Av2\")\n",
- "Av=Av1*Av2\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "overall voltage is Av=Av1*Av2\n",
- "The value of Av= 1902.09 \n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.18, Page No 516"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hFE=60.0\n",
- "hfe=60.0\n",
- "hie=1.4*10**3\n",
- "Rl=70.0*10**3\n",
- "Vce=3.0\n",
- "Vbe=.7\n",
- "Vcc=10.0\n",
- "\n",
- "#Calculations\n",
- "Rc2=Rl/10#use 6.8Kohm as standard value\n",
- "Vrc2=Vcc+Vbe-Vce\n",
- "Ic=Vrc2/Rc2\n",
- "Ie=Ic\n",
- "Re=(Vcc-Vbe)/(2*Ie)#use 4.7 as standard value\n",
- "Re=4.7*10**3\n",
- "Rb=Vbe/(10*(Ic/hFE))\n",
- "Rb1=Rb\n",
- "\n",
- "#Results\n",
- "print('The value of Rb= %.2f kohm ' %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb= 3.82 kohm \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.19, Page No 517"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f1=60.0\n",
- "Ie=1.13*10**-3\n",
- "hfe=60.0\n",
- "Rb=3.9*10**3\n",
- "Rl=70.0*10**3\n",
- "Rc=6.8*10**3\n",
- "\n",
- "#Calculations\n",
- "re=26*10**-3/Ie#use 20 as standard value\n",
- "re=20\n",
- "hie=hfe*re\n",
- "Zb=2*hie\n",
- "Zi=(Rb*Zb)/(Rb+Zb)\n",
- "C1=1/(2*3.14*f1*Zi)\n",
- "C2=1/(2*3.14*f1*(Rl/10))\n",
- "Av=(hfe*((Rc*Rl)/(Rc+Rl)))/(2*hie)\n",
- "\n",
- "#Results\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Av= 154.95 \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.20, Page No 521"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=20.0\n",
- "Rl=90.0*10**3\n",
- "hfe=50.0\n",
- "hie=1.2*10**3\n",
- "hib=24.0\n",
- "Vce=3\n",
- "Vce1=Vce\n",
- "Ve=5.0\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Rc=Rl/10#use 8.2kohm as standard value\n",
- "Rc=8.2*10**3\n",
- "Vrc=Vcc-Vce-Vce1-Ve\n",
- "Ic=Vrc/Rc\n",
- "Re=Ve/Ic\n",
- "Re=4.7*10**3#use 4.7 as standard value\n",
- "R3=10*Re\n",
- "Vb1=Ve+Vbe\n",
- "I3=Vb1/R3\n",
- "Vb2=Ve+Vce+Vbe\n",
- "Vr2=Vb2-Vb1\n",
- "R2=Vr2/I3\n",
- "R1=(Vcc-Vb2)/I3\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 93.18 kohm \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.21, Page No 522"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f1=25.0\n",
- "R2=24.7*10**3\n",
- "R3=47.0*10**3\n",
- "hie=1.2*10**3\n",
- "hib=24.0\n",
- "Rc=9.0*10**3\n",
- "Rl=90*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi=(R2*R3*hie)/(R2*R3+R2*hie+R3*hie)\n",
- "C1=1/(2*3.14*f1*(Zi/10))\n",
- "C2=1/(2*3.14*f1*(hie/10))\n",
- "C3=1/(2*3.14*f1*hib)\n",
- "C4=1/(2*3.14*f1*((Rc+Rl)/10))\n",
- "\n",
- "#Results\n",
- "print('The value of C4= %.2f mF' %(C4*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C4= 0.64 mF\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.22, Page No 525"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hie=1.0\n",
- "hfe=50.0\n",
- "hoe=10.0*10**-6\n",
- "Cc=5*10**-12\n",
- "Cp=330*10**-12\n",
- "Lp=75*10**-6\n",
- "Rw=1.0\n",
- "Rl=5.0\n",
- "hfb=50.0\n",
- "fo=1.0*10**6\n",
- "\n",
- "#Calculations\n",
- "fo=1.0/(2.0*3.14*math.sqrt(Lp*(Cp+Cc)))\n",
- "print(\"resonance frequency is %3fHz \" %fo)\n",
- "Zp=Lp/((Cp+Cc)*Rw)\n",
- "Rc=(1.0/hoe)/1000\n",
- "RL=(Zp*Rc*Rl)/(Rl*Rc+Rc*Zp+Rl*Zp)\n",
- "RL1=4.7 #as standard value\n",
- "Av=(hfb*RL1)/hie\n",
- "print(\" voltage gain is %d \" %Av)\n",
- "Qp=7.6\n",
- "QL=(2*3.14*fo*Lp)/Rw\n",
- "print(\"since QL>Qp\")\n",
- "fo=1\n",
- "B=fo/Qp\n",
- "\n",
- "#Results\n",
- "print(\"bandwidth is %.2f kHz \" %(B*10**3))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "resonance frequency is 1004586.461587Hz \n",
- " voltage gain is 235 \n",
- "since QL>Qp\n",
- "bandwidth is 131.58 kHz \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.23, Page No 528"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hie=1.0*10**3\n",
- "hfe=50.0\n",
- "hoe=10.0*10**-6\n",
- "Cc=5.0*10**-12\n",
- "Cp=330.0*10**-12\n",
- "Lp=75.0*10**-6\n",
- "Rw=1.0\n",
- "Rl=5.0*10**3\n",
- "fo=1.0*10**6\n",
- "zP=224.0*10**3\n",
- "rC=100.0*10**3\n",
- "K=0.015\n",
- "Ls=50.0*10**-6\n",
- "\n",
- "\n",
- "#Calculations\n",
- "RL=(Zp*Rc)/(Rc+Zp)\n",
- "print(\"voltage gain from the input to the primary memory winding\")\n",
- "Avp=(hfe*RL)/hie\n",
- "Vsp=K*math.sqrt(Ls/Lp)\n",
- "print(\"overall voltage gain from the input to teh secondary winding\")\n",
- "Av=Avp*Vsp\n",
- "Qp=Rc/(2*3.14*fo*Lp)\n",
- "Ql=471\n",
- "Q=(Ql*Qp)/(Ql+Qp)\n",
- "B=fo/Q\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"bandwidth is %.2f kHz \" %(B/10**5))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain from the input to the primary memory winding\n",
- "overall voltage gain from the input to teh secondary winding\n",
- "bandwidth is 47.12 kHz \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12.24, Page No 530"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=1.0*10**6\n",
- "L2=50.0*10**-6\n",
- "K=0.015\n",
- "L1=75*10**-6\n",
- "rs=5.0\n",
- "Rw=1.0\n",
- "Lp=100.0*10**-6\n",
- "Cp=330.0*10**-12\n",
- "Cc=5.0*10**-12\n",
- "Rc=100.0*10**3\n",
- "hfe=50.0\n",
- "hie=1.0*10**3\n",
- "\n",
- "\n",
- "#Calculations\n",
- "C2=1/(((2*3.14*f)**2)*L2)\n",
- "M=K*math.sqrt(L1*L2)\n",
- "Rs=(((2*3.14*f)**2)*(M)**2)/rs\n",
- "Rp=Rs+Rw\n",
- "Zp=Lp/((Cp+Cc)*Rp)\n",
- "Rl=(Zp*Rc)/(Zp+Rc)\n",
- "print(\"voltage gain from the input to primary winding\")\n",
- "Avp=(hfe*Rl)/hie\n",
- "Vsp=12.2*10**-3\n",
- "Vos=((2*3.14*f)*L2)/rs\n",
- "\n",
- "#Results\n",
- "print(\"overall voltage gain from the input to secondary winding \")\n",
- "Av=Avp*Vos*Vsp\n",
- "print('The value of Av= %.2f ' %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain from the input to primary winding\n",
- "overall voltage gain from the input to secondary winding \n",
- "The value of Av= 1074.71 \n"
- ]
- }
- ],
- "prompt_number": 22
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter13_1.ipynb b/Electronic_Devices_and_Circuits/Chapter13_1.ipynb deleted file mode 100755 index 0a7d7550..00000000 --- a/Electronic_Devices_and_Circuits/Chapter13_1.ipynb +++ /dev/null @@ -1,733 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 13 : Amplifier with negative feedback"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.1, Page No 547"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Av=100000.0\n",
- "B=1.0/100\n",
- "print(\"when Av=100000\")\n",
- "\n",
- "#Calculations\n",
- "Acl=Av/(1+Av*B)\n",
- "print(\"when Av is 150000\")\n",
- "Av=150000\n",
- "Acl=Av/(1+Av*B)\n",
- "\n",
- "#Results\n",
- "print(\"when Av is 50000\")\n",
- "Av=50000\n",
- "Acl=Av/(1+Av*B)\n",
- "print('The value of Acl= %.2f ' %(Acl))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Av=100000\n",
- "when Av is 150000\n",
- "when Av is 50000\n",
- "The value of Acl= 99.80 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.2, Page No 549"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Rf2=560.0\n",
- "Rf1=56.0*10**3\n",
- "Av=100000.0\n",
- "Zb=1.0*10**3\n",
- "R1=68.0*10**3\n",
- "R2=33.0*10**3\n",
- "\n",
- "#Calculations\n",
- "B=Rf2/(Rf2+Rf1)\n",
- "Zi=(1+Av*B)*Zb\n",
- "Zin=(Zi*R1*R2)/(R1*R2+R1*Zi+R2*Zi)\n",
- "\n",
- "#Results\n",
- "print(\"input impedance with negative feedback is %.2f ohm \" %(Zin/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "input impedance with negative feedback is 21.73 ohm \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.3 Page No 552"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Zb=1.0*10**3\n",
- "B=1.0/100\n",
- "Av=5562.0\n",
- "R1=68.0*10**3\n",
- "R2=47.0*10**3\n",
- "hoe=1.0/(50*10**3)\n",
- "Rc=3.9*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi=(1+Av*B)*Zb\n",
- "Zin=(R1*R2*Zi)/(R1*R2+R2*Zi+R1*Zi)\n",
- "Zo=(1/hoe)/(1+Av*B)\n",
- "Zout=(Rc*Zo)/(Rc+Zo)\n",
- "\n",
- "#Results\n",
- "print(\" circuit output impedance is %.2f ohm \" %Zout)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " circuit output impedance is 720.04 ohm \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.4, Page No 554"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Zb=1.0*10**3\n",
- "hoe=1.0/(85*10**3)\n",
- "Av=58000.0\n",
- "Rf2=220.0\n",
- "Rf1=16.2*10**3\n",
- "R1=120.0*10**3\n",
- "R2=39.0*10**3\n",
- "R7=12.0*10**3\n",
- "\n",
- "#Calculations\n",
- "B=Rf2/(Rf2+Rf1)\n",
- "print(\"voltage gain\")\n",
- "Acl=Av/(1+Av*B)\n",
- "Zi=Zb*(1+Av*B)\n",
- "Zin=(Zi*R1*R2)/(Zi*R1+R2*R1+R2*Zi)\n",
- "Zo=(1/hoe)/(1+Av*B)\n",
- "Zout=(R7*Zo)/(R7+Zo)\n",
- "\n",
- "#Results\n",
- "print(\"output impedance is %.2f ohm \" %Zout)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain\n",
- "output impedance is 108.25 ohm \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.5 Page No 558"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Rf2=220.0\n",
- "R4=3.9*10**3\n",
- "Acl=75.0\n",
- "f=100.0\n",
- "\n",
- "#Calculations\n",
- "Rf1=(Acl-1)*Rf2\n",
- "Xc2=Rf2\n",
- "C2=1/(2*3.14*f*Rf2)\n",
- "Xcf1=Rf1/100\n",
- "Cf1=1/(2*3.14*f*Xcf1)\n",
- "\n",
- "#Results\n",
- "print('The value of Cf1= %.2f mF' %(Cf1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Cf1= 9.78 mF\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.6 Page No 560"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Acl=300.0\n",
- "Rf2=220.0\n",
- "R4=4.7*10**3\n",
- "f=100.0\n",
- "\n",
- "#Calculations\n",
- "Rf1=(Acl-1)*Rf2\n",
- "xc2=Rf2\n",
- "C2=1.0/(2*3.14*f*Rf2)\n",
- "\n",
- "#Results\n",
- "print('The value of C2= %.2f mf' %(C2*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C2= 7.24 mf\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.7, Page No 565"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=100.0\n",
- "Vbe=0.7\n",
- "Ic1=1.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "Ic2=Ic1\n",
- "Ic3=Ic2\n",
- "Ic4=Ic3\n",
- "Vee=10.0\n",
- "Vce=3.0\n",
- "Acl=33.0\n",
- "print(\"different resistor value of circuit\")\n",
- "R1=Vbe/((10*Ic1)/hfe)\n",
- "R3=(Vee-Vbe)/(Ic1+Ic2)\n",
- "Vr2=Vee+Vbe-Vce\n",
- "R4=Vr2/Ic1\n",
- "R2=R4\n",
- "R7=(Vr2-Vbe)/(Ic3+Ic4)\n",
- "R8=Vee/Ic3\n",
- "R6=6.8*10**3\n",
- "R5=(Acl-1)*R6\n",
- "\n",
- "#Results\n",
- "print('The value of R5= %.2f kohm' %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "different resistor value of circuit\n",
- "The value of R5= 217.60 kohm\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.8 Page No 566"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Av=25000.0\n",
- "hie=2.0*10**3\n",
- "hib=25.0\n",
- "hoe=1.0/(100*10**3)\n",
- "R6=6.8*10**3\n",
- "R5=220.0*10**3\n",
- "R1=R6\n",
- "\n",
- "#Calculations\n",
- "R8=10*10**3\n",
- "B=R6/(R5+R6)\n",
- "Acl=Av/(1+Av*B)\n",
- "Zi=2*hie*(1+Av*B)\n",
- "Zin=(Zi*R1)/(Zi+R1)\n",
- "Zo=(1/hoe)/(1+Av*B)\n",
- "Zout=(R8*Zo)/(R8+Zo)\n",
- "\n",
- "#Results\n",
- "print(\"output impedance is %.2f ohm \" %Zout)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "output impedance is 131.48 ohm \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.9 Page No 568"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hic=2.0*10**3\n",
- "hie=hic\n",
- "hfe=100.0\n",
- "hfc=100.0\n",
- "Av=25000.0\n",
- "B=1.0/33.4\n",
- "\n",
- "#Calculations\n",
- "R8=10*10**3\n",
- "R5=R8\n",
- "Ze=(hic+R8)/hfc\n",
- "Zo=Ze/(1+Av*B)\n",
- "Zout=(R5*Zo)/(R5+Zo)\n",
- "\n",
- "#Results\n",
- "print(\"output impedance is %.2fohm \" %Zout)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "output impedance is 0.16ohm \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.10 Page No 570"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "hfemin=100.0\n",
- "hfemax=400.0\n",
- "hiemin=2.0*10**3\n",
- "hiemax=5.0*10**3\n",
- "Rc=12.0*10**3\n",
- "Rl=120.0*10**3\n",
- "Re1=150.0\n",
- "\n",
- "#Calculations\n",
- "print(\" voltage gain at extreme value \")\n",
- "Avmax=(hfemax*((Rc*Rl)/(Rc+Rl)))/(hiemax+Re1*(1+hfemax))\n",
- "Avmin=(hfemin*((Rc*Rl)/(Rc+Rl)))/(hiemin+Re1*(1+hfemin))\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"approximate voltage gain\")\n",
- "Av=((Rc*Rl)/(Rc+Rl))/Re1"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " voltage gain at extreme value \n",
- "approximate voltage gain\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.11, Page No 571"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Av=70.0\n",
- "f=100.0\n",
- "rs=600.0\n",
- "Rc=12.0*10**3\n",
- "Rl=120*10**3\n",
- "Re2=3.9*10**3\n",
- "hie=2.0*10**3\n",
- "hfe=100.0\n",
- "R1=Rl\n",
- "R2=39.0*10**3\n",
- "Re1=150.0\n",
- "\n",
- "#Calculations\n",
- "Zb=hie+Re1*(1+hfe)\n",
- "Zin=(R1*R2*Zb)/(R1*R2+R1*Zb+R2*Zb)\n",
- "C1=1/(2*3.14*f*((Zin+rs)/10))\n",
- "C2=1/(2*3.14*f*Re1)\n",
- "\n",
- "#Results\n",
- "print('The value of C2= %.2f mF ' %(C2*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C2= 10.62 mF \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.12, Page No 573"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Av=1000.0\n",
- "f=100.0\n",
- "hie=2.0*10**3\n",
- "hfe=100.0\n",
- "R8=12.0*10**3\n",
- "Rl=120*10**3\n",
- "R10=3.9*10**3\n",
- "R6=Rl\n",
- "R7=39.0*10**3\n",
- "\n",
- "#Calculations\n",
- "R3=R8\n",
- "Av1=math.sqrt(Av)\n",
- "Av2=Av1\n",
- "R9=((R8*Rl)/(R8+Rl))/Av2\n",
- "R9=330#use standard value\n",
- "Av2=((R8*Rl)/(R8+Rl))/R9\n",
- "Av1=Av/Av2\n",
- "Zb=hie+R9*(1+hfe)\n",
- "Zin=(R6*R7*Zb)/(R6*R7+R6*Zb+R7*Zb)\n",
- "R4=((R3*Zin)/(R3+Zin))/Av1\n",
- "R5=R10-R4\n",
- "\n",
- "#Results\n",
- "print('The value of R5= %.2f ' %(R5/1000))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R5= 3.67 \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.13, Page No 574"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=100.0\n",
- "hie=2.0*10**3\n",
- "hfe=100.0\n",
- "R8=12.0*10**3\n",
- "Rl=120.0*10**3\n",
- "R10=3.9*10**3\n",
- "R6=Rl\n",
- "R7=39.0*10**3\n",
- "R3=R8\n",
- "R4=220.0\n",
- "rs=600.0\n",
- "Zin2=16.0*10**3\n",
- "R9=330.0\n",
- "\n",
- "#Calculations\n",
- "Zb=hie+R4*(1+hfe)\n",
- "Zin=(R1*R2*Zb)/(R1*R2+R1*Zb+R2*Zb)\n",
- "C1=1.0/(2*3.14*f*((Zin+rs)/10))\n",
- "Xc2=0.65*R4\n",
- "C2=1.0/(2*3.14*f*Xc2)\n",
- "C3=1.0/(2*3.14*f*((Zin2+R3)/10))\n",
- "C4=1.0/(2*3.14*f*.65*R9)\n",
- "C5=1.0/(2*3.14*f*((R8+Rl)/10))\n",
- "\n",
- "#Results\n",
- "print('The value of C5= %.2f mF ' %(C5*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C5= 0.12 mF \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.14, Page No 580"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=100.0\n",
- "hie=2.0*10**3\n",
- "R4=100.0\n",
- "R1=5.6*10**3\n",
- "R6=2.2*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi=hie+(1+hfe)*R4\n",
- "print(\"open loop current gain\")\n",
- "Ai=(hfe*hfe*R1)/(R1+Zi)\n",
- "B=R4/(R4+R6)\n",
- "print(\"closed loop gain\")\n",
- "Acl=Ai/(1+Ai*B)\n",
- "Zi=hie/(1+Ai*B)\n",
- "\n",
- "#Results\n",
- "print('The value of Zi= %.2f ohm ' %(Zi))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "open loop current gain\n",
- "closed loop gain\n",
- "The value of Zi= 14.43 ohm \n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.15, Page No 585"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Av=60000.0\n",
- "Acl=300.0\n",
- "f1=15.0*10**3\n",
- "B=1.0/300\n",
- "\n",
- "#Calculations\n",
- "f2=(Av*f1)/Acl\n",
- "print(\"% distortion with NFB\")\n",
- "NFB=(.1/(1+Av*B))*100.0\n",
- "\n",
- "#Results\n",
- "print(\" percenatge distortion with NFB is %.3f percent \" %NFB)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "% distortion with NFB\n",
- " percenatge distortion with NFB is 0.050 percent \n"
- ]
- }
- ],
- "prompt_number": 15
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter13_2.ipynb b/Electronic_Devices_and_Circuits/Chapter13_2.ipynb deleted file mode 100755 index 0a7d7550..00000000 --- a/Electronic_Devices_and_Circuits/Chapter13_2.ipynb +++ /dev/null @@ -1,733 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 13 : Amplifier with negative feedback"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.1, Page No 547"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Av=100000.0\n",
- "B=1.0/100\n",
- "print(\"when Av=100000\")\n",
- "\n",
- "#Calculations\n",
- "Acl=Av/(1+Av*B)\n",
- "print(\"when Av is 150000\")\n",
- "Av=150000\n",
- "Acl=Av/(1+Av*B)\n",
- "\n",
- "#Results\n",
- "print(\"when Av is 50000\")\n",
- "Av=50000\n",
- "Acl=Av/(1+Av*B)\n",
- "print('The value of Acl= %.2f ' %(Acl))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Av=100000\n",
- "when Av is 150000\n",
- "when Av is 50000\n",
- "The value of Acl= 99.80 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.2, Page No 549"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Rf2=560.0\n",
- "Rf1=56.0*10**3\n",
- "Av=100000.0\n",
- "Zb=1.0*10**3\n",
- "R1=68.0*10**3\n",
- "R2=33.0*10**3\n",
- "\n",
- "#Calculations\n",
- "B=Rf2/(Rf2+Rf1)\n",
- "Zi=(1+Av*B)*Zb\n",
- "Zin=(Zi*R1*R2)/(R1*R2+R1*Zi+R2*Zi)\n",
- "\n",
- "#Results\n",
- "print(\"input impedance with negative feedback is %.2f ohm \" %(Zin/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "input impedance with negative feedback is 21.73 ohm \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.3 Page No 552"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Zb=1.0*10**3\n",
- "B=1.0/100\n",
- "Av=5562.0\n",
- "R1=68.0*10**3\n",
- "R2=47.0*10**3\n",
- "hoe=1.0/(50*10**3)\n",
- "Rc=3.9*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi=(1+Av*B)*Zb\n",
- "Zin=(R1*R2*Zi)/(R1*R2+R2*Zi+R1*Zi)\n",
- "Zo=(1/hoe)/(1+Av*B)\n",
- "Zout=(Rc*Zo)/(Rc+Zo)\n",
- "\n",
- "#Results\n",
- "print(\" circuit output impedance is %.2f ohm \" %Zout)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " circuit output impedance is 720.04 ohm \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.4, Page No 554"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Zb=1.0*10**3\n",
- "hoe=1.0/(85*10**3)\n",
- "Av=58000.0\n",
- "Rf2=220.0\n",
- "Rf1=16.2*10**3\n",
- "R1=120.0*10**3\n",
- "R2=39.0*10**3\n",
- "R7=12.0*10**3\n",
- "\n",
- "#Calculations\n",
- "B=Rf2/(Rf2+Rf1)\n",
- "print(\"voltage gain\")\n",
- "Acl=Av/(1+Av*B)\n",
- "Zi=Zb*(1+Av*B)\n",
- "Zin=(Zi*R1*R2)/(Zi*R1+R2*R1+R2*Zi)\n",
- "Zo=(1/hoe)/(1+Av*B)\n",
- "Zout=(R7*Zo)/(R7+Zo)\n",
- "\n",
- "#Results\n",
- "print(\"output impedance is %.2f ohm \" %Zout)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain\n",
- "output impedance is 108.25 ohm \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.5 Page No 558"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Rf2=220.0\n",
- "R4=3.9*10**3\n",
- "Acl=75.0\n",
- "f=100.0\n",
- "\n",
- "#Calculations\n",
- "Rf1=(Acl-1)*Rf2\n",
- "Xc2=Rf2\n",
- "C2=1/(2*3.14*f*Rf2)\n",
- "Xcf1=Rf1/100\n",
- "Cf1=1/(2*3.14*f*Xcf1)\n",
- "\n",
- "#Results\n",
- "print('The value of Cf1= %.2f mF' %(Cf1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Cf1= 9.78 mF\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.6 Page No 560"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Acl=300.0\n",
- "Rf2=220.0\n",
- "R4=4.7*10**3\n",
- "f=100.0\n",
- "\n",
- "#Calculations\n",
- "Rf1=(Acl-1)*Rf2\n",
- "xc2=Rf2\n",
- "C2=1.0/(2*3.14*f*Rf2)\n",
- "\n",
- "#Results\n",
- "print('The value of C2= %.2f mf' %(C2*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C2= 7.24 mf\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.7, Page No 565"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=100.0\n",
- "Vbe=0.7\n",
- "Ic1=1.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "Ic2=Ic1\n",
- "Ic3=Ic2\n",
- "Ic4=Ic3\n",
- "Vee=10.0\n",
- "Vce=3.0\n",
- "Acl=33.0\n",
- "print(\"different resistor value of circuit\")\n",
- "R1=Vbe/((10*Ic1)/hfe)\n",
- "R3=(Vee-Vbe)/(Ic1+Ic2)\n",
- "Vr2=Vee+Vbe-Vce\n",
- "R4=Vr2/Ic1\n",
- "R2=R4\n",
- "R7=(Vr2-Vbe)/(Ic3+Ic4)\n",
- "R8=Vee/Ic3\n",
- "R6=6.8*10**3\n",
- "R5=(Acl-1)*R6\n",
- "\n",
- "#Results\n",
- "print('The value of R5= %.2f kohm' %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "different resistor value of circuit\n",
- "The value of R5= 217.60 kohm\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.8 Page No 566"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Av=25000.0\n",
- "hie=2.0*10**3\n",
- "hib=25.0\n",
- "hoe=1.0/(100*10**3)\n",
- "R6=6.8*10**3\n",
- "R5=220.0*10**3\n",
- "R1=R6\n",
- "\n",
- "#Calculations\n",
- "R8=10*10**3\n",
- "B=R6/(R5+R6)\n",
- "Acl=Av/(1+Av*B)\n",
- "Zi=2*hie*(1+Av*B)\n",
- "Zin=(Zi*R1)/(Zi+R1)\n",
- "Zo=(1/hoe)/(1+Av*B)\n",
- "Zout=(R8*Zo)/(R8+Zo)\n",
- "\n",
- "#Results\n",
- "print(\"output impedance is %.2f ohm \" %Zout)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "output impedance is 131.48 ohm \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.9 Page No 568"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hic=2.0*10**3\n",
- "hie=hic\n",
- "hfe=100.0\n",
- "hfc=100.0\n",
- "Av=25000.0\n",
- "B=1.0/33.4\n",
- "\n",
- "#Calculations\n",
- "R8=10*10**3\n",
- "R5=R8\n",
- "Ze=(hic+R8)/hfc\n",
- "Zo=Ze/(1+Av*B)\n",
- "Zout=(R5*Zo)/(R5+Zo)\n",
- "\n",
- "#Results\n",
- "print(\"output impedance is %.2fohm \" %Zout)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "output impedance is 0.16ohm \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.10 Page No 570"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "hfemin=100.0\n",
- "hfemax=400.0\n",
- "hiemin=2.0*10**3\n",
- "hiemax=5.0*10**3\n",
- "Rc=12.0*10**3\n",
- "Rl=120.0*10**3\n",
- "Re1=150.0\n",
- "\n",
- "#Calculations\n",
- "print(\" voltage gain at extreme value \")\n",
- "Avmax=(hfemax*((Rc*Rl)/(Rc+Rl)))/(hiemax+Re1*(1+hfemax))\n",
- "Avmin=(hfemin*((Rc*Rl)/(Rc+Rl)))/(hiemin+Re1*(1+hfemin))\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"approximate voltage gain\")\n",
- "Av=((Rc*Rl)/(Rc+Rl))/Re1"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " voltage gain at extreme value \n",
- "approximate voltage gain\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.11, Page No 571"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Av=70.0\n",
- "f=100.0\n",
- "rs=600.0\n",
- "Rc=12.0*10**3\n",
- "Rl=120*10**3\n",
- "Re2=3.9*10**3\n",
- "hie=2.0*10**3\n",
- "hfe=100.0\n",
- "R1=Rl\n",
- "R2=39.0*10**3\n",
- "Re1=150.0\n",
- "\n",
- "#Calculations\n",
- "Zb=hie+Re1*(1+hfe)\n",
- "Zin=(R1*R2*Zb)/(R1*R2+R1*Zb+R2*Zb)\n",
- "C1=1/(2*3.14*f*((Zin+rs)/10))\n",
- "C2=1/(2*3.14*f*Re1)\n",
- "\n",
- "#Results\n",
- "print('The value of C2= %.2f mF ' %(C2*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C2= 10.62 mF \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.12, Page No 573"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Av=1000.0\n",
- "f=100.0\n",
- "hie=2.0*10**3\n",
- "hfe=100.0\n",
- "R8=12.0*10**3\n",
- "Rl=120*10**3\n",
- "R10=3.9*10**3\n",
- "R6=Rl\n",
- "R7=39.0*10**3\n",
- "\n",
- "#Calculations\n",
- "R3=R8\n",
- "Av1=math.sqrt(Av)\n",
- "Av2=Av1\n",
- "R9=((R8*Rl)/(R8+Rl))/Av2\n",
- "R9=330#use standard value\n",
- "Av2=((R8*Rl)/(R8+Rl))/R9\n",
- "Av1=Av/Av2\n",
- "Zb=hie+R9*(1+hfe)\n",
- "Zin=(R6*R7*Zb)/(R6*R7+R6*Zb+R7*Zb)\n",
- "R4=((R3*Zin)/(R3+Zin))/Av1\n",
- "R5=R10-R4\n",
- "\n",
- "#Results\n",
- "print('The value of R5= %.2f ' %(R5/1000))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R5= 3.67 \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.13, Page No 574"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=100.0\n",
- "hie=2.0*10**3\n",
- "hfe=100.0\n",
- "R8=12.0*10**3\n",
- "Rl=120.0*10**3\n",
- "R10=3.9*10**3\n",
- "R6=Rl\n",
- "R7=39.0*10**3\n",
- "R3=R8\n",
- "R4=220.0\n",
- "rs=600.0\n",
- "Zin2=16.0*10**3\n",
- "R9=330.0\n",
- "\n",
- "#Calculations\n",
- "Zb=hie+R4*(1+hfe)\n",
- "Zin=(R1*R2*Zb)/(R1*R2+R1*Zb+R2*Zb)\n",
- "C1=1.0/(2*3.14*f*((Zin+rs)/10))\n",
- "Xc2=0.65*R4\n",
- "C2=1.0/(2*3.14*f*Xc2)\n",
- "C3=1.0/(2*3.14*f*((Zin2+R3)/10))\n",
- "C4=1.0/(2*3.14*f*.65*R9)\n",
- "C5=1.0/(2*3.14*f*((R8+Rl)/10))\n",
- "\n",
- "#Results\n",
- "print('The value of C5= %.2f mF ' %(C5*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C5= 0.12 mF \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.14, Page No 580"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hfe=100.0\n",
- "hie=2.0*10**3\n",
- "R4=100.0\n",
- "R1=5.6*10**3\n",
- "R6=2.2*10**3\n",
- "\n",
- "#Calculations\n",
- "Zi=hie+(1+hfe)*R4\n",
- "print(\"open loop current gain\")\n",
- "Ai=(hfe*hfe*R1)/(R1+Zi)\n",
- "B=R4/(R4+R6)\n",
- "print(\"closed loop gain\")\n",
- "Acl=Ai/(1+Ai*B)\n",
- "Zi=hie/(1+Ai*B)\n",
- "\n",
- "#Results\n",
- "print('The value of Zi= %.2f ohm ' %(Zi))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "open loop current gain\n",
- "closed loop gain\n",
- "The value of Zi= 14.43 ohm \n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.15, Page No 585"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Av=60000.0\n",
- "Acl=300.0\n",
- "f1=15.0*10**3\n",
- "B=1.0/300\n",
- "\n",
- "#Calculations\n",
- "f2=(Av*f1)/Acl\n",
- "print(\"% distortion with NFB\")\n",
- "NFB=(.1/(1+Av*B))*100.0\n",
- "\n",
- "#Results\n",
- "print(\" percenatge distortion with NFB is %.3f percent \" %NFB)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "% distortion with NFB\n",
- " percenatge distortion with NFB is 0.050 percent \n"
- ]
- }
- ],
- "prompt_number": 15
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter14_1.ipynb b/Electronic_Devices_and_Circuits/Chapter14_1.ipynb deleted file mode 100755 index 90767c65..00000000 --- a/Electronic_Devices_and_Circuits/Chapter14_1.ipynb +++ /dev/null @@ -1,662 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 14 : Ic operational Amplifier and basic Op amp circuits"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.1, Page No 597"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vbe=0.7\n",
- "Ib=500.0*10**-9\n",
- "\n",
- "#Calculations\n",
- "R1=Vbe/(10.0*Ib)\n",
- "R1=120.0*10**3#use standard value\n",
- "R2=R1\n",
- "I2=100.0*Ib\n",
- "Vr1=15.0\n",
- "Vr2=Vr1\n",
- "R1=Vr1/I2\n",
- "R1=270.0*10**3#use satndard value\n",
- "R2=R1\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "\n",
- "#Results\n",
- "print('The value of R3= %.2f kohm ' %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R3= 135.00 kohm \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.2, Page No 599"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "R2=1.0*10**6\n",
- "Vb=3.0\n",
- "Vo=3.0\n",
- "Vee=9.0\n",
- "\n",
- "#Calculations\n",
- "Vr2=Vb-(-Vee)\n",
- "Vr1=Vee-Vb\n",
- "I2=Vr2/R2\n",
- "R1=Vr1/I2\n",
- "R3=0\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 500.00 kohm \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.3 Page No 601"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Av=200000.0\n",
- "ri=2.0*10**6\n",
- "ro=75.0\n",
- "Vo=1.0\n",
- "B=1.0\n",
- "\n",
- "#Calculations\n",
- "Vd=Vo/Av\n",
- "Zi=(1+Av*B)*ri\n",
- "Zo=ro/(1+Av*B)\n",
- "\n",
- "#Results\n",
- "print('The value of Zo= %.2f X 10^-3 kohm ' %(Zo*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Zo= 0.37 X 10^-3 kohm \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.4, Page No 603"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=70.0\n",
- "Rl=4.0*10**3\n",
- "Ib=500.0*10**-9\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "R1=Vbe/(10*Ib)\n",
- "R1=120*10**3#use standard value\n",
- "R2=R1\n",
- "print(\" desire value of capacitor is C=1/2*3.14*f*R\")\n",
- "C2=1/(2*3.14*f*Rl)\n",
- "C1=1/(2*3.14*f*(R1/10))\n",
- "\n",
- "#Results\n",
- "print('The value of C1= %.2f mF ' %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " desire value of capacitor is C=1/2*3.14*f*R\n",
- "The value of C1= 0.19 mF \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.5 Page No 605"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Ib=500.0*10**-9\n",
- "Vi=50.0*10**-3\n",
- "Vo=2.0\n",
- "\n",
- "#Calculations\n",
- "I2=100.0*Ib\n",
- "R3=Vi/I2\n",
- "R2=(Vo/I2)-R3\n",
- "R1=(R2*R3)/(R2+R3)\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 0.97 kohm \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.6 Page No 606"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Av=200000.0\n",
- "ri=2.0*10**6\n",
- "ro=75.0\n",
- "R3=1.0*10**3\n",
- "R2=39*10**3\n",
- "\n",
- "#Calculations\n",
- "B=R3/(R2+R3)\n",
- "Zi=(1+Av*B)*ri\n",
- "\n",
- "#Results\n",
- "print(\" typical input impedance for non-inverting amplifier is %.2f ohm \" %Zi)\n",
- "Zo=ro/(1+Av*B)\n",
- "print('The value of Zo= %.2f kohm ' %(Zo*10))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " typical input impedance for non-inverting amplifier is 10002000000.00 ohm \n",
- "The value of Zo= 0.15 kohm \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.7, Page No 607"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R2=50.0*10**3\n",
- "R3=2.2*10**3\n",
- "C2=8.2*10**-6\n",
- "Rl=600.0\n",
- "\n",
- "#Calculations\n",
- "print(\"voltage gain \")\n",
- "Acl=(R3+R2)/R3\n",
- "\n",
- "#Results\n",
- "print(\"lower cuttoff frequency \")\n",
- "f=1/(2*3.14*C2*Rl)\n",
- "print('The value of f= %.2f kohm ' %(f))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain \n",
- "lower cuttoff frequency \n",
- "The value of f= 32.36 kohm \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.8 Page No 610"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Acl=144.0\n",
- "Vi=20.0*10**-3\n",
- "Ib=500.0*10**-9\n",
- "\n",
- "#Calculations\n",
- "I1=100.0*Ib\n",
- "R1=Vi/I1\n",
- "R1=390.0 #use standard value\n",
- "R2=Acl*R1\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "\n",
- "#Results\n",
- "print('The value of R3= %.2f kohm ' %(R3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R3= 387.31 kohm \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.9 Page No 612"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Acl=3.0\n",
- "R4=1.0*10**6\n",
- "Vi=1.0\n",
- "\n",
- "#Calculations\n",
- "R1=R4/Acl\n",
- "R1=330.0*10**3#use standard value \n",
- "R2=R1\n",
- "R3=R1\n",
- "I1=Vi/R1\n",
- "I2=I1\n",
- "I3=I1\n",
- "I4=I1+I2+I3\n",
- "Vo=-I4*R4\n",
- "\n",
- "#Results\n",
- "print('The value of Vo= %.2f v ' %(Vo))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Vo= -9.09 v \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.10 Page No 615"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Ib=500.0*10**-9\n",
- "Vi=1.0\n",
- "Acl=10.0\n",
- "\n",
- "#Calculations\n",
- "I1=100*Ib\n",
- "R1=Vi/I1\n",
- "R1=18*10**3#use standard value\n",
- "R2=Acl*R1\n",
- "R4=R1\n",
- "R3=R1/Acl\n",
- "\n",
- "#Results\n",
- "print('The value of R3= %.2f kohm ' %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R3= 1.80 kohm \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.11, Page No 619"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vi=10*10**-3\n",
- "Vn=1.0\n",
- "R1=33.0*10**3\n",
- "R2=300.0\n",
- "R5=15.0*10**3\n",
- "R4=15.0*10**3\n",
- "Vi2=-10.0*10**-3\n",
- "R3=R1\n",
- "R6=15.0*10**3\n",
- "\n",
- "#Calculations\n",
- "R7=R6\n",
- "Acl=((2*R1+R2)/R2)*(R5/R4)\n",
- "print(\"at junction of R1 and R2\")\n",
- "Vb=Vi+Vn\n",
- "print(\"at junction of R2 and R3\")\n",
- "Vc=Vi2+Vn\n",
- "print(\" current through R2\")\n",
- "I2=(Vb-Vc)/R2\n",
- "print(\"at the output of A1\")\n",
- "Va=Vb+(I2*R1)\n",
- "print(\"at output of A2\")\n",
- "Vd=Vc-(I2*R3)\n",
- "print(\"at junction of R6 and R7\")\n",
- "Vf=Vd*(R7/(R6+R7))\n",
- "print(\"at junction of R4 and R5\")\n",
- "Ve=Vf\n",
- "print(\"current through R4\")\n",
- "I4=(Va-Ve)/R4\n",
- "\n",
- "#Results\n",
- "print(\"at output of A3\")\n",
- "Vg=Ve-(I4*R5)\n",
- "print('The value of Vg= %.2f kohm ' %(Vg))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "at junction of R1 and R2\n",
- "at junction of R2 and R3\n",
- " current through R2\n",
- "at the output of A1\n",
- "at output of A2\n",
- "at junction of R6 and R7\n",
- "at junction of R4 and R5\n",
- "current through R4\n",
- "at output of A3\n",
- "The value of Vg= -4.42 kohm \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.12, Page No 623"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=15.0\n",
- "Vee=-15.0\n",
- "Av=200000.0\n",
- "SR=0.5/10**-6\n",
- "Vo=14.0\n",
- "\n",
- "#Calculations\n",
- "V=(Vcc-1)-(Vee+1)\n",
- "Vi=Vo/Av\n",
- "print(\"rise time of output is \")\n",
- "t=(V/SR)*10**6\n",
- "\n",
- "#Results\n",
- "print(\"rise time of output is %d ms \" %t)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "rise time of output is \n",
- "rise time of output is 56 ms \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.13, Page No 627"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#initialisation of variables\n",
- "Ib=500.0*10**-9\n",
- "UTP=5.0\n",
- "Vcc=15.0\n",
- "\n",
- "#Calculations\n",
- "I1=100.0*Ib\n",
- "R2=UTP/I1\n",
- "R1=((Vcc-1)-5)/I1\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 180.00 kohm \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.14, Page No 630"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=15.0\n",
- "Vsat=Vcc\n",
- "R2=150.0*10**3\n",
- "Vf=0.7\n",
- "R1=27.0*10**3\n",
- "R3=120.0*10**3\n",
- "\n",
- "#Calculations\n",
- "I2=(Vsat-Vf)/R2\n",
- "UTP=I2*R1\n",
- "\n",
- "#Results\n",
- "print(\" LTP calculation including Vf\")\n",
- "I3=(Vsat-Vf)/R3\n",
- "LTP=-I3*R1\n",
- "print('The value of LTP= %.2f kohm ' %(LTP))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " LTP calculation including Vf\n",
- "The value of LTP= -3.22 kohm \n"
- ]
- }
- ],
- "prompt_number": 14
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter14_2.ipynb b/Electronic_Devices_and_Circuits/Chapter14_2.ipynb deleted file mode 100755 index 90767c65..00000000 --- a/Electronic_Devices_and_Circuits/Chapter14_2.ipynb +++ /dev/null @@ -1,662 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 14 : Ic operational Amplifier and basic Op amp circuits"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.1, Page No 597"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vbe=0.7\n",
- "Ib=500.0*10**-9\n",
- "\n",
- "#Calculations\n",
- "R1=Vbe/(10.0*Ib)\n",
- "R1=120.0*10**3#use standard value\n",
- "R2=R1\n",
- "I2=100.0*Ib\n",
- "Vr1=15.0\n",
- "Vr2=Vr1\n",
- "R1=Vr1/I2\n",
- "R1=270.0*10**3#use satndard value\n",
- "R2=R1\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "\n",
- "#Results\n",
- "print('The value of R3= %.2f kohm ' %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R3= 135.00 kohm \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.2, Page No 599"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "R2=1.0*10**6\n",
- "Vb=3.0\n",
- "Vo=3.0\n",
- "Vee=9.0\n",
- "\n",
- "#Calculations\n",
- "Vr2=Vb-(-Vee)\n",
- "Vr1=Vee-Vb\n",
- "I2=Vr2/R2\n",
- "R1=Vr1/I2\n",
- "R3=0\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 500.00 kohm \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.3 Page No 601"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Av=200000.0\n",
- "ri=2.0*10**6\n",
- "ro=75.0\n",
- "Vo=1.0\n",
- "B=1.0\n",
- "\n",
- "#Calculations\n",
- "Vd=Vo/Av\n",
- "Zi=(1+Av*B)*ri\n",
- "Zo=ro/(1+Av*B)\n",
- "\n",
- "#Results\n",
- "print('The value of Zo= %.2f X 10^-3 kohm ' %(Zo*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Zo= 0.37 X 10^-3 kohm \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.4, Page No 603"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=70.0\n",
- "Rl=4.0*10**3\n",
- "Ib=500.0*10**-9\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "R1=Vbe/(10*Ib)\n",
- "R1=120*10**3#use standard value\n",
- "R2=R1\n",
- "print(\" desire value of capacitor is C=1/2*3.14*f*R\")\n",
- "C2=1/(2*3.14*f*Rl)\n",
- "C1=1/(2*3.14*f*(R1/10))\n",
- "\n",
- "#Results\n",
- "print('The value of C1= %.2f mF ' %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " desire value of capacitor is C=1/2*3.14*f*R\n",
- "The value of C1= 0.19 mF \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.5 Page No 605"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Ib=500.0*10**-9\n",
- "Vi=50.0*10**-3\n",
- "Vo=2.0\n",
- "\n",
- "#Calculations\n",
- "I2=100.0*Ib\n",
- "R3=Vi/I2\n",
- "R2=(Vo/I2)-R3\n",
- "R1=(R2*R3)/(R2+R3)\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 0.97 kohm \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.6 Page No 606"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Av=200000.0\n",
- "ri=2.0*10**6\n",
- "ro=75.0\n",
- "R3=1.0*10**3\n",
- "R2=39*10**3\n",
- "\n",
- "#Calculations\n",
- "B=R3/(R2+R3)\n",
- "Zi=(1+Av*B)*ri\n",
- "\n",
- "#Results\n",
- "print(\" typical input impedance for non-inverting amplifier is %.2f ohm \" %Zi)\n",
- "Zo=ro/(1+Av*B)\n",
- "print('The value of Zo= %.2f kohm ' %(Zo*10))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " typical input impedance for non-inverting amplifier is 10002000000.00 ohm \n",
- "The value of Zo= 0.15 kohm \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.7, Page No 607"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R2=50.0*10**3\n",
- "R3=2.2*10**3\n",
- "C2=8.2*10**-6\n",
- "Rl=600.0\n",
- "\n",
- "#Calculations\n",
- "print(\"voltage gain \")\n",
- "Acl=(R3+R2)/R3\n",
- "\n",
- "#Results\n",
- "print(\"lower cuttoff frequency \")\n",
- "f=1/(2*3.14*C2*Rl)\n",
- "print('The value of f= %.2f kohm ' %(f))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain \n",
- "lower cuttoff frequency \n",
- "The value of f= 32.36 kohm \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.8 Page No 610"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Acl=144.0\n",
- "Vi=20.0*10**-3\n",
- "Ib=500.0*10**-9\n",
- "\n",
- "#Calculations\n",
- "I1=100.0*Ib\n",
- "R1=Vi/I1\n",
- "R1=390.0 #use standard value\n",
- "R2=Acl*R1\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "\n",
- "#Results\n",
- "print('The value of R3= %.2f kohm ' %(R3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R3= 387.31 kohm \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.9 Page No 612"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Acl=3.0\n",
- "R4=1.0*10**6\n",
- "Vi=1.0\n",
- "\n",
- "#Calculations\n",
- "R1=R4/Acl\n",
- "R1=330.0*10**3#use standard value \n",
- "R2=R1\n",
- "R3=R1\n",
- "I1=Vi/R1\n",
- "I2=I1\n",
- "I3=I1\n",
- "I4=I1+I2+I3\n",
- "Vo=-I4*R4\n",
- "\n",
- "#Results\n",
- "print('The value of Vo= %.2f v ' %(Vo))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Vo= -9.09 v \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.10 Page No 615"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Ib=500.0*10**-9\n",
- "Vi=1.0\n",
- "Acl=10.0\n",
- "\n",
- "#Calculations\n",
- "I1=100*Ib\n",
- "R1=Vi/I1\n",
- "R1=18*10**3#use standard value\n",
- "R2=Acl*R1\n",
- "R4=R1\n",
- "R3=R1/Acl\n",
- "\n",
- "#Results\n",
- "print('The value of R3= %.2f kohm ' %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R3= 1.80 kohm \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.11, Page No 619"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vi=10*10**-3\n",
- "Vn=1.0\n",
- "R1=33.0*10**3\n",
- "R2=300.0\n",
- "R5=15.0*10**3\n",
- "R4=15.0*10**3\n",
- "Vi2=-10.0*10**-3\n",
- "R3=R1\n",
- "R6=15.0*10**3\n",
- "\n",
- "#Calculations\n",
- "R7=R6\n",
- "Acl=((2*R1+R2)/R2)*(R5/R4)\n",
- "print(\"at junction of R1 and R2\")\n",
- "Vb=Vi+Vn\n",
- "print(\"at junction of R2 and R3\")\n",
- "Vc=Vi2+Vn\n",
- "print(\" current through R2\")\n",
- "I2=(Vb-Vc)/R2\n",
- "print(\"at the output of A1\")\n",
- "Va=Vb+(I2*R1)\n",
- "print(\"at output of A2\")\n",
- "Vd=Vc-(I2*R3)\n",
- "print(\"at junction of R6 and R7\")\n",
- "Vf=Vd*(R7/(R6+R7))\n",
- "print(\"at junction of R4 and R5\")\n",
- "Ve=Vf\n",
- "print(\"current through R4\")\n",
- "I4=(Va-Ve)/R4\n",
- "\n",
- "#Results\n",
- "print(\"at output of A3\")\n",
- "Vg=Ve-(I4*R5)\n",
- "print('The value of Vg= %.2f kohm ' %(Vg))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "at junction of R1 and R2\n",
- "at junction of R2 and R3\n",
- " current through R2\n",
- "at the output of A1\n",
- "at output of A2\n",
- "at junction of R6 and R7\n",
- "at junction of R4 and R5\n",
- "current through R4\n",
- "at output of A3\n",
- "The value of Vg= -4.42 kohm \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.12, Page No 623"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=15.0\n",
- "Vee=-15.0\n",
- "Av=200000.0\n",
- "SR=0.5/10**-6\n",
- "Vo=14.0\n",
- "\n",
- "#Calculations\n",
- "V=(Vcc-1)-(Vee+1)\n",
- "Vi=Vo/Av\n",
- "print(\"rise time of output is \")\n",
- "t=(V/SR)*10**6\n",
- "\n",
- "#Results\n",
- "print(\"rise time of output is %d ms \" %t)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "rise time of output is \n",
- "rise time of output is 56 ms \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.13, Page No 627"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#initialisation of variables\n",
- "Ib=500.0*10**-9\n",
- "UTP=5.0\n",
- "Vcc=15.0\n",
- "\n",
- "#Calculations\n",
- "I1=100.0*Ib\n",
- "R2=UTP/I1\n",
- "R1=((Vcc-1)-5)/I1\n",
- "\n",
- "#Results\n",
- "print('The value of R1= %.2f kohm ' %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R1= 180.00 kohm \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14.14, Page No 630"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=15.0\n",
- "Vsat=Vcc\n",
- "R2=150.0*10**3\n",
- "Vf=0.7\n",
- "R1=27.0*10**3\n",
- "R3=120.0*10**3\n",
- "\n",
- "#Calculations\n",
- "I2=(Vsat-Vf)/R2\n",
- "UTP=I2*R1\n",
- "\n",
- "#Results\n",
- "print(\" LTP calculation including Vf\")\n",
- "I3=(Vsat-Vf)/R3\n",
- "LTP=-I3*R1\n",
- "print('The value of LTP= %.2f kohm ' %(LTP))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " LTP calculation including Vf\n",
- "The value of LTP= -3.22 kohm \n"
- ]
- }
- ],
- "prompt_number": 14
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter15_1.ipynb b/Electronic_Devices_and_Circuits/Chapter15_1.ipynb deleted file mode 100755 index db5e05e2..00000000 --- a/Electronic_Devices_and_Circuits/Chapter15_1.ipynb +++ /dev/null @@ -1,282 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 15 : Operational amplifier frequency\n",
- "Response and compensation"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.2, Page No 648"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R2=1.0*10**6\n",
- "Acl=4.5\n",
- "\n",
- "#Calculations\n",
- "R1=R2/Acl\n",
- "R1=220*10**3#use standard value\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "Cf=((R1*30*10**-12)/(R1+R2))*10**12\n",
- "\n",
- "#Results\n",
- "print(\" suitable value of capacitor is %.2fpF \" %Cf)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable value of capacitor is 5.41pF \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.3, Page No 649"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "f=35.0*10**3\n",
- "Rf=68.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Cf=(1.0/(2*3.14*f*Rf))*10**12\n",
- "\n",
- "#Results\n",
- "print(\" suitable miller effect capacitor is %.2f pF \" %Cf)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable miller effect capacitor is 66.91 pF \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.5 Page No 652"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Acl=100.0\n",
- "Av=10.0\n",
- "print(\" for Cf=30pF\")\n",
- "GBW=800.0*10**3\n",
- "\n",
- "#Calculations\n",
- "F2=GBW/Acl\n",
- "print(\" for Cf=3pF\")\n",
- "GBW=(800*10**3)*Av\n",
- "f2=GBW/Acl\n",
- "\n",
- "#Results\n",
- "print(\" The value of f2 is %.2f pF \" %(f2/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for Cf=30pF\n",
- " for Cf=3pF\n",
- " The value of f2 is 80.00 pF \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.6, Page No 654"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vip=1.0\n",
- "R2=39.0*10**3\n",
- "R3=4.7*10**3\n",
- "SR=250.0/10**-6\n",
- "f=100.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" for the AD843\")\n",
- "Vop=((R2+R3)/R3)*Vip\n",
- "fp=SR/(2*3.14*Vop)\n",
- "print(\"full power bandwidth is %dHz \" %fp)\n",
- "print(\" for a 741\")\n",
- "SR=0.5/10**-6\n",
- "Vp=SR/(2*3.14*f)\n",
- "\n",
- "#Results\n",
- "print(\" maximum peak output voltage is %3.2fV \" %Vp)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for the AD843\n",
- "full power bandwidth is 4281508Hz \n",
- " for a 741\n",
- " maximum peak output voltage is 0.80V \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.7 Page No 656"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "rs=600.0\n",
- "R1=1.0*10**3\n",
- "R2=10.0*10**3\n",
- "f=800.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" stray capacitance\")\n",
- "Cs=1/(2*3.14*f*10*(((rs+R1)*R2)/(rs+R1+R2)))\n",
- "print(\"compensation capacitor\")\n",
- "C2=((Cs*(rs+R1))/R2)*10**12\n",
- "\n",
- "#Results\n",
- "print(\"compensation capacitor is %.2fpF \" %C2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " stray capacitance\n",
- "compensation capacitor\n",
- "compensation capacitor is 2.31pF \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.8 Page No 659"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "ro=25.0\n",
- "f=2.0*10**6\n",
- "R2=10.0*10**3\n",
- "Rx=25.0\n",
- "\n",
- "#Calculations\n",
- "Cl=(1.0/(2.0*3.14*f*(10*ro)))*10**+12\n",
- "print(\" load capacitance is %3.2fpF \" %Cl)\n",
- "Cl=0.1*10**-6\n",
- "C2=((Cl*(ro+Rx))/R2)*10**12\n",
- "\n",
- "#Results\n",
- "print(\" compensation capacitance is %.2f pF \" %C2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " load capacitance is 318.47pF \n",
- " compensation capacitance is 500.00 pF \n"
- ]
- }
- ],
- "prompt_number": 14
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter15_2.ipynb b/Electronic_Devices_and_Circuits/Chapter15_2.ipynb deleted file mode 100755 index db5e05e2..00000000 --- a/Electronic_Devices_and_Circuits/Chapter15_2.ipynb +++ /dev/null @@ -1,282 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 15 : Operational amplifier frequency\n",
- "Response and compensation"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.2, Page No 648"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R2=1.0*10**6\n",
- "Acl=4.5\n",
- "\n",
- "#Calculations\n",
- "R1=R2/Acl\n",
- "R1=220*10**3#use standard value\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "Cf=((R1*30*10**-12)/(R1+R2))*10**12\n",
- "\n",
- "#Results\n",
- "print(\" suitable value of capacitor is %.2fpF \" %Cf)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable value of capacitor is 5.41pF \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.3, Page No 649"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "f=35.0*10**3\n",
- "Rf=68.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Cf=(1.0/(2*3.14*f*Rf))*10**12\n",
- "\n",
- "#Results\n",
- "print(\" suitable miller effect capacitor is %.2f pF \" %Cf)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable miller effect capacitor is 66.91 pF \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.5 Page No 652"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Acl=100.0\n",
- "Av=10.0\n",
- "print(\" for Cf=30pF\")\n",
- "GBW=800.0*10**3\n",
- "\n",
- "#Calculations\n",
- "F2=GBW/Acl\n",
- "print(\" for Cf=3pF\")\n",
- "GBW=(800*10**3)*Av\n",
- "f2=GBW/Acl\n",
- "\n",
- "#Results\n",
- "print(\" The value of f2 is %.2f pF \" %(f2/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for Cf=30pF\n",
- " for Cf=3pF\n",
- " The value of f2 is 80.00 pF \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.6, Page No 654"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vip=1.0\n",
- "R2=39.0*10**3\n",
- "R3=4.7*10**3\n",
- "SR=250.0/10**-6\n",
- "f=100.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" for the AD843\")\n",
- "Vop=((R2+R3)/R3)*Vip\n",
- "fp=SR/(2*3.14*Vop)\n",
- "print(\"full power bandwidth is %dHz \" %fp)\n",
- "print(\" for a 741\")\n",
- "SR=0.5/10**-6\n",
- "Vp=SR/(2*3.14*f)\n",
- "\n",
- "#Results\n",
- "print(\" maximum peak output voltage is %3.2fV \" %Vp)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for the AD843\n",
- "full power bandwidth is 4281508Hz \n",
- " for a 741\n",
- " maximum peak output voltage is 0.80V \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.7 Page No 656"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "rs=600.0\n",
- "R1=1.0*10**3\n",
- "R2=10.0*10**3\n",
- "f=800.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" stray capacitance\")\n",
- "Cs=1/(2*3.14*f*10*(((rs+R1)*R2)/(rs+R1+R2)))\n",
- "print(\"compensation capacitor\")\n",
- "C2=((Cs*(rs+R1))/R2)*10**12\n",
- "\n",
- "#Results\n",
- "print(\"compensation capacitor is %.2fpF \" %C2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " stray capacitance\n",
- "compensation capacitor\n",
- "compensation capacitor is 2.31pF \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 15.8 Page No 659"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "ro=25.0\n",
- "f=2.0*10**6\n",
- "R2=10.0*10**3\n",
- "Rx=25.0\n",
- "\n",
- "#Calculations\n",
- "Cl=(1.0/(2.0*3.14*f*(10*ro)))*10**+12\n",
- "print(\" load capacitance is %3.2fpF \" %Cl)\n",
- "Cl=0.1*10**-6\n",
- "C2=((Cl*(ro+Rx))/R2)*10**12\n",
- "\n",
- "#Results\n",
- "print(\" compensation capacitance is %.2f pF \" %C2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " load capacitance is 318.47pF \n",
- " compensation capacitance is 500.00 pF \n"
- ]
- }
- ],
- "prompt_number": 14
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter16_1.ipynb b/Electronic_Devices_and_Circuits/Chapter16_1.ipynb deleted file mode 100755 index 9d8b3b5f..00000000 --- a/Electronic_Devices_and_Circuits/Chapter16_1.ipynb +++ /dev/null @@ -1,581 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 16 : Signal generators"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.1, Page No 668"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=10.0\n",
- "Ib=500.0*10**-9\n",
- "Acl=29.0\n",
- "f=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" phase shift oscillator\")\n",
- "I1=100*Ib\n",
- "vo=Vcc-1\n",
- "vi=vo/Acl\n",
- "R1=vi/I1\n",
- "R1=5.6*10**3#use standard value 5.6Kohm\n",
- "R2=Acl*R1\n",
- "R2=180*10**3#use satndard value 180Kohm to give Acl>180\n",
- "R3=R2R=R1\n",
- "C=1.0/(2*3.14*R3*f*math.sqrt(6))\n",
- "\n",
- "#Results\n",
- "print(\"The value of C = %.2f \" %(C*10**9))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " phase shift oscillator\n",
- "The value of C = 11.61 \n"
- ]
- }
- ],
- "prompt_number": 28
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.2, Page No 672"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "f=40.0*10**3\n",
- "L=100.0*10**-3\n",
- "vp=8.0\n",
- "\n",
- "#Calculations\n",
- "print(\"colpitts oscillator\")\n",
- "Ct=1/(4*3.14*3.14*(f**2)*L)\n",
- "C1=10*Ct\n",
- "C2=1/((1/Ct)-(1/C1))\n",
- "C2=180*10**-12#use standard value\n",
- "Xc2=1/(2*3.14*f*C2)\n",
- "Xc1=1/(2*3.14*f*C1)\n",
- "R1=10*Xc1\n",
- "R1=27*10**3#use standard value\n",
- "Acl=C1/C2\n",
- "R2=Acl*R1\n",
- "R2=270*10**3#use stabdard value\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "f2=Acl*f\n",
- "SR=2*3.14*f*vp\n",
- "\n",
- "#Results\n",
- "print(\"The value of SR is %.2f \" %(SR/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "colpitts oscillator\n",
- "The value of SR is 2009.60 \n"
- ]
- }
- ],
- "prompt_number": 29
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.3 Page No 678"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "vo=8.0\n",
- "f=100.0*10**3\n",
- "print(\" hartley oscillator\")\n",
- "Vcc=vo+1\n",
- "Xl2=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "L2=Xl2/(2*3.14*f)\n",
- "L2=1.5*10**-3#use standard value\n",
- "L1=L2/10.0\n",
- "Lt=L1+L2#(assuming M=0)\n",
- "C1=1/(4*(3.14**2)*(f**2)*Lt)\n",
- "C1=1500*10**-12#use 1500pF with aadditional parallel capacitance if necessary\n",
- "#C1>>stray capacitance\n",
- "Xl1=2*3.14*f*L1#R1>>Xl1\n",
- "R1=1*10**3\n",
- "Acl=L2/L1\n",
- "R2=Acl*R1\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "print(\"full power bandwidth \")\n",
- "f2=Acl*f\n",
- "SR=2*3.14*f*vo\n",
- "\n",
- "#Results\n",
- "print(\"The value of SR is %.2f \" %(SR/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " hartley oscillator\n",
- "full power bandwidth \n",
- "The value of SR is 5024.00 \n"
- ]
- }
- ],
- "prompt_number": 30
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.4, Page No 680"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=100.0*10**3\n",
- "Vo=9.0\n",
- "Acl=3.0\n",
- "\n",
- "#Calculations\n",
- "print(\" design of wein bridge oscillator\")\n",
- "Vcc=Vo+1\n",
- "C1=1000.0*10**-12#standard value\n",
- "C2=C1\n",
- "R1=1.0/(2*3.14*f*C1)\n",
- "R2=R1\n",
- "R4=R2\n",
- "R3=2*R4\n",
- "R3=3.3*10**3#use standard value\n",
- "print(\" minimum full power bandwidth\")\n",
- "f2=Acl*f\n",
- "SR=2*3.14*f*Vo\n",
- "\n",
- "#Results\n",
- "print(\"The value of SR is %.2f \" %(SR/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " design of wein bridge oscillator\n",
- " minimum full power bandwidth\n",
- "The value of SR is 5652.00 \n"
- ]
- }
- ],
- "prompt_number": 31
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.5 Page No 683"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=5.0*10**3\n",
- "vo=5.0\n",
- "I1=1.0*10**-3\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "print(\"phase shift oscillator\")\n",
- "R1=(vo/29.0)/I1\n",
- "R1=150#use standard value\n",
- "R2=29*R1\n",
- "R4=(2*Vf)/I1\n",
- "R4=1.5*10**3#use 1.5kohm standard value\n",
- "R5=R2-R4\n",
- "R6=.4*R5\n",
- "R7=.8*R5\n",
- "R=R1\n",
- "C=1.0/(2*3.14*R*f*math.sqrt(6))\n",
- "\n",
- "#Results\n",
- "print(\"The value of C is %.2f mF\" %(C*10**9))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "phase shift oscillator\n",
- "The value of C is 86.68 mF\n"
- ]
- }
- ],
- "prompt_number": 32
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.6 Page No 686"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "rds=600.0\n",
- "Vgs=1.0\n",
- "Vd1=0.7\n",
- "f=100.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\"wien bridge ocillator\")\n",
- "R4=560.0\n",
- "R3=2*((R4*rds)/(R4+rds))\n",
- "I5=200.0*10**-6\n",
- "Vo=6\n",
- "R6=Vgs/I5\n",
- "R5=(Vo-(Vgs+Vd1))/I5\n",
- "print(\" C4 discharge voltage \")\n",
- "Vc=.1*Vgs\n",
- "print(\"C4 discharge time\")\n",
- "T=1/f\n",
- "Ic=I5\n",
- "C4=(Ic*T)/Vc\n",
- "Xc3=rds/10#at oscillating frequency\n",
- "C3=1/(2*3.14*f*Xc3)\n",
- "\n",
- "#Results\n",
- "print(\"The value of C3 is %.2f mF\" %(C3*10**9))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "wien bridge ocillator\n",
- " C4 discharge voltage \n",
- "C4 discharge time\n",
- "The value of C3 is 26.54 mF\n"
- ]
- }
- ],
- "prompt_number": 33
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.7, Page No 689"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vo=14.0\n",
- "Vr3=.5\n",
- "Ib=500.0*10**-9\n",
- "f=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\"square wave generator\")\n",
- "Vcc=Vo+1\n",
- "UTP=Vr3\n",
- "LTP=UTP\n",
- "I2=100*Ib\n",
- "R3=Vr3/I2\n",
- "R2=(Vo-Vr3)/I2\n",
- "t=1/(2*f)\n",
- "V=UTP-(-LTP)\n",
- "C1=.1*10**-6\n",
- "I1=(C1*V)/t\n",
- "R1=Vo/I1\n",
- "\n",
- "#Results\n",
- "print(\"The value of R1 is %.2f kohm\" %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "square wave generator\n",
- "The value of R1 is 70.00 kohm\n"
- ]
- }
- ],
- "prompt_number": 34
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.8 Page No 694"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "R1=2.2*10**3\n",
- "R2=2.7*10**3\n",
- "C2=.5*10**-6\n",
- "Vcc=15.0\n",
- "\n",
- "#Calculations\n",
- "t1=.693*C2*(R1+R2)\n",
- "t2=.693*C2*R2\n",
- "T=t1+t2\n",
- "f=1/T\n",
- "Ic1=(Vcc/3)/(R1+R2)\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ic1 is %.2f mA\" %(Ic1*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Ic1 is 1.02 mA\n"
- ]
- }
- ],
- "prompt_number": 35
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.10 Page No 699"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=9.0\n",
- "Vo=3\n",
- "I1=1.0*10**-3\n",
- "f=500.0\n",
- "UTP=3.0\n",
- "\n",
- "#Calculations\n",
- "print(\"design the triangular wave\")\n",
- "Vi=Vcc-1\n",
- "V=Vo-(-Vo)\n",
- "print(\" I1>>Ibmax for op-amp\")\n",
- "R1=Vi/I1\n",
- "t=1.0/(2*f)\n",
- "C1=(I1*t)/V\n",
- "print(\"schmitt design\")\n",
- "I2=1.0*10**-3\n",
- "R2=UTP/I2\n",
- "R3=(Vcc-1)/I2\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 is %.2f kohm\" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "design the triangular wave\n",
- " I1>>Ibmax for op-amp\n",
- "schmitt design\n",
- "The value of R3 is 8.00 kohm\n"
- ]
- }
- ],
- "prompt_number": 36
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.11 Page No 705"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "f=100.0*10**3\n",
- "Rs=1.5*10**3\n",
- "R1=2.0*Rs\n",
- "\n",
- "\n",
- "#Calculations\n",
- "R1=2.7*10**3#use standard value\n",
- "R2=R1+Rs\n",
- "C1=1/(2*3.14*f*R2)\n",
- "R4=R2\n",
- "R3=2*R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 is %.2f kohm\" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R3 is 8.40 kohm\n"
- ]
- }
- ],
- "prompt_number": 37
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.12, Page No 705"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "fs=1.0*10**6\n",
- "Rs=700.0\n",
- "C1=1000.0*10**-12\n",
- "C2=100.0*10**-12\n",
- "R1=1.0*10**6\n",
- "R2=10.0*10**3\n",
- "Rs=700.0\n",
- "Vdd=5\n",
- "\n",
- "#Calculations\n",
- "Ct=(C1*C2)/(C1+C2)\n",
- "print(\" at resonance Xl=Xct 2*pi*f*L=1/2*pi*f*Ct\")\n",
- "L=1/(((2*3.14*f)**2)*Ct)\n",
- "ip=Vdd/(R1+R2+Rs)\n",
- "Pd=(((.707*ip)**2)*Rs)*10**9\n",
- "\n",
- "#Results\n",
- "print(\" peak power dissipated is %.3fnW \" %Pd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " at resonance Xl=Xct 2*pi*f*L=1/2*pi*f*Ct\n",
- " peak power dissipated is 8.563nW \n"
- ]
- }
- ],
- "prompt_number": 38
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter16_2.ipynb b/Electronic_Devices_and_Circuits/Chapter16_2.ipynb deleted file mode 100755 index 9d8b3b5f..00000000 --- a/Electronic_Devices_and_Circuits/Chapter16_2.ipynb +++ /dev/null @@ -1,581 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 16 : Signal generators"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.1, Page No 668"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=10.0\n",
- "Ib=500.0*10**-9\n",
- "Acl=29.0\n",
- "f=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" phase shift oscillator\")\n",
- "I1=100*Ib\n",
- "vo=Vcc-1\n",
- "vi=vo/Acl\n",
- "R1=vi/I1\n",
- "R1=5.6*10**3#use standard value 5.6Kohm\n",
- "R2=Acl*R1\n",
- "R2=180*10**3#use satndard value 180Kohm to give Acl>180\n",
- "R3=R2R=R1\n",
- "C=1.0/(2*3.14*R3*f*math.sqrt(6))\n",
- "\n",
- "#Results\n",
- "print(\"The value of C = %.2f \" %(C*10**9))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " phase shift oscillator\n",
- "The value of C = 11.61 \n"
- ]
- }
- ],
- "prompt_number": 28
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.2, Page No 672"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "f=40.0*10**3\n",
- "L=100.0*10**-3\n",
- "vp=8.0\n",
- "\n",
- "#Calculations\n",
- "print(\"colpitts oscillator\")\n",
- "Ct=1/(4*3.14*3.14*(f**2)*L)\n",
- "C1=10*Ct\n",
- "C2=1/((1/Ct)-(1/C1))\n",
- "C2=180*10**-12#use standard value\n",
- "Xc2=1/(2*3.14*f*C2)\n",
- "Xc1=1/(2*3.14*f*C1)\n",
- "R1=10*Xc1\n",
- "R1=27*10**3#use standard value\n",
- "Acl=C1/C2\n",
- "R2=Acl*R1\n",
- "R2=270*10**3#use stabdard value\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "f2=Acl*f\n",
- "SR=2*3.14*f*vp\n",
- "\n",
- "#Results\n",
- "print(\"The value of SR is %.2f \" %(SR/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "colpitts oscillator\n",
- "The value of SR is 2009.60 \n"
- ]
- }
- ],
- "prompt_number": 29
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.3 Page No 678"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "vo=8.0\n",
- "f=100.0*10**3\n",
- "print(\" hartley oscillator\")\n",
- "Vcc=vo+1\n",
- "Xl2=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "L2=Xl2/(2*3.14*f)\n",
- "L2=1.5*10**-3#use standard value\n",
- "L1=L2/10.0\n",
- "Lt=L1+L2#(assuming M=0)\n",
- "C1=1/(4*(3.14**2)*(f**2)*Lt)\n",
- "C1=1500*10**-12#use 1500pF with aadditional parallel capacitance if necessary\n",
- "#C1>>stray capacitance\n",
- "Xl1=2*3.14*f*L1#R1>>Xl1\n",
- "R1=1*10**3\n",
- "Acl=L2/L1\n",
- "R2=Acl*R1\n",
- "R3=(R1*R2)/(R1+R2)\n",
- "print(\"full power bandwidth \")\n",
- "f2=Acl*f\n",
- "SR=2*3.14*f*vo\n",
- "\n",
- "#Results\n",
- "print(\"The value of SR is %.2f \" %(SR/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " hartley oscillator\n",
- "full power bandwidth \n",
- "The value of SR is 5024.00 \n"
- ]
- }
- ],
- "prompt_number": 30
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.4, Page No 680"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=100.0*10**3\n",
- "Vo=9.0\n",
- "Acl=3.0\n",
- "\n",
- "#Calculations\n",
- "print(\" design of wein bridge oscillator\")\n",
- "Vcc=Vo+1\n",
- "C1=1000.0*10**-12#standard value\n",
- "C2=C1\n",
- "R1=1.0/(2*3.14*f*C1)\n",
- "R2=R1\n",
- "R4=R2\n",
- "R3=2*R4\n",
- "R3=3.3*10**3#use standard value\n",
- "print(\" minimum full power bandwidth\")\n",
- "f2=Acl*f\n",
- "SR=2*3.14*f*Vo\n",
- "\n",
- "#Results\n",
- "print(\"The value of SR is %.2f \" %(SR/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " design of wein bridge oscillator\n",
- " minimum full power bandwidth\n",
- "The value of SR is 5652.00 \n"
- ]
- }
- ],
- "prompt_number": 31
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.5 Page No 683"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=5.0*10**3\n",
- "vo=5.0\n",
- "I1=1.0*10**-3\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "print(\"phase shift oscillator\")\n",
- "R1=(vo/29.0)/I1\n",
- "R1=150#use standard value\n",
- "R2=29*R1\n",
- "R4=(2*Vf)/I1\n",
- "R4=1.5*10**3#use 1.5kohm standard value\n",
- "R5=R2-R4\n",
- "R6=.4*R5\n",
- "R7=.8*R5\n",
- "R=R1\n",
- "C=1.0/(2*3.14*R*f*math.sqrt(6))\n",
- "\n",
- "#Results\n",
- "print(\"The value of C is %.2f mF\" %(C*10**9))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "phase shift oscillator\n",
- "The value of C is 86.68 mF\n"
- ]
- }
- ],
- "prompt_number": 32
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.6 Page No 686"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "rds=600.0\n",
- "Vgs=1.0\n",
- "Vd1=0.7\n",
- "f=100.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\"wien bridge ocillator\")\n",
- "R4=560.0\n",
- "R3=2*((R4*rds)/(R4+rds))\n",
- "I5=200.0*10**-6\n",
- "Vo=6\n",
- "R6=Vgs/I5\n",
- "R5=(Vo-(Vgs+Vd1))/I5\n",
- "print(\" C4 discharge voltage \")\n",
- "Vc=.1*Vgs\n",
- "print(\"C4 discharge time\")\n",
- "T=1/f\n",
- "Ic=I5\n",
- "C4=(Ic*T)/Vc\n",
- "Xc3=rds/10#at oscillating frequency\n",
- "C3=1/(2*3.14*f*Xc3)\n",
- "\n",
- "#Results\n",
- "print(\"The value of C3 is %.2f mF\" %(C3*10**9))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "wien bridge ocillator\n",
- " C4 discharge voltage \n",
- "C4 discharge time\n",
- "The value of C3 is 26.54 mF\n"
- ]
- }
- ],
- "prompt_number": 33
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.7, Page No 689"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vo=14.0\n",
- "Vr3=.5\n",
- "Ib=500.0*10**-9\n",
- "f=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\"square wave generator\")\n",
- "Vcc=Vo+1\n",
- "UTP=Vr3\n",
- "LTP=UTP\n",
- "I2=100*Ib\n",
- "R3=Vr3/I2\n",
- "R2=(Vo-Vr3)/I2\n",
- "t=1/(2*f)\n",
- "V=UTP-(-LTP)\n",
- "C1=.1*10**-6\n",
- "I1=(C1*V)/t\n",
- "R1=Vo/I1\n",
- "\n",
- "#Results\n",
- "print(\"The value of R1 is %.2f kohm\" %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "square wave generator\n",
- "The value of R1 is 70.00 kohm\n"
- ]
- }
- ],
- "prompt_number": 34
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.8 Page No 694"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "R1=2.2*10**3\n",
- "R2=2.7*10**3\n",
- "C2=.5*10**-6\n",
- "Vcc=15.0\n",
- "\n",
- "#Calculations\n",
- "t1=.693*C2*(R1+R2)\n",
- "t2=.693*C2*R2\n",
- "T=t1+t2\n",
- "f=1/T\n",
- "Ic1=(Vcc/3)/(R1+R2)\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ic1 is %.2f mA\" %(Ic1*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Ic1 is 1.02 mA\n"
- ]
- }
- ],
- "prompt_number": 35
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.10 Page No 699"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=9.0\n",
- "Vo=3\n",
- "I1=1.0*10**-3\n",
- "f=500.0\n",
- "UTP=3.0\n",
- "\n",
- "#Calculations\n",
- "print(\"design the triangular wave\")\n",
- "Vi=Vcc-1\n",
- "V=Vo-(-Vo)\n",
- "print(\" I1>>Ibmax for op-amp\")\n",
- "R1=Vi/I1\n",
- "t=1.0/(2*f)\n",
- "C1=(I1*t)/V\n",
- "print(\"schmitt design\")\n",
- "I2=1.0*10**-3\n",
- "R2=UTP/I2\n",
- "R3=(Vcc-1)/I2\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 is %.2f kohm\" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "design the triangular wave\n",
- " I1>>Ibmax for op-amp\n",
- "schmitt design\n",
- "The value of R3 is 8.00 kohm\n"
- ]
- }
- ],
- "prompt_number": 36
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.11 Page No 705"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "f=100.0*10**3\n",
- "Rs=1.5*10**3\n",
- "R1=2.0*Rs\n",
- "\n",
- "\n",
- "#Calculations\n",
- "R1=2.7*10**3#use standard value\n",
- "R2=R1+Rs\n",
- "C1=1/(2*3.14*f*R2)\n",
- "R4=R2\n",
- "R3=2*R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 is %.2f kohm\" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R3 is 8.40 kohm\n"
- ]
- }
- ],
- "prompt_number": 37
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16.12, Page No 705"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "fs=1.0*10**6\n",
- "Rs=700.0\n",
- "C1=1000.0*10**-12\n",
- "C2=100.0*10**-12\n",
- "R1=1.0*10**6\n",
- "R2=10.0*10**3\n",
- "Rs=700.0\n",
- "Vdd=5\n",
- "\n",
- "#Calculations\n",
- "Ct=(C1*C2)/(C1+C2)\n",
- "print(\" at resonance Xl=Xct 2*pi*f*L=1/2*pi*f*Ct\")\n",
- "L=1/(((2*3.14*f)**2)*Ct)\n",
- "ip=Vdd/(R1+R2+Rs)\n",
- "Pd=(((.707*ip)**2)*Rs)*10**9\n",
- "\n",
- "#Results\n",
- "print(\" peak power dissipated is %.3fnW \" %Pd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " at resonance Xl=Xct 2*pi*f*L=1/2*pi*f*Ct\n",
- " peak power dissipated is 8.563nW \n"
- ]
- }
- ],
- "prompt_number": 38
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter17_1.ipynb b/Electronic_Devices_and_Circuits/Chapter17_1.ipynb deleted file mode 100755 index 0bf01537..00000000 --- a/Electronic_Devices_and_Circuits/Chapter17_1.ipynb +++ /dev/null @@ -1,560 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 17 : Active filters"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.1, Page No 716"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "rs=600.0\n",
- "R1=12.0*10**3\n",
- "Rl=100.0*10**3\n",
- "C1=0.013*10**-6\n",
- "\n",
- "#Calculations\n",
- "print(\"when Rl is not connected\")\n",
- "fc=1.0/(2*3.14*R1*C1)\n",
- "print(\" when Rl is connected\")\n",
- "fc=1.0/(2*3.14*((R1*Rl)/(R1+Rl))*C1)\n",
- "Attn=3#at fc attenuation is =3dB\n",
- "falloffrate=6\n",
- "print(\"attenuation at 2fc\")\n",
- "Attn=3+6\n",
- "print(\"attenuation at 2fc is %ddB \" %Attn)\n",
- "Attn=3+6+6\n",
- "\n",
- "#Results\n",
- "print(\" attenuation at 4fc is %ddB \" %Attn)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Rl is not connected\n",
- " when Rl is connected\n",
- "attenuation at 2fc\n",
- "attenuation at 2fc is 9dB \n",
- " attenuation at 4fc is 15dB \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.2, Page No 718"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Ib=500.0*10**-9\n",
- "f=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "R1=(70.0*10**-3)/Ib\n",
- "R1=140*10**3#use standard value\n",
- "R2=R1\n",
- "C1=(1/(2*3.14*R1*f))*10**12\n",
- "\n",
- "#Results\n",
- "print(\" capacitor used is of %.2f pF \" %C1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " capacitor used is of 1137.40 pF \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.3 Page No 719"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "print(\"first order high pass active filter\")\n",
- "f=5.0*10**3\n",
- "C1=1000.0*10**-12\n",
- "fu=1.0*10**6\n",
- "\n",
- "#Calculations\n",
- "R1=1.0/(2*3.14*f*C1)\n",
- "BW=fu-f\n",
- "print(\" bandwidth is %.2f kHz \" %(BW/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "first order high pass active filter\n",
- " bandwidth is 995.00 kHz \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.4, Page No 724"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=1.0*10**3\n",
- "Ib=500.0*10**-9\n",
- "print(\"butterworth second order filter\")\n",
- "\n",
- "#Calculations\n",
- "R=(70.0*10**-3)/Ib\n",
- "R1=R/2.0\n",
- "R1=68.1*10**3#use standard value\n",
- "R2=R1 \n",
- "R3=2.0*R1\n",
- "Xc1=math.sqrt(2)*R2\n",
- "C1=1/(2*3.14*f*math.sqrt(2)*R2)\n",
- "C2=2*C1\n",
- "fc=1/(2*3.14*(math.sqrt(R1*R2*C1*C2)))\n",
- "\n",
- "#Results\n",
- "print(\"actual cutoff frequency is %d kHz \" %(fc/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "butterworth second order filter\n",
- "actual cutoff frequency is 1 kHz \n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.5 Page No 725"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=12.0*10**3\n",
- "C1=1000.0*10**-12\n",
- "print(\"butterworth second order filter\")\n",
- "C2=C1\n",
- "\n",
- "#Calculations\n",
- "R2=(math.sqrt(2))/(2*3.14*f*C1)\n",
- "R1=.5*R2\n",
- "R3=R2\n",
- "fc=1.0/(2*3.14*(math.sqrt(R1*R2*C1*C2)))\n",
- "\n",
- "#Results\n",
- "print(\"actual cutoff frequency is %d KHz \" %(fc/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "butterworth second order filter\n",
- "actual cutoff frequency is 11 KHz \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.6 Page No 729"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "f=30.0*10**3\n",
- "C1=1000.0*10**-12\n",
- "print(\" third order low pass filter\")\n",
- "print(\"-20 dB per decade stage\")\n",
- "\n",
- "#Calculations\n",
- "fc1=f/.65\n",
- "R1=1.0/(2*3.14*fc1*C1)\n",
- "R2=R1\n",
- "print(\"-40dB per decade stage\")\n",
- "C3=1000*10**-12\n",
- "C2=2*C3\n",
- "fc2=f/.8\n",
- "R4=1/(2*3.14*fc2*C3*(math.sqrt(2)))\n",
- "R3=R4\n",
- "R5=R3+R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R5 is %.2f kohm\" %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " third order low pass filter\n",
- "-20 dB per decade stage\n",
- "-40dB per decade stage\n",
- "The value of R5 is 6.01 kohm\n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.7, Page No 730"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=20.0*10**3\n",
- "print(\"3rd order high pass filter\")\n",
- "print(\"-20dB per decade stage\")\n",
- "R1=121.0*10**3\n",
- "\n",
- "#Calculations\n",
- "fc1=.65*f\n",
- "C1=1/(2*3.14*fc1*R1)\n",
- "#this is so small it might be effected by stray capacitor.redesign %first choosing a suitable capacitance C1\n",
- "C1=100*10**-12\n",
- "R1=1/(2*3.14*f*C1)\n",
- "R2=R1\n",
- "print(\"-40dB per decade stage\")\n",
- "C3=1000*10**-12\n",
- "R4=(math.sqrt(2))/(2*3.14*.8*f*C3)\n",
- "C2=C3\n",
- "R3=.5*R4\n",
- "R5=R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R5 is %.2f kohm\" %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "3rd order high pass filter\n",
- "-20dB per decade stage\n",
- "-40dB per decade stage\n",
- "The value of R5 is 14.07 kohm\n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.8 Page No 734"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "f1=300.0\n",
- "f2=30.0*10**3\n",
- "print(\" single stage band pass filter\")\n",
- "\n",
- "#Calculations\n",
- "C2=1000*10**-12\n",
- "R2=1/(2*3.14*f2*C2)\n",
- "R1=R2\n",
- "Xc1=R1#at voltage gain Av=1\n",
- "C1=1/(2*3.14*f1*R1)\n",
- "R3=R2\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 is %.2f kohm\" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " single stage band pass filter\n",
- "The value of R3 is 5.31 kohm\n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.9 Page No 736"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f1=300.0\n",
- "f2=30.0*10**3\n",
- "\n",
- "#Calculations\n",
- "fo=math.sqrt(f1*f2)\n",
- "BW=f2-f1\n",
- "Q=fo/BW\n",
- "\n",
- "#Results\n",
- "print(\"The value of Q is %.2f \" %(Q))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Q is 0.10 \n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.10 Page No 737"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "R1=60.4*10**3\n",
- "R4=1.21*10**3\n",
- "C=.012*10**-6\n",
- "R2=121.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Q=math.sqrt((R1+R4)/(2*R4))\n",
- "fo=Q/(3.14*C*R2)\n",
- "print(\" center frequency is %3.2fHz \" %fo)\n",
- "BW=fo/Q\n",
- "\n",
- "#Results\n",
- "print(\" bandwidth is %3.1fHz \" %BW)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " center frequency is 1106.68Hz \n",
- " bandwidth is 219.3Hz \n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.12, Page No 744"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "f1=10.3*10**3\n",
- "f2=10.9*10**3\n",
- "C1=1000.0*10**-12\n",
- "\n",
- "#Calculations\n",
- "C2=C1\n",
- "fo=math.sqrt(f1*f2)\n",
- "R5=1.0/(2*3.14*fo*C1)\n",
- "R1=R5\n",
- "Q=fo/(f2-f1)\n",
- "R2=R1*(2*Q-1)\n",
- "\n",
- "#Results\n",
- "print(\"The value of R2 is %.2f kohm\" %(R2/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R2 is 515.76 kohm\n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.13, Page No 750"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f1=10.3*10**3\n",
- "f2=10.9*10**3\n",
- "Hobp=34\n",
- "\n",
- "#Calculations\n",
- "math.sqrt(f1*f2)\n",
- "Q=fo/(f2-f1)\n",
- "R3=120.0*10**3\n",
- "R2=R3/Q\n",
- "R1=R3/Hobp\n",
- "k=50*fo\n",
- "\n",
- "#Results\n",
- "print(\"The value of k is %.2f \" %(k/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of k is 529.79 \n"
- ]
- }
- ],
- "prompt_number": 27
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter17_2.ipynb b/Electronic_Devices_and_Circuits/Chapter17_2.ipynb deleted file mode 100755 index 0bf01537..00000000 --- a/Electronic_Devices_and_Circuits/Chapter17_2.ipynb +++ /dev/null @@ -1,560 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 17 : Active filters"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.1, Page No 716"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "rs=600.0\n",
- "R1=12.0*10**3\n",
- "Rl=100.0*10**3\n",
- "C1=0.013*10**-6\n",
- "\n",
- "#Calculations\n",
- "print(\"when Rl is not connected\")\n",
- "fc=1.0/(2*3.14*R1*C1)\n",
- "print(\" when Rl is connected\")\n",
- "fc=1.0/(2*3.14*((R1*Rl)/(R1+Rl))*C1)\n",
- "Attn=3#at fc attenuation is =3dB\n",
- "falloffrate=6\n",
- "print(\"attenuation at 2fc\")\n",
- "Attn=3+6\n",
- "print(\"attenuation at 2fc is %ddB \" %Attn)\n",
- "Attn=3+6+6\n",
- "\n",
- "#Results\n",
- "print(\" attenuation at 4fc is %ddB \" %Attn)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Rl is not connected\n",
- " when Rl is connected\n",
- "attenuation at 2fc\n",
- "attenuation at 2fc is 9dB \n",
- " attenuation at 4fc is 15dB \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.2, Page No 718"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Ib=500.0*10**-9\n",
- "f=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "R1=(70.0*10**-3)/Ib\n",
- "R1=140*10**3#use standard value\n",
- "R2=R1\n",
- "C1=(1/(2*3.14*R1*f))*10**12\n",
- "\n",
- "#Results\n",
- "print(\" capacitor used is of %.2f pF \" %C1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " capacitor used is of 1137.40 pF \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.3 Page No 719"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "print(\"first order high pass active filter\")\n",
- "f=5.0*10**3\n",
- "C1=1000.0*10**-12\n",
- "fu=1.0*10**6\n",
- "\n",
- "#Calculations\n",
- "R1=1.0/(2*3.14*f*C1)\n",
- "BW=fu-f\n",
- "print(\" bandwidth is %.2f kHz \" %(BW/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "first order high pass active filter\n",
- " bandwidth is 995.00 kHz \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.4, Page No 724"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=1.0*10**3\n",
- "Ib=500.0*10**-9\n",
- "print(\"butterworth second order filter\")\n",
- "\n",
- "#Calculations\n",
- "R=(70.0*10**-3)/Ib\n",
- "R1=R/2.0\n",
- "R1=68.1*10**3#use standard value\n",
- "R2=R1 \n",
- "R3=2.0*R1\n",
- "Xc1=math.sqrt(2)*R2\n",
- "C1=1/(2*3.14*f*math.sqrt(2)*R2)\n",
- "C2=2*C1\n",
- "fc=1/(2*3.14*(math.sqrt(R1*R2*C1*C2)))\n",
- "\n",
- "#Results\n",
- "print(\"actual cutoff frequency is %d kHz \" %(fc/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "butterworth second order filter\n",
- "actual cutoff frequency is 1 kHz \n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.5 Page No 725"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=12.0*10**3\n",
- "C1=1000.0*10**-12\n",
- "print(\"butterworth second order filter\")\n",
- "C2=C1\n",
- "\n",
- "#Calculations\n",
- "R2=(math.sqrt(2))/(2*3.14*f*C1)\n",
- "R1=.5*R2\n",
- "R3=R2\n",
- "fc=1.0/(2*3.14*(math.sqrt(R1*R2*C1*C2)))\n",
- "\n",
- "#Results\n",
- "print(\"actual cutoff frequency is %d KHz \" %(fc/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "butterworth second order filter\n",
- "actual cutoff frequency is 11 KHz \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.6 Page No 729"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "f=30.0*10**3\n",
- "C1=1000.0*10**-12\n",
- "print(\" third order low pass filter\")\n",
- "print(\"-20 dB per decade stage\")\n",
- "\n",
- "#Calculations\n",
- "fc1=f/.65\n",
- "R1=1.0/(2*3.14*fc1*C1)\n",
- "R2=R1\n",
- "print(\"-40dB per decade stage\")\n",
- "C3=1000*10**-12\n",
- "C2=2*C3\n",
- "fc2=f/.8\n",
- "R4=1/(2*3.14*fc2*C3*(math.sqrt(2)))\n",
- "R3=R4\n",
- "R5=R3+R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R5 is %.2f kohm\" %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " third order low pass filter\n",
- "-20 dB per decade stage\n",
- "-40dB per decade stage\n",
- "The value of R5 is 6.01 kohm\n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.7, Page No 730"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=20.0*10**3\n",
- "print(\"3rd order high pass filter\")\n",
- "print(\"-20dB per decade stage\")\n",
- "R1=121.0*10**3\n",
- "\n",
- "#Calculations\n",
- "fc1=.65*f\n",
- "C1=1/(2*3.14*fc1*R1)\n",
- "#this is so small it might be effected by stray capacitor.redesign %first choosing a suitable capacitance C1\n",
- "C1=100*10**-12\n",
- "R1=1/(2*3.14*f*C1)\n",
- "R2=R1\n",
- "print(\"-40dB per decade stage\")\n",
- "C3=1000*10**-12\n",
- "R4=(math.sqrt(2))/(2*3.14*.8*f*C3)\n",
- "C2=C3\n",
- "R3=.5*R4\n",
- "R5=R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R5 is %.2f kohm\" %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "3rd order high pass filter\n",
- "-20dB per decade stage\n",
- "-40dB per decade stage\n",
- "The value of R5 is 14.07 kohm\n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.8 Page No 734"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "f1=300.0\n",
- "f2=30.0*10**3\n",
- "print(\" single stage band pass filter\")\n",
- "\n",
- "#Calculations\n",
- "C2=1000*10**-12\n",
- "R2=1/(2*3.14*f2*C2)\n",
- "R1=R2\n",
- "Xc1=R1#at voltage gain Av=1\n",
- "C1=1/(2*3.14*f1*R1)\n",
- "R3=R2\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 is %.2f kohm\" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " single stage band pass filter\n",
- "The value of R3 is 5.31 kohm\n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.9 Page No 736"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f1=300.0\n",
- "f2=30.0*10**3\n",
- "\n",
- "#Calculations\n",
- "fo=math.sqrt(f1*f2)\n",
- "BW=f2-f1\n",
- "Q=fo/BW\n",
- "\n",
- "#Results\n",
- "print(\"The value of Q is %.2f \" %(Q))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Q is 0.10 \n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.10 Page No 737"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "R1=60.4*10**3\n",
- "R4=1.21*10**3\n",
- "C=.012*10**-6\n",
- "R2=121.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Q=math.sqrt((R1+R4)/(2*R4))\n",
- "fo=Q/(3.14*C*R2)\n",
- "print(\" center frequency is %3.2fHz \" %fo)\n",
- "BW=fo/Q\n",
- "\n",
- "#Results\n",
- "print(\" bandwidth is %3.1fHz \" %BW)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " center frequency is 1106.68Hz \n",
- " bandwidth is 219.3Hz \n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.12, Page No 744"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "f1=10.3*10**3\n",
- "f2=10.9*10**3\n",
- "C1=1000.0*10**-12\n",
- "\n",
- "#Calculations\n",
- "C2=C1\n",
- "fo=math.sqrt(f1*f2)\n",
- "R5=1.0/(2*3.14*fo*C1)\n",
- "R1=R5\n",
- "Q=fo/(f2-f1)\n",
- "R2=R1*(2*Q-1)\n",
- "\n",
- "#Results\n",
- "print(\"The value of R2 is %.2f kohm\" %(R2/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R2 is 515.76 kohm\n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17.13, Page No 750"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f1=10.3*10**3\n",
- "f2=10.9*10**3\n",
- "Hobp=34\n",
- "\n",
- "#Calculations\n",
- "math.sqrt(f1*f2)\n",
- "Q=fo/(f2-f1)\n",
- "R3=120.0*10**3\n",
- "R2=R3/Q\n",
- "R1=R3/Hobp\n",
- "k=50*fo\n",
- "\n",
- "#Results\n",
- "print(\"The value of k is %.2f \" %(k/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of k is 529.79 \n"
- ]
- }
- ],
- "prompt_number": 27
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter18_1.ipynb b/Electronic_Devices_and_Circuits/Chapter18_1.ipynb deleted file mode 100755 index 4cac5251..00000000 --- a/Electronic_Devices_and_Circuits/Chapter18_1.ipynb +++ /dev/null @@ -1,684 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 18 : Linear and switching voltage regulators"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.1, Page No 761"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vs=21.0\n",
- "Vo=12.0\n",
- "Av=100.0\n",
- "\n",
- "#Calculations\n",
- "vo=(Vs*0.1)/Av#source effect is 10% of the Vs\n",
- "print(\" source effect is %3.3fV \" %vo)\n",
- "vo=(21-20)/100.0\n",
- "print(\" laod effect is %3.3fV \" %vo)\n",
- "LR=(21*10**-3 *100)/12.0\n",
- "print(\"line regulation is %3.3fpercentage \" %LR)\n",
- "LR=(10*10**-3*100)/12.0\n",
- "print(\" load effect is %3.3fpercentage \" %LR)\n",
- "RJ=20*math.log((1.0/Av),10)\n",
- "\n",
- "#Results\n",
- "print(\"ripple rejection is %d dB \" %RJ)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " source effect is 0.021V \n",
- " laod effect is 0.010V \n",
- "line regulation is 0.175percentage \n",
- " load effect is 0.083percentage \n",
- "ripple rejection is -39 dB \n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.2, Page No 762"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vo=12.0\n",
- "Il=40.0*10**-3\n",
- "Vs=20.0\n",
- "Vbe=.7\n",
- "Vz=0.75*Vo\n",
- "print(\"for minimum D1 current select\")\n",
- "Ir2=10.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R2=(Vo-Vz)/Ir2\n",
- "Ie1=Il+Ir2\n",
- "print(\"specification for Q\")\n",
- "Vce1=20 \n",
- "Vs=Vce1\n",
- "Ic1=50*10**-3\n",
- "Pd=(Vs-Vo)*Ie1\n",
- "hfe=50\n",
- "Ib1=Ie1/hfe\n",
- "Ic2=5*10**-3\n",
- "R1=(Vs-(Vo+.7))/(Ic2+Ib1)\n",
- "Iz=Ie1+Ir2\n",
- "I4=1*10**-3\n",
- "R4=(Vz+Vbe)/I4\n",
- "R3=(Vo-(Vz+Vbe))/I4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 is %.2f kohm\" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "for minimum D1 current select\n",
- "specification for Q\n",
- "The value of R3 is 2.30 kohm\n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.3 Page No 765"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "I4=1.0*10**-3\n",
- "Vb2=9.8\n",
- "\n",
- "#Calculations\n",
- "print(\" for Vo=11V moving contact at top of R5\")\n",
- "Vo=11\n",
- "R3=(Vo-Vb2)/I4\n",
- "R=Vb2/I4#R=R4+R5\n",
- "print(\" for Vo=13V moving contact at bottom of R5\")\n",
- "Vo=13\n",
- "I4=Vo/(R3+R)\n",
- "R4=Vb2/I4\n",
- "R5=R-R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R5 is %.2f kohm\" %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for Vo=11V moving contact at top of R5\n",
- " for Vo=13V moving contact at bottom of R5\n",
- "The value of R5 is 1.51 kohm\n"
- ]
- }
- ],
- "prompt_number": 27
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.4, Page No 766"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hFE3=50.0\n",
- "hFE1=20.0\n",
- "Ie1=200.0*10**-3+10*10**-3\n",
- "Ic2=1.0*1**-3\n",
- "Vs=20.0\n",
- "Vb3=13.4\n",
- "Vo=12.0\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Ib1=Ie1/hFE1\n",
- "Ib3=Ib1/hFE3\n",
- "R1=(Vs-Vb3)/(Ic2+Ib3)\n",
- "print(\"select I6=.5*10**-3\")\n",
- "I6=.5*10**-3\n",
- "R6=(Vo+Vbe)/I6\n",
- "Pd=(Vs-Vo)*Ie1\n",
- "\n",
- "#Results\n",
- "print(\" peak power dissipated is %.3fnW \" %Pd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "select I6=.5*10**-3\n",
- " peak power dissipated is 1.680nW \n"
- ]
- }
- ],
- "prompt_number": 28
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.5 Page No 769"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vr1=3.0\n",
- "Ic2=1.0*10**-3\n",
- "Ib3=0.21*10**-3\n",
- "Vbe1=0.7\n",
- "Vbe3=Vbe1\n",
- "Vs=20.0\n",
- "\n",
- "#Calculations\n",
- "R1=Vr1/(Ic2+Ib3)\n",
- "Vz2=Vo+Vbe1+Vbe3+Vr1\n",
- "Ir7=5*10**-3\n",
- "R2=(Vs-Vz2)/Ir7\n",
- "\n",
- "#Results\n",
- "print(\"The value of R2 is %.2f kohm\" %(R2/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R2 is 0.72 kohm\n"
- ]
- }
- ],
- "prompt_number": 29
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.6 Page No 770"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vc5=9.8\n",
- "Vb2=Vc5\n",
- "Vce5=3.0\n",
- "Vbe=0.7\n",
- "Vo=12.0\n",
- "\n",
- "#Calculations\n",
- "Vr9=Vc5-Vce5\n",
- "Vz2=Vr9+Vbe\n",
- "Ic5=1.0*10**-3\n",
- "R8=(Vo-Vc5)/Ic5\n",
- "Ir9=2*Ic5\n",
- "R9=Vr9/Ir9\n",
- "print(\" Iz2>>Ib5 and Iz2> Izk for the zener diode \")\n",
- "Iz2=10*10**-3\n",
- "R7=(Vo-Vz2)/Iz2\n",
- "I4=1*10**-3\n",
- "Vb6=7.5\n",
- "Vz2=Vb6\n",
- "print(\" when Vo=11V moving contact at top of R5 \")\n",
- "Vo=11\n",
- "R3=(Vo-Vb6)/I4\n",
- "R3=3.3*10**3#use standard value\n",
- "I4=(Vo-Vb6)/R3\n",
- "R=Vb6/I4#R=R4+R5\n",
- "print(\" when Vo=13V moving contact at bottom of R5\")\n",
- "Vo=13.0\n",
- "Vb6=7.5\n",
- "I4=Vo/(R3+R)\n",
- "R4=Vb6/I4\n",
- "R5=R-R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R5 is %.2f kohm\" %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Iz2>>Ib5 and Iz2> Izk for the zener diode \n",
- " when Vo=11V moving contact at top of R5 \n",
- " when Vo=13V moving contact at bottom of R5\n",
- "The value of R5 is 1.09 kohm\n"
- ]
- }
- ],
- "prompt_number": 30
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.7, Page No 770"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Isc=100.0*10**-3\n",
- "Vr10=0.5\n",
- "Vo=12.0\n",
- "\n",
- "#Calculations\n",
- "R10=Vr10/Isc\n",
- "R10=4.7#use standard value\n",
- "Il=200.0*10**-3\n",
- "Vr10=Il*R10\n",
- "Vr11=Vr10-.5\n",
- "I11=1.0*10**-3\n",
- "R11=Vr11/I11\n",
- "R12=(Vo+Vr10-Vr11)/I11\n",
- "\n",
- "#Results\n",
- "print(\"The value of R12 is %.2f kohm\" %(R12/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R12 is 12.50 kohm\n"
- ]
- }
- ],
- "prompt_number": 31
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.8 Page No 778"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vo=12.0\n",
- "hFE1=20.0\n",
- "hFE2=50.0\n",
- "Il=250.0*10**-3\n",
- "Vz=0.75*Vo\n",
- "Vz=9.1#use standard value for 1N757 diode\n",
- "Iz1=10.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R1=(Vo-Vz)/Iz1\n",
- "I3=1.0*10**-3\n",
- "print(\" when V0=12V(moving contact at top of R5)\")\n",
- "R3=(Vo-Vz)/I3\n",
- "R=Vz/I3\n",
- "print(\" when Vo=15V moving contact at bottom of R5\")\n",
- "Vo=15\n",
- "I3=Vo/(R+R3)\n",
- "R4=Vz/I3\n",
- "R5=R-R4\n",
- "Ir6=.5*10**-3\n",
- "R6=Vo/Ir6\n",
- "print(\" op-amp output current\")\n",
- "Ib2=Il/(hFE1*hFE2)\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ib2 is %.2f mA\" %(Ib2*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " when V0=12V(moving contact at top of R5)\n",
- " when Vo=15V moving contact at bottom of R5\n",
- " op-amp output current\n",
- "The value of Ib2 is 0.25 mA\n"
- ]
- }
- ],
- "prompt_number": 32
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.9 Page No 782"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "I2=1.0*10**-3\n",
- "Vr2=7.15\n",
- "Vref=Vr2\n",
- "Vo=10.0\n",
- "Pdmax=1000.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R2=Vref/I2\n",
- "R2=6.8*10**3#use standard value and recalculate the I2\n",
- "I2=Vref/R2\n",
- "R1=(Vo-Vref)/I2\n",
- "Vs=Vo+5#for satisfactory operation of series pass transistor\n",
- "Iint=25*10**-3#internal circuit current\n",
- "Pi=Vs*Iint\n",
- "print(\"maximum power dissipated in series pass transistor\")\n",
- "Pd=Pdmax-Pi\n",
- "print(\"maximum load current is \")\n",
- "Il=Pd/(Vs-Vo)\n",
- "\n",
- "#Results\n",
- "print(\"The value of Il is %.2f mA\" %(Il*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "maximum power dissipated in series pass transistor\n",
- "maximum load current is \n",
- "The value of Il is 125.00 mA\n"
- ]
- }
- ],
- "prompt_number": 33
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.10 Page No 785"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "I1=1.0*10**-3\n",
- "Vref=1.25\n",
- "Vo=6.0\n",
- "Vs=15.0\n",
- "Il=200.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R1=Vref/I1\n",
- "R2=(Vo-Vref)/I1\n",
- "Pd=(Vs-Vo)*Il\n",
- "\n",
- "#Results\n",
- "print(\"regulated power dissipation is %.2f W \" %Pd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "regulated power dissipation is 1.80 W \n"
- ]
- }
- ],
- "prompt_number": 34
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.11, Page No 788"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vo=10.0\n",
- "Io=1.0\n",
- "Vce=7.0\n",
- "Vf=1.0\n",
- "\n",
- "#Calculations\n",
- "Po=Vo*Io\n",
- "print(\" linear regulator\")\n",
- "Pi=Po+(Vce*Io)\n",
- "n=(Po*100.0)/Pi#efficiency\n",
- "print(\" switching regulator\")\n",
- "Vce=1\n",
- "Pi=Po+Io*(Vce+Vf)\n",
- "n=(Po*100.0)/Pi#efficiency\n",
- "\n",
- "#Results\n",
- "print(\"The value of n is %.2f \" %(n))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " linear regulator\n",
- " switching regulator\n",
- "The value of n is 83.33 \n"
- ]
- }
- ],
- "prompt_number": 35
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.12, Page No 752"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=50.0*10**3\n",
- "Vo=12.0\n",
- "Vf=0.7\n",
- "Vi=30.0\n",
- "Vsat=1.0\n",
- "Io=500.0*10**-3\n",
- "Vr=100.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "T=1.0/f\n",
- "t=(Vo+Vf)/(Vi-Vsat-Vo)\n",
- "toff=T/1.75\n",
- "ton=T-toff\n",
- "Ip=2*Io\n",
- "L1=((Vi-Vsat-Vo)*ton)/Ip\n",
- "C1=Ip/(8.0*f*Vr)\n",
- "\n",
- "#Results\n",
- "print(\"The value of C1 is %.2f pF\" %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C1 is 25.00 pF\n"
- ]
- }
- ],
- "prompt_number": 36
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.13, Page No 799"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "print(\" an MC34063 controller is for step down transformer\")\n",
- "Ib=-400.0*10**-3\n",
- "I1=1.0*10**-3\n",
- "Vref=1.25\n",
- "V0=12.0\n",
- "Ip=1.0\n",
- "\n",
- "#Calculations\n",
- "ton=8.6*10**-6\n",
- "R1=Vref/I1\n",
- "R1=1.2*10**3#use standard value\n",
- "I1=Vref/R1\n",
- "R2=(Vo-Vref)/I1\n",
- "Rsc=.33/Ip\n",
- "Ct=4.8*10**-5 *ton\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ct is %.2f pF\" %(Ct*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " an MC34063 controller is for step down transformer\n",
- "The value of Ct is 0.00 pF\n"
- ]
- }
- ],
- "prompt_number": 37
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter18_2.ipynb b/Electronic_Devices_and_Circuits/Chapter18_2.ipynb deleted file mode 100755 index 4cac5251..00000000 --- a/Electronic_Devices_and_Circuits/Chapter18_2.ipynb +++ /dev/null @@ -1,684 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 18 : Linear and switching voltage regulators"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.1, Page No 761"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vs=21.0\n",
- "Vo=12.0\n",
- "Av=100.0\n",
- "\n",
- "#Calculations\n",
- "vo=(Vs*0.1)/Av#source effect is 10% of the Vs\n",
- "print(\" source effect is %3.3fV \" %vo)\n",
- "vo=(21-20)/100.0\n",
- "print(\" laod effect is %3.3fV \" %vo)\n",
- "LR=(21*10**-3 *100)/12.0\n",
- "print(\"line regulation is %3.3fpercentage \" %LR)\n",
- "LR=(10*10**-3*100)/12.0\n",
- "print(\" load effect is %3.3fpercentage \" %LR)\n",
- "RJ=20*math.log((1.0/Av),10)\n",
- "\n",
- "#Results\n",
- "print(\"ripple rejection is %d dB \" %RJ)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " source effect is 0.021V \n",
- " laod effect is 0.010V \n",
- "line regulation is 0.175percentage \n",
- " load effect is 0.083percentage \n",
- "ripple rejection is -39 dB \n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.2, Page No 762"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vo=12.0\n",
- "Il=40.0*10**-3\n",
- "Vs=20.0\n",
- "Vbe=.7\n",
- "Vz=0.75*Vo\n",
- "print(\"for minimum D1 current select\")\n",
- "Ir2=10.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R2=(Vo-Vz)/Ir2\n",
- "Ie1=Il+Ir2\n",
- "print(\"specification for Q\")\n",
- "Vce1=20 \n",
- "Vs=Vce1\n",
- "Ic1=50*10**-3\n",
- "Pd=(Vs-Vo)*Ie1\n",
- "hfe=50\n",
- "Ib1=Ie1/hfe\n",
- "Ic2=5*10**-3\n",
- "R1=(Vs-(Vo+.7))/(Ic2+Ib1)\n",
- "Iz=Ie1+Ir2\n",
- "I4=1*10**-3\n",
- "R4=(Vz+Vbe)/I4\n",
- "R3=(Vo-(Vz+Vbe))/I4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 is %.2f kohm\" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "for minimum D1 current select\n",
- "specification for Q\n",
- "The value of R3 is 2.30 kohm\n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.3 Page No 765"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "I4=1.0*10**-3\n",
- "Vb2=9.8\n",
- "\n",
- "#Calculations\n",
- "print(\" for Vo=11V moving contact at top of R5\")\n",
- "Vo=11\n",
- "R3=(Vo-Vb2)/I4\n",
- "R=Vb2/I4#R=R4+R5\n",
- "print(\" for Vo=13V moving contact at bottom of R5\")\n",
- "Vo=13\n",
- "I4=Vo/(R3+R)\n",
- "R4=Vb2/I4\n",
- "R5=R-R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R5 is %.2f kohm\" %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for Vo=11V moving contact at top of R5\n",
- " for Vo=13V moving contact at bottom of R5\n",
- "The value of R5 is 1.51 kohm\n"
- ]
- }
- ],
- "prompt_number": 27
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.4, Page No 766"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "hFE3=50.0\n",
- "hFE1=20.0\n",
- "Ie1=200.0*10**-3+10*10**-3\n",
- "Ic2=1.0*1**-3\n",
- "Vs=20.0\n",
- "Vb3=13.4\n",
- "Vo=12.0\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Ib1=Ie1/hFE1\n",
- "Ib3=Ib1/hFE3\n",
- "R1=(Vs-Vb3)/(Ic2+Ib3)\n",
- "print(\"select I6=.5*10**-3\")\n",
- "I6=.5*10**-3\n",
- "R6=(Vo+Vbe)/I6\n",
- "Pd=(Vs-Vo)*Ie1\n",
- "\n",
- "#Results\n",
- "print(\" peak power dissipated is %.3fnW \" %Pd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "select I6=.5*10**-3\n",
- " peak power dissipated is 1.680nW \n"
- ]
- }
- ],
- "prompt_number": 28
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.5 Page No 769"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vr1=3.0\n",
- "Ic2=1.0*10**-3\n",
- "Ib3=0.21*10**-3\n",
- "Vbe1=0.7\n",
- "Vbe3=Vbe1\n",
- "Vs=20.0\n",
- "\n",
- "#Calculations\n",
- "R1=Vr1/(Ic2+Ib3)\n",
- "Vz2=Vo+Vbe1+Vbe3+Vr1\n",
- "Ir7=5*10**-3\n",
- "R2=(Vs-Vz2)/Ir7\n",
- "\n",
- "#Results\n",
- "print(\"The value of R2 is %.2f kohm\" %(R2/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R2 is 0.72 kohm\n"
- ]
- }
- ],
- "prompt_number": 29
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.6 Page No 770"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vc5=9.8\n",
- "Vb2=Vc5\n",
- "Vce5=3.0\n",
- "Vbe=0.7\n",
- "Vo=12.0\n",
- "\n",
- "#Calculations\n",
- "Vr9=Vc5-Vce5\n",
- "Vz2=Vr9+Vbe\n",
- "Ic5=1.0*10**-3\n",
- "R8=(Vo-Vc5)/Ic5\n",
- "Ir9=2*Ic5\n",
- "R9=Vr9/Ir9\n",
- "print(\" Iz2>>Ib5 and Iz2> Izk for the zener diode \")\n",
- "Iz2=10*10**-3\n",
- "R7=(Vo-Vz2)/Iz2\n",
- "I4=1*10**-3\n",
- "Vb6=7.5\n",
- "Vz2=Vb6\n",
- "print(\" when Vo=11V moving contact at top of R5 \")\n",
- "Vo=11\n",
- "R3=(Vo-Vb6)/I4\n",
- "R3=3.3*10**3#use standard value\n",
- "I4=(Vo-Vb6)/R3\n",
- "R=Vb6/I4#R=R4+R5\n",
- "print(\" when Vo=13V moving contact at bottom of R5\")\n",
- "Vo=13.0\n",
- "Vb6=7.5\n",
- "I4=Vo/(R3+R)\n",
- "R4=Vb6/I4\n",
- "R5=R-R4\n",
- "\n",
- "#Results\n",
- "print(\"The value of R5 is %.2f kohm\" %(R5/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Iz2>>Ib5 and Iz2> Izk for the zener diode \n",
- " when Vo=11V moving contact at top of R5 \n",
- " when Vo=13V moving contact at bottom of R5\n",
- "The value of R5 is 1.09 kohm\n"
- ]
- }
- ],
- "prompt_number": 30
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.7, Page No 770"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Isc=100.0*10**-3\n",
- "Vr10=0.5\n",
- "Vo=12.0\n",
- "\n",
- "#Calculations\n",
- "R10=Vr10/Isc\n",
- "R10=4.7#use standard value\n",
- "Il=200.0*10**-3\n",
- "Vr10=Il*R10\n",
- "Vr11=Vr10-.5\n",
- "I11=1.0*10**-3\n",
- "R11=Vr11/I11\n",
- "R12=(Vo+Vr10-Vr11)/I11\n",
- "\n",
- "#Results\n",
- "print(\"The value of R12 is %.2f kohm\" %(R12/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R12 is 12.50 kohm\n"
- ]
- }
- ],
- "prompt_number": 31
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.8 Page No 778"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vo=12.0\n",
- "hFE1=20.0\n",
- "hFE2=50.0\n",
- "Il=250.0*10**-3\n",
- "Vz=0.75*Vo\n",
- "Vz=9.1#use standard value for 1N757 diode\n",
- "Iz1=10.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R1=(Vo-Vz)/Iz1\n",
- "I3=1.0*10**-3\n",
- "print(\" when V0=12V(moving contact at top of R5)\")\n",
- "R3=(Vo-Vz)/I3\n",
- "R=Vz/I3\n",
- "print(\" when Vo=15V moving contact at bottom of R5\")\n",
- "Vo=15\n",
- "I3=Vo/(R+R3)\n",
- "R4=Vz/I3\n",
- "R5=R-R4\n",
- "Ir6=.5*10**-3\n",
- "R6=Vo/Ir6\n",
- "print(\" op-amp output current\")\n",
- "Ib2=Il/(hFE1*hFE2)\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ib2 is %.2f mA\" %(Ib2*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " when V0=12V(moving contact at top of R5)\n",
- " when Vo=15V moving contact at bottom of R5\n",
- " op-amp output current\n",
- "The value of Ib2 is 0.25 mA\n"
- ]
- }
- ],
- "prompt_number": 32
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.9 Page No 782"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "I2=1.0*10**-3\n",
- "Vr2=7.15\n",
- "Vref=Vr2\n",
- "Vo=10.0\n",
- "Pdmax=1000.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R2=Vref/I2\n",
- "R2=6.8*10**3#use standard value and recalculate the I2\n",
- "I2=Vref/R2\n",
- "R1=(Vo-Vref)/I2\n",
- "Vs=Vo+5#for satisfactory operation of series pass transistor\n",
- "Iint=25*10**-3#internal circuit current\n",
- "Pi=Vs*Iint\n",
- "print(\"maximum power dissipated in series pass transistor\")\n",
- "Pd=Pdmax-Pi\n",
- "print(\"maximum load current is \")\n",
- "Il=Pd/(Vs-Vo)\n",
- "\n",
- "#Results\n",
- "print(\"The value of Il is %.2f mA\" %(Il*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "maximum power dissipated in series pass transistor\n",
- "maximum load current is \n",
- "The value of Il is 125.00 mA\n"
- ]
- }
- ],
- "prompt_number": 33
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.10 Page No 785"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "I1=1.0*10**-3\n",
- "Vref=1.25\n",
- "Vo=6.0\n",
- "Vs=15.0\n",
- "Il=200.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R1=Vref/I1\n",
- "R2=(Vo-Vref)/I1\n",
- "Pd=(Vs-Vo)*Il\n",
- "\n",
- "#Results\n",
- "print(\"regulated power dissipation is %.2f W \" %Pd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "regulated power dissipation is 1.80 W \n"
- ]
- }
- ],
- "prompt_number": 34
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.11, Page No 788"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vo=10.0\n",
- "Io=1.0\n",
- "Vce=7.0\n",
- "Vf=1.0\n",
- "\n",
- "#Calculations\n",
- "Po=Vo*Io\n",
- "print(\" linear regulator\")\n",
- "Pi=Po+(Vce*Io)\n",
- "n=(Po*100.0)/Pi#efficiency\n",
- "print(\" switching regulator\")\n",
- "Vce=1\n",
- "Pi=Po+Io*(Vce+Vf)\n",
- "n=(Po*100.0)/Pi#efficiency\n",
- "\n",
- "#Results\n",
- "print(\"The value of n is %.2f \" %(n))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " linear regulator\n",
- " switching regulator\n",
- "The value of n is 83.33 \n"
- ]
- }
- ],
- "prompt_number": 35
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.12, Page No 752"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=50.0*10**3\n",
- "Vo=12.0\n",
- "Vf=0.7\n",
- "Vi=30.0\n",
- "Vsat=1.0\n",
- "Io=500.0*10**-3\n",
- "Vr=100.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "T=1.0/f\n",
- "t=(Vo+Vf)/(Vi-Vsat-Vo)\n",
- "toff=T/1.75\n",
- "ton=T-toff\n",
- "Ip=2*Io\n",
- "L1=((Vi-Vsat-Vo)*ton)/Ip\n",
- "C1=Ip/(8.0*f*Vr)\n",
- "\n",
- "#Results\n",
- "print(\"The value of C1 is %.2f pF\" %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C1 is 25.00 pF\n"
- ]
- }
- ],
- "prompt_number": 36
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 18.13, Page No 799"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "print(\" an MC34063 controller is for step down transformer\")\n",
- "Ib=-400.0*10**-3\n",
- "I1=1.0*10**-3\n",
- "Vref=1.25\n",
- "V0=12.0\n",
- "Ip=1.0\n",
- "\n",
- "#Calculations\n",
- "ton=8.6*10**-6\n",
- "R1=Vref/I1\n",
- "R1=1.2*10**3#use standard value\n",
- "I1=Vref/R1\n",
- "R2=(Vo-Vref)/I1\n",
- "Rsc=.33/Ip\n",
- "Ct=4.8*10**-5 *ton\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ct is %.2f pF\" %(Ct*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " an MC34063 controller is for step down transformer\n",
- "The value of Ct is 0.00 pF\n"
- ]
- }
- ],
- "prompt_number": 37
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter19_1.ipynb b/Electronic_Devices_and_Circuits/Chapter19_1.ipynb deleted file mode 100755 index f144d168..00000000 --- a/Electronic_Devices_and_Circuits/Chapter19_1.ipynb +++ /dev/null @@ -1,1316 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 19 : Power amplifiers"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.1, Page No 810"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "Rpy=40.0\n",
- "N1=74.0\n",
- "N2=14.0\n",
- "R2=3.7*10**3\n",
- "R1=4.7*10**3\n",
- "Vbe=0.7\n",
- "Re=1.0*10**3\n",
- "Vcc=13.0\n",
- "Rl=56.0\n",
- "\n",
- "#Calculations\n",
- "print(\"Q-point\")\n",
- "Vb=Vcc*(R2/(R1+R2))\n",
- "Ic=(Vb-Vbe)/Re\n",
- "Ie=Ic\n",
- "Vce=Vcc-Ic*(Rpy+Re)\n",
- "rl=(N1/N2)**2 *Rl\n",
- "rl=rl+Rpy\n",
- "Ic=5*10**-3\n",
- "Vce=Ic*rl\n",
- "\n",
- "#Results\n",
- "print(\"The value of Vce is %.2f v \" %Vce)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Q-point\n",
- "The value of Vce is 8.02 v \n"
- ]
- }
- ],
- "prompt_number": 44
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.2, Page No 814"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=13.0\n",
- "Icq=5.0*10**-3\n",
- "Vceq=8.0\n",
- "Vp=Vceq\n",
- "Ip=Icq\n",
- "nt=0.8\n",
- "\n",
- "#Calculations\n",
- "Pi=Vcc*Icq\n",
- "Po=.5*Vp*Ip\n",
- "P0=nt*Po\n",
- "n=(P0/Pi)*100.0\n",
- "\n",
- "#Results\n",
- "print(\" maximum efficiency is %3.2f percentage \" %n)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " maximum efficiency is 24.62 percentage \n"
- ]
- }
- ],
- "prompt_number": 45
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.4 Page No 821"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "N1=60.0\n",
- "N2=10.0\n",
- "Rl=16.0\n",
- "Rpy=0\n",
- "R6=56.0\n",
- "Vcc=27.0\n",
- "Vce=0.5\n",
- "n=0.79\n",
- "\n",
- "#Calculations\n",
- "print(\" Referred laod\")\n",
- "rl=(N1/N2)**2 *Rl\n",
- "print(\" tatol ac load line in series with each of Q2 and Q3\")\n",
- "Rl=rl+R6+Rpy\n",
- "print(\" peak primary current\")\n",
- "Ip=(Vcc-Vce)/Rl\n",
- "print(\"peak primary voltage\")\n",
- "Vp=Vcc-Vce-(Ip*R6)\n",
- "print(\"power delivered to primary\")\n",
- "Po=.5*Vp*Ip\n",
- "\n",
- "#Calculations\n",
- "Po=Po*n#n is power efficiency\n",
- "print(\"power delivered to the load %.2f W \" %Po)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Referred laod\n",
- " tatol ac load line in series with each of Q2 and Q3\n",
- " peak primary current\n",
- "peak primary voltage\n",
- "power delivered to primary\n",
- "power delivered to the load 0.40 W \n"
- ]
- }
- ],
- "prompt_number": 46
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.5, Page No 824"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Po=4.0\n",
- "nt=0.8\n",
- "Vcc=30.0\n",
- "Vp=Vcc\n",
- "Rl=16.0\n",
- "\n",
- "#Calculations\n",
- "P0=Po/nt\n",
- "rl=(Vp)**2 /(2*P0)\n",
- "rl=4*rl\n",
- "print(\"transformer specification Po=4 %Rl=16 rl=360\")\n",
- "Vce=2.0*Vcc\n",
- "Ip=(2.0*P0)/Vp\n",
- "Pi=Vcc*.636*Ip\n",
- "Pt=0.5*(Pi-P0)\n",
- "\n",
- "#Results\n",
- "print(\" transistor specification is Py=.68W Vce=60 Ip=333mA\")\n",
- "print(\"power delivered to the load Pi = %.2f W \" %Pi)\n",
- "print(\"power delivered to the load Pt = %.2f W \" %Pt)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "transformer specification Po=4 %Rl=16 rl=360\n",
- " transistor specification is Py=.68W Vce=60 Ip=333mA\n",
- "power delivered to the load Pi = 6.36 W \n",
- "power delivered to the load Pt = 0.68 W \n"
- ]
- }
- ],
- "prompt_number": 47
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.6 Page No 830"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rl=50.0\n",
- "Po=1.0\n",
- "hFE=50.0\n",
- "Vbe=0.7\n",
- "Vrc=4.0\n",
- "Vre=1.0\n",
- "Vd1=0.7\n",
- "\n",
- "#Calculations\n",
- "Vd2=Vd1\n",
- "Vp=math.sqrt(2*Rl*Po)\n",
- "Ip=Vp/Rl\n",
- "Re3=.1*Rl\n",
- "Re2=4.7#use stabdard value\n",
- "Re2=Re3\n",
- "Icq=.1*Ip\n",
- "Vb=Vbe+Icq*(Re2+Re3)+Vbe\n",
- "Vc1=Vrc\n",
- "Ib2=Ip/hFE\n",
- "Irc=Ib2+1*10**-3\n",
- "Rc=Vrc/Irc\n",
- "Rc=680.0 #use standard value\n",
- "Vcc=2.0*(Vp+Vre+Vbe+Vrc)\n",
- "Vcc=32#use standard value\n",
- "Vrcdc=.5*(Vcc-Vb)\n",
- "Ic1=Vrcdc/Rc\n",
- "Rb=(Vb-Vd1-Vd2)/Ic1\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.2f kOhm \" %Rb)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 8.95 kOhm \n"
- ]
- }
- ],
- "prompt_number": 48
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.7 Page No 832"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=32.0\n",
- "Vce=32.0\n",
- "Ip=200.0*10**-3\n",
- "Po=1.0\n",
- "\n",
- "#Calculations\n",
- "Ic=1.1*Ip\n",
- "Pi=0.35*Vcc*Ip\n",
- "Pt=0.5*(Pi-Po)\n",
- "\n",
- "#Results\n",
- "print(\"power delivered to the load Pi = %.2f \" %Pi)\n",
- "print(\"power delivered to the load Pt = %.2f \" %Pt)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "power delivered to the load Pi = 2.24 \n",
- "power delivered to the load Pt = 0.62 \n"
- ]
- }
- ],
- "prompt_number": 49
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.8, Page No 832"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f=50.0\n",
- "hib=2.0\n",
- "Rl=50.0\n",
- "\n",
- "#Calculations\n",
- "Ce=1.0/(2*3.14*f*hib)\n",
- "Co=1.0/(2*3.14*50*.1*Rl)\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ce is %.2f pF \" %(Ce*10**3))\n",
- "print(\"The value of Co is %.2f pF \" %(Co*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Ce is 1.59 pF \n",
- "The value of Co is 0.64 pF \n"
- ]
- }
- ],
- "prompt_number": 50
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.9 Page No 834"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "hFE=2000.0\n",
- "Vbe=1.4\n",
- "Vp=10.0\n",
- "Ip=200.0*10**-3\n",
- "Icq2=20.0*10**-3\n",
- "Re3=4.7\n",
- "Re2=4.7\n",
- "Vd=0.7\n",
- "Ve1=3.0\n",
- "Vc1=15.2\n",
- "\n",
- "#Calculations\n",
- "Vrc=Vc1\n",
- "Vb=Vbe+Icq*(Re2+Re3)+Vbe\n",
- "Vcc=Vrc+Vc1+Vb\n",
- "Ib2=Ip/hFE\n",
- "Irc=1.0*10**-3\n",
- "Vrcac=4.0\n",
- "Rc=Vrcac/Irc\n",
- "Ic1=Vrc/Rc\n",
- "Rb=(Vb-(4*Vd))/Ic1\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.2f kohm \" %Rb)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 49.47 kohm \n"
- ]
- }
- ],
- "prompt_number": 51
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.10 Page No 838"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vb=3.2\n",
- "Ic1=5*10**-3\n",
- "Vce=3.2\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Vbmin=Vb-0.5\n",
- "Vbmax=Vb+0.5\n",
- "I10=.1*Ic1\n",
- "R10=(Vce-Vbe)/I10\n",
- "R10=4.7*10**3#use standard value\n",
- "print(\" for Vce=3.7\")\n",
- "Vce=3.7\n",
- "I10max=(Vce-Vbe)/R10\n",
- "print(\"Vce=2.7V\")\n",
- "Vce=2.7\n",
- "I10min=(Vce-Vbe)/R10\n",
- "R=Vbe/I10min\n",
- "R11=Vbe/I10max\n",
- "R12=R-R11\n",
- "\n",
- "#Results\n",
- "print(\"The value of R12 is %.2f kohm \" %R12)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for Vce=3.7\n",
- "Vce=2.7V\n",
- "The value of R12 is 548.33 kohm \n"
- ]
- }
- ],
- "prompt_number": 52
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.11 Page No 843"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Rl=16.0\n",
- "Po=6.0\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Vp=math.sqrt(2.0*Rl*Po)\n",
- "Vr14=0.1*Vp\n",
- "Vr15=Vr14\n",
- "R14=0.1*Rl\n",
- "R15=R14\n",
- "Vce3=1.0\n",
- "Vce4=Vce3\n",
- "Vr9=3.0\n",
- "Vr11=Vr9\n",
- "Vcc=(Vp+Vr14+Vbe+Vce3+Vr9)\n",
- "Vee=-Vcc\n",
- "Ip=Vp/Rl\n",
- "print(\" DC power inpit from supply line\")\n",
- "Pi=(Vcc-Vee)*.35*Ip\n",
- "Pt=.5*(Pi-Po)\n",
- "Vce=2*Vcc\n",
- "Ic=1.1*Ip\n",
- "\n",
- "#Results\n",
- "print(\" output transistor specification %.2f mA\" %Ic)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " DC power inpit from supply line\n",
- " output transistor specification 0.95 mA\n"
- ]
- }
- ],
- "prompt_number": 53
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.12, Page No 844"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "hFE7=20.0\n",
- "Icbo=50.0*10**-6\n",
- "hFE5=70.0\n",
- "Vr9=3.0\n",
- "Ip=869.0*10**-3\n",
- "R15=1.5\n",
- "R8=15.0*10**3\n",
- "Vbe=0.7\n",
- "Vr11=3.0\n",
- "Vee=20.0\n",
- "\n",
- "#Calculations\n",
- "R12=0.01/Icbo\n",
- "R12=220#use standard value\n",
- "R13=R12\n",
- "Ib5=Ip/(hFE7*hFE5)\n",
- "Ic3=2.0*10**-3\n",
- "R9=Vr9/Ic3\n",
- "R11=R9\n",
- "Iq78=0.1*Ip\n",
- "Vr14=Iq78*R15\n",
- "Vr15=Vr14\n",
- "Vr10=(Vr14+Vr15)+(Vr14+Vr15)/2\n",
- "R10=Vr10/Ic3\n",
- "Ir8=(Vr11+Vbe)/R8\n",
- "R7=(Vee-(Vr11+Vbe))/Ir8\n",
- "\n",
- "#Results\n",
- "print(\"The value of R7 is %.2f kohm \" %(R7/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R7 is 66.08 kohm \n"
- ]
- }
- ],
- "prompt_number": 54
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.13, Page No 848"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Rl=20.0\n",
- "Po=2.5\n",
- "Rd=4.0\n",
- "Vr6=1.0\n",
- "Vr9=Vr6\n",
- "Vth=1.0\n",
- "gFS=250.0*10**-3\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Vp=math.sqrt(2*Rl*Po)\n",
- "Ip=Vp/Rl\n",
- "Vcc=(Vp+Ip*Rd)\n",
- "vr6=Ip/gFS\n",
- "Vr2=vr6+1\n",
- "Vce=Vr2\n",
- "Vce3=1.0\n",
- "Vr2=Vcc-Vce\n",
- "Vee=Vcc\n",
- "Vr3=Vee-Vbe\n",
- "Vr7=Vr2-Vr6\n",
- "Vr8=Vcc-(-Vee)-Vr6-Vr7-Vr9\n",
- "\n",
- "#Results\n",
- "print(\"The value of Vr8 is %.2f V \" %Vr8)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Vr8 is 14.00 V \n"
- ]
- }
- ],
- "prompt_number": 55
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.14, Page No 849"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R6=100.0*10**3\n",
- "R9=R6\n",
- "Vth=1.0\n",
- "Vr7=8.0\n",
- "Vr8=14.0\n",
- "Vr3=11.3\n",
- "Vpout=10.0\n",
- "Vpin=800.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "I6=Vth/R6\n",
- "R7=Vr7/I6\n",
- "R8=Vr8/I6\n",
- "Ic1=1*10**-4\n",
- "Ic2=Ic1\n",
- "Vr2=9\n",
- "R2=Vr2/Ic1\n",
- "R3=Vr3/(Ic1+Ic2)\n",
- "R5=4.7*10**3\n",
- "Acl=Vpout/Vpin\n",
- "R4=R5/(Acl-1.0)\n",
- "\n",
- "#Results\n",
- "print(\"The value of R4 is %.2f kohm \" %(R4/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R4 is 0.41 kohm \n"
- ]
- }
- ],
- "prompt_number": 56
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.15, Page No 854"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vce=1.5\n",
- "Vcc=17.0\n",
- "Vd1=0.7\n",
- "R8=1.5*10**3\n",
- "R9=R8\n",
- "Rl=100.0\n",
- "R6=8.2\n",
- "\n",
- "#Calculations\n",
- "I4=(Vcc-Vd1)/(R8+R9)\n",
- "Vc3=Vcc-(I4*R8)\n",
- "print(\" bootstrap capacitance terminal voltage is %3.1fV \" %Vc3)\n",
- "V=Vcc-Vce#V=Vp+Vr6\n",
- "Ip=V/(Rl+R6)\n",
- "Vp=Ip*Rl\n",
- "print(\" peak output voltage is %3.1fV \" %Vp)\n",
- "Po=(Vp)**2.0/(2.0*Rl)\n",
- "\n",
- "#Results\n",
- "print(\" peak output power is %dW \" %Po)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " bootstrap capacitance terminal voltage is 8.8V \n",
- " peak output voltage is 14.3V \n",
- " peak output power is 1W \n"
- ]
- }
- ],
- "prompt_number": 57
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.16, Page No 856"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Rl=8.0\n",
- "Po=6.0\n",
- "vs=0.1\n",
- "hFE=1000.0\n",
- "Vce=2.0\n",
- "f=50.0*10**3\n",
- "Vd1=0.7\n",
- "\n",
- "#Calculations\n",
- "Vp=math.sqrt(2*Rl*Po)\n",
- "Ip=Vp/Rl\n",
- "R6=.1*Rl\n",
- "R7=R6\n",
- "Vcc=Vp+Ip*R6+Vce\n",
- "Ib=Ip/hFE\n",
- "I4=2*10**-3\n",
- "R4=(Vcc-Vd1-Vd1)/I4\n",
- "R8=.5*R4\n",
- "Acl=Vp/vs\n",
- "R3=100*10**3\n",
- "R2=R3/(Acl-1)\n",
- "SR=(2*3.14*f*Vp)*10**-6\n",
- "\n",
- "#Results\n",
- "print(\" slew rate is %.2f V/us \" %SR)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " slew rate is 3.08 V/us \n"
- ]
- }
- ],
- "prompt_number": 58
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.17, Page No 856"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=50.0\n",
- "R1=100.0*10**3\n",
- "R2=1.0*10**3\n",
- "R8=2.7*10**3\n",
- "\n",
- "#Calculations\n",
- "R9=R8\n",
- "C1=1/(2*3.14*f*.1*R1)\n",
- "C2=1/(2*3.14*f*R2)\n",
- "Xc3=.1*((R8*R9)/(R8+R9))\n",
- "C3=1/(2*3.14*f*Xc3)\n",
- "C4=C3\n",
- "\n",
- "#Results\n",
- "print(\"The value of C4 is %.2f pF \" %(C4*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C4 is 23.59 pF \n"
- ]
- }
- ],
- "prompt_number": 59
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.18, Page No 860"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Ismin=1.8*10**-3\n",
- "Ismax=3.4*10**-3\n",
- "R7=820.0\n",
- "R5=390.0\n",
- "R6=18.0*10**3\n",
- "Vi=100.0*10**-3\n",
- "Rl=10.0\n",
- "\n",
- "#Calculations\n",
- "Vgsmin=Ismin*R7\n",
- "Vgsmax=Ismax*R7\n",
- "Acl=(R5+R6)/R5\n",
- "Vp=Acl*Vi\n",
- "Ip=Vp/Rl\n",
- "print(\"peak output current is %3.3fA \" %Ip)\n",
- "Po=(Vp*Ip)/2.0\n",
- "\n",
- "#Results\n",
- "print(\"peak output power is %3.2fW \" %Po)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "peak output current is 0.472A \n",
- "peak output power is 1.11W \n"
- ]
- }
- ],
- "prompt_number": 60
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.19, Page No 862"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vbe=0.7\n",
- "R2=560.0\n",
- "R3min=0\n",
- "R3max=1.0*10**3\n",
- "Is=2.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "Ic2max=Vbe/(R2+R3min)\n",
- "Ic2min=Vbe/(R2+R3max)\n",
- "Vgsmin=(Is+Ic2min)*820.0\n",
- "Vgsmax=(Is+Ic2max)*820.0\n",
- "\n",
- "#Results\n",
- "print(\"The value of Vgsmax is %.2f v \" %Vgsmax)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Vgsmax is 2.67 v \n"
- ]
- }
- ],
- "prompt_number": 61
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.20, Page No 865"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=12.0\n",
- "Rl=10.0\n",
- "Rd=0.5\n",
- "gfs=2.5\n",
- "R7=820.0\n",
- "V9=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "R10=R9\n",
- "Vp=(Vcc*Rl)/(Rd+Rl)\n",
- "Ip=Vp/Rl\n",
- "Vgs=Ip/gfs\n",
- "Vr7=Is*R7\n",
- "Vs=Vcc-Vr7-Vgs\n",
- "Vr9=(Vp*R9)/(R9+R10)\n",
- "\n",
- "#Results\n",
- "print(\"op-amp peak output voltage is %.2f v \" %Vr9)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "op-amp peak output voltage is 5.71 v \n"
- ]
- }
- ],
- "prompt_number": 62
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.21, Page No 867"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vbe=0.7\n",
- "R2=470.0\n",
- "R3=1.0*10**3\n",
- "Is=0.5*10**-3\n",
- "R7=1.5*10**3\n",
- "Vcc=15\n",
- "\n",
- "#Calculations\n",
- "Ic2max=Vbe/R2\n",
- "Ic2min=Vbe/(R2+R3)\n",
- "Vgs=(Is+Ic2max)*R7\n",
- "print(\" MOSFET maximum gate source voltage is %.1fV \" %Vgs)\n",
- "Vs=Vcc-Vgs\n",
- "\n",
- "#Results\n",
- "print(\" op-amp minimum suppy is %.2fV \" %Vs)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " MOSFET maximum gate source voltage is 3.0V \n",
- " op-amp minimum suppy is 12.02V \n"
- ]
- }
- ],
- "prompt_number": 63
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.22, Page No 868"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=15.0\n",
- "Rl=15.0\n",
- "Rd=0.3\n",
- "R5=2.2*10**3\n",
- "R6=33.0*10**3\n",
- "C2=3.9*10**-6\n",
- "C4=100.0*10**-12\n",
- "\n",
- "#Calculations\n",
- "print(\" power output\")\n",
- "Vp=(Vcc*Rl)/(Rd+Rl)\n",
- "Ip=Vp/Rl\n",
- "Po=(Vp*Ip)/2.0\n",
- "print(\" voltage gain\")\n",
- "Av=(R5+R6)/R5\n",
- "print(\"cutoff frequency\")\n",
- "f1=1.0/(2*3.14*C2*R5)\n",
- "f2=1.0/(2*3.14*C4*R6)\n",
- "\n",
- "#Results\n",
- "print(\" cutoff frequency f1 %.2f \" %f1)\n",
- "print(\" cutoff frequency f2 %.2f \" %f2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " power output\n",
- " voltage gain\n",
- "cutoff frequency\n",
- " cutoff frequency f1 18.56 \n",
- " cutoff frequency f2 48253.23 \n"
- ]
- }
- ],
- "prompt_number": 64
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.23, Page No 871"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=23.0\n",
- "Rl=8.0\n",
- "Rf2=100.0*10**3\n",
- "Rf1=5.6*10**3\n",
- "Cf=1.0*10**-6\n",
- "Vp=Vcc-5\n",
- "\n",
- "#Calculations\n",
- "Po=(Vp)**2/(2*Rl)\n",
- "print(\"maximum output power is %3.2fW \" %Po)\n",
- "Acl=(Rf1+Rf2)/Rf1\n",
- "print(\" voltage gain %3.1f \" %Acl)\n",
- "f=1/(2*3.14*Cf*Rf1)\n",
- "\n",
- "#Results\n",
- "print(\"lower cutoff frequency is %dHz \" %f)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "maximum output power is 20.25W \n",
- " voltage gain 18.9 \n",
- "lower cutoff frequency is 28Hz \n"
- ]
- }
- ],
- "prompt_number": 65
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.24, Page No 875"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rf=15.0*10**3\n",
- "R1=5.6*10**3\n",
- "vs=0.5\n",
- "Vp=2.7\n",
- "\n",
- "#Calculations\n",
- "Acl=(2.0*Rf)/R1\n",
- "Vo=Acl*vs\n",
- "Po=(Vp)**2.0/(2.0*Rl)\n",
- "\n",
- "#Results\n",
- "print(\"load power dissipation is %.2fW \" %Po)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "load power dissipation is 0.46W \n"
- ]
- }
- ],
- "prompt_number": 66
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.24, Page No 875"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=10.0\n",
- "Rl=1.0*10**3\n",
- "f=3.0*10**6\n",
- "Ip=25.0*10**-3\n",
- "Vce=0.3\n",
- "\n",
- "#Calculations\n",
- "Vp=Vcc-Vce\n",
- "Po=(Vp)**2 /(2*Rl)\n",
- "T=1.0/f\n",
- "t=(Po*T)/(Ip*Vp)\n",
- "angle=(t/T)*360\n",
- "print(\" conduction angle is %3.1fdegree \" %angle)\n",
- "Idc=Po/Vp\n",
- "Pi=Vcc*Idc\n",
- "print( \"dc input power is %3.4fW \" %Pi)\n",
- "n=(Po/Pi)*100#efficiency\n",
- "\n",
- "#Results\n",
- "print(\" maximum efficiency is %3.2f percentage \" %n)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " conduction angle is 69.8degree \n",
- "dc input power is 0.0485W \n",
- " maximum efficiency is 97.00 percentage \n"
- ]
- }
- ],
- "prompt_number": 67
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.26, Page No 882"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f=1.0*10**6\n",
- "Xc=120.0\n",
- "Vce=0.5\n",
- "Vcc=30.0\n",
- "Rl=1.2*10**3\n",
- "O=100.0\n",
- "\n",
- "#Calculations\n",
- "Cp=1.0/(2*3.14*f*Xc)\n",
- "Cp=1300*10**-12#use standard value\n",
- "Lp=1/(((2*3.14*f)**2)*Cp)\n",
- "Vp=Vcc-Vce\n",
- "Po=((Vp)**2) /(2*Rl)\n",
- "Idc=Po/Vp\n",
- "T=1.0/f\n",
- "t=(O*T)/360.0\n",
- "Ip=(Idc*T)/t\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ip is %.2f mA \" %(Ip*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Ip is 44.25 mA \n"
- ]
- }
- ],
- "prompt_number": 68
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.27, Page No 883"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rw=0.1\n",
- "f=1.0*10**6\n",
- "Lp=19.5*10**-6\n",
- "Rl=1.2*10**3\n",
- "Vcc=30.0\n",
- "\n",
- "#Calculations\n",
- "Idc=12.3*10**-3\n",
- "QL=(2*3.14*f*Lp)/Rw\n",
- "Qp=Rl/(2*3.14*f*Lp)\n",
- "B=f/Qp\n",
- "Il=(.707*Vp)/(2*3.14*f*Lp)\n",
- "Pl=(Il)**2 *Rw\n",
- "Pi=(Vcc*Idc)+Pl\n",
- "n=(Po/Pi)*100.0\n",
- "\n",
- "#Results\n",
- "print(\" maximum efficiency is %3.2f percentage \" %n)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " maximum efficiency is 97.50 percentage \n"
- ]
- }
- ],
- "prompt_number": 69
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter19_2.ipynb b/Electronic_Devices_and_Circuits/Chapter19_2.ipynb deleted file mode 100755 index f144d168..00000000 --- a/Electronic_Devices_and_Circuits/Chapter19_2.ipynb +++ /dev/null @@ -1,1316 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 19 : Power amplifiers"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.1, Page No 810"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "Rpy=40.0\n",
- "N1=74.0\n",
- "N2=14.0\n",
- "R2=3.7*10**3\n",
- "R1=4.7*10**3\n",
- "Vbe=0.7\n",
- "Re=1.0*10**3\n",
- "Vcc=13.0\n",
- "Rl=56.0\n",
- "\n",
- "#Calculations\n",
- "print(\"Q-point\")\n",
- "Vb=Vcc*(R2/(R1+R2))\n",
- "Ic=(Vb-Vbe)/Re\n",
- "Ie=Ic\n",
- "Vce=Vcc-Ic*(Rpy+Re)\n",
- "rl=(N1/N2)**2 *Rl\n",
- "rl=rl+Rpy\n",
- "Ic=5*10**-3\n",
- "Vce=Ic*rl\n",
- "\n",
- "#Results\n",
- "print(\"The value of Vce is %.2f v \" %Vce)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Q-point\n",
- "The value of Vce is 8.02 v \n"
- ]
- }
- ],
- "prompt_number": 44
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.2, Page No 814"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=13.0\n",
- "Icq=5.0*10**-3\n",
- "Vceq=8.0\n",
- "Vp=Vceq\n",
- "Ip=Icq\n",
- "nt=0.8\n",
- "\n",
- "#Calculations\n",
- "Pi=Vcc*Icq\n",
- "Po=.5*Vp*Ip\n",
- "P0=nt*Po\n",
- "n=(P0/Pi)*100.0\n",
- "\n",
- "#Results\n",
- "print(\" maximum efficiency is %3.2f percentage \" %n)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " maximum efficiency is 24.62 percentage \n"
- ]
- }
- ],
- "prompt_number": 45
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.4 Page No 821"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "N1=60.0\n",
- "N2=10.0\n",
- "Rl=16.0\n",
- "Rpy=0\n",
- "R6=56.0\n",
- "Vcc=27.0\n",
- "Vce=0.5\n",
- "n=0.79\n",
- "\n",
- "#Calculations\n",
- "print(\" Referred laod\")\n",
- "rl=(N1/N2)**2 *Rl\n",
- "print(\" tatol ac load line in series with each of Q2 and Q3\")\n",
- "Rl=rl+R6+Rpy\n",
- "print(\" peak primary current\")\n",
- "Ip=(Vcc-Vce)/Rl\n",
- "print(\"peak primary voltage\")\n",
- "Vp=Vcc-Vce-(Ip*R6)\n",
- "print(\"power delivered to primary\")\n",
- "Po=.5*Vp*Ip\n",
- "\n",
- "#Calculations\n",
- "Po=Po*n#n is power efficiency\n",
- "print(\"power delivered to the load %.2f W \" %Po)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Referred laod\n",
- " tatol ac load line in series with each of Q2 and Q3\n",
- " peak primary current\n",
- "peak primary voltage\n",
- "power delivered to primary\n",
- "power delivered to the load 0.40 W \n"
- ]
- }
- ],
- "prompt_number": 46
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.5, Page No 824"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Po=4.0\n",
- "nt=0.8\n",
- "Vcc=30.0\n",
- "Vp=Vcc\n",
- "Rl=16.0\n",
- "\n",
- "#Calculations\n",
- "P0=Po/nt\n",
- "rl=(Vp)**2 /(2*P0)\n",
- "rl=4*rl\n",
- "print(\"transformer specification Po=4 %Rl=16 rl=360\")\n",
- "Vce=2.0*Vcc\n",
- "Ip=(2.0*P0)/Vp\n",
- "Pi=Vcc*.636*Ip\n",
- "Pt=0.5*(Pi-P0)\n",
- "\n",
- "#Results\n",
- "print(\" transistor specification is Py=.68W Vce=60 Ip=333mA\")\n",
- "print(\"power delivered to the load Pi = %.2f W \" %Pi)\n",
- "print(\"power delivered to the load Pt = %.2f W \" %Pt)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "transformer specification Po=4 %Rl=16 rl=360\n",
- " transistor specification is Py=.68W Vce=60 Ip=333mA\n",
- "power delivered to the load Pi = 6.36 W \n",
- "power delivered to the load Pt = 0.68 W \n"
- ]
- }
- ],
- "prompt_number": 47
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.6 Page No 830"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rl=50.0\n",
- "Po=1.0\n",
- "hFE=50.0\n",
- "Vbe=0.7\n",
- "Vrc=4.0\n",
- "Vre=1.0\n",
- "Vd1=0.7\n",
- "\n",
- "#Calculations\n",
- "Vd2=Vd1\n",
- "Vp=math.sqrt(2*Rl*Po)\n",
- "Ip=Vp/Rl\n",
- "Re3=.1*Rl\n",
- "Re2=4.7#use stabdard value\n",
- "Re2=Re3\n",
- "Icq=.1*Ip\n",
- "Vb=Vbe+Icq*(Re2+Re3)+Vbe\n",
- "Vc1=Vrc\n",
- "Ib2=Ip/hFE\n",
- "Irc=Ib2+1*10**-3\n",
- "Rc=Vrc/Irc\n",
- "Rc=680.0 #use standard value\n",
- "Vcc=2.0*(Vp+Vre+Vbe+Vrc)\n",
- "Vcc=32#use standard value\n",
- "Vrcdc=.5*(Vcc-Vb)\n",
- "Ic1=Vrcdc/Rc\n",
- "Rb=(Vb-Vd1-Vd2)/Ic1\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.2f kOhm \" %Rb)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 8.95 kOhm \n"
- ]
- }
- ],
- "prompt_number": 48
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.7 Page No 832"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=32.0\n",
- "Vce=32.0\n",
- "Ip=200.0*10**-3\n",
- "Po=1.0\n",
- "\n",
- "#Calculations\n",
- "Ic=1.1*Ip\n",
- "Pi=0.35*Vcc*Ip\n",
- "Pt=0.5*(Pi-Po)\n",
- "\n",
- "#Results\n",
- "print(\"power delivered to the load Pi = %.2f \" %Pi)\n",
- "print(\"power delivered to the load Pt = %.2f \" %Pt)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "power delivered to the load Pi = 2.24 \n",
- "power delivered to the load Pt = 0.62 \n"
- ]
- }
- ],
- "prompt_number": 49
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.8, Page No 832"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f=50.0\n",
- "hib=2.0\n",
- "Rl=50.0\n",
- "\n",
- "#Calculations\n",
- "Ce=1.0/(2*3.14*f*hib)\n",
- "Co=1.0/(2*3.14*50*.1*Rl)\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ce is %.2f pF \" %(Ce*10**3))\n",
- "print(\"The value of Co is %.2f pF \" %(Co*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Ce is 1.59 pF \n",
- "The value of Co is 0.64 pF \n"
- ]
- }
- ],
- "prompt_number": 50
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.9 Page No 834"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "hFE=2000.0\n",
- "Vbe=1.4\n",
- "Vp=10.0\n",
- "Ip=200.0*10**-3\n",
- "Icq2=20.0*10**-3\n",
- "Re3=4.7\n",
- "Re2=4.7\n",
- "Vd=0.7\n",
- "Ve1=3.0\n",
- "Vc1=15.2\n",
- "\n",
- "#Calculations\n",
- "Vrc=Vc1\n",
- "Vb=Vbe+Icq*(Re2+Re3)+Vbe\n",
- "Vcc=Vrc+Vc1+Vb\n",
- "Ib2=Ip/hFE\n",
- "Irc=1.0*10**-3\n",
- "Vrcac=4.0\n",
- "Rc=Vrcac/Irc\n",
- "Ic1=Vrc/Rc\n",
- "Rb=(Vb-(4*Vd))/Ic1\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.2f kohm \" %Rb)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 49.47 kohm \n"
- ]
- }
- ],
- "prompt_number": 51
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.10 Page No 838"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vb=3.2\n",
- "Ic1=5*10**-3\n",
- "Vce=3.2\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Vbmin=Vb-0.5\n",
- "Vbmax=Vb+0.5\n",
- "I10=.1*Ic1\n",
- "R10=(Vce-Vbe)/I10\n",
- "R10=4.7*10**3#use standard value\n",
- "print(\" for Vce=3.7\")\n",
- "Vce=3.7\n",
- "I10max=(Vce-Vbe)/R10\n",
- "print(\"Vce=2.7V\")\n",
- "Vce=2.7\n",
- "I10min=(Vce-Vbe)/R10\n",
- "R=Vbe/I10min\n",
- "R11=Vbe/I10max\n",
- "R12=R-R11\n",
- "\n",
- "#Results\n",
- "print(\"The value of R12 is %.2f kohm \" %R12)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for Vce=3.7\n",
- "Vce=2.7V\n",
- "The value of R12 is 548.33 kohm \n"
- ]
- }
- ],
- "prompt_number": 52
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.11 Page No 843"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Rl=16.0\n",
- "Po=6.0\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Vp=math.sqrt(2.0*Rl*Po)\n",
- "Vr14=0.1*Vp\n",
- "Vr15=Vr14\n",
- "R14=0.1*Rl\n",
- "R15=R14\n",
- "Vce3=1.0\n",
- "Vce4=Vce3\n",
- "Vr9=3.0\n",
- "Vr11=Vr9\n",
- "Vcc=(Vp+Vr14+Vbe+Vce3+Vr9)\n",
- "Vee=-Vcc\n",
- "Ip=Vp/Rl\n",
- "print(\" DC power inpit from supply line\")\n",
- "Pi=(Vcc-Vee)*.35*Ip\n",
- "Pt=.5*(Pi-Po)\n",
- "Vce=2*Vcc\n",
- "Ic=1.1*Ip\n",
- "\n",
- "#Results\n",
- "print(\" output transistor specification %.2f mA\" %Ic)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " DC power inpit from supply line\n",
- " output transistor specification 0.95 mA\n"
- ]
- }
- ],
- "prompt_number": 53
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.12, Page No 844"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "hFE7=20.0\n",
- "Icbo=50.0*10**-6\n",
- "hFE5=70.0\n",
- "Vr9=3.0\n",
- "Ip=869.0*10**-3\n",
- "R15=1.5\n",
- "R8=15.0*10**3\n",
- "Vbe=0.7\n",
- "Vr11=3.0\n",
- "Vee=20.0\n",
- "\n",
- "#Calculations\n",
- "R12=0.01/Icbo\n",
- "R12=220#use standard value\n",
- "R13=R12\n",
- "Ib5=Ip/(hFE7*hFE5)\n",
- "Ic3=2.0*10**-3\n",
- "R9=Vr9/Ic3\n",
- "R11=R9\n",
- "Iq78=0.1*Ip\n",
- "Vr14=Iq78*R15\n",
- "Vr15=Vr14\n",
- "Vr10=(Vr14+Vr15)+(Vr14+Vr15)/2\n",
- "R10=Vr10/Ic3\n",
- "Ir8=(Vr11+Vbe)/R8\n",
- "R7=(Vee-(Vr11+Vbe))/Ir8\n",
- "\n",
- "#Results\n",
- "print(\"The value of R7 is %.2f kohm \" %(R7/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R7 is 66.08 kohm \n"
- ]
- }
- ],
- "prompt_number": 54
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.13, Page No 848"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Rl=20.0\n",
- "Po=2.5\n",
- "Rd=4.0\n",
- "Vr6=1.0\n",
- "Vr9=Vr6\n",
- "Vth=1.0\n",
- "gFS=250.0*10**-3\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Vp=math.sqrt(2*Rl*Po)\n",
- "Ip=Vp/Rl\n",
- "Vcc=(Vp+Ip*Rd)\n",
- "vr6=Ip/gFS\n",
- "Vr2=vr6+1\n",
- "Vce=Vr2\n",
- "Vce3=1.0\n",
- "Vr2=Vcc-Vce\n",
- "Vee=Vcc\n",
- "Vr3=Vee-Vbe\n",
- "Vr7=Vr2-Vr6\n",
- "Vr8=Vcc-(-Vee)-Vr6-Vr7-Vr9\n",
- "\n",
- "#Results\n",
- "print(\"The value of Vr8 is %.2f V \" %Vr8)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Vr8 is 14.00 V \n"
- ]
- }
- ],
- "prompt_number": 55
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.14, Page No 849"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "R6=100.0*10**3\n",
- "R9=R6\n",
- "Vth=1.0\n",
- "Vr7=8.0\n",
- "Vr8=14.0\n",
- "Vr3=11.3\n",
- "Vpout=10.0\n",
- "Vpin=800.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "I6=Vth/R6\n",
- "R7=Vr7/I6\n",
- "R8=Vr8/I6\n",
- "Ic1=1*10**-4\n",
- "Ic2=Ic1\n",
- "Vr2=9\n",
- "R2=Vr2/Ic1\n",
- "R3=Vr3/(Ic1+Ic2)\n",
- "R5=4.7*10**3\n",
- "Acl=Vpout/Vpin\n",
- "R4=R5/(Acl-1.0)\n",
- "\n",
- "#Results\n",
- "print(\"The value of R4 is %.2f kohm \" %(R4/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of R4 is 0.41 kohm \n"
- ]
- }
- ],
- "prompt_number": 56
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.15, Page No 854"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vce=1.5\n",
- "Vcc=17.0\n",
- "Vd1=0.7\n",
- "R8=1.5*10**3\n",
- "R9=R8\n",
- "Rl=100.0\n",
- "R6=8.2\n",
- "\n",
- "#Calculations\n",
- "I4=(Vcc-Vd1)/(R8+R9)\n",
- "Vc3=Vcc-(I4*R8)\n",
- "print(\" bootstrap capacitance terminal voltage is %3.1fV \" %Vc3)\n",
- "V=Vcc-Vce#V=Vp+Vr6\n",
- "Ip=V/(Rl+R6)\n",
- "Vp=Ip*Rl\n",
- "print(\" peak output voltage is %3.1fV \" %Vp)\n",
- "Po=(Vp)**2.0/(2.0*Rl)\n",
- "\n",
- "#Results\n",
- "print(\" peak output power is %dW \" %Po)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " bootstrap capacitance terminal voltage is 8.8V \n",
- " peak output voltage is 14.3V \n",
- " peak output power is 1W \n"
- ]
- }
- ],
- "prompt_number": 57
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.16, Page No 856"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Rl=8.0\n",
- "Po=6.0\n",
- "vs=0.1\n",
- "hFE=1000.0\n",
- "Vce=2.0\n",
- "f=50.0*10**3\n",
- "Vd1=0.7\n",
- "\n",
- "#Calculations\n",
- "Vp=math.sqrt(2*Rl*Po)\n",
- "Ip=Vp/Rl\n",
- "R6=.1*Rl\n",
- "R7=R6\n",
- "Vcc=Vp+Ip*R6+Vce\n",
- "Ib=Ip/hFE\n",
- "I4=2*10**-3\n",
- "R4=(Vcc-Vd1-Vd1)/I4\n",
- "R8=.5*R4\n",
- "Acl=Vp/vs\n",
- "R3=100*10**3\n",
- "R2=R3/(Acl-1)\n",
- "SR=(2*3.14*f*Vp)*10**-6\n",
- "\n",
- "#Results\n",
- "print(\" slew rate is %.2f V/us \" %SR)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " slew rate is 3.08 V/us \n"
- ]
- }
- ],
- "prompt_number": 58
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.17, Page No 856"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "f=50.0\n",
- "R1=100.0*10**3\n",
- "R2=1.0*10**3\n",
- "R8=2.7*10**3\n",
- "\n",
- "#Calculations\n",
- "R9=R8\n",
- "C1=1/(2*3.14*f*.1*R1)\n",
- "C2=1/(2*3.14*f*R2)\n",
- "Xc3=.1*((R8*R9)/(R8+R9))\n",
- "C3=1/(2*3.14*f*Xc3)\n",
- "C4=C3\n",
- "\n",
- "#Results\n",
- "print(\"The value of C4 is %.2f pF \" %(C4*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of C4 is 23.59 pF \n"
- ]
- }
- ],
- "prompt_number": 59
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.18, Page No 860"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Ismin=1.8*10**-3\n",
- "Ismax=3.4*10**-3\n",
- "R7=820.0\n",
- "R5=390.0\n",
- "R6=18.0*10**3\n",
- "Vi=100.0*10**-3\n",
- "Rl=10.0\n",
- "\n",
- "#Calculations\n",
- "Vgsmin=Ismin*R7\n",
- "Vgsmax=Ismax*R7\n",
- "Acl=(R5+R6)/R5\n",
- "Vp=Acl*Vi\n",
- "Ip=Vp/Rl\n",
- "print(\"peak output current is %3.3fA \" %Ip)\n",
- "Po=(Vp*Ip)/2.0\n",
- "\n",
- "#Results\n",
- "print(\"peak output power is %3.2fW \" %Po)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "peak output current is 0.472A \n",
- "peak output power is 1.11W \n"
- ]
- }
- ],
- "prompt_number": 60
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.19, Page No 862"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vbe=0.7\n",
- "R2=560.0\n",
- "R3min=0\n",
- "R3max=1.0*10**3\n",
- "Is=2.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "Ic2max=Vbe/(R2+R3min)\n",
- "Ic2min=Vbe/(R2+R3max)\n",
- "Vgsmin=(Is+Ic2min)*820.0\n",
- "Vgsmax=(Is+Ic2max)*820.0\n",
- "\n",
- "#Results\n",
- "print(\"The value of Vgsmax is %.2f v \" %Vgsmax)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Vgsmax is 2.67 v \n"
- ]
- }
- ],
- "prompt_number": 61
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.20, Page No 865"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=12.0\n",
- "Rl=10.0\n",
- "Rd=0.5\n",
- "gfs=2.5\n",
- "R7=820.0\n",
- "V9=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "R10=R9\n",
- "Vp=(Vcc*Rl)/(Rd+Rl)\n",
- "Ip=Vp/Rl\n",
- "Vgs=Ip/gfs\n",
- "Vr7=Is*R7\n",
- "Vs=Vcc-Vr7-Vgs\n",
- "Vr9=(Vp*R9)/(R9+R10)\n",
- "\n",
- "#Results\n",
- "print(\"op-amp peak output voltage is %.2f v \" %Vr9)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "op-amp peak output voltage is 5.71 v \n"
- ]
- }
- ],
- "prompt_number": 62
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.21, Page No 867"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vbe=0.7\n",
- "R2=470.0\n",
- "R3=1.0*10**3\n",
- "Is=0.5*10**-3\n",
- "R7=1.5*10**3\n",
- "Vcc=15\n",
- "\n",
- "#Calculations\n",
- "Ic2max=Vbe/R2\n",
- "Ic2min=Vbe/(R2+R3)\n",
- "Vgs=(Is+Ic2max)*R7\n",
- "print(\" MOSFET maximum gate source voltage is %.1fV \" %Vgs)\n",
- "Vs=Vcc-Vgs\n",
- "\n",
- "#Results\n",
- "print(\" op-amp minimum suppy is %.2fV \" %Vs)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " MOSFET maximum gate source voltage is 3.0V \n",
- " op-amp minimum suppy is 12.02V \n"
- ]
- }
- ],
- "prompt_number": 63
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.22, Page No 868"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=15.0\n",
- "Rl=15.0\n",
- "Rd=0.3\n",
- "R5=2.2*10**3\n",
- "R6=33.0*10**3\n",
- "C2=3.9*10**-6\n",
- "C4=100.0*10**-12\n",
- "\n",
- "#Calculations\n",
- "print(\" power output\")\n",
- "Vp=(Vcc*Rl)/(Rd+Rl)\n",
- "Ip=Vp/Rl\n",
- "Po=(Vp*Ip)/2.0\n",
- "print(\" voltage gain\")\n",
- "Av=(R5+R6)/R5\n",
- "print(\"cutoff frequency\")\n",
- "f1=1.0/(2*3.14*C2*R5)\n",
- "f2=1.0/(2*3.14*C4*R6)\n",
- "\n",
- "#Results\n",
- "print(\" cutoff frequency f1 %.2f \" %f1)\n",
- "print(\" cutoff frequency f2 %.2f \" %f2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " power output\n",
- " voltage gain\n",
- "cutoff frequency\n",
- " cutoff frequency f1 18.56 \n",
- " cutoff frequency f2 48253.23 \n"
- ]
- }
- ],
- "prompt_number": 64
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.23, Page No 871"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=23.0\n",
- "Rl=8.0\n",
- "Rf2=100.0*10**3\n",
- "Rf1=5.6*10**3\n",
- "Cf=1.0*10**-6\n",
- "Vp=Vcc-5\n",
- "\n",
- "#Calculations\n",
- "Po=(Vp)**2/(2*Rl)\n",
- "print(\"maximum output power is %3.2fW \" %Po)\n",
- "Acl=(Rf1+Rf2)/Rf1\n",
- "print(\" voltage gain %3.1f \" %Acl)\n",
- "f=1/(2*3.14*Cf*Rf1)\n",
- "\n",
- "#Results\n",
- "print(\"lower cutoff frequency is %dHz \" %f)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "maximum output power is 20.25W \n",
- " voltage gain 18.9 \n",
- "lower cutoff frequency is 28Hz \n"
- ]
- }
- ],
- "prompt_number": 65
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.24, Page No 875"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rf=15.0*10**3\n",
- "R1=5.6*10**3\n",
- "vs=0.5\n",
- "Vp=2.7\n",
- "\n",
- "#Calculations\n",
- "Acl=(2.0*Rf)/R1\n",
- "Vo=Acl*vs\n",
- "Po=(Vp)**2.0/(2.0*Rl)\n",
- "\n",
- "#Results\n",
- "print(\"load power dissipation is %.2fW \" %Po)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "load power dissipation is 0.46W \n"
- ]
- }
- ],
- "prompt_number": 66
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.24, Page No 875"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=10.0\n",
- "Rl=1.0*10**3\n",
- "f=3.0*10**6\n",
- "Ip=25.0*10**-3\n",
- "Vce=0.3\n",
- "\n",
- "#Calculations\n",
- "Vp=Vcc-Vce\n",
- "Po=(Vp)**2 /(2*Rl)\n",
- "T=1.0/f\n",
- "t=(Po*T)/(Ip*Vp)\n",
- "angle=(t/T)*360\n",
- "print(\" conduction angle is %3.1fdegree \" %angle)\n",
- "Idc=Po/Vp\n",
- "Pi=Vcc*Idc\n",
- "print( \"dc input power is %3.4fW \" %Pi)\n",
- "n=(Po/Pi)*100#efficiency\n",
- "\n",
- "#Results\n",
- "print(\" maximum efficiency is %3.2f percentage \" %n)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " conduction angle is 69.8degree \n",
- "dc input power is 0.0485W \n",
- " maximum efficiency is 97.00 percentage \n"
- ]
- }
- ],
- "prompt_number": 67
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.26, Page No 882"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f=1.0*10**6\n",
- "Xc=120.0\n",
- "Vce=0.5\n",
- "Vcc=30.0\n",
- "Rl=1.2*10**3\n",
- "O=100.0\n",
- "\n",
- "#Calculations\n",
- "Cp=1.0/(2*3.14*f*Xc)\n",
- "Cp=1300*10**-12#use standard value\n",
- "Lp=1/(((2*3.14*f)**2)*Cp)\n",
- "Vp=Vcc-Vce\n",
- "Po=((Vp)**2) /(2*Rl)\n",
- "Idc=Po/Vp\n",
- "T=1.0/f\n",
- "t=(O*T)/360.0\n",
- "Ip=(Idc*T)/t\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ip is %.2f mA \" %(Ip*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Ip is 44.25 mA \n"
- ]
- }
- ],
- "prompt_number": 68
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 19.27, Page No 883"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rw=0.1\n",
- "f=1.0*10**6\n",
- "Lp=19.5*10**-6\n",
- "Rl=1.2*10**3\n",
- "Vcc=30.0\n",
- "\n",
- "#Calculations\n",
- "Idc=12.3*10**-3\n",
- "QL=(2*3.14*f*Lp)/Rw\n",
- "Qp=Rl/(2*3.14*f*Lp)\n",
- "B=f/Qp\n",
- "Il=(.707*Vp)/(2*3.14*f*Lp)\n",
- "Pl=(Il)**2 *Rw\n",
- "Pi=(Vcc*Idc)+Pl\n",
- "n=(Po/Pi)*100.0\n",
- "\n",
- "#Results\n",
- "print(\" maximum efficiency is %3.2f percentage \" %n)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " maximum efficiency is 97.50 percentage \n"
- ]
- }
- ],
- "prompt_number": 69
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter1_1.ipynb b/Electronic_Devices_and_Circuits/Chapter1_1.ipynb deleted file mode 100755 index 47b8b5fc..00000000 --- a/Electronic_Devices_and_Circuits/Chapter1_1.ipynb +++ /dev/null @@ -1,307 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 01 : Basic semiconductor and pn junction theory"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.1, Page No 15"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Nd=3*10**14\n",
- "Na=0.5*10**14 #all in atom/cm**3\n",
- "ni=1.5*10**10\n",
- "\n",
- "#Calculations\n",
- "print(\"resultant densities of free electrons and hole\")\n",
- "ne=(-(Na-Nd)+(math.sqrt(((Na-Nd)**2)+4*ni**2)))/2\n",
- "print(\"Electron densities = %.1f x 10^14 electron/cm**3\" %(ne/(10**14))) #electron densities in electron/cm**3\n",
- "Nd>Na\n",
- "n=Nd-Na\n",
- "print(n)\n",
- "p=(ni**2)/n\n",
- "\n",
- "#Results\n",
- "\n",
- "print(\"densities of hole is =%.1f X 10^6 dhole/cm3\" %(p/(10**6)))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "resultant densities of free electrons and hole\n",
- "Electron densities = 2.5 x 10^14 electron/cm**3\n",
- "2.5e+14\n",
- "densities of hole is =0.9 X 10^6 dhole/cm3\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.2, Page No 18"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "l=1*10**-3\n",
- "E=10\n",
- "\n",
- "#Calculations\n",
- "un=1500*10**-4\n",
- "up=500*10-4\n",
- "Vn=-(un*E)/l\n",
- "\n",
- "#Results\n",
- "print(\"drift current is =%.2dm/s\\n\" %Vn)\n",
- "print(\"drift current of hole\")\n",
- "Vp=(up*E)/l\n",
- "print(\"drift current is =%.f dm/s\\n\" %(Vp/10**5))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "drift current is =-1500m/s\n",
- "\n",
- "drift current of hole\n",
- "drift current is =500 dm/s\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.3 Page No 19"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "l=1*10**-3\n",
- "a=0.1*10**-4\n",
- "ni=1.5*10**10\n",
- "p=1.5*10**10\n",
- "un=1500\n",
- "up=500 #in cm3/V.s\n",
- "q=1.6*10**-19\n",
- "\n",
- "#Calculations\n",
- "m=q*((ni*un)+(p*up))*10**6\n",
- "print( \"mobility is =%.1fmicro/ohmcm\" %m)\n",
- "R=l/(m*a)\n",
- "print(\" resistance is =%.1fMohm\" %R)\n",
- "\n",
- "#for doped material\n",
- "n=8*10**13\n",
- "p=(ni**2)/n\n",
- "m=q*((n*un)+(p*up))\n",
- "\n",
- "#Results\n",
- "print(\"mobility is =%3.4f/ohmcm\" %m)\n",
- "R=l/(m*a)\n",
- "print(\" resistance is %.2f Kohm\" %(R/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "mobility is =4.8micro/ohmcm\n",
- " resistance is =20.8Mohm\n",
- "mobility is =0.0192/ohmcm\n",
- " resistance is 5.21 Kohm\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.4, Page No 25"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "T1=25.0\n",
- "T2=35.0\n",
- "T3=45.0\n",
- "I0=30.0 # nA\n",
- "print(\"I0(35)=I0*2**(T2-T1)/10\")\n",
- "#on solving\n",
- "I035=I0*2**((T2-T1)/10)\n",
- "print(\"Current at 35c is =%.2f nA\\n\" %I035)\n",
- "print(\"I0(45)=I0*2**(T3-T1)/10\")\n",
- "#on solving\n",
- "I045=30*2**2\n",
- "print(\"current at 45c is =%.2f nA\\n\" %I045)\n",
- "I_CS=100.0 \n",
- "V_CC=200.0 \n",
- "t_on=40*10**-6"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "I0(35)=I0*2**(T2-T1)/10\n",
- "Current at 35c is =60.00 nA\n",
- "\n",
- "I0(45)=I0*2**(T3-T1)/10\n",
- "current at 45c is =120.00 nA\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.5, Page No 28"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "I0=30\n",
- "Vd=0.7\n",
- "n=2\n",
- "\n",
- "#Calculations\n",
- "Vt=26.0*10**-3\n",
- "k=Vd/(n*Vt)\n",
- "Id=I0*((2.7**k)-1)*10**-6 #Junction current\n",
- "print(\" a) Forward bais current is =%.2f mA\\n\" %Id)\n",
- "Vd=-10 #reverse bais\n",
- "k=Vd/(n*Vt)\n",
- "Id=I0*((2.7**k)-1)\n",
- "\n",
- "#Results\n",
- "print(\" b) Forward bais current is =%.2f nA\" %Id)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " a) Forward bais current is =19.23 mA\n",
- "\n",
- " b) Forward bais current is =-30.00 nA\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.6, Page No 29"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Id=.1*10**-3\n",
- "n=2\n",
- "vt=26*10**-3\n",
- "I0=30*10**-9\n",
- "\n",
- "#Calculations\n",
- "Vd=(n*Vt)*math.log(Id/I0)*10**3\n",
- "print(\" a) Forward bais current is =%.2f mV\\n\" %Vd)\n",
- "Id=10*10**-3\n",
- "Vd=(n*Vt)*math.log(Id/I0)*10**3\n",
- "\n",
- "#Results\n",
- "print(\"b) forward bais current is %dmV\\n\" %Vd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " a) Forward bais current is =421.81 mV\n",
- "\n",
- "b) forward bais current is 661mV\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 6
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter1_2.ipynb b/Electronic_Devices_and_Circuits/Chapter1_2.ipynb deleted file mode 100755 index 47b8b5fc..00000000 --- a/Electronic_Devices_and_Circuits/Chapter1_2.ipynb +++ /dev/null @@ -1,307 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 01 : Basic semiconductor and pn junction theory"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.1, Page No 15"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Nd=3*10**14\n",
- "Na=0.5*10**14 #all in atom/cm**3\n",
- "ni=1.5*10**10\n",
- "\n",
- "#Calculations\n",
- "print(\"resultant densities of free electrons and hole\")\n",
- "ne=(-(Na-Nd)+(math.sqrt(((Na-Nd)**2)+4*ni**2)))/2\n",
- "print(\"Electron densities = %.1f x 10^14 electron/cm**3\" %(ne/(10**14))) #electron densities in electron/cm**3\n",
- "Nd>Na\n",
- "n=Nd-Na\n",
- "print(n)\n",
- "p=(ni**2)/n\n",
- "\n",
- "#Results\n",
- "\n",
- "print(\"densities of hole is =%.1f X 10^6 dhole/cm3\" %(p/(10**6)))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "resultant densities of free electrons and hole\n",
- "Electron densities = 2.5 x 10^14 electron/cm**3\n",
- "2.5e+14\n",
- "densities of hole is =0.9 X 10^6 dhole/cm3\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.2, Page No 18"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "l=1*10**-3\n",
- "E=10\n",
- "\n",
- "#Calculations\n",
- "un=1500*10**-4\n",
- "up=500*10-4\n",
- "Vn=-(un*E)/l\n",
- "\n",
- "#Results\n",
- "print(\"drift current is =%.2dm/s\\n\" %Vn)\n",
- "print(\"drift current of hole\")\n",
- "Vp=(up*E)/l\n",
- "print(\"drift current is =%.f dm/s\\n\" %(Vp/10**5))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "drift current is =-1500m/s\n",
- "\n",
- "drift current of hole\n",
- "drift current is =500 dm/s\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.3 Page No 19"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "l=1*10**-3\n",
- "a=0.1*10**-4\n",
- "ni=1.5*10**10\n",
- "p=1.5*10**10\n",
- "un=1500\n",
- "up=500 #in cm3/V.s\n",
- "q=1.6*10**-19\n",
- "\n",
- "#Calculations\n",
- "m=q*((ni*un)+(p*up))*10**6\n",
- "print( \"mobility is =%.1fmicro/ohmcm\" %m)\n",
- "R=l/(m*a)\n",
- "print(\" resistance is =%.1fMohm\" %R)\n",
- "\n",
- "#for doped material\n",
- "n=8*10**13\n",
- "p=(ni**2)/n\n",
- "m=q*((n*un)+(p*up))\n",
- "\n",
- "#Results\n",
- "print(\"mobility is =%3.4f/ohmcm\" %m)\n",
- "R=l/(m*a)\n",
- "print(\" resistance is %.2f Kohm\" %(R/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "mobility is =4.8micro/ohmcm\n",
- " resistance is =20.8Mohm\n",
- "mobility is =0.0192/ohmcm\n",
- " resistance is 5.21 Kohm\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.4, Page No 25"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "T1=25.0\n",
- "T2=35.0\n",
- "T3=45.0\n",
- "I0=30.0 # nA\n",
- "print(\"I0(35)=I0*2**(T2-T1)/10\")\n",
- "#on solving\n",
- "I035=I0*2**((T2-T1)/10)\n",
- "print(\"Current at 35c is =%.2f nA\\n\" %I035)\n",
- "print(\"I0(45)=I0*2**(T3-T1)/10\")\n",
- "#on solving\n",
- "I045=30*2**2\n",
- "print(\"current at 45c is =%.2f nA\\n\" %I045)\n",
- "I_CS=100.0 \n",
- "V_CC=200.0 \n",
- "t_on=40*10**-6"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "I0(35)=I0*2**(T2-T1)/10\n",
- "Current at 35c is =60.00 nA\n",
- "\n",
- "I0(45)=I0*2**(T3-T1)/10\n",
- "current at 45c is =120.00 nA\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.5, Page No 28"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "I0=30\n",
- "Vd=0.7\n",
- "n=2\n",
- "\n",
- "#Calculations\n",
- "Vt=26.0*10**-3\n",
- "k=Vd/(n*Vt)\n",
- "Id=I0*((2.7**k)-1)*10**-6 #Junction current\n",
- "print(\" a) Forward bais current is =%.2f mA\\n\" %Id)\n",
- "Vd=-10 #reverse bais\n",
- "k=Vd/(n*Vt)\n",
- "Id=I0*((2.7**k)-1)\n",
- "\n",
- "#Results\n",
- "print(\" b) Forward bais current is =%.2f nA\" %Id)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " a) Forward bais current is =19.23 mA\n",
- "\n",
- " b) Forward bais current is =-30.00 nA\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1.6, Page No 29"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Id=.1*10**-3\n",
- "n=2\n",
- "vt=26*10**-3\n",
- "I0=30*10**-9\n",
- "\n",
- "#Calculations\n",
- "Vd=(n*Vt)*math.log(Id/I0)*10**3\n",
- "print(\" a) Forward bais current is =%.2f mV\\n\" %Vd)\n",
- "Id=10*10**-3\n",
- "Vd=(n*Vt)*math.log(Id/I0)*10**3\n",
- "\n",
- "#Results\n",
- "print(\"b) forward bais current is %dmV\\n\" %Vd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " a) Forward bais current is =421.81 mV\n",
- "\n",
- "b) forward bais current is 661mV\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 6
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter20_1.ipynb b/Electronic_Devices_and_Circuits/Chapter20_1.ipynb deleted file mode 100755 index dcf6cb7f..00000000 --- a/Electronic_Devices_and_Circuits/Chapter20_1.ipynb +++ /dev/null @@ -1,434 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 20 : Thyristors "
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.1, Page No 902"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vs=25.0\n",
- "Vtm=1.7\n",
- "Rl=25.0\n",
- "Ih=5*10**-3\n",
- "\n",
- "#Calculations\n",
- "Vspk=1.414*Vs\n",
- "Ilpk=(Vs-Vtm)/Rl\n",
- "print(\" for half wave rectifier sinusodial waveform\")\n",
- "Ilrms=.5*Ilpk\n",
- "es=Vtm+(Ih*Rl)\n",
- "\n",
- "#Results\n",
- "print(\" switch-off voltage =%.2f v\" %es)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for half wave rectifier sinusodial waveform\n",
- " switch-off voltage =1.82 v\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.2, Page No 905"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vs=30.0\n",
- "Vd1=.7\n",
- "Vg=.8\n",
- "Ig=200*10**-6\n",
- "\n",
- "#Calculations\n",
- "Vspk=1.414*Vs\n",
- "print(\" at 5 degree\")\n",
- "es=Vspk*.087 # sin5=.087\n",
- "print(\" at 90 degree\")\n",
- "es=Vspk\n",
- "Vt=Vd1+Vg\n",
- "print(\" to trigger at es=3.7V the R2 moving contact is at the top\")\n",
- "es=3.7\n",
- "Vr1=es-Vt\n",
- "I1=1*10**-3\n",
- "R1=Vr1/I1\n",
- "R=Vt/I1 #R=R2+R3\n",
- "es=42.4\n",
- "Vr3=Vt\n",
- "I1=es/(R+R1)\n",
- "R3=Vt/I1\n",
- "R2=R-R3\n",
- "\n",
- "#Results\n",
- "print(\" To trigger at es =42.4 the R2 moving contact at the bottom =%.2f\" %R2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " at 5 degree\n",
- " at 90 degree\n",
- " to trigger at es=3.7V the R2 moving contact is at the top\n",
- " To trigger at es =42.4 the R2 moving contact at the bottom =1369.10\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.3 Page No 906"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "R1=2.2*10**3\n",
- "R2=1.5*10**3\n",
- "R3=120.0\n",
- "Vt=1.5\n",
- "\n",
- "#Calculations\n",
- "Vak1=Vt*((R1+R2+R3)/(R3+.5*R2))\n",
- "Vak2=Vt*((R1+R2+R3)/R3)\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\" with R2 contact at center = %.2f\" %Vak1)\n",
- "print(\" with R2 contact at zero = %.2f\" %Vak2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " with R2 contact at center = 6.59\n",
- " with R2 contact at zero = 47.75\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.4, Page No 911"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vs=5.0\n",
- "Ilmax=300*10**-3\n",
- "Vl=7.0\n",
- "Vg=0.8\n",
- "\n",
- "\n",
- "#Calculations\n",
- "Vz=Vl-Vg\n",
- "print(\" for D1, select a 1N753 with Vz=6.2\")\n",
- "Izmin=1*10**-3\n",
- "R1=Vg/Izmin\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"The value of R1 is %d kohm \" %R1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for D1, select a 1N753 with Vz=6.2\n",
- "The value of R1 is 800 kohm \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.5 Page No 911"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "R1=25*10**3\n",
- "R2=2.7*10**3\n",
- "C1=3*10**-6\n",
- "Vg=0.8\n",
- "Vd1=8.0\n",
- "Vs=115.0\n",
- "f=60.0\n",
- "\n",
- "#Calculations\n",
- "Vc1=Vd1+Vg\n",
- "#assume the average charging voltage is\n",
- "Vac=1.414*Vs\n",
- "E=.636*Vac\n",
- "#average charging\n",
- "Ic=E/(R1+R2)\n",
- "#charging time\n",
- "t=(C1*Vc1)/Ic\n",
- "T=1/f\n",
- "q=(t*360)/T\n",
- "a=180-q\n",
- "\n",
- "#Results\n",
- "print(\"Conduction angle =%.2f degrees\" %a)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Conduction angle =27.27 degrees\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.6 Page No 925"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vs=10.0\n",
- "Vf=1.7\n",
- "Is=500*10**-6\n",
- "Ih=1.5*10**-3\n",
- "E=30.0\n",
- "\n",
- "#Calculations\n",
- "R=27*10**3\n",
- "C=0.5*10**-6\n",
- "R1max=(E-Vs)/Is\n",
- "R1min=(E-Vf)/Ih\n",
- "t=C*R*math.log((E-Vf)/(E-Vs))\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"Capacitor charging time is %3.4f s\" %t)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacitor charging time is 0.0047 s\n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.7, Page No 931"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rbb=4.0*10**3\n",
- "Pd25=360.0*10**-3\n",
- "D=2.4*10**-3\n",
- "T2=100.0\n",
- "\n",
- "#Calculations\n",
- "Pd=Pd25-D*(T2-25)\n",
- "Vb1b1=math.sqrt(Rbb*Pd)\n",
- "\n",
- "#Results\n",
- "print(\"Maximum Vb1b1 that should be used at a temp 100 is %3.1fV \" %Vb1b1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum Vb1b1 that should be used at a temp 100 is 26.8V \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.8 Page No 931"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Vb1b1=25\n",
- "nmax=0.86\n",
- "nmin=0.74\n",
- "Vd=0.7\n",
- "\n",
- "#Calculations\n",
- "Vpmax=Vd+(nmax*Vb1b1)\n",
- "Vpmin=Vd+(nmin*Vb1b1)\n",
- "\n",
- "#Results\n",
- "print(\"Maximum Vpmax that should be is %3.1fV \" %Vpmax)\n",
- "print(\"Minimum Vpmin that should be is %3.1fV \" %Vpmin)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum Vpmax that should be is 22.2V \n",
- "Minimum Vpmin that should be is 19.2V \n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.9 Page No 933"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Ip=.6*10**-6\n",
- "Iv=2*10**-3\n",
- "Veb1=2.5\n",
- "Vpmin=19.2\n",
- "Vpmax=22.2\n",
- "Vbb=25.0\n",
- "C=1*10**-6\n",
- "R=18*10**3\n",
- "Vp=20.0\n",
- "\n",
- "\n",
- "#Calculations\n",
- "Vpmin=(Vbb-Vpmax)/Ip\n",
- "Remax=(Vbb-Veb1)/Iv\n",
- "t=C*R*math.log((Vbb-Veb1)/(Vbb-Vp))\n",
- "f=1.0/t\n",
- "\n",
- "#Results\n",
- "print(\"The value of f is %.2f \" %f)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of f is 36.94 \n"
- ]
- }
- ],
- "prompt_number": 23
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter20_2.ipynb b/Electronic_Devices_and_Circuits/Chapter20_2.ipynb deleted file mode 100755 index dcf6cb7f..00000000 --- a/Electronic_Devices_and_Circuits/Chapter20_2.ipynb +++ /dev/null @@ -1,434 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 20 : Thyristors "
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.1, Page No 902"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vs=25.0\n",
- "Vtm=1.7\n",
- "Rl=25.0\n",
- "Ih=5*10**-3\n",
- "\n",
- "#Calculations\n",
- "Vspk=1.414*Vs\n",
- "Ilpk=(Vs-Vtm)/Rl\n",
- "print(\" for half wave rectifier sinusodial waveform\")\n",
- "Ilrms=.5*Ilpk\n",
- "es=Vtm+(Ih*Rl)\n",
- "\n",
- "#Results\n",
- "print(\" switch-off voltage =%.2f v\" %es)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for half wave rectifier sinusodial waveform\n",
- " switch-off voltage =1.82 v\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.2, Page No 905"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vs=30.0\n",
- "Vd1=.7\n",
- "Vg=.8\n",
- "Ig=200*10**-6\n",
- "\n",
- "#Calculations\n",
- "Vspk=1.414*Vs\n",
- "print(\" at 5 degree\")\n",
- "es=Vspk*.087 # sin5=.087\n",
- "print(\" at 90 degree\")\n",
- "es=Vspk\n",
- "Vt=Vd1+Vg\n",
- "print(\" to trigger at es=3.7V the R2 moving contact is at the top\")\n",
- "es=3.7\n",
- "Vr1=es-Vt\n",
- "I1=1*10**-3\n",
- "R1=Vr1/I1\n",
- "R=Vt/I1 #R=R2+R3\n",
- "es=42.4\n",
- "Vr3=Vt\n",
- "I1=es/(R+R1)\n",
- "R3=Vt/I1\n",
- "R2=R-R3\n",
- "\n",
- "#Results\n",
- "print(\" To trigger at es =42.4 the R2 moving contact at the bottom =%.2f\" %R2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " at 5 degree\n",
- " at 90 degree\n",
- " to trigger at es=3.7V the R2 moving contact is at the top\n",
- " To trigger at es =42.4 the R2 moving contact at the bottom =1369.10\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.3 Page No 906"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "R1=2.2*10**3\n",
- "R2=1.5*10**3\n",
- "R3=120.0\n",
- "Vt=1.5\n",
- "\n",
- "#Calculations\n",
- "Vak1=Vt*((R1+R2+R3)/(R3+.5*R2))\n",
- "Vak2=Vt*((R1+R2+R3)/R3)\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\" with R2 contact at center = %.2f\" %Vak1)\n",
- "print(\" with R2 contact at zero = %.2f\" %Vak2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " with R2 contact at center = 6.59\n",
- " with R2 contact at zero = 47.75\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.4, Page No 911"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vs=5.0\n",
- "Ilmax=300*10**-3\n",
- "Vl=7.0\n",
- "Vg=0.8\n",
- "\n",
- "\n",
- "#Calculations\n",
- "Vz=Vl-Vg\n",
- "print(\" for D1, select a 1N753 with Vz=6.2\")\n",
- "Izmin=1*10**-3\n",
- "R1=Vg/Izmin\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"The value of R1 is %d kohm \" %R1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " for D1, select a 1N753 with Vz=6.2\n",
- "The value of R1 is 800 kohm \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.5 Page No 911"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "R1=25*10**3\n",
- "R2=2.7*10**3\n",
- "C1=3*10**-6\n",
- "Vg=0.8\n",
- "Vd1=8.0\n",
- "Vs=115.0\n",
- "f=60.0\n",
- "\n",
- "#Calculations\n",
- "Vc1=Vd1+Vg\n",
- "#assume the average charging voltage is\n",
- "Vac=1.414*Vs\n",
- "E=.636*Vac\n",
- "#average charging\n",
- "Ic=E/(R1+R2)\n",
- "#charging time\n",
- "t=(C1*Vc1)/Ic\n",
- "T=1/f\n",
- "q=(t*360)/T\n",
- "a=180-q\n",
- "\n",
- "#Results\n",
- "print(\"Conduction angle =%.2f degrees\" %a)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Conduction angle =27.27 degrees\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.6 Page No 925"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vs=10.0\n",
- "Vf=1.7\n",
- "Is=500*10**-6\n",
- "Ih=1.5*10**-3\n",
- "E=30.0\n",
- "\n",
- "#Calculations\n",
- "R=27*10**3\n",
- "C=0.5*10**-6\n",
- "R1max=(E-Vs)/Is\n",
- "R1min=(E-Vf)/Ih\n",
- "t=C*R*math.log((E-Vf)/(E-Vs))\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"Capacitor charging time is %3.4f s\" %t)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacitor charging time is 0.0047 s\n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.7, Page No 931"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rbb=4.0*10**3\n",
- "Pd25=360.0*10**-3\n",
- "D=2.4*10**-3\n",
- "T2=100.0\n",
- "\n",
- "#Calculations\n",
- "Pd=Pd25-D*(T2-25)\n",
- "Vb1b1=math.sqrt(Rbb*Pd)\n",
- "\n",
- "#Results\n",
- "print(\"Maximum Vb1b1 that should be used at a temp 100 is %3.1fV \" %Vb1b1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum Vb1b1 that should be used at a temp 100 is 26.8V \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.8 Page No 931"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Vb1b1=25\n",
- "nmax=0.86\n",
- "nmin=0.74\n",
- "Vd=0.7\n",
- "\n",
- "#Calculations\n",
- "Vpmax=Vd+(nmax*Vb1b1)\n",
- "Vpmin=Vd+(nmin*Vb1b1)\n",
- "\n",
- "#Results\n",
- "print(\"Maximum Vpmax that should be is %3.1fV \" %Vpmax)\n",
- "print(\"Minimum Vpmin that should be is %3.1fV \" %Vpmin)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum Vpmax that should be is 22.2V \n",
- "Minimum Vpmin that should be is 19.2V \n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 20.9 Page No 933"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Ip=.6*10**-6\n",
- "Iv=2*10**-3\n",
- "Veb1=2.5\n",
- "Vpmin=19.2\n",
- "Vpmax=22.2\n",
- "Vbb=25.0\n",
- "C=1*10**-6\n",
- "R=18*10**3\n",
- "Vp=20.0\n",
- "\n",
- "\n",
- "#Calculations\n",
- "Vpmin=(Vbb-Vpmax)/Ip\n",
- "Remax=(Vbb-Veb1)/Iv\n",
- "t=C*R*math.log((Vbb-Veb1)/(Vbb-Vp))\n",
- "f=1.0/t\n",
- "\n",
- "#Results\n",
- "print(\"The value of f is %.2f \" %f)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of f is 36.94 \n"
- ]
- }
- ],
- "prompt_number": 23
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter21_1.ipynb b/Electronic_Devices_and_Circuits/Chapter21_1.ipynb deleted file mode 100755 index adcb4972..00000000 --- a/Electronic_Devices_and_Circuits/Chapter21_1.ipynb +++ /dev/null @@ -1,241 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 21 : Optoelectronic Devices"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.1, Page No 947"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "r=3.0\n",
- "Os=25.0\n",
- "area=0.25\n",
- "\n",
- "#Calculations\n",
- "Ea=Os/(4.0*3.14*(r)**2)\n",
- "Tf=Ea*area\n",
- "\n",
- "#Results\n",
- "print(\" total flux is %3.3fW \" %Tf)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " total flux is 0.055W \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.3, Page No 951"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vcc=9.0\n",
- "Vf=1.6\n",
- "Vb=7.0\n",
- "hFE=100.0\n",
- "Vce=0.2\n",
- "Ic=10.0*10**-3\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "R2=(Vcc-Vf-Vce)/Ic\n",
- "R2=680#use standard value\n",
- "Ic=(Vcc-Vf-Vce)/R2\n",
- "Ib=Ic/hFE\n",
- "Rb=(Vb-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %d kohm\" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 59 kohm\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.4 Page No 952"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vcc=5.0\n",
- "N=(3*7.0)+(1.0*2)\n",
- "\n",
- "#Calculations\n",
- "It=N*10.0*10**-3\n",
- "P=It*Vcc\n",
- "\n",
- "#Results\n",
- "print(\"The value of power is %.2f W\" %P)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of power is 1.15 W\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.5, Page No 957"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rc=1.0*10**3\n",
- "I=10.0*10**-3\n",
- "E=30.0\n",
- "\n",
- "#Calculations\n",
- "R1=E/I -Rc\n",
- "R1=1.8*10**3#use standard value\n",
- "print(\" when dark Rc=100Kohm\")\n",
- "Rc=100*10**3\n",
- "I=E/(R1+Rc)\n",
- "\n",
- "#Results\n",
- "print(\"The value of I is %.2f mA\" %(I*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " when dark Rc=100Kohm\n",
- "The value of I is 0.29 mA\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.6 Page No 958"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vee=6.0\n",
- "Vbe=0.7\n",
- "Ib=200.0*10**-6\n",
- "Vb=0.7\n",
- "Vcc=6.0\n",
- "\n",
- "#Calculations\n",
- "print(\"when cell is dark Rc=100Kohm\")\n",
- "Rc=100.0*10**3\n",
- "Vrc=Vee+Vbe\n",
- "Irc=Vrc/Rc\n",
- "Ir1=Irc+Ib\n",
- "Vr1=Vcc-Vb\n",
- "R1=Vr1/Ir1\n",
- "R1=18.0*10**3#use standard value\n",
- "print(\" when Q1 is off\")\n",
- "Vr1=6.0\n",
- "Vrc=6.0\n",
- "Ir1=Vr1/R1\n",
- "Rc=Vrc/Ir1\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rc is %d kohm\" %(Rc/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when cell is dark Rc=100Kohm\n",
- " when Q1 is off\n",
- "The value of Rc is 18 kohm\n"
- ]
- }
- ],
- "prompt_number": 17
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter21_2.ipynb b/Electronic_Devices_and_Circuits/Chapter21_2.ipynb deleted file mode 100755 index adcb4972..00000000 --- a/Electronic_Devices_and_Circuits/Chapter21_2.ipynb +++ /dev/null @@ -1,241 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 21 : Optoelectronic Devices"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.1, Page No 947"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "r=3.0\n",
- "Os=25.0\n",
- "area=0.25\n",
- "\n",
- "#Calculations\n",
- "Ea=Os/(4.0*3.14*(r)**2)\n",
- "Tf=Ea*area\n",
- "\n",
- "#Results\n",
- "print(\" total flux is %3.3fW \" %Tf)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " total flux is 0.055W \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.3, Page No 951"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vcc=9.0\n",
- "Vf=1.6\n",
- "Vb=7.0\n",
- "hFE=100.0\n",
- "Vce=0.2\n",
- "Ic=10.0*10**-3\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "R2=(Vcc-Vf-Vce)/Ic\n",
- "R2=680#use standard value\n",
- "Ic=(Vcc-Vf-Vce)/R2\n",
- "Ib=Ic/hFE\n",
- "Rb=(Vb-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %d kohm\" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 59 kohm\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.4 Page No 952"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vcc=5.0\n",
- "N=(3*7.0)+(1.0*2)\n",
- "\n",
- "#Calculations\n",
- "It=N*10.0*10**-3\n",
- "P=It*Vcc\n",
- "\n",
- "#Results\n",
- "print(\"The value of power is %.2f W\" %P)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of power is 1.15 W\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.5, Page No 957"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rc=1.0*10**3\n",
- "I=10.0*10**-3\n",
- "E=30.0\n",
- "\n",
- "#Calculations\n",
- "R1=E/I -Rc\n",
- "R1=1.8*10**3#use standard value\n",
- "print(\" when dark Rc=100Kohm\")\n",
- "Rc=100*10**3\n",
- "I=E/(R1+Rc)\n",
- "\n",
- "#Results\n",
- "print(\"The value of I is %.2f mA\" %(I*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " when dark Rc=100Kohm\n",
- "The value of I is 0.29 mA\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 21.6 Page No 958"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vee=6.0\n",
- "Vbe=0.7\n",
- "Ib=200.0*10**-6\n",
- "Vb=0.7\n",
- "Vcc=6.0\n",
- "\n",
- "#Calculations\n",
- "print(\"when cell is dark Rc=100Kohm\")\n",
- "Rc=100.0*10**3\n",
- "Vrc=Vee+Vbe\n",
- "Irc=Vrc/Rc\n",
- "Ir1=Irc+Ib\n",
- "Vr1=Vcc-Vb\n",
- "R1=Vr1/Ir1\n",
- "R1=18.0*10**3#use standard value\n",
- "print(\" when Q1 is off\")\n",
- "Vr1=6.0\n",
- "Vrc=6.0\n",
- "Ir1=Vr1/R1\n",
- "Rc=Vrc/Ir1\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rc is %d kohm\" %(Rc/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when cell is dark Rc=100Kohm\n",
- " when Q1 is off\n",
- "The value of Rc is 18 kohm\n"
- ]
- }
- ],
- "prompt_number": 17
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter2_1.ipynb b/Electronic_Devices_and_Circuits/Chapter2_1.ipynb deleted file mode 100755 index 1c97e28b..00000000 --- a/Electronic_Devices_and_Circuits/Chapter2_1.ipynb +++ /dev/null @@ -1,571 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 02 : Semiconductor diodes"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.1, Page No 37"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "If=100*10**-3\n",
- "Vf=.75 #given\n",
- "print(\"a)\")\n",
- "print(\"forward resistance\")\n",
- "\n",
- "#Calculations\n",
- "Rf=Vf/If\n",
- "print(\"forward resistnace is %3.1fohm \" %Rf)\n",
- "print(\"b)\")\n",
- "Vr=50\n",
- "Ir=100*10**-9\n",
- "Rr=(Vr/Ir)\n",
- "\n",
- "#Results\n",
- "print(\"reverse resistnace is %.1fohm \" %(Rr/10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "a)\n",
- "forward resistance\n",
- "forward resistnace is 7.5ohm \n",
- "b)\n",
- "reverse resistnace is 500.0ohm \n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.2, Page No 39"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "If=70*10**-3\n",
- "\n",
- "#Calculations\n",
- "rd=(26*10**-3)/If\n",
- "print(\"dynamic resistance is %.2fohm \" %rd)\n",
- "If=60*10**-3\n",
- "Vf=.025\n",
- "rd=Vf/If\n",
- "\n",
- "#Results\n",
- "print(\"dynamic resistance is %.2fohm \" %rd)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "dynamic resistance is 0.37ohm \n",
- "dynamic resistance is 0.42ohm \n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.3 Page No 40"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "R1=4.7*10**3\n",
- "E=15.0\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "print(\"diode current is E=If*R1+Vf\")\n",
- "If=((E-Vf)/R1)*10**3\n",
- "\n",
- "#Results\n",
- "print(\" diode current is %.2fmA \" %If) "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "diode current is E=If*R1+Vf\n",
- " diode current is 3.04mA \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.5, Page No 41"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=1.5\n",
- "Vf=0.7\n",
- "R1=10\n",
- "rd=.25\n",
- "\n",
- "#Calculations\n",
- "print(\"a)\")\n",
- "If=(E-Vf)/R1\n",
- "print(\" forward current is %0.1fmA \" %(If*1000))\n",
- "print(\"b)\")\n",
- "If=(E-Vf)/(R1+rd)\n",
- "\n",
- "#Results\n",
- "print(\" forward current is %0.1fmA \" %(If*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "a)\n",
- " forward current is 80.0mA \n",
- "b)\n",
- " forward current is 78.0mA \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.6 Page No 43"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "If=0\n",
- "Vf=5.0\n",
- "R1=100.0\n",
- "\n",
- "#Calculations\n",
- "E=(If*R1)+Vf\n",
- "print(\"B)\")\n",
- "Vf=0\n",
- "E=5.0\n",
- "R1=100.0\n",
- "If=(E/R1)*1000\n",
- "\n",
- "#Results\n",
- "print(\"resistance is %dmA \" %If) "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "B)\n",
- "resistance is 50mA \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.8 Page No 45"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "If=50*10**-3\n",
- "Vf=1.1\n",
- "R1=100.0\n",
- "\n",
- "#Calculations\n",
- "Vf1=If*R1\n",
- "E=Vf1+Vf\n",
- "\n",
- "#Results\n",
- "print(\" new supply voltage is %.2fV \" %E)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " new supply voltage is 6.10V \n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.9, Page No 48"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "P1=700.0*10**-3\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "If=P1/Vf\n",
- "#at 65C\n",
- "D=5*10**-3\n",
- "T=65-25\n",
- "P2=P1-D*T\n",
- "If=P2/Vf\n",
- "\n",
- "#Results\n",
- "print( \"maximum forward current at 65C is %.1fA \" %(If*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "maximum forward current at 65C is 714.3A \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.10 Page No 49"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vf1=0.7\n",
- "Vf=-1.8*10**-3\n",
- "If=26.0*10**-3\n",
- "T=100-25\n",
- "\n",
- "#Calculations\n",
- "Vf2=Vf1+(T*Vf)\n",
- "print(\" voltage at 100C is %.3f V \" %Vf2)\n",
- "print(\"At 25C\")\n",
- "T1=25.0\n",
- "rd=(26*10**-3/If)*((T1+273)/298)\n",
- "print(\" resistance at 25 C is %.2f ohm \" %rd)\n",
- "print(\" At 100C\")\n",
- "T2=100.0\n",
- "rd=(26*10**-3/If)*((T2+273)/298)\n",
- "\n",
- "#Results\n",
- "print(\" resistance at 100 C is %.2fohm \" %rd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " voltage at 100C is 0.565 V \n",
- "At 25C\n",
- " resistance at 25 C is 1.00 ohm \n",
- " At 100C\n",
- " resistance at 100 C is 1.25ohm \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.11 Page No 51"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variablesV_s=230\n",
- "If=10*10**-3\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "t=70.0*10**-9\n",
- "Cd=((t*If)/Vf)*10**9\n",
- "\n",
- "#Results\n",
- "print(\" diffusion capacitance is %.2f nF \" %Cd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " diffusion capacitance is 1.00 nF \n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.12 Page No 53"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "print(\"A\")\n",
- "trr=10.0*10**-9\n",
- "\n",
- "#Calculations\n",
- "tf=10.0*trr*10**9\n",
- "print(\"minimum fall times is %d ns \" %tf)\n",
- "print(\"B)\")\n",
- "trr=3.0\n",
- "tf=10*trr\n",
- "\n",
- "#Results\n",
- "print(\"minimum fall times is %d ns \" %tf)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "A\n",
- "minimum fall times is 100 ns \n",
- "B)\n",
- "minimum fall times is 30 ns \n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.14, Page No 58"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Io=75.0*10**-3\n",
- "#vertical scale of 5mA/cm \n",
- "\n",
- "#Calculations\n",
- "If=Io/5*10**-3\n",
- "R1=15/(75*10**-3)\n",
- "P=((Io)**2)*R1\n",
- "\n",
- "#Results\n",
- "print(\"Pr1 = %1.1f W \" %P)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pr1 = 1.1 W \n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.15, Page No 63"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vz=7.5\n",
- "Pd=400.0*10**-3\n",
- "D=3.2*10**-3\n",
- "\n",
- "#Calculations\n",
- "Izm=Pd/Vz\n",
- "print(\"current at 50C is %.1fA \" %(Izm*1000))\n",
- "print(\"At 100C\")\n",
- "P2=Pd-((100-50)*D)\n",
- "print(\" power at 100C is %.3fW \" %P2)\n",
- "Izm=P2/Vz\n",
- "\n",
- "#Results\n",
- "print(\" current at 100C is %.1fA \" %(Izm*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "current at 50C is 53.3A \n",
- "At 100C\n",
- " power at 100C is 0.240W \n",
- " current at 100C is 32.0A \n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.16, Page No 64"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=20.0\n",
- "R1=620.0\n",
- "Vz=7.5\n",
- "\n",
- "#Calculations\n",
- "Vr1=E-Vz\n",
- "Iz=Vr1/R1\n",
- "print(\" diode current is %.1f mA \" %(Iz*1000))\n",
- "Pd=Vz*Iz\n",
- "\n",
- "#Results\n",
- "print( \"power dissipation is %.1f mW \" %(Pd*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " diode current is 20.2 mA \n",
- "power dissipation is 151.2 mW \n"
- ]
- }
- ],
- "prompt_number": 26
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter2_2.ipynb b/Electronic_Devices_and_Circuits/Chapter2_2.ipynb deleted file mode 100755 index 1c97e28b..00000000 --- a/Electronic_Devices_and_Circuits/Chapter2_2.ipynb +++ /dev/null @@ -1,571 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 02 : Semiconductor diodes"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.1, Page No 37"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "If=100*10**-3\n",
- "Vf=.75 #given\n",
- "print(\"a)\")\n",
- "print(\"forward resistance\")\n",
- "\n",
- "#Calculations\n",
- "Rf=Vf/If\n",
- "print(\"forward resistnace is %3.1fohm \" %Rf)\n",
- "print(\"b)\")\n",
- "Vr=50\n",
- "Ir=100*10**-9\n",
- "Rr=(Vr/Ir)\n",
- "\n",
- "#Results\n",
- "print(\"reverse resistnace is %.1fohm \" %(Rr/10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "a)\n",
- "forward resistance\n",
- "forward resistnace is 7.5ohm \n",
- "b)\n",
- "reverse resistnace is 500.0ohm \n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.2, Page No 39"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "If=70*10**-3\n",
- "\n",
- "#Calculations\n",
- "rd=(26*10**-3)/If\n",
- "print(\"dynamic resistance is %.2fohm \" %rd)\n",
- "If=60*10**-3\n",
- "Vf=.025\n",
- "rd=Vf/If\n",
- "\n",
- "#Results\n",
- "print(\"dynamic resistance is %.2fohm \" %rd)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "dynamic resistance is 0.37ohm \n",
- "dynamic resistance is 0.42ohm \n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.3 Page No 40"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "R1=4.7*10**3\n",
- "E=15.0\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "print(\"diode current is E=If*R1+Vf\")\n",
- "If=((E-Vf)/R1)*10**3\n",
- "\n",
- "#Results\n",
- "print(\" diode current is %.2fmA \" %If) "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "diode current is E=If*R1+Vf\n",
- " diode current is 3.04mA \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.5, Page No 41"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=1.5\n",
- "Vf=0.7\n",
- "R1=10\n",
- "rd=.25\n",
- "\n",
- "#Calculations\n",
- "print(\"a)\")\n",
- "If=(E-Vf)/R1\n",
- "print(\" forward current is %0.1fmA \" %(If*1000))\n",
- "print(\"b)\")\n",
- "If=(E-Vf)/(R1+rd)\n",
- "\n",
- "#Results\n",
- "print(\" forward current is %0.1fmA \" %(If*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "a)\n",
- " forward current is 80.0mA \n",
- "b)\n",
- " forward current is 78.0mA \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.6 Page No 43"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "If=0\n",
- "Vf=5.0\n",
- "R1=100.0\n",
- "\n",
- "#Calculations\n",
- "E=(If*R1)+Vf\n",
- "print(\"B)\")\n",
- "Vf=0\n",
- "E=5.0\n",
- "R1=100.0\n",
- "If=(E/R1)*1000\n",
- "\n",
- "#Results\n",
- "print(\"resistance is %dmA \" %If) "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "B)\n",
- "resistance is 50mA \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.8 Page No 45"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "If=50*10**-3\n",
- "Vf=1.1\n",
- "R1=100.0\n",
- "\n",
- "#Calculations\n",
- "Vf1=If*R1\n",
- "E=Vf1+Vf\n",
- "\n",
- "#Results\n",
- "print(\" new supply voltage is %.2fV \" %E)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " new supply voltage is 6.10V \n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.9, Page No 48"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "P1=700.0*10**-3\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "If=P1/Vf\n",
- "#at 65C\n",
- "D=5*10**-3\n",
- "T=65-25\n",
- "P2=P1-D*T\n",
- "If=P2/Vf\n",
- "\n",
- "#Results\n",
- "print( \"maximum forward current at 65C is %.1fA \" %(If*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "maximum forward current at 65C is 714.3A \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.10 Page No 49"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vf1=0.7\n",
- "Vf=-1.8*10**-3\n",
- "If=26.0*10**-3\n",
- "T=100-25\n",
- "\n",
- "#Calculations\n",
- "Vf2=Vf1+(T*Vf)\n",
- "print(\" voltage at 100C is %.3f V \" %Vf2)\n",
- "print(\"At 25C\")\n",
- "T1=25.0\n",
- "rd=(26*10**-3/If)*((T1+273)/298)\n",
- "print(\" resistance at 25 C is %.2f ohm \" %rd)\n",
- "print(\" At 100C\")\n",
- "T2=100.0\n",
- "rd=(26*10**-3/If)*((T2+273)/298)\n",
- "\n",
- "#Results\n",
- "print(\" resistance at 100 C is %.2fohm \" %rd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " voltage at 100C is 0.565 V \n",
- "At 25C\n",
- " resistance at 25 C is 1.00 ohm \n",
- " At 100C\n",
- " resistance at 100 C is 1.25ohm \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.11 Page No 51"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variablesV_s=230\n",
- "If=10*10**-3\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "t=70.0*10**-9\n",
- "Cd=((t*If)/Vf)*10**9\n",
- "\n",
- "#Results\n",
- "print(\" diffusion capacitance is %.2f nF \" %Cd)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " diffusion capacitance is 1.00 nF \n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.12 Page No 53"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "print(\"A\")\n",
- "trr=10.0*10**-9\n",
- "\n",
- "#Calculations\n",
- "tf=10.0*trr*10**9\n",
- "print(\"minimum fall times is %d ns \" %tf)\n",
- "print(\"B)\")\n",
- "trr=3.0\n",
- "tf=10*trr\n",
- "\n",
- "#Results\n",
- "print(\"minimum fall times is %d ns \" %tf)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "A\n",
- "minimum fall times is 100 ns \n",
- "B)\n",
- "minimum fall times is 30 ns \n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.14, Page No 58"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Io=75.0*10**-3\n",
- "#vertical scale of 5mA/cm \n",
- "\n",
- "#Calculations\n",
- "If=Io/5*10**-3\n",
- "R1=15/(75*10**-3)\n",
- "P=((Io)**2)*R1\n",
- "\n",
- "#Results\n",
- "print(\"Pr1 = %1.1f W \" %P)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pr1 = 1.1 W \n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.15, Page No 63"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vz=7.5\n",
- "Pd=400.0*10**-3\n",
- "D=3.2*10**-3\n",
- "\n",
- "#Calculations\n",
- "Izm=Pd/Vz\n",
- "print(\"current at 50C is %.1fA \" %(Izm*1000))\n",
- "print(\"At 100C\")\n",
- "P2=Pd-((100-50)*D)\n",
- "print(\" power at 100C is %.3fW \" %P2)\n",
- "Izm=P2/Vz\n",
- "\n",
- "#Results\n",
- "print(\" current at 100C is %.1fA \" %(Izm*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "current at 50C is 53.3A \n",
- "At 100C\n",
- " power at 100C is 0.240W \n",
- " current at 100C is 32.0A \n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2.16, Page No 64"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=20.0\n",
- "R1=620.0\n",
- "Vz=7.5\n",
- "\n",
- "#Calculations\n",
- "Vr1=E-Vz\n",
- "Iz=Vr1/R1\n",
- "print(\" diode current is %.1f mA \" %(Iz*1000))\n",
- "Pd=Vz*Iz\n",
- "\n",
- "#Results\n",
- "print( \"power dissipation is %.1f mW \" %(Pd*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " diode current is 20.2 mA \n",
- "power dissipation is 151.2 mW \n"
- ]
- }
- ],
- "prompt_number": 26
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter3_1.ipynb b/Electronic_Devices_and_Circuits/Chapter3_1.ipynb deleted file mode 100755 index 8f8a6a3b..00000000 --- a/Electronic_Devices_and_Circuits/Chapter3_1.ipynb +++ /dev/null @@ -1,1201 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 03 : Diode applications"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.1, Page No 73"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vf=.7\n",
- "Rl=500.0\n",
- "Vi=22.0\n",
- "Vpi=1.414*Vi\n",
- "\n",
- "#Calculations\n",
- "Vpo=Vpi-Vf\n",
- "print(\" peak vouput voltage is %3.2fV \" %Vpo)\n",
- "Ip=Vpo/Rl\n",
- "\n",
- "#Results\n",
- "print(\"peak load current is %3.4fA \" %Ip)\n",
- "PIV=Vpi\n",
- "print(\"diode paek reverse voltage %3.2fV \" %PIV)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " peak vouput voltage is 30.41V \n",
- "peak load current is 0.0608A \n",
- "diode paek reverse voltage 31.11V \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.2, Page No 79"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vi=30.0\n",
- "Rl=300.0\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "Vpi=1.414*Vi\n",
- "Vpo=Vpi-2*Vf\n",
- "print(\" peak output voltage %.3f V \" %Vpo)\n",
- "Ip=Vpo/Rl\n",
- "\n",
- "#Results\n",
- "print(\" current bridge is %.1f mA \" %(Ip*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " peak output voltage 41.020 V \n",
- " current bridge is 136.7 mA \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.3 Page No 83"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "C1=680.0*10**-6\n",
- "Eo=28.0\n",
- "Rl=200.0\n",
- "f=60.0\n",
- "\n",
- "#Calculations\n",
- "Il=Eo/Rl\n",
- "T=1/f\n",
- "t1=T\n",
- "Vr=(Il*t1)/C1\n",
- "\n",
- "#Results\n",
- "print(\"peak to peak ripple voltage is %.2f V \" %Vr)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "peak to peak ripple voltage is 3.43 V \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.4, Page No 84"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Eo=20.0\n",
- "Rl=500.0\n",
- "f=60.0\n",
- "\n",
- "#Calculations\n",
- "Vr=(10*Eo)/100#10% of Eo\n",
- "Il=Eo/Rl\n",
- "T=1/f\n",
- "t1=T\n",
- "C1=((Il*t1)/Vr)*10**6\n",
- "\n",
- "#Results\n",
- "print(\"Reservior capacitance is %.2f uF \" %C1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Reservior capacitance is 333.33 uF \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.5 Page No 85"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Eo=20.0\n",
- "f=60.0\n",
- "Rl=500.0\n",
- "Il=Eo/Rl\n",
- "\n",
- "#Calculations\n",
- "Vr=(10.0*Eo)/100\n",
- "print(\"10percent of Eo is %.2f V \" %Vr)\n",
- "Eomin=Eo-0.5*Vr\n",
- "Eomax=Eo+0.5*Vr\n",
- "Q1=math.asin(Eomin/Eomax)\n",
- "Q1=65\n",
- "Q2=90-Q1\n",
- "T=1/f\n",
- "t2=(Q2*T)/360\n",
- "print(\" charging time is %.2fs \" %t2)\n",
- "t1=T-t2\n",
- "print(\"discharging time is %.2fs \" %t1)\n",
- "C1=((Il*t1)/Vr)*10**6\n",
- "\n",
- "#Results\n",
- "print(\"reservior capacitance is %.2f uF \" %C1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10percent of Eo is 2.00 V \n",
- " charging time is 0.00s \n",
- "discharging time is 0.02s \n",
- "reservior capacitance is 310.19 uF \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.6 Page No 88"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Eo=21.0\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "t1=1.16*10**-3\n",
- "t2=15.54*10**-3\n",
- "Vp=Eo+Vf\n",
- "Vr=2*Vp\n",
- "Il=40*10**-4\n",
- "Ifrm=(Il*(t1+t2))/t2\n",
- "Ifsm=30.0\n",
- "Rs=Vp/Ifsm\n",
- "\n",
- "#Results\n",
- "print(\" surge limiting resistance is %3.2fohm \" %Rs)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " surge limiting resistance is 0.72ohm \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.7, Page No 89 "
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vf=.7\n",
- "Eo=21.0\n",
- "\n",
- "#Calculations\n",
- "Il=40*10**-3\n",
- "Vp=115.0\n",
- "Vs=.707*(Vf+Eo)\n",
- "print(\" Vrms voltage is %3.3fV \" %Vs)\n",
- "Is=3.6*Il\n",
- "print(\" rms current is %.2f mA \" %(Is*1000))\n",
- "Ip=(Vs*Is)/Vp\n",
- "\n",
- "#Results\n",
- "print(\"primary current is %.2f mA \" %(Ip*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Vrms voltage is 15.342V \n",
- " rms current is 144.00 mA \n",
- "primary current is 19.21 mA \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.8 Page No 92"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Vr=2.0\n",
- "T=16.7*10**-3\n",
- "t2=1.16*10**-3\n",
- "\n",
- "#Calculations\n",
- "Il=40.0*10**-3#from example 3.5\n",
- "t1=(T/2.0)-t2\n",
- "C1=(Il*t1)/Vr\n",
- "\n",
- "#Results\n",
- "print(\" resrvior capacitor is %.2f mF \" %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " resrvior capacitor is 143.80 mF \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.9 Page No 93"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vr=2.0\n",
- "T=16.7*10**-3\n",
- "Il=40.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "t1=T/2\n",
- "C1=(Il*t1)/Vr\n",
- "\n",
- "#Results\n",
- "print(\" reservior capacitance is %.1fF \" %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " reservior capacitance is 167.0F \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.10 Page No 93"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Eo=21.0\n",
- "Vf=0.7\n",
- "Il=40.0*10**-3\n",
- "t1=7.19*10**-3\n",
- "t2=1.16*10**-3\n",
- "\n",
- "#Calculations\n",
- "Vp=Eo+(2*Vf)\n",
- "Vr=Vp\n",
- "If=Il/2\n",
- "Ifrm=Il*(t1+t2)/t2\n",
- "Ifsm=30\n",
- "Rs=Vp/Ifsm\n",
- "\n",
- "#Results\n",
- "print(\"surge limiting resistance is %.3fohm \" %Rs)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "surge limiting resistance is 0.747ohm \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.11, Page No 93"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Eo=21.0\n",
- "Vf=0.7\n",
- "Il=40*10**-3\n",
- "Vp=115.0\n",
- "\n",
- "#Calculations\n",
- "Vs=0.707*(Eo+2*Vf)\n",
- "Is=1.6*Il\n",
- "Ip=(Vs*Is)/Vp\n",
- "\n",
- "#Results\n",
- "print(\" supply current is %.1f mA \" %(Ip*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " supply current is 8.8 mA \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.12, Page No 97"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Eo=20.0\n",
- "Il=40.0*10**-3\n",
- "R1=22.0\n",
- "Vr=2.0\n",
- "C1=150*10**-6\n",
- "C2=C1\n",
- "fr=120\n",
- "\n",
- "#Calculations\n",
- "Vo=Eo-Il*R1\n",
- "vi=Vr/3.14\n",
- "Xc2=1/(2*3.14*fr*C2)\n",
- "vo=(vi*Xc2)/math.sqrt((R1**2) + (Xc2**2))\n",
- "print(\" dc output voltage is %.3fV \" %vo)\n",
- "Vpp=2*vo\n",
- "\n",
- "#Results\n",
- "print(\" peak to peak voltage is %.1fV \" %(Vpp*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " dc output voltage is 0.238V \n",
- " peak to peak voltage is 475.3V \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.13, Page No 98"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "C1=150*10**-6\n",
- "C2=C1\n",
- "vi=4.0\n",
- "vo=1.0\n",
- "f=120.0\n",
- "\n",
- "#Calculations\n",
- "Xc2=8.84 #FROM EXAMPLE 3.12\n",
- "Xl=Xc2*((vi/vo)+1)\n",
- "L1=Xl/(2*3.14*f)\n",
- "\n",
- "#Results\n",
- "print(\" suitable value of L1 is %.3fH \" %(L1*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable value of L1 is 58.652H \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.14, Page No 101"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Edc=20.0\n",
- "vo=0.24\n",
- "Vo=20.0\n",
- "Il=40*10**-3\n",
- "fr=120.0\n",
- "\n",
- "#Calculations\n",
- "Eomax=(3.14*Edc)/2\n",
- "Epeak=(4*Eomax)/(3*3.14)\n",
- "vi=Epeak\n",
- "Rl=Vo/Il\n",
- "Xlc=(2*Rl)/3\n",
- "Lc=Xlc/(2*3.14*fr)\n",
- "L=1.25*Lc\n",
- "Xl=2*3.14*fr*L\n",
- "Xc=Xl/((vi/vo)+1)\n",
- "C1=1/(2*3.14*fr*Xc)\n",
- "\n",
- "#Results\n",
- "print(\"The value of c1 = %.2f mF \" %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of c1 = 180.11 mF \n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.15, Page No 105"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Eo=20.0\n",
- "E0=20-19.7 #load effect\n",
- "\n",
- "#Calculations\n",
- "loadregulation =(E0*100)/Eo#percentage\n",
- "sourceeffect=20.2-20\n",
- "lineregulation =(sourceeffect*100)/Eo\n",
- "\n",
- "#Results\n",
- "print(\"Line regulation = %.1f percent \" %lineregulation)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Line regulation = 1.0 percent \n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.16, Page No 108"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vz=9.1\n",
- "Izt=20*10**-3\n",
- "Es=30.0\n",
- "\n",
- "#Calculations\n",
- "R1=(Es-Vz)/Izt\n",
- "Pr1=(Izt**2)*R1\n",
- "Es=27\n",
- "Iz=(Es-Vz)/R1\n",
- "\n",
- "#Results\n",
- "print(\"The circuit current is %.2f mA \" %(Iz*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The circuit current is 17.13 mA \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.17, Page No 110"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vz=6.2\n",
- "Pd=400.0*10**-3\n",
- "Es=16.0\n",
- "\n",
- "#Calculations\n",
- "Izm=Pd/Vz\n",
- "R1=(Es-Vz)/Izm\n",
- "Pr1=(Izm**2)*R1\n",
- "Izmin=5.0*10**-3\n",
- "Izmax=Izm-Izmin\n",
- "\n",
- "#Results\n",
- "print(\"maximum current is %3.2f mA \" %(Izmax*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "maximum current is 59.52 mA \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.18, Page No 112"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Zz=7.0\n",
- "Es=16.0\n",
- "Vo=6.2\n",
- "Il=59.5*10**-3\n",
- "\n",
- "#Calculations\n",
- "es=(10*Es)/100.0 #10% os Es\n",
- "Rl=Vo/Il\n",
- "print(\"es*Zz||Rl/R1+Zz||Rl\")\n",
- "V0=es*((Zz*Rl)/(Zz+Rl))/(R1+((Zz*Rl)/(Zz+Rl)))\n",
- "lineregulation=(V0*100)/Vo\n",
- "print(\"line regulation voltage is %3.3fpercentage \" %lineregulation)\n",
- "V0=Il*((Zz*R1)/(Zz+R1))\n",
- "loadregulation=(V0*100)/Vo\n",
- "print(\"loadregulation voltage is %3.3fpercentage \" %loadregulation)\n",
- "Rr=((Zz*Rl)/(Zz+Rl))/(R1+(Zz*Rl)/(Zz+Rl))\n",
- "\n",
- "#Results\n",
- "print(\"ripple rejection is %3.2f X 10^-2 \" %(Rr*10**2))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "es*Zz||Rl/R1+Zz||Rl\n",
- "line regulation voltage is 1.068percentage \n",
- "loadregulation voltage is 6.422percentage \n",
- "ripple rejection is 4.14 X 10^-2 \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.19, Page No 114"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "E=9.0\n",
- "Vf=.7\n",
- "\n",
- "#Calculations\n",
- "If=1.0*10**-3\n",
- "Vo=E-Vf\n",
- "R1=Vo/If\n",
- "Vr=E\n",
- "\n",
- "#Results\n",
- "print(\"diode forward voltage is %3.2fohm \" %Vr)\n",
- "print(\"diode forward current is %3.1fA \" %(If*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "diode forward voltage is 9.00ohm \n",
- "diode forward current is 1.0A \n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.20, Page No 117"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=5.0\n",
- "Vo=4.5\n",
- "Il=2.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R1=(E-Vo)/Il\n",
- "print(\" suitable resistance is %dohm \" %R1)\n",
- "Vr=E\n",
- "print(\"when diode is forward baised\")\n",
- "If=(E-Vf)/R1\n",
- "\n",
- "#Results\n",
- "print(\" diode forward current is %3.2fA \" %(If*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable resistance is 250ohm \n",
- "when diode is forward baised\n",
- " diode forward current is 17.20A \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.21, Page No 119"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vo=2.7\n",
- "Vf=.7\n",
- "E=9.0\n",
- "If=1*10**-3\n",
- "\n",
- "#Calculations\n",
- "Il=If\n",
- "Vb=Vo-Vf\n",
- "R1=(E-Vo)/(Il+If)\n",
- "\n",
- "#Results\n",
- "print(\"resistance is %.2f kOhm \" %(R1/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "resistance is 3.15 kOhm \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.22, Page No 120"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vo=5.0\n",
- "Vf=0.7\n",
- "Iz=5.0\n",
- "Il=1.0\n",
- "E=20.0\n",
- "\n",
- "#Calculations\n",
- "Vz=Vo-Vf\n",
- "R1=(E-Vo)/(Il+Iz)\n",
- "\n",
- "#Results\n",
- "print(\"zener diode resistance si %.2f ohm \" %R1)\n",
- "#Answer in the book is wrong"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "zener diode resistance si 2.50 ohm \n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.23, Page No 122"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=10.0\n",
- "R1=56.0*10**3\n",
- "f=1000.0\n",
- "C1=1.0*10**-6\n",
- "\n",
- "#Calculations\n",
- "Vo=2*E\n",
- "Ic=Vo/R1\n",
- "t=1/(2*f)\n",
- "Vc=(Ic*t)/C1\n",
- "\n",
- "#Results\n",
- "print(\" tilt output voltage is %3.2fV \" %(Vc*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " tilt output voltage is 178.57V \n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.24, Page No 124"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f=500.0\n",
- "Rs=600.0\n",
- "E=8.0\n",
- "\n",
- "#Calculations\n",
- "t=1.0/(2*f)\n",
- "PW=t\n",
- "C1=PW/Rs\n",
- "Vo=2.0*E\n",
- "Vc=(1*Vo)/100#1% of the Vo\n",
- "Ic=(Vc*C1)/t\n",
- "R1=(2*E)/(Ic*1000)\n",
- "\n",
- "#Results\n",
- "print(\"suitable value of R1 is %.2f ohm \" %R1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "suitable value of R1 is 60.00 ohm \n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.25, Page No 125"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vf=0.7\n",
- "E=6.0\n",
- "Vb1=3.0\n",
- "\n",
- "#Calculations\n",
- "Vc=Vb1-Vf-(-E)\n",
- "Vo=Vb1-Vf\n",
- "print(\"when input is -E\")\n",
- "Vo=E+Vc\n",
- "Vo=Vb1+Vf\n",
- "print(\"Capicitor voltage is %.2f ohm \" %Vc)\n",
- "print(\"when input is +E\")\n",
- "Vo=E+(Vc)\n",
- "\n",
- "#Results\n",
- "print(\"Capicitor voltage is %.2f ohm \" %Vo)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when input is -E\n",
- "Capicitor voltage is 8.30 ohm \n",
- "when input is +E\n",
- "Capicitor voltage is 14.30 ohm \n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.26, Page No 130"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=12.0\n",
- "Vf=0.7\n",
- "Rl=47*10**3\n",
- "f=5000.0\n",
- "\n",
- "#Calculations\n",
- "Vo=2*(E-Vf)\n",
- "Il=Vo/Rl\n",
- "print(\" capacitor discharge time\")\n",
- "t=1.0/(2*f)\n",
- "print(\" for 1% ripple allow .5% due to discharge of C2 %.5%due to discharge of C1\")\n",
- "Vc=(.5*Vo)/100\n",
- "C2=((Il*t)/Vc)*10**6\n",
- "print(\" value of capacitor C2 is %3.2fuF \" %C2)\n",
- "C1=2*C2\n",
- "\n",
- "#Results\n",
- "print(\"value of capacitor C1 is %3.2fuF \" %C1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " capacitor discharge time\n",
- " for 1% ripple allow .5% due to discharge of C2 %.5%due to discharge of C1\n",
- " value of capacitor C2 is 0.43uF \n",
- "value of capacitor C1 is 0.85uF \n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.27, Page No 133"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=5.0\n",
- "Vf=.7\n",
- "R1=3.3*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\"A)\")\n",
- "Ir1=(Vcc-Vf)/R1\n",
- "print(\"diode forward current when all input are low is %3.4fA \" %Ir1)\n",
- "print(\"for each diode\")\n",
- "If=Ir1/3\n",
- "print(\"B)\")\n",
- "If2=Ir1/2\n",
- "If3=If2\n",
- "print(\" forward current when input A is high is %3.5fA \" %If3)\n",
- "print(\"C)\")\n",
- "If3=Ir1\n",
- "\n",
- "#Results\n",
- "print(\" forward current when input A and B are high and C is low %3.2fA \" %(If3*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "A)\n",
- "diode forward current when all input are low is 0.0013A \n",
- "for each diode\n",
- "B)\n",
- " forward current when input A is high is 0.00065A \n",
- "C)\n",
- " forward current when input A and B are high and C is low 1.30A \n"
- ]
- }
- ],
- "prompt_number": 27
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter3_2.ipynb b/Electronic_Devices_and_Circuits/Chapter3_2.ipynb deleted file mode 100755 index 8f8a6a3b..00000000 --- a/Electronic_Devices_and_Circuits/Chapter3_2.ipynb +++ /dev/null @@ -1,1201 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 03 : Diode applications"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.1, Page No 73"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vf=.7\n",
- "Rl=500.0\n",
- "Vi=22.0\n",
- "Vpi=1.414*Vi\n",
- "\n",
- "#Calculations\n",
- "Vpo=Vpi-Vf\n",
- "print(\" peak vouput voltage is %3.2fV \" %Vpo)\n",
- "Ip=Vpo/Rl\n",
- "\n",
- "#Results\n",
- "print(\"peak load current is %3.4fA \" %Ip)\n",
- "PIV=Vpi\n",
- "print(\"diode paek reverse voltage %3.2fV \" %PIV)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " peak vouput voltage is 30.41V \n",
- "peak load current is 0.0608A \n",
- "diode paek reverse voltage 31.11V \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.2, Page No 79"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vi=30.0\n",
- "Rl=300.0\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "Vpi=1.414*Vi\n",
- "Vpo=Vpi-2*Vf\n",
- "print(\" peak output voltage %.3f V \" %Vpo)\n",
- "Ip=Vpo/Rl\n",
- "\n",
- "#Results\n",
- "print(\" current bridge is %.1f mA \" %(Ip*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " peak output voltage 41.020 V \n",
- " current bridge is 136.7 mA \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.3 Page No 83"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "C1=680.0*10**-6\n",
- "Eo=28.0\n",
- "Rl=200.0\n",
- "f=60.0\n",
- "\n",
- "#Calculations\n",
- "Il=Eo/Rl\n",
- "T=1/f\n",
- "t1=T\n",
- "Vr=(Il*t1)/C1\n",
- "\n",
- "#Results\n",
- "print(\"peak to peak ripple voltage is %.2f V \" %Vr)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "peak to peak ripple voltage is 3.43 V \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.4, Page No 84"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Eo=20.0\n",
- "Rl=500.0\n",
- "f=60.0\n",
- "\n",
- "#Calculations\n",
- "Vr=(10*Eo)/100#10% of Eo\n",
- "Il=Eo/Rl\n",
- "T=1/f\n",
- "t1=T\n",
- "C1=((Il*t1)/Vr)*10**6\n",
- "\n",
- "#Results\n",
- "print(\"Reservior capacitance is %.2f uF \" %C1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Reservior capacitance is 333.33 uF \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.5 Page No 85"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Eo=20.0\n",
- "f=60.0\n",
- "Rl=500.0\n",
- "Il=Eo/Rl\n",
- "\n",
- "#Calculations\n",
- "Vr=(10.0*Eo)/100\n",
- "print(\"10percent of Eo is %.2f V \" %Vr)\n",
- "Eomin=Eo-0.5*Vr\n",
- "Eomax=Eo+0.5*Vr\n",
- "Q1=math.asin(Eomin/Eomax)\n",
- "Q1=65\n",
- "Q2=90-Q1\n",
- "T=1/f\n",
- "t2=(Q2*T)/360\n",
- "print(\" charging time is %.2fs \" %t2)\n",
- "t1=T-t2\n",
- "print(\"discharging time is %.2fs \" %t1)\n",
- "C1=((Il*t1)/Vr)*10**6\n",
- "\n",
- "#Results\n",
- "print(\"reservior capacitance is %.2f uF \" %C1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10percent of Eo is 2.00 V \n",
- " charging time is 0.00s \n",
- "discharging time is 0.02s \n",
- "reservior capacitance is 310.19 uF \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.6 Page No 88"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Eo=21.0\n",
- "Vf=0.7\n",
- "\n",
- "#Calculations\n",
- "t1=1.16*10**-3\n",
- "t2=15.54*10**-3\n",
- "Vp=Eo+Vf\n",
- "Vr=2*Vp\n",
- "Il=40*10**-4\n",
- "Ifrm=(Il*(t1+t2))/t2\n",
- "Ifsm=30.0\n",
- "Rs=Vp/Ifsm\n",
- "\n",
- "#Results\n",
- "print(\" surge limiting resistance is %3.2fohm \" %Rs)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " surge limiting resistance is 0.72ohm \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.7, Page No 89 "
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vf=.7\n",
- "Eo=21.0\n",
- "\n",
- "#Calculations\n",
- "Il=40*10**-3\n",
- "Vp=115.0\n",
- "Vs=.707*(Vf+Eo)\n",
- "print(\" Vrms voltage is %3.3fV \" %Vs)\n",
- "Is=3.6*Il\n",
- "print(\" rms current is %.2f mA \" %(Is*1000))\n",
- "Ip=(Vs*Is)/Vp\n",
- "\n",
- "#Results\n",
- "print(\"primary current is %.2f mA \" %(Ip*1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Vrms voltage is 15.342V \n",
- " rms current is 144.00 mA \n",
- "primary current is 19.21 mA \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.8 Page No 92"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Vr=2.0\n",
- "T=16.7*10**-3\n",
- "t2=1.16*10**-3\n",
- "\n",
- "#Calculations\n",
- "Il=40.0*10**-3#from example 3.5\n",
- "t1=(T/2.0)-t2\n",
- "C1=(Il*t1)/Vr\n",
- "\n",
- "#Results\n",
- "print(\" resrvior capacitor is %.2f mF \" %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " resrvior capacitor is 143.80 mF \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.9 Page No 93"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vr=2.0\n",
- "T=16.7*10**-3\n",
- "Il=40.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "t1=T/2\n",
- "C1=(Il*t1)/Vr\n",
- "\n",
- "#Results\n",
- "print(\" reservior capacitance is %.1fF \" %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " reservior capacitance is 167.0F \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.10 Page No 93"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Eo=21.0\n",
- "Vf=0.7\n",
- "Il=40.0*10**-3\n",
- "t1=7.19*10**-3\n",
- "t2=1.16*10**-3\n",
- "\n",
- "#Calculations\n",
- "Vp=Eo+(2*Vf)\n",
- "Vr=Vp\n",
- "If=Il/2\n",
- "Ifrm=Il*(t1+t2)/t2\n",
- "Ifsm=30\n",
- "Rs=Vp/Ifsm\n",
- "\n",
- "#Results\n",
- "print(\"surge limiting resistance is %.3fohm \" %Rs)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "surge limiting resistance is 0.747ohm \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.11, Page No 93"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Eo=21.0\n",
- "Vf=0.7\n",
- "Il=40*10**-3\n",
- "Vp=115.0\n",
- "\n",
- "#Calculations\n",
- "Vs=0.707*(Eo+2*Vf)\n",
- "Is=1.6*Il\n",
- "Ip=(Vs*Is)/Vp\n",
- "\n",
- "#Results\n",
- "print(\" supply current is %.1f mA \" %(Ip*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " supply current is 8.8 mA \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.12, Page No 97"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Eo=20.0\n",
- "Il=40.0*10**-3\n",
- "R1=22.0\n",
- "Vr=2.0\n",
- "C1=150*10**-6\n",
- "C2=C1\n",
- "fr=120\n",
- "\n",
- "#Calculations\n",
- "Vo=Eo-Il*R1\n",
- "vi=Vr/3.14\n",
- "Xc2=1/(2*3.14*fr*C2)\n",
- "vo=(vi*Xc2)/math.sqrt((R1**2) + (Xc2**2))\n",
- "print(\" dc output voltage is %.3fV \" %vo)\n",
- "Vpp=2*vo\n",
- "\n",
- "#Results\n",
- "print(\" peak to peak voltage is %.1fV \" %(Vpp*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " dc output voltage is 0.238V \n",
- " peak to peak voltage is 475.3V \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.13, Page No 98"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "C1=150*10**-6\n",
- "C2=C1\n",
- "vi=4.0\n",
- "vo=1.0\n",
- "f=120.0\n",
- "\n",
- "#Calculations\n",
- "Xc2=8.84 #FROM EXAMPLE 3.12\n",
- "Xl=Xc2*((vi/vo)+1)\n",
- "L1=Xl/(2*3.14*f)\n",
- "\n",
- "#Results\n",
- "print(\" suitable value of L1 is %.3fH \" %(L1*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable value of L1 is 58.652H \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.14, Page No 101"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Edc=20.0\n",
- "vo=0.24\n",
- "Vo=20.0\n",
- "Il=40*10**-3\n",
- "fr=120.0\n",
- "\n",
- "#Calculations\n",
- "Eomax=(3.14*Edc)/2\n",
- "Epeak=(4*Eomax)/(3*3.14)\n",
- "vi=Epeak\n",
- "Rl=Vo/Il\n",
- "Xlc=(2*Rl)/3\n",
- "Lc=Xlc/(2*3.14*fr)\n",
- "L=1.25*Lc\n",
- "Xl=2*3.14*fr*L\n",
- "Xc=Xl/((vi/vo)+1)\n",
- "C1=1/(2*3.14*fr*Xc)\n",
- "\n",
- "#Results\n",
- "print(\"The value of c1 = %.2f mF \" %(C1*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of c1 = 180.11 mF \n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.15, Page No 105"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Eo=20.0\n",
- "E0=20-19.7 #load effect\n",
- "\n",
- "#Calculations\n",
- "loadregulation =(E0*100)/Eo#percentage\n",
- "sourceeffect=20.2-20\n",
- "lineregulation =(sourceeffect*100)/Eo\n",
- "\n",
- "#Results\n",
- "print(\"Line regulation = %.1f percent \" %lineregulation)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Line regulation = 1.0 percent \n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.16, Page No 108"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vz=9.1\n",
- "Izt=20*10**-3\n",
- "Es=30.0\n",
- "\n",
- "#Calculations\n",
- "R1=(Es-Vz)/Izt\n",
- "Pr1=(Izt**2)*R1\n",
- "Es=27\n",
- "Iz=(Es-Vz)/R1\n",
- "\n",
- "#Results\n",
- "print(\"The circuit current is %.2f mA \" %(Iz*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The circuit current is 17.13 mA \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.17, Page No 110"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vz=6.2\n",
- "Pd=400.0*10**-3\n",
- "Es=16.0\n",
- "\n",
- "#Calculations\n",
- "Izm=Pd/Vz\n",
- "R1=(Es-Vz)/Izm\n",
- "Pr1=(Izm**2)*R1\n",
- "Izmin=5.0*10**-3\n",
- "Izmax=Izm-Izmin\n",
- "\n",
- "#Results\n",
- "print(\"maximum current is %3.2f mA \" %(Izmax*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "maximum current is 59.52 mA \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.18, Page No 112"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Zz=7.0\n",
- "Es=16.0\n",
- "Vo=6.2\n",
- "Il=59.5*10**-3\n",
- "\n",
- "#Calculations\n",
- "es=(10*Es)/100.0 #10% os Es\n",
- "Rl=Vo/Il\n",
- "print(\"es*Zz||Rl/R1+Zz||Rl\")\n",
- "V0=es*((Zz*Rl)/(Zz+Rl))/(R1+((Zz*Rl)/(Zz+Rl)))\n",
- "lineregulation=(V0*100)/Vo\n",
- "print(\"line regulation voltage is %3.3fpercentage \" %lineregulation)\n",
- "V0=Il*((Zz*R1)/(Zz+R1))\n",
- "loadregulation=(V0*100)/Vo\n",
- "print(\"loadregulation voltage is %3.3fpercentage \" %loadregulation)\n",
- "Rr=((Zz*Rl)/(Zz+Rl))/(R1+(Zz*Rl)/(Zz+Rl))\n",
- "\n",
- "#Results\n",
- "print(\"ripple rejection is %3.2f X 10^-2 \" %(Rr*10**2))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "es*Zz||Rl/R1+Zz||Rl\n",
- "line regulation voltage is 1.068percentage \n",
- "loadregulation voltage is 6.422percentage \n",
- "ripple rejection is 4.14 X 10^-2 \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.19, Page No 114"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "E=9.0\n",
- "Vf=.7\n",
- "\n",
- "#Calculations\n",
- "If=1.0*10**-3\n",
- "Vo=E-Vf\n",
- "R1=Vo/If\n",
- "Vr=E\n",
- "\n",
- "#Results\n",
- "print(\"diode forward voltage is %3.2fohm \" %Vr)\n",
- "print(\"diode forward current is %3.1fA \" %(If*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "diode forward voltage is 9.00ohm \n",
- "diode forward current is 1.0A \n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.20, Page No 117"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=5.0\n",
- "Vo=4.5\n",
- "Il=2.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "R1=(E-Vo)/Il\n",
- "print(\" suitable resistance is %dohm \" %R1)\n",
- "Vr=E\n",
- "print(\"when diode is forward baised\")\n",
- "If=(E-Vf)/R1\n",
- "\n",
- "#Results\n",
- "print(\" diode forward current is %3.2fA \" %(If*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable resistance is 250ohm \n",
- "when diode is forward baised\n",
- " diode forward current is 17.20A \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.21, Page No 119"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vo=2.7\n",
- "Vf=.7\n",
- "E=9.0\n",
- "If=1*10**-3\n",
- "\n",
- "#Calculations\n",
- "Il=If\n",
- "Vb=Vo-Vf\n",
- "R1=(E-Vo)/(Il+If)\n",
- "\n",
- "#Results\n",
- "print(\"resistance is %.2f kOhm \" %(R1/10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "resistance is 3.15 kOhm \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.22, Page No 120"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vo=5.0\n",
- "Vf=0.7\n",
- "Iz=5.0\n",
- "Il=1.0\n",
- "E=20.0\n",
- "\n",
- "#Calculations\n",
- "Vz=Vo-Vf\n",
- "R1=(E-Vo)/(Il+Iz)\n",
- "\n",
- "#Results\n",
- "print(\"zener diode resistance si %.2f ohm \" %R1)\n",
- "#Answer in the book is wrong"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "zener diode resistance si 2.50 ohm \n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.23, Page No 122"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=10.0\n",
- "R1=56.0*10**3\n",
- "f=1000.0\n",
- "C1=1.0*10**-6\n",
- "\n",
- "#Calculations\n",
- "Vo=2*E\n",
- "Ic=Vo/R1\n",
- "t=1/(2*f)\n",
- "Vc=(Ic*t)/C1\n",
- "\n",
- "#Results\n",
- "print(\" tilt output voltage is %3.2fV \" %(Vc*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " tilt output voltage is 178.57V \n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.24, Page No 124"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f=500.0\n",
- "Rs=600.0\n",
- "E=8.0\n",
- "\n",
- "#Calculations\n",
- "t=1.0/(2*f)\n",
- "PW=t\n",
- "C1=PW/Rs\n",
- "Vo=2.0*E\n",
- "Vc=(1*Vo)/100#1% of the Vo\n",
- "Ic=(Vc*C1)/t\n",
- "R1=(2*E)/(Ic*1000)\n",
- "\n",
- "#Results\n",
- "print(\"suitable value of R1 is %.2f ohm \" %R1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "suitable value of R1 is 60.00 ohm \n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.25, Page No 125"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vf=0.7\n",
- "E=6.0\n",
- "Vb1=3.0\n",
- "\n",
- "#Calculations\n",
- "Vc=Vb1-Vf-(-E)\n",
- "Vo=Vb1-Vf\n",
- "print(\"when input is -E\")\n",
- "Vo=E+Vc\n",
- "Vo=Vb1+Vf\n",
- "print(\"Capicitor voltage is %.2f ohm \" %Vc)\n",
- "print(\"when input is +E\")\n",
- "Vo=E+(Vc)\n",
- "\n",
- "#Results\n",
- "print(\"Capicitor voltage is %.2f ohm \" %Vo)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when input is -E\n",
- "Capicitor voltage is 8.30 ohm \n",
- "when input is +E\n",
- "Capicitor voltage is 14.30 ohm \n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.26, Page No 130"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "E=12.0\n",
- "Vf=0.7\n",
- "Rl=47*10**3\n",
- "f=5000.0\n",
- "\n",
- "#Calculations\n",
- "Vo=2*(E-Vf)\n",
- "Il=Vo/Rl\n",
- "print(\" capacitor discharge time\")\n",
- "t=1.0/(2*f)\n",
- "print(\" for 1% ripple allow .5% due to discharge of C2 %.5%due to discharge of C1\")\n",
- "Vc=(.5*Vo)/100\n",
- "C2=((Il*t)/Vc)*10**6\n",
- "print(\" value of capacitor C2 is %3.2fuF \" %C2)\n",
- "C1=2*C2\n",
- "\n",
- "#Results\n",
- "print(\"value of capacitor C1 is %3.2fuF \" %C1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " capacitor discharge time\n",
- " for 1% ripple allow .5% due to discharge of C2 %.5%due to discharge of C1\n",
- " value of capacitor C2 is 0.43uF \n",
- "value of capacitor C1 is 0.85uF \n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.27, Page No 133"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Vcc=5.0\n",
- "Vf=.7\n",
- "R1=3.3*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\"A)\")\n",
- "Ir1=(Vcc-Vf)/R1\n",
- "print(\"diode forward current when all input are low is %3.4fA \" %Ir1)\n",
- "print(\"for each diode\")\n",
- "If=Ir1/3\n",
- "print(\"B)\")\n",
- "If2=Ir1/2\n",
- "If3=If2\n",
- "print(\" forward current when input A is high is %3.5fA \" %If3)\n",
- "print(\"C)\")\n",
- "If3=Ir1\n",
- "\n",
- "#Results\n",
- "print(\" forward current when input A and B are high and C is low %3.2fA \" %(If3*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "A)\n",
- "diode forward current when all input are low is 0.0013A \n",
- "for each diode\n",
- "B)\n",
- " forward current when input A is high is 0.00065A \n",
- "C)\n",
- " forward current when input A and B are high and C is low 1.30A \n"
- ]
- }
- ],
- "prompt_number": 27
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter4_1.ipynb b/Electronic_Devices_and_Circuits/Chapter4_1.ipynb deleted file mode 100755 index eb199d80..00000000 --- a/Electronic_Devices_and_Circuits/Chapter4_1.ipynb +++ /dev/null @@ -1,237 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 04 : Bipolar junction transistors"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.1, Page No 153"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Adc=.98\n",
- "Ib=100*10**-6\n",
- "\n",
- "#Calculations\n",
- "Ic=(Adc*Ib)/(1-Adc)\n",
- "print(\"value of Ic is %3.3fA \" %Ic)\n",
- "Ie=Ic/Adc\n",
- "\n",
- "#Results\n",
- "print(\" value of Ie is %3.3fA \" %Ie)\n",
- "Bdc=Adc/(1-Adc)\n",
- "print(\"The value of Bdc = %.2f \" %Bdc) "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "value of Ic is 0.005A \n",
- " value of Ie is 0.005A \n",
- "The value of Bdc = 49.00 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.2, Page No 153"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Ic=1.0*10**-3\n",
- "Ib=25.0*10**-6\n",
- "\n",
- "#Calculations\n",
- "Bdc=Ic/Ib\n",
- "Ie=Ic+Ib\n",
- "Adc=Ic/Ie\n",
- "Ic=5\n",
- "Ib=Ic/Bdc\n",
- "\n",
- "print(\"The new base current = %.2f mA\" %(Ib*10**3)) "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The new base current = 125.00 mA\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.3 Page No 157"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Bdc=80.0\n",
- "Bac=Bdc\n",
- "Vcc=18.0\n",
- "R1=10.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ib=15.0*10**-6#for Vb=.7\n",
- "Ic=Bdc*Ib\n",
- "Vc=Vcc-(Ic*R1)\n",
- "\n",
- "#Results\n",
- "print(\"dc collector voltage is %dV \" %Vc)\n",
- "print(\" when vi=50mV\")\n",
- "Ib=3.0*10**-6\n",
- "Vi=50.0*10**-3\n",
- "Ic=Bdc*Ib\n",
- "Vo=Ic*R1\n",
- "Av=Vo/Vi\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "dc collector voltage is 6V \n",
- " when vi=50mV\n",
- "Current voltage is 48.0 V \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.4, Page No 160"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=5.0\n",
- "Vce=.2\n",
- "R2=4.7*10**3\n",
- "Vi=2\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "R1=12.0*10**3\n",
- "Ic=(Vcc-Vce)/R2\n",
- "Ib=(Vi-Vbe)/R1\n",
- "hFE=Ic/Ib\n",
- "\n",
- "#Results\n",
- "print(\"Transistor current gain is %.2f V \" %(hFE))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Transistor current gain is 9.43 V \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.6 Page No 169"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vbe=.7\n",
- "Vce=-6\n",
- "\n",
- "#Calculations\n",
- "Ib=20.0*10**-6\n",
- "Ic=2.5*10**-3#from output characteristics\n",
- "Bdc=Ic/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Bdc is %.1f V \" %Bdc)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Bdc is 125.0 V \n"
- ]
- }
- ],
- "prompt_number": 5
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter4_2.ipynb b/Electronic_Devices_and_Circuits/Chapter4_2.ipynb deleted file mode 100755 index eb199d80..00000000 --- a/Electronic_Devices_and_Circuits/Chapter4_2.ipynb +++ /dev/null @@ -1,237 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 04 : Bipolar junction transistors"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.1, Page No 153"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Adc=.98\n",
- "Ib=100*10**-6\n",
- "\n",
- "#Calculations\n",
- "Ic=(Adc*Ib)/(1-Adc)\n",
- "print(\"value of Ic is %3.3fA \" %Ic)\n",
- "Ie=Ic/Adc\n",
- "\n",
- "#Results\n",
- "print(\" value of Ie is %3.3fA \" %Ie)\n",
- "Bdc=Adc/(1-Adc)\n",
- "print(\"The value of Bdc = %.2f \" %Bdc) "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "value of Ic is 0.005A \n",
- " value of Ie is 0.005A \n",
- "The value of Bdc = 49.00 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.2, Page No 153"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Ic=1.0*10**-3\n",
- "Ib=25.0*10**-6\n",
- "\n",
- "#Calculations\n",
- "Bdc=Ic/Ib\n",
- "Ie=Ic+Ib\n",
- "Adc=Ic/Ie\n",
- "Ic=5\n",
- "Ib=Ic/Bdc\n",
- "\n",
- "print(\"The new base current = %.2f mA\" %(Ib*10**3)) "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The new base current = 125.00 mA\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.3 Page No 157"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Bdc=80.0\n",
- "Bac=Bdc\n",
- "Vcc=18.0\n",
- "R1=10.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ib=15.0*10**-6#for Vb=.7\n",
- "Ic=Bdc*Ib\n",
- "Vc=Vcc-(Ic*R1)\n",
- "\n",
- "#Results\n",
- "print(\"dc collector voltage is %dV \" %Vc)\n",
- "print(\" when vi=50mV\")\n",
- "Ib=3.0*10**-6\n",
- "Vi=50.0*10**-3\n",
- "Ic=Bdc*Ib\n",
- "Vo=Ic*R1\n",
- "Av=Vo/Vi\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Av))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "dc collector voltage is 6V \n",
- " when vi=50mV\n",
- "Current voltage is 48.0 V \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.4, Page No 160"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=5.0\n",
- "Vce=.2\n",
- "R2=4.7*10**3\n",
- "Vi=2\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "R1=12.0*10**3\n",
- "Ic=(Vcc-Vce)/R2\n",
- "Ib=(Vi-Vbe)/R1\n",
- "hFE=Ic/Ib\n",
- "\n",
- "#Results\n",
- "print(\"Transistor current gain is %.2f V \" %(hFE))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Transistor current gain is 9.43 V \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4.6 Page No 169"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vbe=.7\n",
- "Vce=-6\n",
- "\n",
- "#Calculations\n",
- "Ib=20.0*10**-6\n",
- "Ic=2.5*10**-3#from output characteristics\n",
- "Bdc=Ic/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Bdc is %.1f V \" %Bdc)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Bdc is 125.0 V \n"
- ]
- }
- ],
- "prompt_number": 5
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter5_1.ipynb b/Electronic_Devices_and_Circuits/Chapter5_1.ipynb deleted file mode 100755 index 07d0da6b..00000000 --- a/Electronic_Devices_and_Circuits/Chapter5_1.ipynb +++ /dev/null @@ -1,1022 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 05 : BJT biasing"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.1, Page No 182"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rc=12.0*10**3\n",
- "Vcc=20.0\n",
- "print(\" When Ic=0\")\n",
- "Ic=0\n",
- "\n",
- "#Calculations\n",
- "Vce=Vcc-Ic*Rc\n",
- "print(\" At point A Ic=0 nad Vce=20\")\n",
- "print(\"When Vce=0\")\n",
- "Vce=0\n",
- "Ic=Vcc/Rc\n",
- "\n",
- "#Results\n",
- "print(\" At point B Ic=1.7mA and Vce=0\")\n",
- "print(\"Ic is %.1f mA \" %(Ic*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " When Ic=0\n",
- " At point A Ic=0 nad Vce=20\n",
- "When Vce=0\n",
- " At point B Ic=1.7mA and Vce=0\n",
- "Ic is 1.7 mA \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.2 Page No 186"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vcc=18.0\n",
- "Rc=2.2*10**3\n",
- "Ib=40.0*10**-6\n",
- "\n",
- "#Calculations\n",
- "print(\"when Ic=0\")\n",
- "Ic=0\n",
- "Vce=Vcc-Ic*Rc\n",
- "print(\"At point A Ic=0 and Vce=18\")\n",
- "print(\"when Vce=0\")\n",
- "Ic=Vcc/Rc\n",
- "\n",
- "#Results\n",
- "print(\" at point B Ic=8.2mA and Vce=0\")\n",
- "print(\"Ic = %.1f mA \" %(Ic*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Ic=0\n",
- "At point A Ic=0 and Vce=18\n",
- "when Vce=0\n",
- " at point B Ic=8.2mA and Vce=0\n",
- "Ic = 8.2 mA \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.3 Page No 189"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Rb=470*10**3\n",
- "Rc=2.2*10**3\n",
- "Vcc=18.0\n",
- "hfe=100\n",
- "Vee=.7\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vcc-Vee)/Rb\n",
- "Ic=hfe*Ib\n",
- "Vce=Vcc-Ic*Rc\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 9.9 V \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.4, Page No 189"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hFEmin=50.0\n",
- "hFEmax=200.0\n",
- "Vcc=18.0\n",
- "Vbe=0.7\n",
- "Rb=470.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vcc-Vbe)/Rb\n",
- "Ic=hFEmin*Ib\n",
- "Vce=Vcc-Ic*Rc\n",
- "Ic=hFEmax*Ib\n",
- "Vce=Vcc-Ic*Rc\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 1.8 V \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.5 Page No 193"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Rb=270*10**3\n",
- "Rc=2.2*10**3\n",
- "Vcc=18.0\n",
- "hFE=100\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vcc-Vbe)/(Rb+Rc*(hFE+1))\n",
- "Ic=hFE*Ib\n",
- "Vce=Vcc-Rc*(Ic+Ib)\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 10.2 V \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.7 Page No 197"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "R1=33.0*10**3\n",
- "R2=12.0*10**3\n",
- "Rc=1.2*10**3\n",
- "Re=1*10**3\n",
- "Vcc=18.0\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Vb=(Vcc*R2)/(R1+R2)\n",
- "Ve=Vb-Vbe\n",
- "Ie=(Vb-Vbe)/Re\n",
- "Ic=Ie\n",
- "Vc=Vcc-(Ic*Rc)\n",
- "Vce=Vc-Ve\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 9.0 V \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.8, Page No 199"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=18.0\n",
- "Vbe=.7\n",
- "hfe=100.0\n",
- "R1=33*10**3\n",
- "R2=12.0*10**3\n",
- "Re=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Vt=(Vcc*R2)/(R1+R2)\n",
- "Rt=(R1*R2)/(R1+R2)\n",
- "Ib=(Vt-Vbe)/(Rt+Re*(1+hfe))\n",
- "Ic=hfe*Ib\n",
- "Ie=Ib+Ic\n",
- "Ve=Ie*Re\n",
- "Vc=Vcc-(Ic*Rc)\n",
- "Vce=Vc-Ve\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 9.7 V \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.9 Page No 200"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "hfe=50.0\n",
- "Vt=4.8\n",
- "Rt=8.8*10**3#from example 5.7\n",
- "Re=1.0*10**3\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vt-Vbe)/(Rt+Re*(1+hfe))\n",
- "Ic=hfe*Ib\n",
- "Ie=Ib+Ic\n",
- "Ve=Ie*Re\n",
- "Vc=Vcc-(Ic*Rc)\n",
- "Vce=Vc-Ve\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 10.4 V \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.10 Page No 201"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vt=4.8\n",
- "Rt=8.8*10**3#from example 5.8\n",
- "Re=1*10**3\n",
- "Vbe=.7\n",
- "hfe=200.0\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vt-Vbe)/(Rt+Re*(1+hfe))\n",
- "Ic=hfe*Ib\n",
- "Ie=Ib+Ic\n",
- "Ve=Ie*Re\n",
- "Vc=Vcc-(Ic*Rc)\n",
- "Vce=Vc-Ve\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 9.4 V \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.11 Page No 208"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vce=5.0\n",
- "Ic=5*10**-3\n",
- "Vcc=15.0\n",
- "hfe=100.0\n",
- "\n",
- "#Calculations\n",
- "Rc=(Vcc-Vce)/Ic\n",
- "Ib=Ic/hfe\n",
- "Rb=(Vcc-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rv is %.1f kohm \" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rv is 286.0 kohm \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.12, Page No 209"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vce=5.0\n",
- "Ic=5*10**-3\n",
- "Vcc=15.0\n",
- "hfe=100.0\n",
- "\n",
- "#Calculations\n",
- "Ib=Ic/hfe\n",
- "Rc=(Vcc-Vce)/(Ic+Ib)\n",
- "Rb=(Vce-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.1f kohm \" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 86.0 kohm \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.13, Page No 211"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vce=5.0\n",
- "Ve=Vce\n",
- "Ic=5.0*10**-3\n",
- "hFE=100.0\n",
- "Vcc=15.0\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "Re=Ve/Ie\n",
- "Rc=(Vcc-Vce-Ve)/Ic\n",
- "I2=Ic/10\n",
- "Vb=Ve+Vbe\n",
- "R2=Vb/I2\n",
- "R1=(Vcc-Vb)/I2\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.1f kOhm \" %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 18.6 kOhm \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.14, Page No 212"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vce=3.0\n",
- "Ve=5.0\n",
- "Ic=1*10**-3\n",
- "Vcc=12.0\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "R4=Ve/Ie\n",
- "print(\" with Ic=1mA and R4=4.7Kohm\")\n",
- "R4=4.7*10**3\n",
- "Ve=Ic*R4\n",
- "Vc=Ve+Vce\n",
- "Vr3=Vcc-Vc\n",
- "R3=Vr3/Ic\n",
- "Vb=Ve+Vbe\n",
- "I2=Ic/10\n",
- "R2=Vb/I2\n",
- "print(\" with R2=56Kohm and Vb=5.4V\")\n",
- "R2=56*10**3\n",
- "I2=Vb/R2\n",
- "R1=(Vcc-Vb)/I2\n",
- "\n",
- "#Results\n",
- "print(\"The value of R1 is %.1f V \" %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " with Ic=1mA and R4=4.7Kohm\n",
- " with R2=56Kohm and Vb=5.4V\n",
- "The value of R1 is 68.4 V \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.15, Page No 214"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vce=9.0\n",
- "Ve=4.0\n",
- "Ic=4*10**-3\n",
- "Vcc=18.0\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "R4=Ve/Ie\n",
- "Vb=Ve+Vbe\n",
- "I2=Ic/10\n",
- "R2=Vb/I2\n",
- "print(\" with R2=12Kohm standard\")\n",
- "R2=12*10**3\n",
- "I2=Vb/R2\n",
- "R1=(Vce+Ve-Vb)/I2\n",
- "print(\" with R1=22kohm standard\")\n",
- "R1=22*10**3\n",
- "Vr3=Vcc-Vce-Ve\n",
- "R3=Vr3/(Ic+I2)\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 %.2f V \" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " with R2=12Kohm standard\n",
- " with R1=22kohm standard\n",
- "The value of R3 1.14 V \n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.16, Page No 216"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vc=5.0\n",
- "Ic=1.0*10**-3\n",
- "hFE=70.0\n",
- "Vbe=.7\n",
- "Vee=9.0\n",
- "Vcc=Vee\n",
- "Re=8.2*10**3\n",
- "\n",
- "#Calculations\n",
- "Ve=Vee-Vbe\n",
- "Ie=Ic\n",
- "R3=Ve/Ie\n",
- "print(\" with R3=8.2kohm standard value\")\n",
- "R3=8.2*10**3\n",
- "Ie=Ve/R3\n",
- "Vr2=Vcc-Vc\n",
- "R2=Vr2/Ic\n",
- "Ib=Ic/hFE\n",
- "Vr1=Vbe/10\n",
- "R1=Vr1/Ib\n",
- "print(\" use 4.7Kohm as standard\")\n",
- "#the transistor emitter terminal is .7 below ground and voltage across Re is\n",
- "Ve=Vee-Vbe\n",
- "Ie=Ve/Re\n",
- "Vc=Vcc-(Ie*3.9*10**3)\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vc))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " with R3=8.2kohm standard value\n",
- " use 4.7Kohm as standard\n",
- "Current voltage is 5.1 V \n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.17, Page No 220"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hFE=100.0\n",
- "Rc=2.2*10**3\n",
- "Rb=270.0*10**3\n",
- "Re=1.0*10**3\n",
- "R1=33.0*10**3\n",
- "R2=12*10**3\n",
- "\n",
- "#Calculations\n",
- "S=1+hFE\n",
- "print(\"for collector to base bias\")\n",
- "S=(1+hFE)/(1+(hFE*Rc)/(Rc+Rb))\n",
- "print(\" for voltage divider bias\")\n",
- "print(\"S=(1+hFE)/(1+hFE*Re(Re+R1||R2))\")\n",
- "S=(1+hFE)/(1+(hFE*Re)/(Re+(R1*R2)/(R1+R2)))\n",
- "\n",
- "#Results\n",
- "print(\"Voltage-divider bias is %.2f \" %(S))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "for collector to base bias\n",
- " for voltage divider bias\n",
- "S=(1+hFE)/(1+hFE*Re(Re+R1||R2))\n",
- "Voltage-divider bias is 9.01 \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.18, Page No 221"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Icbo1=15.0*10**-9# at 25C\n",
- "S=101.0\n",
- "print(\"chnage in temp\")\n",
- "T=105-25\n",
- "print(\" n=T in 10 step\")\n",
- "n=T/10.0\n",
- "\n",
- "#Calculations\n",
- "Icbo2=Icbo1*2**n\n",
- "Icbo=Icbo2-Icbo1\n",
- "print(\" for base bais\")\n",
- "Ic=S*Icbo\n",
- "print(\" for collector to base bais\")\n",
- "S=56\n",
- "Ic=S*Icbo\n",
- "print(\" for voltage divider bais\")\n",
- "S=8.2\n",
- "Ic=S*Icbo\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ic is %.1f mA \" %(Ic*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "chnage in temp\n",
- " n=T in 10 step\n",
- " for base bais\n",
- " for collector to base bais\n",
- " for voltage divider bais\n",
- "The value of Ic is 31.4 mA \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.19, Page No 223"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Re=4.7*10**3\n",
- "T=125-25\n",
- "\n",
- "#Calculations\n",
- "Vbe=T*(1.8*10**-3)\n",
- "Ie=Vbe/Re\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ie is %.1f V \" %(Ie*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Ie is 38.3 V \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.20, Page No 223"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=10.0\n",
- "Rc=1.0*10**3\n",
- "Rb=6.8*10**3\n",
- "Vs=5.0\n",
- "\n",
- "#Calculations\n",
- "print(\" hFE calculation\")\n",
- "Ic=Vcc/Rc\n",
- "Ib=(Vs-Vbe)/Rb\n",
- "hFE=Ic/Ib\n",
- "print(\"when hFE=10\")\n",
- "hFE=10\n",
- "Ic=hFE*Ib\n",
- "Vce=Vcc-(Ic*Rc)\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " hFE calculation\n",
- "when hFE=10\n",
- "Current voltage is 2.9 V \n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.21, Page No 227"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#initialisation of variables\n",
- "Vcc=15.0\n",
- "Rc=3.3*10**3\n",
- "Vbe=.7\n",
- "Rb=56.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ic=Vcc/Rc\n",
- "Ib=(Vcc-Vbe)/Rb\n",
- "hFE=Ic/Ib\n",
- "\n",
- "#Results\n",
- "print(\" minimum hFE is %3.2f \" %hFE)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " minimum hFE is 17.80 \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.22, Page No 229"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#initialisation of variables\n",
- "Vcc=12.0\n",
- "Ic=1.5*10**-3\n",
- "Vs=5.0\n",
- "hFE=10.0\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Rc=Vcc/Ic\n",
- "Ib=Ic/hFE\n",
- "Rb=(Vs-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.1f kohm \" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 28.7 kohm \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.23, Page No 229"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Calculations\n",
- "Vcc=9.0\n",
- "Ic=2*10**-3\n",
- "hFE=10.0\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Rc=Vcc/Ic\n",
- "Ib=Ic/hFE\n",
- "Rb=(Vcc-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.2f kohm \" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 41.50 kohm \n"
- ]
- }
- ],
- "prompt_number": 22
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter5_2.ipynb b/Electronic_Devices_and_Circuits/Chapter5_2.ipynb deleted file mode 100755 index 07d0da6b..00000000 --- a/Electronic_Devices_and_Circuits/Chapter5_2.ipynb +++ /dev/null @@ -1,1022 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 05 : BJT biasing"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.1, Page No 182"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rc=12.0*10**3\n",
- "Vcc=20.0\n",
- "print(\" When Ic=0\")\n",
- "Ic=0\n",
- "\n",
- "#Calculations\n",
- "Vce=Vcc-Ic*Rc\n",
- "print(\" At point A Ic=0 nad Vce=20\")\n",
- "print(\"When Vce=0\")\n",
- "Vce=0\n",
- "Ic=Vcc/Rc\n",
- "\n",
- "#Results\n",
- "print(\" At point B Ic=1.7mA and Vce=0\")\n",
- "print(\"Ic is %.1f mA \" %(Ic*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " When Ic=0\n",
- " At point A Ic=0 nad Vce=20\n",
- "When Vce=0\n",
- " At point B Ic=1.7mA and Vce=0\n",
- "Ic is 1.7 mA \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.2 Page No 186"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vcc=18.0\n",
- "Rc=2.2*10**3\n",
- "Ib=40.0*10**-6\n",
- "\n",
- "#Calculations\n",
- "print(\"when Ic=0\")\n",
- "Ic=0\n",
- "Vce=Vcc-Ic*Rc\n",
- "print(\"At point A Ic=0 and Vce=18\")\n",
- "print(\"when Vce=0\")\n",
- "Ic=Vcc/Rc\n",
- "\n",
- "#Results\n",
- "print(\" at point B Ic=8.2mA and Vce=0\")\n",
- "print(\"Ic = %.1f mA \" %(Ic*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "when Ic=0\n",
- "At point A Ic=0 and Vce=18\n",
- "when Vce=0\n",
- " at point B Ic=8.2mA and Vce=0\n",
- "Ic = 8.2 mA \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.3 Page No 189"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Rb=470*10**3\n",
- "Rc=2.2*10**3\n",
- "Vcc=18.0\n",
- "hfe=100\n",
- "Vee=.7\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vcc-Vee)/Rb\n",
- "Ic=hfe*Ib\n",
- "Vce=Vcc-Ic*Rc\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 9.9 V \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.4, Page No 189"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hFEmin=50.0\n",
- "hFEmax=200.0\n",
- "Vcc=18.0\n",
- "Vbe=0.7\n",
- "Rb=470.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vcc-Vbe)/Rb\n",
- "Ic=hFEmin*Ib\n",
- "Vce=Vcc-Ic*Rc\n",
- "Ic=hFEmax*Ib\n",
- "Vce=Vcc-Ic*Rc\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 1.8 V \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.5 Page No 193"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Rb=270*10**3\n",
- "Rc=2.2*10**3\n",
- "Vcc=18.0\n",
- "hFE=100\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vcc-Vbe)/(Rb+Rc*(hFE+1))\n",
- "Ic=hFE*Ib\n",
- "Vce=Vcc-Rc*(Ic+Ib)\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 10.2 V \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.7 Page No 197"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "R1=33.0*10**3\n",
- "R2=12.0*10**3\n",
- "Rc=1.2*10**3\n",
- "Re=1*10**3\n",
- "Vcc=18.0\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Vb=(Vcc*R2)/(R1+R2)\n",
- "Ve=Vb-Vbe\n",
- "Ie=(Vb-Vbe)/Re\n",
- "Ic=Ie\n",
- "Vc=Vcc-(Ic*Rc)\n",
- "Vce=Vc-Ve\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 9.0 V \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.8, Page No 199"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=18.0\n",
- "Vbe=.7\n",
- "hfe=100.0\n",
- "R1=33*10**3\n",
- "R2=12.0*10**3\n",
- "Re=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Vt=(Vcc*R2)/(R1+R2)\n",
- "Rt=(R1*R2)/(R1+R2)\n",
- "Ib=(Vt-Vbe)/(Rt+Re*(1+hfe))\n",
- "Ic=hfe*Ib\n",
- "Ie=Ib+Ic\n",
- "Ve=Ie*Re\n",
- "Vc=Vcc-(Ic*Rc)\n",
- "Vce=Vc-Ve\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 9.7 V \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.9 Page No 200"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "hfe=50.0\n",
- "Vt=4.8\n",
- "Rt=8.8*10**3#from example 5.7\n",
- "Re=1.0*10**3\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vt-Vbe)/(Rt+Re*(1+hfe))\n",
- "Ic=hfe*Ib\n",
- "Ie=Ib+Ic\n",
- "Ve=Ie*Re\n",
- "Vc=Vcc-(Ic*Rc)\n",
- "Vce=Vc-Ve\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 10.4 V \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.10 Page No 201"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vt=4.8\n",
- "Rt=8.8*10**3#from example 5.8\n",
- "Re=1*10**3\n",
- "Vbe=.7\n",
- "hfe=200.0\n",
- "\n",
- "#Calculations\n",
- "Ib=(Vt-Vbe)/(Rt+Re*(1+hfe))\n",
- "Ic=hfe*Ib\n",
- "Ie=Ib+Ic\n",
- "Ve=Ie*Re\n",
- "Vc=Vcc-(Ic*Rc)\n",
- "Vce=Vc-Ve\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current voltage is 9.4 V \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.11 Page No 208"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vce=5.0\n",
- "Ic=5*10**-3\n",
- "Vcc=15.0\n",
- "hfe=100.0\n",
- "\n",
- "#Calculations\n",
- "Rc=(Vcc-Vce)/Ic\n",
- "Ib=Ic/hfe\n",
- "Rb=(Vcc-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rv is %.1f kohm \" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rv is 286.0 kohm \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.12, Page No 209"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vce=5.0\n",
- "Ic=5*10**-3\n",
- "Vcc=15.0\n",
- "hfe=100.0\n",
- "\n",
- "#Calculations\n",
- "Ib=Ic/hfe\n",
- "Rc=(Vcc-Vce)/(Ic+Ib)\n",
- "Rb=(Vce-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.1f kohm \" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 86.0 kohm \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.13, Page No 211"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vce=5.0\n",
- "Ve=Vce\n",
- "Ic=5.0*10**-3\n",
- "hFE=100.0\n",
- "Vcc=15.0\n",
- "Vbe=0.7\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "Re=Ve/Ie\n",
- "Rc=(Vcc-Vce-Ve)/Ic\n",
- "I2=Ic/10\n",
- "Vb=Ve+Vbe\n",
- "R2=Vb/I2\n",
- "R1=(Vcc-Vb)/I2\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.1f kOhm \" %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 18.6 kOhm \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.14, Page No 212"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vce=3.0\n",
- "Ve=5.0\n",
- "Ic=1*10**-3\n",
- "Vcc=12.0\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "R4=Ve/Ie\n",
- "print(\" with Ic=1mA and R4=4.7Kohm\")\n",
- "R4=4.7*10**3\n",
- "Ve=Ic*R4\n",
- "Vc=Ve+Vce\n",
- "Vr3=Vcc-Vc\n",
- "R3=Vr3/Ic\n",
- "Vb=Ve+Vbe\n",
- "I2=Ic/10\n",
- "R2=Vb/I2\n",
- "print(\" with R2=56Kohm and Vb=5.4V\")\n",
- "R2=56*10**3\n",
- "I2=Vb/R2\n",
- "R1=(Vcc-Vb)/I2\n",
- "\n",
- "#Results\n",
- "print(\"The value of R1 is %.1f V \" %(R1/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " with Ic=1mA and R4=4.7Kohm\n",
- " with R2=56Kohm and Vb=5.4V\n",
- "The value of R1 is 68.4 V \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.15, Page No 214"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vce=9.0\n",
- "Ve=4.0\n",
- "Ic=4*10**-3\n",
- "Vcc=18.0\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "R4=Ve/Ie\n",
- "Vb=Ve+Vbe\n",
- "I2=Ic/10\n",
- "R2=Vb/I2\n",
- "print(\" with R2=12Kohm standard\")\n",
- "R2=12*10**3\n",
- "I2=Vb/R2\n",
- "R1=(Vce+Ve-Vb)/I2\n",
- "print(\" with R1=22kohm standard\")\n",
- "R1=22*10**3\n",
- "Vr3=Vcc-Vce-Ve\n",
- "R3=Vr3/(Ic+I2)\n",
- "\n",
- "#Results\n",
- "print(\"The value of R3 %.2f V \" %(R3/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " with R2=12Kohm standard\n",
- " with R1=22kohm standard\n",
- "The value of R3 1.14 V \n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.16, Page No 216"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vc=5.0\n",
- "Ic=1.0*10**-3\n",
- "hFE=70.0\n",
- "Vbe=.7\n",
- "Vee=9.0\n",
- "Vcc=Vee\n",
- "Re=8.2*10**3\n",
- "\n",
- "#Calculations\n",
- "Ve=Vee-Vbe\n",
- "Ie=Ic\n",
- "R3=Ve/Ie\n",
- "print(\" with R3=8.2kohm standard value\")\n",
- "R3=8.2*10**3\n",
- "Ie=Ve/R3\n",
- "Vr2=Vcc-Vc\n",
- "R2=Vr2/Ic\n",
- "Ib=Ic/hFE\n",
- "Vr1=Vbe/10\n",
- "R1=Vr1/Ib\n",
- "print(\" use 4.7Kohm as standard\")\n",
- "#the transistor emitter terminal is .7 below ground and voltage across Re is\n",
- "Ve=Vee-Vbe\n",
- "Ie=Ve/Re\n",
- "Vc=Vcc-(Ie*3.9*10**3)\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vc))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " with R3=8.2kohm standard value\n",
- " use 4.7Kohm as standard\n",
- "Current voltage is 5.1 V \n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.17, Page No 220"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hFE=100.0\n",
- "Rc=2.2*10**3\n",
- "Rb=270.0*10**3\n",
- "Re=1.0*10**3\n",
- "R1=33.0*10**3\n",
- "R2=12*10**3\n",
- "\n",
- "#Calculations\n",
- "S=1+hFE\n",
- "print(\"for collector to base bias\")\n",
- "S=(1+hFE)/(1+(hFE*Rc)/(Rc+Rb))\n",
- "print(\" for voltage divider bias\")\n",
- "print(\"S=(1+hFE)/(1+hFE*Re(Re+R1||R2))\")\n",
- "S=(1+hFE)/(1+(hFE*Re)/(Re+(R1*R2)/(R1+R2)))\n",
- "\n",
- "#Results\n",
- "print(\"Voltage-divider bias is %.2f \" %(S))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "for collector to base bias\n",
- " for voltage divider bias\n",
- "S=(1+hFE)/(1+hFE*Re(Re+R1||R2))\n",
- "Voltage-divider bias is 9.01 \n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.18, Page No 221"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Icbo1=15.0*10**-9# at 25C\n",
- "S=101.0\n",
- "print(\"chnage in temp\")\n",
- "T=105-25\n",
- "print(\" n=T in 10 step\")\n",
- "n=T/10.0\n",
- "\n",
- "#Calculations\n",
- "Icbo2=Icbo1*2**n\n",
- "Icbo=Icbo2-Icbo1\n",
- "print(\" for base bais\")\n",
- "Ic=S*Icbo\n",
- "print(\" for collector to base bais\")\n",
- "S=56\n",
- "Ic=S*Icbo\n",
- "print(\" for voltage divider bais\")\n",
- "S=8.2\n",
- "Ic=S*Icbo\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ic is %.1f mA \" %(Ic*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "chnage in temp\n",
- " n=T in 10 step\n",
- " for base bais\n",
- " for collector to base bais\n",
- " for voltage divider bais\n",
- "The value of Ic is 31.4 mA \n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.19, Page No 223"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Re=4.7*10**3\n",
- "T=125-25\n",
- "\n",
- "#Calculations\n",
- "Vbe=T*(1.8*10**-3)\n",
- "Ie=Vbe/Re\n",
- "\n",
- "#Results\n",
- "print(\"The value of Ie is %.1f V \" %(Ie*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Ie is 38.3 V \n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.20, Page No 223"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=10.0\n",
- "Rc=1.0*10**3\n",
- "Rb=6.8*10**3\n",
- "Vs=5.0\n",
- "\n",
- "#Calculations\n",
- "print(\" hFE calculation\")\n",
- "Ic=Vcc/Rc\n",
- "Ib=(Vs-Vbe)/Rb\n",
- "hFE=Ic/Ib\n",
- "print(\"when hFE=10\")\n",
- "hFE=10\n",
- "Ic=hFE*Ib\n",
- "Vce=Vcc-(Ic*Rc)\n",
- "\n",
- "#Results\n",
- "print(\"Current voltage is %.1f V \" %(Vce))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " hFE calculation\n",
- "when hFE=10\n",
- "Current voltage is 2.9 V \n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.21, Page No 227"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#initialisation of variables\n",
- "Vcc=15.0\n",
- "Rc=3.3*10**3\n",
- "Vbe=.7\n",
- "Rb=56.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ic=Vcc/Rc\n",
- "Ib=(Vcc-Vbe)/Rb\n",
- "hFE=Ic/Ib\n",
- "\n",
- "#Results\n",
- "print(\" minimum hFE is %3.2f \" %hFE)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " minimum hFE is 17.80 \n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.22, Page No 229"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#initialisation of variables\n",
- "Vcc=12.0\n",
- "Ic=1.5*10**-3\n",
- "Vs=5.0\n",
- "hFE=10.0\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Rc=Vcc/Ic\n",
- "Ib=Ic/hFE\n",
- "Rb=(Vs-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.1f kohm \" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 28.7 kohm \n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5.23, Page No 229"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Calculations\n",
- "Vcc=9.0\n",
- "Ic=2*10**-3\n",
- "hFE=10.0\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "Rc=Vcc/Ic\n",
- "Ib=Ic/hFE\n",
- "Rb=(Vcc-Vbe)/Ib\n",
- "\n",
- "#Results\n",
- "print(\"The value of Rb is %.2f kohm \" %(Rb/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of Rb is 41.50 kohm \n"
- ]
- }
- ],
- "prompt_number": 22
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter6_1.ipynb b/Electronic_Devices_and_Circuits/Chapter6_1.ipynb deleted file mode 100755 index 85bada6c..00000000 --- a/Electronic_Devices_and_Circuits/Chapter6_1.ipynb +++ /dev/null @@ -1,656 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 06 : Ac analysis of BJT circuits"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.1, Page No 240"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=12.0\n",
- "R2=15.0*10**3\n",
- "R1=33.0*10**3\n",
- "rs=600\n",
- "\n",
- "#Calculations\n",
- "print(\"with no signal source\")\n",
- "Vb=(Vcc*R2)/(R1+R2)\n",
- "print(\" base bais voltage when no signal source is present %3.2fV \" %Vb)\n",
- "print(\" signal source directly connected\")\n",
- "Vb=(Vcc*((rs*R2)/(rs+R2))/(R1+((rs*R2)/(rs+R2))))\n",
- "\n",
- "#Results\n",
- "print(\"base bais voltage is %3.2fV \" %Vb)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "with no signal source\n",
- " base bais voltage when no signal source is present 3.75V \n",
- " signal source directly connected\n",
- "base bais voltage is 0.21V \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.2, Page No 244"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Rc=2.2*10**3\n",
- "Re=2.7*10**3\n",
- "R1=18.0*10**3\n",
- "R2=8.2*10**3\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "print(\"drawing dc load line\")\n",
- "Rldc=Rc+Re\n",
- "print(\" for Vce\")\n",
- "Ic=0\n",
- "Vcc=20\n",
- "Vce=Vcc-Ic*(Rc+Re)\n",
- "print(\"plot point A at\")\n",
- "Ic=Vcc/(Rc+Re)\n",
- "print(\"plot point B Ic=4.08mA and Vce=0\")\n",
- "print(\" draw dc laod line through point A nad B\")\n",
- "Vb=(Vcc*R2)/(R1+R2)\n",
- "Ve=Vb-Vbe\n",
- "Ic=Ve/Re\n",
- "Ie=Ic\n",
- "print(\"drawing the ac load line\")\n",
- "Rlac=Rc#when there is no external Rl\n",
- "Vce=Ic*Rc\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"The voltage is %.2f v \" %Vce)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "drawing dc load line\n",
- " for Vce\n",
- "plot point A at\n",
- "plot point B Ic=4.08mA and Vce=0\n",
- " draw dc laod line through point A nad B\n",
- "drawing the ac load line\n",
- "The voltage is 4.53 v \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.3 Page No 251"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vce=4.5\n",
- "Ib=40.0*10**-6\n",
- "\n",
- "#Calculations\n",
- "print(\"from current characteristic at Vce=4.5V and Ib=40uA\")\n",
- "Ic=4.0*10**-3\n",
- "Ib=30.0*10**-6\n",
- "hFE=Ic/Ib\n",
- "print(\" the value of hFE is %d \" %hFE)\n",
- "print(\"from output characteristic at Vce=4.5 and Ib=40uA\")\n",
- "Ic=0.2\n",
- "Vce=6\n",
- "hoe=(Ic/Vce)\n",
- "R=1/hoe\n",
- "\n",
- "#Results\n",
- "print(\"the value of hoe is %3.1fuS \" %(hoe*10**3))\n",
- "print(\"the value of 1/hoe is %3.1fuS \" %(1/hoe))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "from current characteristic at Vce=4.5V and Ib=40uA\n",
- " the value of hFE is 133 \n",
- "from output characteristic at Vce=4.5 and Ib=40uA\n",
- "the value of hoe is 33.3uS \n",
- "the value of 1/hoe is 30.0uS \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.4, Page No 253"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hfe=133.0\n",
- "hoe=33.3*10**-6\n",
- "hfc=1+hfe\n",
- "\n",
- "#Calculations\n",
- "hob=hoe/(1+hfe)\n",
- "A=hfe/(1+hfe)\n",
- "\n",
- "#Results\n",
- "print(\"tye value of a is %3.1fuS \" %(A))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "tye value of a is 1.0uS \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.5 Page No 253"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Ib=20.0*10**-6\n",
- "Ic=1.0*10**-3\n",
- "Ie=Ic\n",
- "\n",
- "#Calculations\n",
- "re=(26*10**-3)/Ie\n",
- "hfe=Ic/Ib\n",
- "hie=(1+hfe)*re\n",
- "r=hie\n",
- "B=hfe\n",
- "\n",
- "#Results\n",
- "print(\"the value of b is %3.1f \" %(B))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "the value of b is 50.0 \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.6 Page No 258"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "hie=2.1*10**3\n",
- "hfe=75.0\n",
- "hoe=1*10**-6\n",
- "R1=68.0*10**3\n",
- "R2=56.0*10**3\n",
- "Rc=3.9*10**3\n",
- "Rl=82*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" input impedance Zi=R1||R2||hie\")\n",
- "Zi=((R1*R2*hie)/(R1+R2+hie))*10**-3\n",
- "print(\" input impedance is %3.2fKohm \" %Zi)\n",
- "print(\"output impedance is Zo=Rc||(1/hoe)\")\n",
- "Zo=((Rc*(1/hoe))/(Rc+(1/hoe)))*10**-3\n",
- "print(\" output impadance is %f3.2fKohm \" %Zo)\n",
- "Av=-(hfe*((Rc*Rl)/(Rc+Rl)))/hie\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\" voltage gain is %d \" %Av)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " input impedance Zi=R1||R2||hie\n",
- " input impedance is 63416.34Kohm \n",
- "output impedance is Zo=Rc||(1/hoe)\n",
- " output impadance is 3.8848493.2fKohm \n",
- " voltage gain is -132 \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.7, Page No 259"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Ic=1.5*10**-3\n",
- "Rc=4.7*10**3\n",
- "Rl=56.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "re=(26*10**-3)/Ie\n",
- "Av=-(((Rc*Rl)/(Rc+Rl))/re)\n",
- "\n",
- "#Results\n",
- "print(\" voltage gain is %d \" %Av)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " voltage gain is -250 \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.8 Page No 262"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "hie=2.1*10**3\n",
- "hfe=75.0\n",
- "hoe=1.0*10**-6\n",
- "Re=4.7*10**3\n",
- "R1=68.0*10**3\n",
- "R2=56.0*10**3\n",
- "Rc=3.9*10**3\n",
- "Rl=82.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Zb=hie+Re*(1+hfe)\n",
- "print(\" input impedance is Zi=R1||R2||Zb\")\n",
- "Zi=((R1*R2*Zb)/(R1+R2+Zb))\n",
- "print(\" input circuit resistance is %3.3fKohm \" %Zi)\n",
- "Zo=Rc\n",
- "Av=-hfe*((Rc*Rl)/(Rc+Rl))/(hie+Re*(1+hfe))\n",
- "\n",
- "#Results\n",
- "print(\"voltage gain is %3.3f \" %Av)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " input impedance is Zi=R1||R2||Zb\n",
- " input circuit resistance is 2830983654.045Kohm \n",
- "voltage gain is -0.777 \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.9 Page No 267"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hie=2.1*10**3\n",
- "hfe=75.0\n",
- "R1=10.0*10**3\n",
- "R2=10.0*10**3\n",
- "Re=4.7*10**3\n",
- "Rl=12.0*10**3\n",
- "rs=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" Rl is not connected\")\n",
- "hic=hie\n",
- "hfc=1+hfe\n",
- "Zb=hic+hfc*(Re)\n",
- "Zi=(R1*R2*Zb)/(R1+R2+Zb)\n",
- "Ze=(hic+(R1*R2*rs)/(R1+R2+rs))/hfc\n",
- "Z0=(Ze*Re)/(Ze+Re)\n",
- "print(\" when Rl is connected\")\n",
- "Zb=hic+hfc*((Re*Rl)/(Re+Rl))\n",
- "Zi=(R1*R2*Zb)/(R1+R2+Zb)\n",
- "hib=hie/(1+hfe)\n",
- "Av=((Re*Rl)/(Re+Rl))/(hib+((Re*Rl)/(Re+Rl)))\n",
- "\n",
- "#Results\n",
- "print(\"voltage gain is %3.3f \" %Av)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Rl is not connected\n",
- " when Rl is connected\n",
- "voltage gain is 0.992 \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.10 Page No 273"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "hie=2.1*10**3\n",
- "hfe=75.0\n",
- "Re=4.7*10**3\n",
- "Rc=3.9*10**3\n",
- "Rl=82.0*10**3\n",
- "\n",
- "#Calculations\n",
- "hib=hie/(1+hfe)\n",
- "hfb=hfe/(1+hfe)\n",
- "Zi=(hib*Re)/(Re+hib)\n",
- "print(\"input impedance is %3.2fohm \" %Zi)\n",
- "Zo=Rc\n",
- "print(\" output impedance is %3.2fohm \" %Zo)\n",
- "Av=(hfb*((Rc*Rl)/(Rc+Rl)))/hib\n",
- "\n",
- "#Results\n",
- "print(\" voltage gain is %3.2f \" %Av)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "input impedance is 27.47ohm \n",
- " output impedance is 3900.00ohm \n",
- " voltage gain is 132.96 \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.11, Page No 273"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "hib=27.6\n",
- "hfb=.987\n",
- "R1=68.0*10**3\n",
- "R2=56.0*10**3\n",
- "Re=4.7*10**3\n",
- "Rc=3.9*10**3\n",
- "Rl=82.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Rb=(R1*R2)/(R1+R2)\n",
- "Ze=hib+Rb*(1-hfb)\n",
- "Zi=(Ze*Re)/(Ze+Re)\n",
- "Av=(hfb*((Rc*Rl)/(Rc+Rl)))/(hib+Rb*(1-hfb))\n",
- "\n",
- "#Results\n",
- "print(\"voltage gain is %3.3f \" %Av)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain is 8.609 \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.12, Page No 277"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rc=5.6*10**3\n",
- "Rl=33.0*10**3\n",
- "rs=600.0\n",
- "hfe=100\n",
- "hie=1.5*10**3\n",
- "vs=50.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "print(\" CE circuit operation with vs at transistor base and Re bypassed\")\n",
- "Av=(hfe*((Rc*Rl)/(Rc+Rl)))/hie\n",
- "Zb=hie\n",
- "Rb=(R1*R2)/(R1+R2)\n",
- "Zi=(Rb*Zb)/(Rb+Zb)\n",
- "vi=(vs*Zi)/(rs+Zi)\n",
- "vo=Av*vi\n",
- "print(\"Cb circuit operation with vs at emitter and the base resistor bypassed\")\n",
- "Av=(hfe*((Rc*Rl)/(Rc+Rl)))/hie\n",
- "Ze=hie/(1+hfe)\n",
- "Zi=(Ze*Re)/(Ze+Re)\n",
- "vi=(vs*Zi)/(rs+Zi)\n",
- "vo=Av*vi\n",
- "\n",
- "#Results\n",
- "print(\"voltage vo is %3.2f \" %(vo*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " CE circuit operation with vs at transistor base and Re bypassed\n",
- "Cb circuit operation with vs at emitter and the base resistor bypassed\n",
- "voltage vo is 384.29 \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.13, Page No 279"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Io=50.0*10**-9\n",
- "Vbe=.7\n",
- "Vbc=-10\n",
- "Af=.995\n",
- "Ar=.5\n",
- "Vt=26.0*10**-3\n",
- "n=2.0\n",
- "Vd=-10.0\n",
- "\n",
- "#Calculations\n",
- "x=Vd/(n*Vt)\n",
- "Idc=(Io*((2.73**-x)-1))*10**9\n",
- "Idc=Io*(-1)\n",
- "y=Vbe/(n*Vt)\n",
- "Ide=Io*((2.73**y)-1)\n",
- "I1=Af*Ide\n",
- "I2=Ar*Idc\n",
- "Ic=I1-Idc\n",
- "Ie=Ide-I2\n",
- "Ib=Ie-Ic\n",
- "\n",
- "#Results\n",
- "print(\"voltage gain is %3.3f \" %(Ib*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain is 185.909 \n"
- ]
- }
- ],
- "prompt_number": 13
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter6_2.ipynb b/Electronic_Devices_and_Circuits/Chapter6_2.ipynb deleted file mode 100755 index 85bada6c..00000000 --- a/Electronic_Devices_and_Circuits/Chapter6_2.ipynb +++ /dev/null @@ -1,656 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 06 : Ac analysis of BJT circuits"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.1, Page No 240"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Vcc=12.0\n",
- "R2=15.0*10**3\n",
- "R1=33.0*10**3\n",
- "rs=600\n",
- "\n",
- "#Calculations\n",
- "print(\"with no signal source\")\n",
- "Vb=(Vcc*R2)/(R1+R2)\n",
- "print(\" base bais voltage when no signal source is present %3.2fV \" %Vb)\n",
- "print(\" signal source directly connected\")\n",
- "Vb=(Vcc*((rs*R2)/(rs+R2))/(R1+((rs*R2)/(rs+R2))))\n",
- "\n",
- "#Results\n",
- "print(\"base bais voltage is %3.2fV \" %Vb)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "with no signal source\n",
- " base bais voltage when no signal source is present 3.75V \n",
- " signal source directly connected\n",
- "base bais voltage is 0.21V \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.2, Page No 244"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "\n",
- "Rc=2.2*10**3\n",
- "Re=2.7*10**3\n",
- "R1=18.0*10**3\n",
- "R2=8.2*10**3\n",
- "Vbe=.7\n",
- "\n",
- "#Calculations\n",
- "print(\"drawing dc load line\")\n",
- "Rldc=Rc+Re\n",
- "print(\" for Vce\")\n",
- "Ic=0\n",
- "Vcc=20\n",
- "Vce=Vcc-Ic*(Rc+Re)\n",
- "print(\"plot point A at\")\n",
- "Ic=Vcc/(Rc+Re)\n",
- "print(\"plot point B Ic=4.08mA and Vce=0\")\n",
- "print(\" draw dc laod line through point A nad B\")\n",
- "Vb=(Vcc*R2)/(R1+R2)\n",
- "Ve=Vb-Vbe\n",
- "Ic=Ve/Re\n",
- "Ie=Ic\n",
- "print(\"drawing the ac load line\")\n",
- "Rlac=Rc#when there is no external Rl\n",
- "Vce=Ic*Rc\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"The voltage is %.2f v \" %Vce)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "drawing dc load line\n",
- " for Vce\n",
- "plot point A at\n",
- "plot point B Ic=4.08mA and Vce=0\n",
- " draw dc laod line through point A nad B\n",
- "drawing the ac load line\n",
- "The voltage is 4.53 v \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.3 Page No 251"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vce=4.5\n",
- "Ib=40.0*10**-6\n",
- "\n",
- "#Calculations\n",
- "print(\"from current characteristic at Vce=4.5V and Ib=40uA\")\n",
- "Ic=4.0*10**-3\n",
- "Ib=30.0*10**-6\n",
- "hFE=Ic/Ib\n",
- "print(\" the value of hFE is %d \" %hFE)\n",
- "print(\"from output characteristic at Vce=4.5 and Ib=40uA\")\n",
- "Ic=0.2\n",
- "Vce=6\n",
- "hoe=(Ic/Vce)\n",
- "R=1/hoe\n",
- "\n",
- "#Results\n",
- "print(\"the value of hoe is %3.1fuS \" %(hoe*10**3))\n",
- "print(\"the value of 1/hoe is %3.1fuS \" %(1/hoe))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "from current characteristic at Vce=4.5V and Ib=40uA\n",
- " the value of hFE is 133 \n",
- "from output characteristic at Vce=4.5 and Ib=40uA\n",
- "the value of hoe is 33.3uS \n",
- "the value of 1/hoe is 30.0uS \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.4, Page No 253"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hfe=133.0\n",
- "hoe=33.3*10**-6\n",
- "hfc=1+hfe\n",
- "\n",
- "#Calculations\n",
- "hob=hoe/(1+hfe)\n",
- "A=hfe/(1+hfe)\n",
- "\n",
- "#Results\n",
- "print(\"tye value of a is %3.1fuS \" %(A))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "tye value of a is 1.0uS \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.5 Page No 253"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "\n",
- "Ib=20.0*10**-6\n",
- "Ic=1.0*10**-3\n",
- "Ie=Ic\n",
- "\n",
- "#Calculations\n",
- "re=(26*10**-3)/Ie\n",
- "hfe=Ic/Ib\n",
- "hie=(1+hfe)*re\n",
- "r=hie\n",
- "B=hfe\n",
- "\n",
- "#Results\n",
- "print(\"the value of b is %3.1f \" %(B))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "the value of b is 50.0 \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.6 Page No 258"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "hie=2.1*10**3\n",
- "hfe=75.0\n",
- "hoe=1*10**-6\n",
- "R1=68.0*10**3\n",
- "R2=56.0*10**3\n",
- "Rc=3.9*10**3\n",
- "Rl=82*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" input impedance Zi=R1||R2||hie\")\n",
- "Zi=((R1*R2*hie)/(R1+R2+hie))*10**-3\n",
- "print(\" input impedance is %3.2fKohm \" %Zi)\n",
- "print(\"output impedance is Zo=Rc||(1/hoe)\")\n",
- "Zo=((Rc*(1/hoe))/(Rc+(1/hoe)))*10**-3\n",
- "print(\" output impadance is %f3.2fKohm \" %Zo)\n",
- "Av=-(hfe*((Rc*Rl)/(Rc+Rl)))/hie\n",
- "\n",
- "\n",
- "#Results\n",
- "print(\" voltage gain is %d \" %Av)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " input impedance Zi=R1||R2||hie\n",
- " input impedance is 63416.34Kohm \n",
- "output impedance is Zo=Rc||(1/hoe)\n",
- " output impadance is 3.8848493.2fKohm \n",
- " voltage gain is -132 \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.7, Page No 259"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Ic=1.5*10**-3\n",
- "Rc=4.7*10**3\n",
- "Rl=56.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "re=(26*10**-3)/Ie\n",
- "Av=-(((Rc*Rl)/(Rc+Rl))/re)\n",
- "\n",
- "#Results\n",
- "print(\" voltage gain is %d \" %Av)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " voltage gain is -250 \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.8 Page No 262"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "hie=2.1*10**3\n",
- "hfe=75.0\n",
- "hoe=1.0*10**-6\n",
- "Re=4.7*10**3\n",
- "R1=68.0*10**3\n",
- "R2=56.0*10**3\n",
- "Rc=3.9*10**3\n",
- "Rl=82.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Zb=hie+Re*(1+hfe)\n",
- "print(\" input impedance is Zi=R1||R2||Zb\")\n",
- "Zi=((R1*R2*Zb)/(R1+R2+Zb))\n",
- "print(\" input circuit resistance is %3.3fKohm \" %Zi)\n",
- "Zo=Rc\n",
- "Av=-hfe*((Rc*Rl)/(Rc+Rl))/(hie+Re*(1+hfe))\n",
- "\n",
- "#Results\n",
- "print(\"voltage gain is %3.3f \" %Av)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " input impedance is Zi=R1||R2||Zb\n",
- " input circuit resistance is 2830983654.045Kohm \n",
- "voltage gain is -0.777 \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.9 Page No 267"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "hie=2.1*10**3\n",
- "hfe=75.0\n",
- "R1=10.0*10**3\n",
- "R2=10.0*10**3\n",
- "Re=4.7*10**3\n",
- "Rl=12.0*10**3\n",
- "rs=1.0*10**3\n",
- "\n",
- "#Calculations\n",
- "print(\" Rl is not connected\")\n",
- "hic=hie\n",
- "hfc=1+hfe\n",
- "Zb=hic+hfc*(Re)\n",
- "Zi=(R1*R2*Zb)/(R1+R2+Zb)\n",
- "Ze=(hic+(R1*R2*rs)/(R1+R2+rs))/hfc\n",
- "Z0=(Ze*Re)/(Ze+Re)\n",
- "print(\" when Rl is connected\")\n",
- "Zb=hic+hfc*((Re*Rl)/(Re+Rl))\n",
- "Zi=(R1*R2*Zb)/(R1+R2+Zb)\n",
- "hib=hie/(1+hfe)\n",
- "Av=((Re*Rl)/(Re+Rl))/(hib+((Re*Rl)/(Re+Rl)))\n",
- "\n",
- "#Results\n",
- "print(\"voltage gain is %3.3f \" %Av)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Rl is not connected\n",
- " when Rl is connected\n",
- "voltage gain is 0.992 \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.10 Page No 273"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "hie=2.1*10**3\n",
- "hfe=75.0\n",
- "Re=4.7*10**3\n",
- "Rc=3.9*10**3\n",
- "Rl=82.0*10**3\n",
- "\n",
- "#Calculations\n",
- "hib=hie/(1+hfe)\n",
- "hfb=hfe/(1+hfe)\n",
- "Zi=(hib*Re)/(Re+hib)\n",
- "print(\"input impedance is %3.2fohm \" %Zi)\n",
- "Zo=Rc\n",
- "print(\" output impedance is %3.2fohm \" %Zo)\n",
- "Av=(hfb*((Rc*Rl)/(Rc+Rl)))/hib\n",
- "\n",
- "#Results\n",
- "print(\" voltage gain is %3.2f \" %Av)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "input impedance is 27.47ohm \n",
- " output impedance is 3900.00ohm \n",
- " voltage gain is 132.96 \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.11, Page No 273"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "hib=27.6\n",
- "hfb=.987\n",
- "R1=68.0*10**3\n",
- "R2=56.0*10**3\n",
- "Re=4.7*10**3\n",
- "Rc=3.9*10**3\n",
- "Rl=82.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Rb=(R1*R2)/(R1+R2)\n",
- "Ze=hib+Rb*(1-hfb)\n",
- "Zi=(Ze*Re)/(Ze+Re)\n",
- "Av=(hfb*((Rc*Rl)/(Rc+Rl)))/(hib+Rb*(1-hfb))\n",
- "\n",
- "#Results\n",
- "print(\"voltage gain is %3.3f \" %Av)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain is 8.609 \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.12, Page No 277"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Rc=5.6*10**3\n",
- "Rl=33.0*10**3\n",
- "rs=600.0\n",
- "hfe=100\n",
- "hie=1.5*10**3\n",
- "vs=50.0*10**-3\n",
- "\n",
- "#Calculations\n",
- "print(\" CE circuit operation with vs at transistor base and Re bypassed\")\n",
- "Av=(hfe*((Rc*Rl)/(Rc+Rl)))/hie\n",
- "Zb=hie\n",
- "Rb=(R1*R2)/(R1+R2)\n",
- "Zi=(Rb*Zb)/(Rb+Zb)\n",
- "vi=(vs*Zi)/(rs+Zi)\n",
- "vo=Av*vi\n",
- "print(\"Cb circuit operation with vs at emitter and the base resistor bypassed\")\n",
- "Av=(hfe*((Rc*Rl)/(Rc+Rl)))/hie\n",
- "Ze=hie/(1+hfe)\n",
- "Zi=(Ze*Re)/(Ze+Re)\n",
- "vi=(vs*Zi)/(rs+Zi)\n",
- "vo=Av*vi\n",
- "\n",
- "#Results\n",
- "print(\"voltage vo is %3.2f \" %(vo*10**3))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " CE circuit operation with vs at transistor base and Re bypassed\n",
- "Cb circuit operation with vs at emitter and the base resistor bypassed\n",
- "voltage vo is 384.29 \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6.13, Page No 279"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Io=50.0*10**-9\n",
- "Vbe=.7\n",
- "Vbc=-10\n",
- "Af=.995\n",
- "Ar=.5\n",
- "Vt=26.0*10**-3\n",
- "n=2.0\n",
- "Vd=-10.0\n",
- "\n",
- "#Calculations\n",
- "x=Vd/(n*Vt)\n",
- "Idc=(Io*((2.73**-x)-1))*10**9\n",
- "Idc=Io*(-1)\n",
- "y=Vbe/(n*Vt)\n",
- "Ide=Io*((2.73**y)-1)\n",
- "I1=Af*Ide\n",
- "I2=Ar*Idc\n",
- "Ic=I1-Idc\n",
- "Ie=Ide-I2\n",
- "Ib=Ie-Ic\n",
- "\n",
- "#Results\n",
- "print(\"voltage gain is %3.3f \" %(Ib*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "voltage gain is 185.909 \n"
- ]
- }
- ],
- "prompt_number": 13
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/Chapter8_2.ipynb b/Electronic_Devices_and_Circuits/Chapter8_2.ipynb deleted file mode 100755 index d91fc639..00000000 --- a/Electronic_Devices_and_Circuits/Chapter8_2.ipynb +++ /dev/null @@ -1,499 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 08 : BJT specifications and performance"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.2, Page No 313"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "P2=25.0*10**-3#when frequency increase to 20KHz\n",
- "P1=50.0*10**-3#when signal frequency is 5KHz\n",
- "\n",
- "#Calculations\n",
- "Po=10*math.log((P2/P1),10)\n",
- "\n",
- "#Results\n",
- "print(\" output power change in decibels is %.2f dB \" %Po)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " output power change in decibels is -3.01 dB \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.3, Page No 314"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "v1=1# output voltage measured at 5KHz\n",
- "v2=.707# output voltage measure at 20kHz\n",
- "\n",
- "#Calculations\n",
- "Po=20*math.log((v2/v1),10)\n",
- "\n",
- "#Results\n",
- "print(\" output power change is %.2f dB \" %Po)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " output power change is -3.01 dB \n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.4 Page No 317"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Ic=1.0*10**-3\n",
- "hfe=50.0\n",
- "hie=1.3*10**3\n",
- "fT=250.0*10**6\n",
- "Cbc=5.0*10**-12\n",
- "Rc=8.2*10**3\n",
- "Rl=100.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Ie=Ic\n",
- "Av=(hfe*((Rc*Rl)/(Rc+Rl)))/hie\n",
- "Cbe=(6.1*Ie)/fT\n",
- "Cin=(Cbe+(1+Av)*Cbc)*10**9\n",
- "\n",
- "#Results\n",
- "print(\" input capacitance when the circuit operated as CE is %.2fnF \"%Cin)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " input capacitance when the circuit operated as CE is 1.49nF \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.5, Page No 319"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "R1=100*10**3\n",
- "R2=47.0*10**3\n",
- "Re=4.7*10**3\n",
- "Cbc=5.0*10**-12\n",
- "Cbe=24.4*10**-12\n",
- "hfe=50\n",
- "hie=1.3*10**3\n",
- "hib=24.5\n",
- "rs=hib\n",
- "rs=600.0\n",
- "\n",
- "#Calculations\n",
- "print(\" common emitter circuit\")\n",
- "Rb=(R1*R2)/(R1+R2)\n",
- "Zi=(Rb*hie)/(Rb+hie)\n",
- "Cin=1.48*10**-9\n",
- "f2=1/(2*3.14*Cin*((rs*Zi)/(rs+Zi)))\n",
- "print(\"input-capacitance upper cutoff frequency is %dHz \" %f2)\n",
- "print(\"common base circuit\")\n",
- "Zi=(Re*hib)/(Re+hib)\n",
- "Cin=(Cbe+Cbc)\n",
- "f2=(1/(2*3.14*Cin*((rs*Zi)/(rs+Zi))))*10**-6\n",
- "\n",
- "#Results\n",
- "print(\" input capacitance upper cutoff when operating as CB circuit with base bypassed to ground is %.2f MHz \" %f2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " common emitter circuit\n",
- "input-capacitance upper cutoff frequency is 265447Hz \n",
- "common base circuit\n",
- " input capacitance upper cutoff when operating as CB circuit with base bypassed to ground is 231.25 MHz \n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.6 Page No 322"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "fT=50.0*10**6\n",
- "hfe=50.0\n",
- "f2o=60.0*10**3\n",
- "Rc=10.0*10**3\n",
- "\n",
- "#Calculations\n",
- "fae=fT/hfe\n",
- "C4=(1.0/(2*3.14*f2o*Rc))*10**12\n",
- "\n",
- "#Results\n",
- "print(\"capacitance required for C4 to give 60kHz upper cutoff frequency is %.2f pF \" %C4)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "capacitance required for C4 to give 60kHz upper cutoff frequency is 265.39 pF \n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.8 Page No 326"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "ton=100.0*10**-9\n",
- "Rs=600.0\n",
- "Rb=4.7*10**3\n",
- "\n",
- "#Calculations\n",
- "C1=(ton/Rs)*10**12\n",
- "print(\" suitable speed up capacitor is %dpF \" %C1)\n",
- "C1=160*10**-12#standard value\n",
- "PWmin=(5*Rs*C1)\n",
- "SWmin=5*Rb*C1\n",
- "fmax=1/(PWmin+SWmin)\n",
- "\n",
- "#Results\n",
- "print(\"maximum signal frequency is %.2f Hz \" %(fmax/1000))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " suitable speed up capacitor is 166pF \n",
- "maximum signal frequency is 235.85 Hz \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.9, Page No 330"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "R1=30.0*10**3\n",
- "R2=30.0*10**3\n",
- "rs=30.0*10**3\n",
- "f2=40.0*10**3\n",
- "f1=100.0\n",
- "k=1.37*10**-23\n",
- "R=10.0*10**3\n",
- "Av=600.0\n",
- "Ri=3.0*10**3\n",
- "\n",
- "#Calculations\n",
- "Rb=(R1*R2)/(R1+R2)\n",
- "Rg=(rs*Rb)/(rs+Rb)\n",
- "T=(273+25)\n",
- "B=f2-f1\n",
- "en=math.sqrt(4*k*T*B*R)\n",
- "eni=en*((Ri/(Ri+Rg)))\n",
- "eno=(Av*eni)*10**6\n",
- "\n",
- "#Results\n",
- "print(\"noise output voltage is %.2f uV \" %eno)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "noise output voltage is 353.44 uV \n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.10 Page No 331"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math \n",
- "\n",
- "#initialisation of variables\n",
- "Ic=30.0*10**-6\n",
- "Vce=5.0\n",
- "eno=354.0*10**-6\n",
- "NF=10.0\n",
- "F=2.51#F=antilog(NF/10)\n",
- "\n",
- "#Calculations\n",
- "Vn=((math.sqrt(F))*eno)*10**6\n",
- "\n",
- "#Results\n",
- "print(\"total noise output volateg for amplifier is %.2f uV \" %Vn)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "total noise output volateg for amplifier is 560.84 uV \n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.11 Page No 333"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Pd25=625.0*10**-3\n",
- "D=5.0*10**-3\n",
- "Vce=10.0\n",
- "T2=55.0\n",
- "\n",
- "#Calculations\n",
- "Pdt2=Pd25-D*(T2-25)\n",
- "Pd=Pdt2\n",
- "Ic=Pd/Vce\n",
- "\n",
- "#Results\n",
- "print(\" maximum Ic level is %.2fA \" %(Ic*1000))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " maximum Ic level is 47.50A \n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.13 Page No 335"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Pd=80.0\n",
- "Vce=60.0\n",
- "\n",
- "#Calculations\n",
- "Ic=Pd/Vce\n",
- "print(\"point 1 Vce=60 and Ic= %.2f A\" %Ic)\n",
- "Vce=40.0\n",
- "Ic=Pd/Vce\n",
- "print(\"point 2 Vce=40 and Ic= %.2f A\" %Ic)\n",
- "Vce=20.0\n",
- "Ic=Pd/Vce\n",
- "print(\" point 3 Vce=20 and Ic= %.2f A\" %Ic)\n",
- "Vce=10.0\n",
- "Ic=Pd/Vce\n",
- "\n",
- "#Results\n",
- "print(\" point 4 Vce=10 and Ic= %.2f A\" %Ic)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "point 1 Vce=60 and Ic= 1.33 A\n",
- "point 2 Vce=40 and Ic= 2.00 A\n",
- " point 3 Vce=20 and Ic= 4.00 A\n",
- " point 4 Vce=10 and Ic= 8.00 A\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8.14, Page No 339"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#initialisation of variables\n",
- "Vce=20.0\n",
- "Ic=1.0\n",
- "T2=90.0\n",
- "T1=25.0\n",
- "\n",
- "#Calculations\n",
- "Q=Vce*Ic\n",
- "Qcs=.4\n",
- "Qjc=1#from table\n",
- "Qsa=((T2-T1)/Q)-(Qjc+Qcs)\n",
- "\n",
- "#Results\n",
- "print(\"Qsa= %.2f \" %Qsa)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Qsa= 1.85 \n"
- ]
- }
- ],
- "prompt_number": 11
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter3.png b/Electronic_Devices_and_Circuits/screenshots/Chapter3.png Binary files differdeleted file mode 100755 index 17bf554f..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter3.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter3_1.png b/Electronic_Devices_and_Circuits/screenshots/Chapter3_1.png Binary files differdeleted file mode 100755 index 17bf554f..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter3_1.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter3_2.png b/Electronic_Devices_and_Circuits/screenshots/Chapter3_2.png Binary files differdeleted file mode 100755 index 17bf554f..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter3_2.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter4.png b/Electronic_Devices_and_Circuits/screenshots/Chapter4.png Binary files differdeleted file mode 100755 index 721d70c1..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter4.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter4_1.png b/Electronic_Devices_and_Circuits/screenshots/Chapter4_1.png Binary files differdeleted file mode 100755 index 721d70c1..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter4_1.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter4_2.png b/Electronic_Devices_and_Circuits/screenshots/Chapter4_2.png Binary files differdeleted file mode 100755 index 721d70c1..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter4_2.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter5.png b/Electronic_Devices_and_Circuits/screenshots/Chapter5.png Binary files differdeleted file mode 100755 index 205ddb6d..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter5.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter5_1.png b/Electronic_Devices_and_Circuits/screenshots/Chapter5_1.png Binary files differdeleted file mode 100755 index 205ddb6d..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter5_1.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/screenshots/Chapter5_2.png b/Electronic_Devices_and_Circuits/screenshots/Chapter5_2.png Binary files differdeleted file mode 100755 index 205ddb6d..00000000 --- a/Electronic_Devices_and_Circuits/screenshots/Chapter5_2.png +++ /dev/null diff --git a/Electronic_Devices_and_Circuits/Chapter1.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter1.ipynb index 47b8b5fc..47b8b5fc 100755 --- a/Electronic_Devices_and_Circuits/Chapter1.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter1.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter10.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter10.ipynb index b92c4b1d..b92c4b1d 100755 --- a/Electronic_Devices_and_Circuits/Chapter10.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter10.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter11.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter11.ipynb index e211f994..e211f994 100755 --- a/Electronic_Devices_and_Circuits/Chapter11.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter11.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter12.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter12.ipynb index b0fb9991..b0fb9991 100755 --- a/Electronic_Devices_and_Circuits/Chapter12.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter12.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter13.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter13.ipynb index 0a7d7550..0a7d7550 100755 --- a/Electronic_Devices_and_Circuits/Chapter13.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter13.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter14.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter14.ipynb index 90767c65..90767c65 100755 --- a/Electronic_Devices_and_Circuits/Chapter14.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter14.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter15.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter15.ipynb index db5e05e2..db5e05e2 100755 --- a/Electronic_Devices_and_Circuits/Chapter15.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter15.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter16.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter16.ipynb index 9d8b3b5f..9d8b3b5f 100755 --- a/Electronic_Devices_and_Circuits/Chapter16.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter16.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter17.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter17.ipynb index 0bf01537..0bf01537 100755 --- a/Electronic_Devices_and_Circuits/Chapter17.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter17.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter18.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter18.ipynb index 4cac5251..4cac5251 100755 --- a/Electronic_Devices_and_Circuits/Chapter18.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter18.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter19.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter19.ipynb index f144d168..f144d168 100755 --- a/Electronic_Devices_and_Circuits/Chapter19.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter19.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter2.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter2.ipynb index 1c97e28b..1c97e28b 100755 --- a/Electronic_Devices_and_Circuits/Chapter2.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter2.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter20.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter20.ipynb index dcf6cb7f..dcf6cb7f 100755 --- a/Electronic_Devices_and_Circuits/Chapter20.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter20.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter21.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter21.ipynb index adcb4972..adcb4972 100755 --- a/Electronic_Devices_and_Circuits/Chapter21.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter21.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter3.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter3.ipynb index 8f8a6a3b..8f8a6a3b 100755 --- a/Electronic_Devices_and_Circuits/Chapter3.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter3.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter4.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter4.ipynb index eb199d80..eb199d80 100755 --- a/Electronic_Devices_and_Circuits/Chapter4.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter4.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter5.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter5.ipynb index 07d0da6b..07d0da6b 100755 --- a/Electronic_Devices_and_Circuits/Chapter5.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter5.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter6.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter6.ipynb index 85bada6c..85bada6c 100755 --- a/Electronic_Devices_and_Circuits/Chapter6.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter6.ipynb diff --git a/Electronic_Devices_and_Circuits/Chapter8.ipynb b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter8.ipynb index d91fc639..d91fc639 100755 --- a/Electronic_Devices_and_Circuits/Chapter8.ipynb +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/Chapter8.ipynb diff --git a/Electronic_Devices_and_Circuits/README.txt b/Electronic_Devices_and_Circuits_By_David_A_Bell/README.txt index 005586a5..3f1113a2 100755 --- a/Electronic_Devices_and_Circuits/README.txt +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/README.txt @@ -1,5 +1,5 @@ -Contributed By: Mayur Sabban -Course: be +ontributed By: Mayur Sabban +Course: btech College/Institute/Organization: Vishwakarma Institute of Technology Pune Department/Designation: Computer Engg Book Title: Electronic Devices and Circuits @@ -7,4 +7,4 @@ Author: David A. Bell Publisher: Oxford University Press(2008), Year of publication: 2008 Isbn: 019569340 -Edition: 5
\ No newline at end of file +Edition: 5 diff --git a/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter3.png b/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter3.png Binary files differnew file mode 100755 index 00000000..9de5a4b0 --- /dev/null +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter3.png diff --git a/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter4.png b/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter4.png Binary files differnew file mode 100755 index 00000000..0dbac297 --- /dev/null +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter4.png diff --git a/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter5.png b/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter5.png Binary files differnew file mode 100755 index 00000000..ea5b73ab --- /dev/null +++ b/Electronic_Devices_and_Circuits_By_David_A_Bell/screenshots/Chapter5.png diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter01.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter01.ipynb new file mode 100755 index 00000000..76fb6b09 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter01.ipynb @@ -0,0 +1,241 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b7a82ebd5adf08f1d2cb1363a68626f83f8a9fdc0fb722a735bf408f1a7aed03"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter01: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": 6
+ },
+ {
+ "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": 7
+ },
+ {
+ "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": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter02.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter02.ipynb new file mode 100755 index 00000000..6a53266d --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter02.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b73ef6216a642d72e71cacf5b5b61b6bfffda60f0becbd024d7e5a916e6cf6d4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter02:Semiconductor Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the conductivity and resistivity of germanium\n",
+ "#!/usr/bin/env/ python\n",
+ "#-*- coding: utf-8 -*-\n",
+ "q=1.6*10.**-19.#Coulomb #charge of an electron\n",
+ "ni=2.5*10.**19.#per m**3 #concentration\n",
+ "un=0.36#m**2/Vs #mobility of electron\n",
+ "up=0.17#m**2/Vs #mobility of holes\n",
+ "con=q*ni*(un+up); #conductivity\n",
+ "res=(1./con); #resistivity\n",
+ "print '%s %.2f %s' %(\"The conductivty is =\",con,'S/m');\n",
+ "print '%s %.2f %s' %(\"The resistivity is =\",res,'ohm m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is = 2.12 S/m\n",
+ "The resistivity is = 0.47 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ecample E2 - pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the conductivity of extrinsic semiconductor\n",
+ "#given\n",
+ "e=1.6*10.**-19.;#Coulomb #charge of an electron\n",
+ "ni=1.5*10.**16.;#per m**3 #concentration\n",
+ "un=0.13;#m**2/Vs #mobility of electron\n",
+ "up=0.05;#m**2/Vs #mobility of holes\n",
+ "Si=5.*10.**28.;#per m**3 #atomic density in silicon\n",
+ "dop=(1./(2.*10.**8.)); #concentration of an antimony per silicon atoms\n",
+ "Nd=dop*Si;#per m**3 #donor concentraion\n",
+ "n=Nd;#per m**3 #free electron concentration\n",
+ "p=(ni**2/Nd);#per m **3 # hole concentration\n",
+ "con=e*(n*un+p*up);\n",
+ "print '%s %.1f %s' %(\"The conductivty is=\",con, 'S/m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is= 5.2 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter03.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter03.ipynb new file mode 100755 index 00000000..1fd8d21b --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter03.ipynb @@ -0,0 +1,644 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7bf8d28c6c82b7e899c3ac6b15267e576e5304a1722b176d625beb68170b13b4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter03:Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Page 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value of threshold voltage\n",
+ "#given\n",
+ "t1=25.;#degrees C#initial temperature\n",
+ "t2=100.;#degrees C#final temperature\n",
+ "V=2.*10.**-3.;#V per celsius degree#decrease in barrier potential per degree\n",
+ "V0=0.7#V#Potential at normal temperature\n",
+ "Vd=(t2-t1)*V;#decrease in barrier potential\n",
+ "Vt=V0-Vd;#threshold volatge at 100degree C\n",
+ "print '%s %.2f %s' %(\"Threshold volatge at 100 degrees C =\",Vt,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Threshold volatge at 100 degrees C = 0.55 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detrenmine dc resistance of silicon diode\n",
+ "#given\n",
+ "#At Id = 2 mA\n",
+ "Id=2.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.5;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Id = 20 mA\n",
+ "Id=20.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.75;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.1f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Vd = - 10 V \n",
+ "Id=-2.*10.**-6.;#Ampere#diode current(from given curve)\n",
+ "Vd=-10.;#V#voltage\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf/10**6,\"M ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance is = 250 ohm\n",
+ "\n",
+ "The dc resistance is = 37.5 ohm\n",
+ "\n",
+ "The dc resistance is = 5 M ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc & ac resistance of silicon diode\n",
+ "#given\n",
+ "Id=20.*10.**-3.;#A#diode current\n",
+ "Vd=0.75;#V# as given in the V-I graph\n",
+ "Rf=Vd/Id;\n",
+ "print '%s %.1f %s' %(\"The dc resistance of diode is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#From Graph the values of dynamic voltage and current are\n",
+ "#which is equal to MN and NL repectively (in graph)\n",
+ "del_Vd=(0.8-0.68);#V\n",
+ "del_Id=(40-0)*10.**-3.;#A\n",
+ "rf=del_Vd/del_Id;\n",
+ "print '%s %.f %s' %(\"The ac resistance of the diode is =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance of diode is = 37.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is = 3 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine ac resistance of silicon diode\n",
+ "#given\n",
+ "#At Id =10mA\n",
+ "Id=10.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.1f %s' %(\"The ac resistance of the diode is(At Id= 10mA) =\",rf,\"ohm\\n\")\n",
+ "\n",
+ "#At Id =20mA\n",
+ "Id=20.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.2f %s' %(\"The ac resistance of the diode is(At Id= 20mA) =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode is(At Id= 10mA) = 2.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is(At Id= 20mA) = 1.25 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through diode\n",
+ "#given\n",
+ "Vt=0.3;#V#Threshold voltage\n",
+ "rf=25.;#ohm# average resistance\n",
+ "\n",
+ "#assuming it to be ideal\n",
+ "#from fig 3.19\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=45.;#ohm\n",
+ "R2=5.;#ohm\n",
+ "Vab=Vaa*R2/(R1+R2);\n",
+ "#Vab>Vt therefore diode is forward bias and no current flow through R2\n",
+ "Idi=Vaa/R1; #for ideal\n",
+ "print '%s %.f %s' %(\"The diode current (for ideal) is =\",Idi*1000,\"mA\\n\");\n",
+ "\n",
+ "#assuming it to be real\n",
+ "#Thevenins equivalent circuit parameters of fig 3.19\n",
+ "Vth=Vaa*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "Idr=(Vth-Vt)/(Rth+rf); #for real\n",
+ "print '%s %.1f %s' %(\"The diode current (for real) is =\",Idr*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diode current (for ideal) is = 222 mA\n",
+ "\n",
+ "The diode current (for real) is = 23.7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through resistance in given figure\n",
+ "#From fig\n",
+ "Vaa=20.;#V#supply\n",
+ "Vt=0.7;#V#threshold voltage of diode\n",
+ "rf=5.;#ohm #forward resistance\n",
+ "R=90.;#ohm#given resistor\n",
+ "\n",
+ "#Diode D1 and D4 are forward bias and D2 and D3 are reverse biased\n",
+ "\n",
+ "Vnet=Vaa-Vt-Vt;\n",
+ "Rt=R+rf+rf;\n",
+ "I=Vnet/Rt;\n",
+ "print '%s %.f %s' %(\"Current through 90 ohm resistor is =\",I*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 90 ohm resistor is = 186 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current drawn by the battery\n",
+ "#From fig\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=100.;#ohm\n",
+ "R2=100.;#ohm\n",
+ "\n",
+ "#Forward Bias\n",
+ "Id=Vaa/R1;\n",
+ "print '%s %.1f %s' %(\"Current drawn from battery (forward bias) =\",Id,\"A\\n\");\n",
+ "\n",
+ "#Reverse Bias\n",
+ "Rnet=R1+R2;\n",
+ "Id=Vaa/Rnet;\n",
+ "print '%s %.2f %s' %(\"Current drawn from battery (reverse bias) =\",Id,\"A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from battery (forward bias) = 0.1 A\n",
+ "\n",
+ "Current drawn from battery (reverse bias) = 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc current through load and rectification efficiency and peak inverse voltage\n",
+ "#given\n",
+ "import math\n",
+ "TR=31./2.;#Turn ratio of the transformer\n",
+ "rf=20.;#ohm#Dynamic forward resistance\n",
+ "Rl=1000.;#ohm#Load resistance\n",
+ "Vt=0.66;#V#Threshold voltage of diode\n",
+ "V=220.;#V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp;\n",
+ "Im=(Vm-Vt)/(rf+Rl);\n",
+ "Idc=Im/math.pi;\n",
+ "n=40.6/(1.+rf/Rl);\n",
+ "print '%s %.f %s' %(\"The dc current through load is =\",Idc*1000,\"mA\\n\");\n",
+ "print '%s %.1f %s' %(\"The rectification efficiency is =\",n,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"Peak inverse voltage =Vm = \",Vm,\"V\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current through load is = 6 mA\n",
+ "\n",
+ "The rectification efficiency is = 39.8 percent\n",
+ "\n",
+ "Peak inverse voltage =Vm = 20.07 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc voltage across load and peak inverse voltage across each diode\n",
+ "#given\n",
+ "import math\n",
+ "TR=12./1.##Turn ratio of the transformer\n",
+ "V=220.##V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp#\n",
+ "Vdc=(2.*Vm)/math.pi#\n",
+ "print '%s %.1f %s' %(\"The dc voltage across load =\",Vdc,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for bridge rectifier) =\",Vm,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for centre tap rectifier) =\",2*Vm,\"V\\n\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc voltage across load = 16.5 V\n",
+ "\n",
+ "Peak inverse voltage (for bridge rectifier) = 25.9 V\n",
+ "\n",
+ "Peak inverse voltage (for centre tap rectifier) = 51.9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc power supplied to load and efficiency and PIV rating of the diode\n",
+ "#given\n",
+ "import math\n",
+ "rf=2.;#ohm#Dynamic forward resistance\n",
+ "Rs=5.;#ohm#resistaqnce of secondary\n",
+ "Rl=25.;#ohm#Load resistance\n",
+ "Idc=0.1;#A#dc current to a load\n",
+ "Pdc=Idc**2.*Rl; #dc power\n",
+ "n=(81.2*Rl)/(Rl+rf+Rs); #efficiency\n",
+ "Im=(math.pi*Idc)/2.; #peak value current\n",
+ "Vm=Im*(Rl+rf+Rs); #peak voltage\n",
+ "Vlm=Vm-Im*(rf+Rs); #peak voltage across load\n",
+ "PIV=Vm+Vlm;\n",
+ "print '%s %.2f %s' %(\"The dc power supplied to the load is =\",Pdc,'W\\n');\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,'percent\\n');\n",
+ "print '%s %.3f %s' %(\"The peak inverse voltage is =\",PIV,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc power supplied to the load is = 0.25 W\n",
+ "\n",
+ "Efficiency = 63.44 percent\n",
+ "\n",
+ "The peak inverse voltage is = 8.954 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate output voltage and current through load and voltage across series resistor and current and power dissipated in zener diode\n",
+ "#given\n",
+ "Vi=110.;#V #input voltage\n",
+ "Rl=6.*10.**3.;# ohm #load resistance\n",
+ "Rs=2.*10.**3.;#ohm #series resistance\n",
+ "Vz=60.;#V #Zener voltage\n",
+ "V=Vi*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Vs=Vi-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Iz=Is-Il #/By applying kirchhoffs law\n",
+ "Pz=Vz*Iz #Power dissipated accross zener diode\n",
+ "\n",
+ "print '%s %.f %s' %(\"The output voltage is =\",Vo,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The current through load resistance is =\",Il*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"Voltage across series resistor is =\",Vs,\"V\\n\")\n",
+ "print '%s %.f %s' %(\"Current in zener diode is =\",Iz*1000,\"mA\\n\")\n",
+ "print '%s %.f %s' %(\"Power dissipated by zener diode =\",Pz*1000,'mW');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 60 V\n",
+ "\n",
+ "The current through load resistance is = 10 mA\n",
+ "\n",
+ "Voltage across series resistor is = 50 V\n",
+ "\n",
+ "Current in zener diode is = 15 mA\n",
+ "\n",
+ "Power dissipated by zener diode = 900 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate max and min values of zener diode current\n",
+ "#given\n",
+ "Vimin=80.;#V #minimum input voltage\n",
+ "Vimax=120.;#V #maximum input voltage\n",
+ "Rl=10.*10.**3.;# ohm #load resistance\n",
+ "Rs=5.*10.**3.;#ohm #series resistance\n",
+ "Vz=50.;#V #Zener voltage\n",
+ "V=Vimin*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "#For minimum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimin-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmin=Is-Il;\n",
+ "print '%s %.f %s' %(\"Minimum values of zener diode current is =\",Izmin*1000,\"mA\\n\");\n",
+ "\n",
+ "#For maximum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimax-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmax=Is-Il;\n",
+ "print '%s %.f %s' %(\"Maximum values of zener diode current is =\",Izmax*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum values of zener diode current is = 1 mA\n",
+ "\n",
+ "Maximum values of zener diode current is = 9 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine value of the series resistor and wattage rating\n",
+ "#given\n",
+ "Vi=12.##V #input voltage\n",
+ "Vz=7.2##V #Zener voltage\n",
+ "Izmin=10.*10.**-3.##A #min current through zener diode\n",
+ "Ilmax=100*10.**-3.##A #max current through load\n",
+ "Ilmin=12.*10.**-3.##A #min current through load\n",
+ "Vs=Vi-Vz# #Voltage drop across the series resistor\n",
+ "Is=Izmin+Ilmax# #Current through the series resistor\n",
+ "Rs=Vs/Is#\n",
+ "print '%s %.1f %s' %(\"The series resistor so that 10mA current flow through zener diode is =\",Rs,\"ohm\\n\")#\n",
+ "Izmax=Is-Ilmin#max zener through zener diode\n",
+ "Pmax=Izmax*Vz#\n",
+ "print '%s %.1f %s' %(\"The maximum wattage rating is =\",Pmax*1000,\"mW\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resistor so that 10mA current flow through zener diode is = 43.6 ohm\n",
+ "\n",
+ "The maximum wattage rating is = 705.6 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the capacitance of a varactor diode\n",
+ "#given\n",
+ "import math\n",
+ "C=5.;#pf#capcitance of varactor diode at V=4V\n",
+ "V=4.;#V\n",
+ "K=C*math.sqrt(4.);\n",
+ "#When bias voltage is increased upto 6 V\n",
+ "Vn=6.;#V#new bias voltage\n",
+ "Cn=K/(math.sqrt(Vn));\n",
+ "print '%s %.3f %s' %(\"Capacitance (At 6 V ) =\",Cn,\"pf\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance (At 6 V ) = 4.082 pf\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter04.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter04.ipynb new file mode 100755 index 00000000..6c215ea6 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter04.ipynb @@ -0,0 +1,420 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:42445a9cad2a842fdbeaf4fef86ad51dfbe0d5e8d585b4595a7c5777bd6d8bc1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter04:Bipolar Junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the collector and base current\n",
+ "#given\n",
+ "a=0.98;#dc alpha\n",
+ "Ie=5.*10.**-3.;#A#emitter current\n",
+ "Ico=2.*10.**-6.;#A#collector reverse leakage current\n",
+ "Ic=a*Ie+Ico;\n",
+ "Ib=Ie-Ic;\n",
+ "print '%s %.3f %s' %(\"The collector current is =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is = 4.902 mA\n",
+ "\n",
+ "The base current is = 98 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the base and collector current and exact and approax dc alpha \n",
+ "#given\n",
+ "Ie=8.4*10.**-3.#A#emitter current\n",
+ "Icbo=0.1*10.**-6.##A#reverse leakage current\n",
+ "Ib=0.008*Ie##A#base current\n",
+ "Ic=Ie-Ib#\n",
+ "Icinj=Ic-Icbo#\n",
+ "a0=Icinj/Ie#\n",
+ "a=Ic/Ie#\n",
+ "print '%s %.1f %s' %(\"Base current is =\",Ib*10**6,\"uA\\n\")#\n",
+ "print '%s %.4f %s' %(\"Collector current =\",Ic*1000,\"mA\\n\",)#\n",
+ "print '%s %.7f %s' %(\"Exact value of alphha =\",a0,\"\\n\")#\n",
+ "print '%s %.3f' %(\"Approax value of alpha =\",a)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current is = 67.2 uA\n",
+ "\n",
+ "Collector current = 8.3328 mA\n",
+ "\n",
+ "Exact value of alphha = 0.9919881 \n",
+ "\n",
+ "Approax value of alpha = 0.992\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the base current\n",
+ "#given\n",
+ "a=0.96; #dc alpha\n",
+ "Rc=2.*10.**3.;#ohm #resistor across collector\n",
+ "Vc=4.;#V #Voltage drop across the collector resistor\n",
+ "Ic=Vc/Rc; #Colletor current\n",
+ "Ie=Ic/a; #Emmiter current\n",
+ "Ib=Ie-Ic; #Base current\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\",)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is = 83 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Ie=2.;#mA\n",
+ "Vcb=10.;#V\n",
+ "\n",
+ "#Taking points around Ie & Vcb from graph\n",
+ "del_Ie=(2.5-1.5)*10.**-3.;#A\n",
+ "\n",
+ "#corresponding change in Veb\n",
+ "del_Veb=(0.9-0.8);#V\n",
+ "rib=del_Veb/del_Ie;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rib,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 100 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc current gain in common emitter configuration\n",
+ "#given\n",
+ "a=0.98;#dc current gain in common base configuration\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The dc current gain in common emitter configuration is=\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current gain in common emitter configuration is= 49\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac alpha and beta\n",
+ "#given\n",
+ "ic=0.995#mA#Emitter current change\n",
+ "ie=1.#mA#collector current change\n",
+ "a=ic/ie;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.3f %s' %(\"The ac alpha is =\",a,\"\\n\")\n",
+ "print '%s %.f' %(\"The common emitter ac current gain is =\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac alpha is = 0.995 \n",
+ "\n",
+ "The common emitter ac current gain is = 199\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate beta and Iceo and exact and approax collector current\n",
+ "#given\n",
+ "a0=0.992;#dc current gain in common base configuration\n",
+ "Icbo=48.*10.**-9.;#A\n",
+ "Ib=30.*10.**-6.;#A#base current\n",
+ "B=a0/(1.-a0);\n",
+ "Iceo=Icbo/(1.-a0);\n",
+ "print '%s %.f %s' %(\"Beta=\",B,\"\\n\");\n",
+ "print '%s %.f %s' %(\"Iceo=\",Iceo*10**6,\"uA\\n\");\n",
+ "Ic=B*Ib+Iceo;\n",
+ "Ica=B*Ib;#approax\n",
+ "print '%s %.3f %s' %(\"Exact collector current =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"Approax collector current =\",Ica*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 124 \n",
+ "\n",
+ "Iceo= 6 uA\n",
+ "\n",
+ "Exact collector current = 3.726 mA\n",
+ "\n",
+ "Approax collector current = 3.72 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Vbe=0.75;#V\n",
+ "Vce=2.;#V\n",
+ "\n",
+ "#Taking points around Vbe=0.75V from graph\n",
+ "del_Vbe=(0.98-0.9);#V\n",
+ "\n",
+ "#corresponding change in ib\n",
+ "del_ib=(68.-48.)*10.**-6.;#A\n",
+ "\n",
+ "rie=del_Vbe/del_ib;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rie/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 4 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance and dc and ac current gain\n",
+ "#given\n",
+ "Ib=30.*10.**-6.;#A\n",
+ "Vce=10.;#V\n",
+ "Ic=3.6*10.**-3.;#A #from graph\n",
+ "\n",
+ "#Taking points around Vce = 10V from graph\n",
+ "del_Vce=(12.5-7.5);#V\n",
+ "\n",
+ "#corresponding change in ic\n",
+ "del_ic=(3.7-3.5)*10.**-3.;#A\n",
+ "\n",
+ "roe=del_Vce/del_ic;\n",
+ "print '%s %.f %s' %(\"The dynamic output resistance of transistor is =\",roe/1000,\"k ohm\\n\");\n",
+ "\n",
+ "#dc current gain\n",
+ "Bo=Ic/Ib;\n",
+ "print '%s %.f %s' %(\"The dc current gain is =\",Bo,\"\\n\");\n",
+ "\n",
+ "#ac current gain\n",
+ "\n",
+ "del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA\n",
+ "del_ib=(40.-20.)*10.**-6.;\n",
+ "B=del_ic/del_ib;\n",
+ "print '%s %.f %s' %(\"The ac current gain is =\",B,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic output resistance of transistor is = 25 k ohm\n",
+ "\n",
+ "The dc current gain is = 120 \n",
+ "\n",
+ "The ac current gain is = 110 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac current gain in CE and CC configuration\n",
+ "#given\n",
+ "a=0.99;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The ac current gain in CE configuration is =\",B);\n",
+ "y=1.+B;\n",
+ "print '%s %.f' %(\"\\nThe ac current gain in CC configuration is =\",y);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac current gain in CE configuration is = 99\n",
+ "\n",
+ "The ac current gain in CC configuration is = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter05.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter05.ipynb new file mode 100755 index 00000000..6fb4ca83 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter05.ipynb @@ -0,0 +1,348 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6ddc78aaecb14f72535c7221afdce9fdaaec875cc64d4211459abad2c8c70077"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter05:Field Effect Transistors (FETs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate saturation voltage and saturation current\n",
+ "#given\n",
+ "Vp=-4.#V #pinch off voltage\n",
+ "Idss=12.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Vgs=-2.;#V #gate to source voltage\n",
+ "Vds=Vgs-Vp;\n",
+ "Id=Idss*(Vds/Vp)**2.;\n",
+ "print '%s %.f %s' %(\"Saturation Voltage is =\",Vds,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Saturation current is =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Voltage is = 2 V\n",
+ "\n",
+ "Saturation current is = 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vgso=-5.;#V #gate to source cut off voltage\n",
+ "Idss=20.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#At vgs = -2 V\n",
+ "vgs=-2.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -2 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -4 V\n",
+ "vgs=-4.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -4 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -8 V\n",
+ "print '%s' %(\"Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current is (At vgs = -2 V) = 7.2 mA\n",
+ "\n",
+ "Drain current is (At vgs = -4 V) = 0.8 mA\n",
+ "\n",
+ "Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Vds saturation\n",
+ "#given\n",
+ "import math\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=-15.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Id=-3.*10.**-3.;#A #saturation current\n",
+ "Vgs=Vp*(1.-math.sqrt(Id/Idss));\n",
+ "Vds=Vgs-Vp;\n",
+ "print '%s %.3f %s' %(\"The gate to source voltage (Vgs) is =\",Vgs,\"V\\n\");\n",
+ "print '%s %.3f %s' %(\"The saturation voltage is Vds(sat) =\",Vds,\"V\");\n",
+ "\n",
+ "print '\\nThe value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gate to source voltage (Vgs) is = 2.764 V\n",
+ "\n",
+ "The saturation voltage is Vds(sat) = -2.236 V\n",
+ "\n",
+ "The value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for N channel\n",
+ "#given\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= - 3 V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id(For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5 V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id(For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id(For Vgs= -3V) = 2.88 mA\n",
+ "\n",
+ "The drain current Id(For Vgs= 2.5V) = 40.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for P channel\n",
+ "#given\n",
+ "Vp=-5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= -3V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id (For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id (For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id (For Vgs= -3V) = 46.08 mA\n",
+ "\n",
+ "The drain current Id (For Vgs= 2.5V) = 4.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vt=2.;#V #threshold voltage\n",
+ "K=0.25*10.**-3.;# A/V**2 #conductivity parameter\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=2.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "Id=K*(Vgs-Vt)**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 0.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of Id\n",
+ "#given\n",
+ "Vt=1.5;#V #threshold voltage\n",
+ "Id=2.*10.**-3.;#A\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=5.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "# Calculating K\n",
+ "K=Id/((Vgs-Vt)**2.); # A/V**2 #conductivity parameter\n",
+ "\n",
+ "#Calculating Id for Vgs= 5 V and Vds= 6 V\n",
+ "Vgs=5;#V #gate supply\n",
+ "Vds=6;#V #saturation voltage\n",
+ "Id=K*((Vgs-Vt)**2);\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 10.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the dynamic drain resistance\n",
+ "#given\n",
+ "gm=200.*10.**-6.;#S transconductance\n",
+ "u=80.;#amplification factor\n",
+ "rd=u/gm;\n",
+ "print '%s %.f %s' %(\"The dynamic drain resistance is =\",rd/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic drain resistance is = 400 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter06.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter06.ipynb new file mode 100755 index 00000000..41c7fb9c --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter06.ipynb @@ -0,0 +1,699 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cddd2c9e37ec7b804dfbcdffbef1b63f83f302e02514fa667b184fd9044289b8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter06:Transistor Biasing and Stabilization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.2*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=270.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,'V',Ic*1000,'mA');\n",
+ "\n",
+ "#Note--In book Vce = 5.7 V because of approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 5.6 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=150.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=100.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ics*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 0 V 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Rb and percentage change in collector current due to temperature rise\n",
+ "#given\n",
+ "\n",
+ "#Calculating the base resistance\n",
+ "B=20.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Ic=1.*10.**-3.;#A #collector current\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Icbo=2.*10.**-6.;#A #collector to base leakage current\n",
+ "\n",
+ "Ib=(Ic-(1.+B)*Icbo)/B;\n",
+ "Rb=(Vcc-Vbe)/Ib;\n",
+ "\n",
+ "print '%s %.f %s' %(\"The value of resistor Ib is =\",120,'kohm');\n",
+ "\n",
+ "Rb=120.*10.**3.;#ohm approax\n",
+ "\n",
+ "#Now when temperature rise\n",
+ "Icbo=10.*10.**-6.;#A #collector to base leakage current\n",
+ "B=25.;#dc beta\n",
+ "Ic1=B*Ib+(B+1)*Icbo;# #changed collector current\n",
+ "perc=(Ic1-Ic)*100./Ic;#percentage increase\n",
+ "print '%s %.f %s' %(\"The percentage change in collector current is =\",perc,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistor Ib is = 120 kohm\n",
+ "The percentage change in collector current is = 46 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.1f %s' %(\"The Q point (At B=50) =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.; #dc beta\n",
+ "Ic1=B*Ib; #Colletor current\n",
+ "Ics1=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.1f %s' %(\"\\nThe Q point (At B=150) is =\",Vce,\"V\",Ics*1000,\"mA\");\n",
+ "\n",
+ "print '%s %.f' %(\"\\nThe factor at which collector current increases =\",Ics1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point (At B=50) = 6.00 V 1.5 mA\n",
+ "\n",
+ "The Q point (At B=150) is = 0 V 4.5 mA\n",
+ "\n",
+ "The factor at which collector current increases = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Q point in collector to base bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=500.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-(Ic+Ib)*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 9.1 V 1.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the collector current and change in it if B is changed by three times of previous B\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.3f %s' %(\"Collector current (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "#Now B=150\n",
+ "B=3.*B; #three times of previous B\n",
+ "Ib1=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic1=B*Ib1; #Colletor current\n",
+ "print '%s %.2f %s' %(\"Collector current (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.f' %(\"The factor at which collector current increases =\",Ic1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current (B=50)= 1.125 mA\n",
+ "\n",
+ "Collector current (B=150)= 2.25 mA\n",
+ "\n",
+ "The factor at which collector current increases = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of all three current Ie and Ic and Ib\n",
+ "#given\n",
+ "B=90.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ie=Ic+Ib; #Emitter current\n",
+ "print '%s %.1f %s %s %.3f %s %s %.3f %s' %(\"Base current =\",Ib*10**6,\"uA\\n\",\"\\nCollector current =\",Ic*10**3,\"mA\\n\",\"\\nEmitter current =\",Ie*10**3,\"mA\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 16.5 uA\n",
+ " \n",
+ "Collector current = 1.486 mA\n",
+ " \n",
+ "Emitter current = 1.503 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max and min value of emitter current\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=75.;#ohm #resistor connected to collector\n",
+ "Re=100.;#ohm #resistor connected to emitter\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Ib=(Vcc-Vbe)/(Rb+(1.+B)*Re); #Base current\n",
+ "Ie=(1.+B)*Ib;\n",
+ "Vce=Vcc-(Rc+Re)*Ie\n",
+ "print '%s %.2f %s' %(\"Minimum emitter current =\",Ie*10**3,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"The collector to emitter volatge =\",Vce,\"V\\n\");\n",
+ "\n",
+ "#At B=300 \n",
+ "\n",
+ "B1=300.; #dc beta\n",
+ "Ib1=(Vcc-Vbe)/(Rb+(1.+B1)*Re);#Base current\n",
+ "Ie1=(1.+B1)*Ib1;\n",
+ "Vce1=Vcc-(Rc+Re)*Ie1\n",
+ "#Here Vce1= -1.4874 V but can never have negative voltage because Ie1 is wrong as it cant be more than saturation value therefore\n",
+ "Ie1=Vcc/(Rc+Re);\n",
+ "\n",
+ "#And Vce=0 V\n",
+ "\n",
+ "Vce1=0;#V\n",
+ "print '%s %.2f %s' %(\"Maximum emitter current =\",Ie1*10**3,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The collector to emitter volatge(saturation) =\",Vce1,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum emitter current = 19.25 mA\n",
+ "\n",
+ "The collector to emitter volatge = 2.63 V\n",
+ "\n",
+ "Maximum emitter current = 34.29 mA\n",
+ "\n",
+ "The collector to emitter volatge(saturation) = 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of base resistance\n",
+ "#given\n",
+ "\n",
+ "B=100.; #dc beta\n",
+ "Rc=200.;#ohm #resistor connected to collector\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Vce=4.5;#V #Collector to emitter voltage\n",
+ "Ic=(Vcc-Vce)/(Rc+Re);\n",
+ "Ib=Ic/B;\n",
+ "Rb=(Vcc-B*Re*Ib)/Ib;\n",
+ "print '%s %.f %s' %(\"The value of base resistance is =\",Rb/1000,\"kohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistance is = 90 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the collector current at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.;#dc beta\n",
+ "Rc=2.;#ohm #resistor connected to collector\n",
+ "Re=1000.;#ohm #resistor connected to emitter\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.2f %s' %(\"The collector current at (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.;#dc beta\n",
+ "Ib1=Vcc/(Rb+B1*Re); #Base current\n",
+ "Ic1=B1*Ib1; #Colletor current\n",
+ "print '%s %.1f %s' %(\"The collector current at (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.1f' %(\"The factor at which collector current increases=\",Ic1/Ic);\n",
+ "\n",
+ "#IN BOOK Ic(AT B=50)= 1.25 mA and Ic1/Ic=2.4 DUE TO APPROAXIMATION\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current at (B=50)= 1.29 mA\n",
+ "\n",
+ "The collector current at (B=150)= 3.0 mA\n",
+ "\n",
+ "The factor at which collector current increases= 2.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Q point in voltage divider\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.*10.**3.;#ohm #voltage divider resistor 1\n",
+ "R2=1.*10.**3.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "I=Vcc/(R1+R2); #current through voltage divider\n",
+ "Vb=I*R2; #voltage at base\n",
+ "Ve=Vb-Vbe;\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie #approaximating Ib is nearly equal to 0\n",
+ "Vc=Vcc-Ic*Rc;\n",
+ "Vce=(Vc)-Ve; \n",
+ "print '%s %.1f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Ibc=I/20.; #critical value of base current\n",
+ "Ib=Ic/B; #actual base current\n",
+ "\n",
+ "#Since Ib < Ibc, hence assumption is alright\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 3.3 V 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Solve the voltage divider accurately by applying thevenin's theorem\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.;#ohm #voltage divider resistor 1\n",
+ "R2=1.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "\n",
+ "Vth=Vcc*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent voltage Vth =\",Vth,\"V\");\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent resistance Rth =\",Rth,\"kohm\");\n",
+ "\n",
+ "Ib=(Vth-Vbe)/(Rth+(1.+B)*Re);\n",
+ "Ic=B*Ib;\n",
+ "Ie=Ic+Ib;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re; \n",
+ "print '%s %.4f %s' %(\"\\nThe accurate value of Ic =\",Ic*10**3,\"mA\");\n",
+ "print '%s %.5f %s' %(\"\\nThe accurate value of Vce =\",Vce,\"V\");\n",
+ "Icp=3.*10.**-3.; # Current calculated by voltage divider in previous example\n",
+ "Vcep=3.4; # Voltage calculated by voltage divider in previous example\n",
+ "Err_Ic=(Ic-Icp)*100./Ic;\n",
+ "Err_Vce=(Vce-Vcep)*100./Vce;\n",
+ "print '%s %.1f %s' %(\"\\nError in Ic =\",Err_Ic,\"percent\\n\");\n",
+ "print '%s %.1f %s' %(\"\\nError in Vce =\",Err_Vce,\"percent\");\n",
+ "\n",
+ "# The errors and The accurate values are different \n",
+ "# because of the approaximation in Vth and Rth in book\n",
+ "\n",
+ "# In Book Ic = 2.8436 mA and Vce = 3.73839 V\n",
+ "# Error in Ic = -5.5% \n",
+ "# Error in Vce = +9% \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin equivalent voltage Vth = 0.9 V\n",
+ "\n",
+ "Thevenin equivalent resistance Rth = 0.9 kohm\n",
+ "\n",
+ "The accurate value of Ic = 3.0152 mA\n",
+ "\n",
+ "The accurate value of Vce = 3.36060 V\n",
+ "\n",
+ "Error in Ic = 0.5 percent\n",
+ "\n",
+ "\n",
+ "Error in Vce = -1.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the Q point for the emitter bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=5.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=10.*10.**3.;#ohm #resistor connected to emitter \n",
+ "Vcc=12.;#V #Voltage supply across the collector resistor\n",
+ "Vee=15;#V #supply at emitter\n",
+ "Ie=Vee/Re;\n",
+ "Ic=Ie;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 4.5 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Rs\n",
+ "#given\n",
+ "import math\n",
+ "Vp=2.;#V\n",
+ "Idss=1.75*10.**-3.;#A #drain current at Vgs=0\n",
+ "Vdd=24.;#V #drain to supply source\n",
+ "Id=1.*10.**-3.;#A #drain current\n",
+ "Vgs=(-Vp)*(1-math.sqrt(Id/Idss));\n",
+ "Rs=abs(Vgs)/Id;\n",
+ "print '%s %.3f %s' %(\"Vgs =\",Vgs,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Rs =\",Rs,\"ohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vgs = -0.488 V\n",
+ "\n",
+ "Rs = 488 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter07.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter07.ipynb new file mode 100755 index 00000000..ef03f356 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter07.ipynb @@ -0,0 +1,591 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:df8de903c993d95a64f446dabb646c726ccbd74d5f5097708ab83278555b0cb9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter07:Small Signal SIngle-Stage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max current and check will the capacitor act as short for given frequency\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "Vs=1.;#V\n",
+ "Imax=Vs/(Rs+Rl);\n",
+ "fc=1./(2.*math.pi*(Rs+Rl)*C) #critical frequency\n",
+ "fh=10.*fc; #Border frequency\n",
+ "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
+ "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
+ "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
+ "\n",
+ "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current is = 200 uA\n",
+ "\n",
+ "fh = 3.18 Hz\n",
+ "\n",
+ "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "f=20.;#Hz #lowest frequency\n",
+ "Xc=1./(2.*math.pi*f*C) #reactance of capacitor at 20Hz\n",
+ "Rth=Rs*Rl/(Rs+Rl); #Thevenins equivalent resistance\n",
+ "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
+ "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
+ " \n",
+ "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of capacitor required\n",
+ "#given\n",
+ "import math\n",
+ "Rs1=20.*10.**3.;#ohm\n",
+ "Rs2=30.*10.**3.;#ohm\n",
+ "Rl1=40.*10.**3.;#ohm\n",
+ "Rl2=80.*10.**3.;#ohm\n",
+ "Rl3=80.*10.**3.;#ohm\n",
+ "Rth=Rs1*Rs2/(Rs1+Rs2); #Thevenins equivalent resistance\n",
+ "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
+ "Rl=Rl1*Rl_/(Rl1+Rl_); #Equivalent load\n",
+ "f=50.;#Hz #lowest frequency\n",
+ "R=Rth+Rl;\n",
+ "C=10./(2.*math.pi*f*R)\n",
+ "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of coupling capacitor is = 1 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage and current gain and input and output resistance\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "#given\n",
+ "\n",
+ "#DC analysis\n",
+ "Vcc=12.;#V\n",
+ "Rb=200.*10.**3.;#ohm\n",
+ "Rc=1.*10.**3.;#ohm\n",
+ "B=100.;# beta\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#AC analysis\n",
+ "Rl=1.*10.**3.;#ohm\n",
+ "hfe=B;\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "hoe_1=40.*10.**3.;#ohm # 1/hoe\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-hfe*Rac/hie;\n",
+ "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "\n",
+ "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
+ "Io=-100.*Ib;\n",
+ "Ac=Io/Ib;\n",
+ "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
+ "\n",
+ "Ri=prll(Rb,hie);\n",
+ "Ro=prll(Rl,prll(Rc,hoe_1));\n",
+ "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
+ "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
+ "\n",
+ "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 6.00 V 6.00 mA\n",
+ "\n",
+ "The voltage gain = -25.00 \n",
+ "\n",
+ "The current gain = -100.00 \n",
+ "\n",
+ "The input resistance = 2 kohm\n",
+ "\n",
+ "The output resistance = 0.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solve previous example using hybrid pie model\n",
+ "#soltion\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "Vcc=12.##V\n",
+ "Rb=200.*10.**3.##ohm\n",
+ "Rc=1.*10.**3.##ohm\n",
+ "Rl=1.*10.**3.##ohm\n",
+ "B=100.## beta\n",
+ "hie=2.*10.**3.##ohm\n",
+ "hoe_1=40.*10.**3.##ohm # 1/hoe\n",
+ "\n",
+ "Ib=Vcc/Rb#\n",
+ "Ic=B*Ib#\n",
+ "Rac=prll(Rc,Rl)#\n",
+ "gm=Ic/(25.*10.**-3.)#\n",
+ "rpi=B/gm#\n",
+ "ri=hie#\n",
+ "rb=ri-rpi#\n",
+ "ro=hoe_1#\n",
+ "Vpi=rpi/(rpi+rb)#\n",
+ "Vo=-gm*Vpi*Rac# #output voltage\n",
+ "Av=Vo#\n",
+ "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
+ "#In book voltage gain is -24.96 due to appraoximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain -25.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of output voltage\n",
+ "#given\n",
+ "Vcc=12.;#V\n",
+ "Rb=150.*10.**3.;#ohm\n",
+ "Rc=5.*10.**3.;#ohm\n",
+ "B=200.;# beta\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "ro=60.*10.**3.;#ohm # 1/hoe\n",
+ "Vi=1.*10.**-3.;#V\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
+ "Vo=0;\n",
+ "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input resistance\n",
+ "# Function definition is here\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2);\n",
+ "\treturn z\n",
+ "\n",
+ "R1=75.*10.**3.;#ohm\n",
+ "R2=7.5*10.**3.;#ohm\n",
+ "Rc=4.7*10.**3.;#ohm\n",
+ "Re=1.2*10.**3.;#ohm\n",
+ "Rl=12.*10.**3.;#ohm\n",
+ "B=150.;\n",
+ "ri=2.*10.**3.;#ohm\n",
+ "Vcc=15.;#V\n",
+ "Vb=Vcc*R2/(R1+R2);\n",
+ "Ve=Vb; #since Vbe=0\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie;\n",
+ "Icsat=Vcc/(Rc+Re);\n",
+ "# Ic < Icsat therefore transistor is in active mode\n",
+ "Vce=Vcc-Ic*(Rc+Re);\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-B*Rac/ri;\n",
+ "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "Ri_=prll(ri,R2);\n",
+ "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 8.30 V 1.14 mA\n",
+ "\n",
+ "The voltage gain = -253.3 \n",
+ "\n",
+ "The input resistance= 1.58 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of gm at different values of Vgs\n",
+ "#given\n",
+ "\n",
+ "Idss=8.*10.**-3.;#A\n",
+ "Vp=4;#V\n",
+ "#At Vgs= -0.5 V\n",
+ "Vgs= -0.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -1.5 V\n",
+ "Vgs= -1.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -2.5 V\n",
+ "Vgs= -2.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gmo = 4 mS\n",
+ "\n",
+ "gm (At Vgs = -0.5V) = 3.5 mS\n",
+ "\n",
+ "gm (At Vgs = -1.5V) = 2.5 mS\n",
+ "\n",
+ "gm (At Vgs = -2.5V) = 1.5 mS\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output signal voltage of the amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Rd=12.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Cs=25.*10.**-6.;#F\n",
+ "u=80.; #amplification factor\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Vi=0.1;#V\n",
+ "f=1.*10.**3.;#Hz #input frequency\n",
+ "Xcs=1./(2.*math.pi*f*Cs);\n",
+ "#This is much smaller than Rs therefore it is bypassed\n",
+ "\n",
+ "gm=u/rd;\n",
+ "Av=gm*(rd*Rd/(rd+Rd));\n",
+ "Vo=Av*Vi;\n",
+ "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 0.453 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "Rd=2.*10.**3.;#ohm\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Av=-gm*(rd*Rd/(rd+Rd));\n",
+ "Ri=Rg;\n",
+ "Ro=rd*Rd/(rd+Rd);\n",
+ "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -4 \n",
+ "input resistance= 1 Mohm \n",
+ "output resistance = 2 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=500.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Rd=5.*10.**3.;#ohm\n",
+ "Rs=100.;#ohm\n",
+ "Rl=5.*10.**3.;#ohm\n",
+ "gm=1.5*10.**-3.;#S\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Rg=R1*R2/(R1+R2);\n",
+ "Rac=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*Rac;\n",
+ "Ri=Rg;\n",
+ "Ro=(rd*Rac/(rd+Rac));\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -3.75 \n",
+ "Input resistance = 45.45 kohm \n",
+ "Output resistance = 2.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the voltage gain of the FET\n",
+ "#given\n",
+ "Idss=8.*10.**-3.##A\n",
+ "Vp=4.##V\n",
+ "rd=25.*10.**3.##ohm\n",
+ "Rd=2.2*10.**3.##ohm #by the help of figure\n",
+ "Vgs=-1.8##V\n",
+ "gmo=2.*Idss/(abs(Vp))#\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
+ "Av=-gm*(rd*Rd/(rd+Rd))#\n",
+ "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain of the FET = -4.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter08.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter08.ipynb new file mode 100755 index 00000000..e4cb5ead --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter08.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47928243cc84327e58308ad01fcae0874127c6d6b4c52996e681382b0f99add6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter08:Multistage Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Express the gain in decibel\n",
+ "#given\n",
+ "#Powere gain of 1000\n",
+ "import math\n",
+ "Pg1=1000.;\n",
+ "Pgd1=10.*math.log10(Pg1);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1000\n",
+ "Vg1=1000.;\n",
+ "Vgd1=20.*math.log10(Vg1);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
+ "\n",
+ "#Powere gain of 1/100\n",
+ "Pg2=1./100.;\n",
+ "Pgd2=10.*math.log10(Pg2);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1/100\n",
+ "Vg2=1./100.;\n",
+ "Vgd2=20.*math.log10(Vg2);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain (in dB)= 30 dB\n",
+ "\n",
+ "Voltage gain (in dB)= 60 dB\n",
+ "\n",
+ "Power gain (in dB)= -20 dB\n",
+ "\n",
+ "Voltage gain (in dB)= -40 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine power and voltage gain\n",
+ "#given\n",
+ "#For Gain = 10 dB\n",
+ "G=10.;#dB\n",
+ "Pg1=10.**(G/10.); #taking antilog\n",
+ "Vg1=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
+ "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
+ "\n",
+ "#For Gain 3 dB\n",
+ "G=3.;#dB\n",
+ "Pg2=10.**(G/10.); #taking antilog\n",
+ "Vg2=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
+ "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Gain 10 dB\n",
+ "\n",
+ "Power gain ratio = 10 \n",
+ "\n",
+ "Voltage gain ratio = 3.16 \n",
+ "\n",
+ "For Gain 3 dB\n",
+ "\n",
+ "Power gain ratio = 2.00 \n",
+ "\n",
+ "Voltage gain ratio = 1.413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the overall voltage gain\n",
+ "#given\n",
+ "import math\n",
+ "A1=80.\n",
+ "A2=50.\n",
+ "A3=30.\n",
+ "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
+ "\n",
+ "#Alternatively\n",
+ "A=A1*A2*A3;\n",
+ "Ad=20.*math.log10(A);\n",
+ "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage gain is = 101.58 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate quiescent output voltage and small signal voltage gain\n",
+ "#given\n",
+ "#At input Voltage =3V\n",
+ "Vi1=3.##V #input voltage\n",
+ "Vbe=0.7##V\n",
+ "B=250.#\n",
+ "Vcc=10.##V #Supply\n",
+ "Re1=1.*10.**3.##ohm\n",
+ "Rc1=3.*10.**3.##ohm\n",
+ "Re2=2.*10.**3.##ohm\n",
+ "Rc2=4.*10.**3.##ohm\n",
+ "Vb1=Vi1# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo1=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
+ "\n",
+ "#At input Voltage =3.2 V\n",
+ "Vi2=3.2##V #input voltage\n",
+ "Vb1=Vi2# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo2=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
+ "\n",
+ "#Small Signal input and output voltage\n",
+ "vi=Vi2-Vi1#\n",
+ "vo=Vo2-Vo1#\n",
+ "Av=vo/vi#\n",
+ "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
+ "\n",
+ "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
+ "\n",
+ "The small signal voltage gain is = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
+ "#FUNCTIONS\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
+ "Rd=10.*10.**3.;#ohm\n",
+ "Rs=500.;#ohm\n",
+ "Rg=470.*10.**3.;#ohm\n",
+ "Rl=470.*10.**3.;#ohm\n",
+ "Cc=0.01*10.**-6.;#Farad\n",
+ "Csh=100.*10.**-12.;#Farad\n",
+ "Cs=50.*10.**-6.;#Farad\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Rac2=prll(Rd,Rl);\n",
+ "Rac1=prll(Rd,Rg);\n",
+ "Req=prll(rd,prll(Rd,Rl));\n",
+ "Am=math.ceil(gm*Req);\n",
+ "Am2=Am*Am; #Voltage gain of two stage amplifier\n",
+ "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
+ "R_=prll(rd,Rd)+prll(Rg,rin);\n",
+ "f1=1./(2.*math.pi*Cc*R_); #lower cutoff frequency\n",
+ "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
+ "f2=1./(2.*math.pi*Csh*Req); #upper cutoff frequency\n",
+ "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
+ "BW=f2_-f1_;\n",
+ "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
+ "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain of two stage amplifier= 324 \n",
+ "\n",
+ "Bandwidth= 115 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Am=8.##midband voltage gain of individual MOSFET\n",
+ "BW=500.*10.**3.#Hz\n",
+ "f2=BW#\n",
+ "n=4.#\n",
+ "A2m=Am**n#\n",
+ "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
+ "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
+ "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Midband voltage gain = 4096 \n",
+ "\n",
+ "Overall Bandwidth = 217.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the input and output impedance and voltage gain\n",
+ "#FUNCTIONS\n",
+ "\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "hie=1.1*10.**3.;#ohm=rin\n",
+ "hfe=120.;#=B\n",
+ "#the values of Rac2, Zi, Zo are as per diagram\n",
+ "Rac2=prll(3.3*10**3,2.2*10**3);\n",
+ "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
+ "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
+ "Zo=prll(3.3*10**3,2.2*10**3);\n",
+ "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
+ "Am2=-hfe*Rac2/(hie);\n",
+ "Am1=-hfe*Rac1/(hie);\n",
+ "Am=Am1*Am2;\n",
+ "Am=20.*math.log10(Am);\n",
+ "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input Resistance = 0.905 kohm\n",
+ " \n",
+ "Output Resistance = 1.32 kohm\n",
+ "\n",
+ "The Overall Voltage gain is 81.97 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter09.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter09.ipynb new file mode 100755 index 00000000..b31e5fc7 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter09.ipynb @@ -0,0 +1,277 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:58dac3f9469c1fa78c6aeab36d8b7e58e74064bbe6f173699cbfdd2fb606b914"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter09:Power Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the turns ratio of the transformer\n",
+ "#given\n",
+ "import math\n",
+ "Rl=8.;#ohm\n",
+ "Rl_=5.*10.**3.;#ohm\n",
+ "TR=math.sqrt(Rl_/Rl); #Turns ratio\n",
+ "print '%s %.f %s' %(\"Turns Ratio =\",TR,\": 1\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Turns Ratio = 25 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the output impedance of the transistor\n",
+ "#given\n",
+ "TR=16./1.; #turn ratio\n",
+ "Rl=4.;#ohm #loudspeaker impedance\n",
+ "ro=(TR**2.)*Rl;\n",
+ "print '%s %.f %s' %(\"The output impedance of the transistor =\",ro,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output impedance of the transistor = 1024 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Determine the efficiency of a single ended transformer\n",
+ "#given\n",
+ "Vceq=10.;#V #supply voltage\n",
+ "\n",
+ "#At Vp=10V\n",
+ "Vp=10.;#V\n",
+ "Vce_max1=Vceq+Vp;\n",
+ "Vce_min1=Vceq-Vp;\n",
+ "n1=50.*((Vce_max1-Vce_min1)/(Vce_max1+Vce_min1))**2.;\n",
+ "print '%s %.f %s' %(\"Efficiency (At Vp = 10V)=\",n1,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=5V\n",
+ "Vp=5.;#V\n",
+ "Vce_max2=Vceq+Vp;\n",
+ "Vce_min2=Vceq-Vp;\n",
+ "n2=50.*((Vce_max2-Vce_min2)/(Vce_max2+Vce_min2))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 5V)=\",n2,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=1V\n",
+ "Vp=1.;#V\n",
+ "Vce_max3=Vceq+Vp;\n",
+ "Vce_min3=Vceq-Vp;\n",
+ "n3=50.*((Vce_max3-Vce_min3)/(Vce_max3+Vce_min3))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 1V)=\",n3,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency (At Vp = 10V)= 50 percent\n",
+ "\n",
+ "Efficiency (At Vp = 5V)= 12.5 percent\n",
+ "\n",
+ "Efficiency (At Vp = 1V)= 0.5 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine input and output power and efficiency\n",
+ "#given\n",
+ "import math\n",
+ "Vcc=20.;#V#supply voltage\n",
+ "Rl=4.;#ohm\n",
+ "Vp=15.;#V\n",
+ "Ip=Vp/Rl;\n",
+ "Idc=Ip/math.pi;\n",
+ "Pi=Vcc*Idc;\n",
+ "Po=((Vp/2.)**2.)/Rl;\n",
+ "n=100.*Po/Pi;\n",
+ "print '%s %.1f %s' %(\"Input power =\",Pi,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Output power =\",Po,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 23.9 W\n",
+ "\n",
+ "Output power = 14.06 W\n",
+ "\n",
+ "Efficiency = 58.90 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage increase in output power\n",
+ "#given\n",
+ "D=0.2;#harmonic distortion\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power=\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage increase in output power= 4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n",
+ "\n",
+ "The percentage increase in output power = 1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter10.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter10.ipynb new file mode 100755 index 00000000..4e6b0eab --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter10.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:efde35bc6b39332bcbdd0902e3c4730008212f1e0c635f78b359c0a32b2006c0"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10:Feedback in Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier\n",
+ "#given\n",
+ "A=100.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 9.09 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=60.;#dB #internal gain in dB\n",
+ "A=10.**(Ad/20.); #internal gain\n",
+ "B=1./20.;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "Afd=20.*math.log10(Af);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 25.85 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of output fed back to input\n",
+ "#given\n",
+ "A=600.;#internal gain\n",
+ "Af=50.;#gain of feedback amplifier\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of output fed back to input = 1.833 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the internal gain and percentage of output fed back to input\n",
+ "#given\n",
+ "Af=80.;#gain of feedback amplifier\n",
+ "Vi=0.05;#V#input with feedback\n",
+ "Vi_=4.*10.**-3.;#V#input without feedback\n",
+ "Vo_=Af*Vi;\n",
+ "A=Vo_/Vi_;\n",
+ "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal gain is = 1000 \n",
+ "\n",
+ "The percentage of output fed back to input = 1.15 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain with and without feedback and feedback factor\n",
+ "#given\n",
+ "Vo_=5.;#V #output voltage\n",
+ "Vi=0.2;#V #input with feedback\n",
+ "Vi_=0.05;#V #input without feedback\n",
+ "A=Vo_/Vi_;\n",
+ "Af=Vo_/Vi;\n",
+ "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain without feedback is = 100 \n",
+ "\n",
+ "The gain with feedback is = 25 \n",
+ "\n",
+ "The feedback factor = 3 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain of feedback amplifier and feedback factor\n",
+ "#given\n",
+ "A=100.; #internal gain\n",
+ "N=20.;#dB #negative feedback\n",
+ "B=(10.**(-N/(-20.))-1.)/A; #taking antilog\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
+ "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The feedback factor = 9 percent\n",
+ "\n",
+ "The gain of the feedback amplifier is = 10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "A=1000.;#internal gain\n",
+ "N=40.;#dB#negative feedback\n",
+ "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
+ "dA_A=10.;#percent#dA/A\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain = 0.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "Adb=60.;#dB#internal gain in dB\n",
+ "B=0.005;#feedback factor\n",
+ "A=10.**(Adb/(20.));#taking antilog\n",
+ "dA_A=-12.;#percent #dA/A\n",
+ "D=(1.+A*B);#D=(1+AB)desensitivity\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain reduces by = 2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the input resistance of feedback amplifier\n",
+ "#given\n",
+ "A=250.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Ri=1.1*10.**3.;#ohm #input resistance\n",
+ "Rif=Ri*(1.+A*B);\n",
+ "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
+ "\n",
+ "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input resistance of feedback amplifier = 28.6 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of negative feedback to input\n",
+ "#given\n",
+ "Adb=60.;#dB #internal gain in dB\n",
+ "A=10.**(Adb/(20.)); #taking antilog\n",
+ "Ro=12.*10.**3.;#ohm #output resistance\n",
+ "Rof=600.;#ohm\n",
+ "B=(Ro/Rof-1.)/A;\n",
+ "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of negative feedback to input = 1.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter11.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter11.ipynb new file mode 100755 index 00000000..776f0b1a --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter11.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3303f44cdb2f2123a36f676f7675540bf34779306594f12942900e5506f78518"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11:Tuned Volatge AMplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current and voltage across each element at resonance\n",
+ "#given\n",
+ "import math\n",
+ "R=12.;#ohm\n",
+ "L=200.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "Vs=9.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Z=R;#impedance\n",
+ "print '%s %.1f %s' %(\"The Resonant frequency =\",fo/1000,\"kHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Z,\"ohm\\n\");\n",
+ "\n",
+ "Io=Vs/R;\n",
+ "print '%s %.2f %s' %(\"The Source current =\",Io,\"A\\n\");\n",
+ "\n",
+ "Vl=Io*(2.*math.pi*fo*L);\n",
+ "Vc=Io/(2.*math.pi*fo*C);\n",
+ "Vr=Io*R;\n",
+ "print '%s %.1f %s' %(\"The voltage across the inductor =\",Vl,\"V\\n\");\n",
+ "print '%s %.1f %s' %(\"The voltage across the capacitor =\",Vc,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The voltage across the resistor =\",Vr,\"V\\n\");\n",
+ "#There is a slight variation in voltage across capacitor due to the approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 649.7 kHz\n",
+ "\n",
+ "The impedance Z = 12 ohm\n",
+ "\n",
+ "The Source current = 0.75 A\n",
+ "\n",
+ "The voltage across the inductor = 612.4 V\n",
+ "\n",
+ "The voltage across the capacitor = 612.4 V\n",
+ "\n",
+ "The voltage across the resistor = 9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current at resonance and current in coil and capacitor\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=100.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "Vs=10.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.3f %s' %(\"The Resonant frequency =\",fo/10**6,\"MHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Io=Vs/Zp;\n",
+ "print '%s %.f %s' %(\"The Source current =\",Io*10**6,\"uA\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Xc=1./(2.*math.pi*fo*C);\n",
+ "Z1=math.sqrt(Xl**2.+R**2.);\n",
+ "Z2=Xc;\n",
+ "Ic=Vs/Z2;\n",
+ "Il=Ic;\n",
+ "print '%s %.f %s' %(\"The current in the coil =\",1000,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"The current in the capacitor =\",Ic*1000,\"mA\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 1.592 MHz\n",
+ "\n",
+ "The impedance Z = 100 kohm\n",
+ "\n",
+ "The Source current = 100 uA\n",
+ "\n",
+ "The current in the coil = 1000 ohm\n",
+ "\n",
+ "The current in the capacitor = 10 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate impedance and quality factor and bandwidth\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=150.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1/(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Q=Xl/R;\n",
+ "BW=fo/Q;\n",
+ "print '%s %.1f %s' %(\"The Quality factor of the circuit =\",Q,\"\\n\");\n",
+ "print '%s %.1f %s' %(\"The Band width of the circuit =\",BW/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance Z = 150 kohm\n",
+ "\n",
+ "The Quality factor of the circuit = 122.5 \n",
+ "\n",
+ "The Band width of the circuit = 10.6 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter12.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter12.ipynb new file mode 100755 index 00000000..842a7419 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter12.ipynb @@ -0,0 +1,214 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f3203bf7786c39de89c39055969e5210f4d6ecee2a5994233cbc07ff50437a9b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12:Sinusoidal Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "L=55.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.f %s' %(\"The frequency of oscillations =\",fo/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1239 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations and feedback factor and voltage gain\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "C1=0.001*10.**-6.;#F\n",
+ "C2=0.01*10.**-6.;#F\n",
+ "L=15.*10.**-6.;#H\n",
+ "C=prll(C1,C2);\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/10**6,\"MHz\\n\");\n",
+ "B=C1/C2;\n",
+ "Amin=1./B;\n",
+ "print '%s %.1f %s' %(\"The feedback factor of the circuit =\",B,\"\\n\");\n",
+ "print '%s %.f' %(\"The circuit needs a minimum voltage gain of\",Amin);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1.36 MHz\n",
+ "\n",
+ "The feedback factor of the circuit = 0.1 \n",
+ "\n",
+ "The circuit needs a minimum voltage gain of 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=10.*10.**3.;#ohm\n",
+ "C=0.01*10.**-6.;#F\n",
+ "fo=1./(2.*math.pi*R*C*math.sqrt(6.));\n",
+ "print '%s %.1f %s' %(\"The frequency of oscillations =\",fo,\"Hz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 649.7 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=22.*10.**3.;#ohm\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*R*C);\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/1000,\"KHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 72.34 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter14.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter14.ipynb new file mode 100755 index 00000000..31604c97 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter14.ipynb @@ -0,0 +1,211 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:22a4fbff9c8897e342a78bd9c8e48f9f093d2131b002f5667d92f4929ec8b5e4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter14:Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "Acl=-Rf/R1;\n",
+ "Ricl=R1;\n",
+ "Ro=0;\n",
+ "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -100 \n",
+ "\n",
+ "The input resistance = 20 kohm\n",
+ "\n",
+ "The output resistance = 0 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output voltage\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "v1=4.;#V\n",
+ "v2=3.8;#V\n",
+ "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
+ "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -16.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design an adder circuit using an op amp\n",
+ "#given\n",
+ "#Vo=-(V1+10*V2+100*V3)\n",
+ "Rf=100.*10.**3.;#ohm\n",
+ "C1=1.;#coefficient of V1\n",
+ "C2=10.;#coefficient of V2\n",
+ "C3=100.;#coefficient of V3\n",
+ "R1=Rf/C1;\n",
+ "R2=Rf/C2;\n",
+ "R3=Rf/C3;\n",
+ "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 kohm\n",
+ "\n",
+ "R2 = 10 kohm\n",
+ "\n",
+ "R3 = 1 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate CMRR in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=100.;#differential mode gain\n",
+ "Ac=0.01;#common mode gain\n",
+ "CMRR=20.*math.log10(Ad/Ac);\n",
+ "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The CMRR in dB = 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the output voltage\n",
+ "#given\n",
+ "Ad=2000.;#differential mode gain\n",
+ "CMRR=10000.;\n",
+ "V1=10.**-3.;#V\n",
+ "V2=0.9*10.**-3.;#V\n",
+ "Vd=V1-V2;\n",
+ "Vc=(V1+V2)/2.;\n",
+ "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
+ "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 200.19 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter15.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter15.ipynb new file mode 100755 index 00000000..fd33b772 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter15.ipynb @@ -0,0 +1,321 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3272b71267bbacf52f9c327ed8b09b4bccad5d41aa103777487106ade1397663"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter15:Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance and multiplying factor\n",
+ "#given\n",
+ "Im=5.*10.**-3.;#A\n",
+ "Rm=20.;#ohm\n",
+ "I=5.;#A\n",
+ "Rsh=Rm*Im/(I-Im);\n",
+ "n=I/Im;\n",
+ "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 0.02002 ohm\n",
+ "\n",
+ "Multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance\n",
+ "#given\n",
+ "#At I= 1 mA\n",
+ "I1=1.*10.**-3.;#A\n",
+ "Im=0.1*10.**-3.;#A\n",
+ "Rm=500.;#ohm\n",
+ "Rsh=Rm*Im/(I1-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I2=10.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I2-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I3=100.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I3-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 55.5556 ohm\n",
+ "\n",
+ "Shunt resistance = 5.0505 ohm\n",
+ "\n",
+ "Shunt resistance = 0.5005 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caluclate the series resistance to convert it into voltmeter\n",
+ "#given\n",
+ "Im=100.*10.**-6.;#A\n",
+ "Rm=100.;#ohm\n",
+ "V=100.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of series resistance is 999.9 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate multiplier resistance and voltage multiplying factor\n",
+ "#given\n",
+ "Im=50.*10.**-6.;#A\n",
+ "Rm=1000.;#ohm\n",
+ "V=50.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
+ "Vm=Im*Rm;\n",
+ "n=V/Vm;\n",
+ "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of multiplier resistance is 999 kohm\n",
+ "\n",
+ "Voltage multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reading and error of each voltmeter\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "S_A=1000.;# ohm/V#sensitivity\n",
+ "S_B=20000.;# ohm/V#sensitivity\n",
+ "R=50.;#V#range of voltmeter\n",
+ "Vs=150.;#V#Supply\n",
+ "R1=100.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Vt=Vs*(R2/(R1+R2));\n",
+ "\n",
+ "#Voltmeter A\n",
+ "Ri1=S_A*R;\n",
+ "Rxy_A=prll(Ri1,R2); #total resistance at X and Y\n",
+ "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
+ "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
+ "\n",
+ "#Voltmeter B\n",
+ "Ri2=S_B*R;\n",
+ "Rxy_B=prll(Ri2,R2); #total resistance at X and Y\n",
+ "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
+ "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
+ "\n",
+ "e1=(Vt-V1)*100./Vt;\n",
+ "e2=(Vt-V2)*100./Vt;\n",
+ "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltmeter indicates 30 V\n",
+ "\n",
+ "The voltmeter indicates 48.39 V\n",
+ "\n",
+ "The error in the reading of voltmeter A = 40 percent\n",
+ "\n",
+ "The error in the reading of voltmeter A = 3.23 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value of the ac voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=8.3;#cm#length of the trace\n",
+ "D=5.;# V/cm#deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/(2.*math.sqrt(2.));\n",
+ "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the ac voltage 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value and frequency of the sine voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=3.5;#cm #length of the trace\n",
+ "D=2.;# V/cm #deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/math.sqrt(2.);\n",
+ "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
+ "x=4.;#cm #one cycle length on x axis\n",
+ "t=0.5*10.**-3.;# s/cm #timebase setting\n",
+ "T=x*t;\n",
+ "f=1./T;\n",
+ "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sine voltage = 4.95 V\n",
+ "\n",
+ "The frequency of the sine voltage = 0.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01.ipynb new file mode 100755 index 00000000..d9b8d232 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01.ipynb @@ -0,0 +1,241 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f29193149f0b645210af1f807e738f44273cdf4f3faf059dbea7ad23270af3f9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 01: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": 6
+ },
+ {
+ "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": 7
+ },
+ {
+ "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": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01_1.ipynb new file mode 100755 index 00000000..d9b8d232 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01_1.ipynb @@ -0,0 +1,241 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f29193149f0b645210af1f807e738f44273cdf4f3faf059dbea7ad23270af3f9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 01: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": 6
+ },
+ {
+ "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": 7
+ },
+ {
+ "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": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02.ipynb new file mode 100755 index 00000000..3298c091 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4bfa36805a5140f0dc7023e6b533e12bf6cf488b53f4f9082629f42b62484f4a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 02:Semiconductor Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the conductivity and resistivity of germanium\n",
+ "#!/usr/bin/env/ python\n",
+ "#-*- coding: utf-8 -*-\n",
+ "q=1.6*10.**-19.#Coulomb #charge of an electron\n",
+ "ni=2.5*10.**19.#per m**3 #concentration\n",
+ "un=0.36#m**2/Vs #mobility of electron\n",
+ "up=0.17#m**2/Vs #mobility of holes\n",
+ "con=q*ni*(un+up); #conductivity\n",
+ "res=(1./con); #resistivity\n",
+ "print '%s %.2f %s' %(\"The conductivty is =\",con,'S/m');\n",
+ "print '%s %.2f %s' %(\"The resistivity is =\",res,'ohm m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is = 2.12 S/m\n",
+ "The resistivity is = 0.47 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ecample E2 - pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the conductivity of extrinsic semiconductor\n",
+ "#given\n",
+ "e=1.6*10.**-19.;#Coulomb #charge of an electron\n",
+ "ni=1.5*10.**16.;#per m**3 #concentration\n",
+ "un=0.13;#m**2/Vs #mobility of electron\n",
+ "up=0.05;#m**2/Vs #mobility of holes\n",
+ "Si=5.*10.**28.;#per m**3 #atomic density in silicon\n",
+ "dop=(1./(2.*10.**8.)); #concentration of an antimony per silicon atoms\n",
+ "Nd=dop*Si;#per m**3 #donor concentraion\n",
+ "n=Nd;#per m**3 #free electron concentration\n",
+ "p=(ni**2/Nd);#per m **3 # hole concentration\n",
+ "con=e*(n*un+p*up);\n",
+ "print '%s %.1f %s' %(\"The conductivty is=\",con, 'S/m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is= 5.2 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02_1.ipynb new file mode 100755 index 00000000..3298c091 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02_1.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4bfa36805a5140f0dc7023e6b533e12bf6cf488b53f4f9082629f42b62484f4a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 02:Semiconductor Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the conductivity and resistivity of germanium\n",
+ "#!/usr/bin/env/ python\n",
+ "#-*- coding: utf-8 -*-\n",
+ "q=1.6*10.**-19.#Coulomb #charge of an electron\n",
+ "ni=2.5*10.**19.#per m**3 #concentration\n",
+ "un=0.36#m**2/Vs #mobility of electron\n",
+ "up=0.17#m**2/Vs #mobility of holes\n",
+ "con=q*ni*(un+up); #conductivity\n",
+ "res=(1./con); #resistivity\n",
+ "print '%s %.2f %s' %(\"The conductivty is =\",con,'S/m');\n",
+ "print '%s %.2f %s' %(\"The resistivity is =\",res,'ohm m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is = 2.12 S/m\n",
+ "The resistivity is = 0.47 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ecample E2 - pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the conductivity of extrinsic semiconductor\n",
+ "#given\n",
+ "e=1.6*10.**-19.;#Coulomb #charge of an electron\n",
+ "ni=1.5*10.**16.;#per m**3 #concentration\n",
+ "un=0.13;#m**2/Vs #mobility of electron\n",
+ "up=0.05;#m**2/Vs #mobility of holes\n",
+ "Si=5.*10.**28.;#per m**3 #atomic density in silicon\n",
+ "dop=(1./(2.*10.**8.)); #concentration of an antimony per silicon atoms\n",
+ "Nd=dop*Si;#per m**3 #donor concentraion\n",
+ "n=Nd;#per m**3 #free electron concentration\n",
+ "p=(ni**2/Nd);#per m **3 # hole concentration\n",
+ "con=e*(n*un+p*up);\n",
+ "print '%s %.1f %s' %(\"The conductivty is=\",con, 'S/m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is= 5.2 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03.ipynb new file mode 100755 index 00000000..280ee382 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03.ipynb @@ -0,0 +1,644 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1e101b9e385e167bfc6f71dcc655515c9c3942d49c6f6361f5ace95f1aed05a9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 03:Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Page 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value of threshold voltage\n",
+ "#given\n",
+ "t1=25.;#degrees C#initial temperature\n",
+ "t2=100.;#degrees C#final temperature\n",
+ "V=2.*10.**-3.;#V per celsius degree#decrease in barrier potential per degree\n",
+ "V0=0.7#V#Potential at normal temperature\n",
+ "Vd=(t2-t1)*V;#decrease in barrier potential\n",
+ "Vt=V0-Vd;#threshold volatge at 100degree C\n",
+ "print '%s %.2f %s' %(\"Threshold volatge at 100 degrees C =\",Vt,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Threshold volatge at 100 degrees C = 0.55 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detrenmine dc resistance of silicon diode\n",
+ "#given\n",
+ "#At Id = 2 mA\n",
+ "Id=2.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.5;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Id = 20 mA\n",
+ "Id=20.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.75;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.1f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Vd = - 10 V \n",
+ "Id=-2.*10.**-6.;#Ampere#diode current(from given curve)\n",
+ "Vd=-10.;#V#voltage\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf/10**6,\"M ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance is = 250 ohm\n",
+ "\n",
+ "The dc resistance is = 37.5 ohm\n",
+ "\n",
+ "The dc resistance is = 5 M ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc & ac resistance of silicon diode\n",
+ "#given\n",
+ "Id=20.*10.**-3.;#A#diode current\n",
+ "Vd=0.75;#V# as given in the V-I graph\n",
+ "Rf=Vd/Id;\n",
+ "print '%s %.1f %s' %(\"The dc resistance of diode is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#From Graph the values of dynamic voltage and current are\n",
+ "#which is equal to MN and NL repectively (in graph)\n",
+ "del_Vd=(0.8-0.68);#V\n",
+ "del_Id=(40-0)*10.**-3.;#A\n",
+ "rf=del_Vd/del_Id;\n",
+ "print '%s %.f %s' %(\"The ac resistance of the diode is =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance of diode is = 37.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is = 3 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine ac resistance of silicon diode\n",
+ "#given\n",
+ "#At Id =10mA\n",
+ "Id=10.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.1f %s' %(\"The ac resistance of the diode is(At Id= 10mA) =\",rf,\"ohm\\n\")\n",
+ "\n",
+ "#At Id =20mA\n",
+ "Id=20.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.2f %s' %(\"The ac resistance of the diode is(At Id= 20mA) =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode is(At Id= 10mA) = 2.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is(At Id= 20mA) = 1.25 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through diode\n",
+ "#given\n",
+ "Vt=0.3;#V#Threshold voltage\n",
+ "rf=25.;#ohm# average resistance\n",
+ "\n",
+ "#assuming it to be ideal\n",
+ "#from fig 3.19\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=45.;#ohm\n",
+ "R2=5.;#ohm\n",
+ "Vab=Vaa*R2/(R1+R2);\n",
+ "#Vab>Vt therefore diode is forward bias and no current flow through R2\n",
+ "Idi=Vaa/R1; #for ideal\n",
+ "print '%s %.f %s' %(\"The diode current (for ideal) is =\",Idi*1000,\"mA\\n\");\n",
+ "\n",
+ "#assuming it to be real\n",
+ "#Thevenins equivalent circuit parameters of fig 3.19\n",
+ "Vth=Vaa*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "Idr=(Vth-Vt)/(Rth+rf); #for real\n",
+ "print '%s %.1f %s' %(\"The diode current (for real) is =\",Idr*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diode current (for ideal) is = 222 mA\n",
+ "\n",
+ "The diode current (for real) is = 23.7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through resistance in given figure\n",
+ "#From fig\n",
+ "Vaa=20.;#V#supply\n",
+ "Vt=0.7;#V#threshold voltage of diode\n",
+ "rf=5.;#ohm #forward resistance\n",
+ "R=90.;#ohm#given resistor\n",
+ "\n",
+ "#Diode D1 and D4 are forward bias and D2 and D3 are reverse biased\n",
+ "\n",
+ "Vnet=Vaa-Vt-Vt;\n",
+ "Rt=R+rf+rf;\n",
+ "I=Vnet/Rt;\n",
+ "print '%s %.f %s' %(\"Current through 90 ohm resistor is =\",I*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 90 ohm resistor is = 186 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current drawn by the battery\n",
+ "#From fig\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=100.;#ohm\n",
+ "R2=100.;#ohm\n",
+ "\n",
+ "#Forward Bias\n",
+ "Id=Vaa/R1;\n",
+ "print '%s %.1f %s' %(\"Current drawn from battery (forward bias) =\",Id,\"A\\n\");\n",
+ "\n",
+ "#Reverse Bias\n",
+ "Rnet=R1+R2;\n",
+ "Id=Vaa/Rnet;\n",
+ "print '%s %.2f %s' %(\"Current drawn from battery (reverse bias) =\",Id,\"A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from battery (forward bias) = 0.1 A\n",
+ "\n",
+ "Current drawn from battery (reverse bias) = 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc current through load and rectification efficiency and peak inverse voltage\n",
+ "#given\n",
+ "import math\n",
+ "TR=31./2.;#Turn ratio of the transformer\n",
+ "rf=20.;#ohm#Dynamic forward resistance\n",
+ "Rl=1000.;#ohm#Load resistance\n",
+ "Vt=0.66;#V#Threshold voltage of diode\n",
+ "V=220.;#V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp;\n",
+ "Im=(Vm-Vt)/(rf+Rl);\n",
+ "Idc=Im/math.pi;\n",
+ "n=40.6/(1.+rf/Rl);\n",
+ "print '%s %.f %s' %(\"The dc current through load is =\",Idc*1000,\"mA\\n\");\n",
+ "print '%s %.1f %s' %(\"The rectification efficiency is =\",n,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"Peak inverse voltage =Vm = \",Vm,\"V\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current through load is = 6 mA\n",
+ "\n",
+ "The rectification efficiency is = 39.8 percent\n",
+ "\n",
+ "Peak inverse voltage =Vm = 20.07 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc voltage across load and peak inverse voltage across each diode\n",
+ "#given\n",
+ "import math\n",
+ "TR=12./1.##Turn ratio of the transformer\n",
+ "V=220.##V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp#\n",
+ "Vdc=(2.*Vm)/math.pi#\n",
+ "print '%s %.1f %s' %(\"The dc voltage across load =\",Vdc,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for bridge rectifier) =\",Vm,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for centre tap rectifier) =\",2*Vm,\"V\\n\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc voltage across load = 16.5 V\n",
+ "\n",
+ "Peak inverse voltage (for bridge rectifier) = 25.9 V\n",
+ "\n",
+ "Peak inverse voltage (for centre tap rectifier) = 51.9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc power supplied to load and efficiency and PIV rating of the diode\n",
+ "#given\n",
+ "import math\n",
+ "rf=2.;#ohm#Dynamic forward resistance\n",
+ "Rs=5.;#ohm#resistaqnce of secondary\n",
+ "Rl=25.;#ohm#Load resistance\n",
+ "Idc=0.1;#A#dc current to a load\n",
+ "Pdc=Idc**2.*Rl; #dc power\n",
+ "n=(81.2*Rl)/(Rl+rf+Rs); #efficiency\n",
+ "Im=(math.pi*Idc)/2.; #peak value current\n",
+ "Vm=Im*(Rl+rf+Rs); #peak voltage\n",
+ "Vlm=Vm-Im*(rf+Rs); #peak voltage across load\n",
+ "PIV=Vm+Vlm;\n",
+ "print '%s %.2f %s' %(\"The dc power supplied to the load is =\",Pdc,'W\\n');\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,'percent\\n');\n",
+ "print '%s %.3f %s' %(\"The peak inverse voltage is =\",PIV,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc power supplied to the load is = 0.25 W\n",
+ "\n",
+ "Efficiency = 63.44 percent\n",
+ "\n",
+ "The peak inverse voltage is = 8.954 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate output voltage and current through load and voltage across series resistor and current and power dissipated in zener diode\n",
+ "#given\n",
+ "Vi=110.;#V #input voltage\n",
+ "Rl=6.*10.**3.;# ohm #load resistance\n",
+ "Rs=2.*10.**3.;#ohm #series resistance\n",
+ "Vz=60.;#V #Zener voltage\n",
+ "V=Vi*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Vs=Vi-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Iz=Is-Il #/By applying kirchhoffs law\n",
+ "Pz=Vz*Iz #Power dissipated accross zener diode\n",
+ "\n",
+ "print '%s %.f %s' %(\"The output voltage is =\",Vo,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The current through load resistance is =\",Il*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"Voltage across series resistor is =\",Vs,\"V\\n\")\n",
+ "print '%s %.f %s' %(\"Current in zener diode is =\",Iz*1000,\"mA\\n\")\n",
+ "print '%s %.f %s' %(\"Power dissipated by zener diode =\",Pz*1000,'mW');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 60 V\n",
+ "\n",
+ "The current through load resistance is = 10 mA\n",
+ "\n",
+ "Voltage across series resistor is = 50 V\n",
+ "\n",
+ "Current in zener diode is = 15 mA\n",
+ "\n",
+ "Power dissipated by zener diode = 900 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate max and min values of zener diode current\n",
+ "#given\n",
+ "Vimin=80.;#V #minimum input voltage\n",
+ "Vimax=120.;#V #maximum input voltage\n",
+ "Rl=10.*10.**3.;# ohm #load resistance\n",
+ "Rs=5.*10.**3.;#ohm #series resistance\n",
+ "Vz=50.;#V #Zener voltage\n",
+ "V=Vimin*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "#For minimum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimin-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmin=Is-Il;\n",
+ "print '%s %.f %s' %(\"Minimum values of zener diode current is =\",Izmin*1000,\"mA\\n\");\n",
+ "\n",
+ "#For maximum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimax-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmax=Is-Il;\n",
+ "print '%s %.f %s' %(\"Maximum values of zener diode current is =\",Izmax*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum values of zener diode current is = 1 mA\n",
+ "\n",
+ "Maximum values of zener diode current is = 9 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine value of the series resistor and wattage rating\n",
+ "#given\n",
+ "Vi=12.##V #input voltage\n",
+ "Vz=7.2##V #Zener voltage\n",
+ "Izmin=10.*10.**-3.##A #min current through zener diode\n",
+ "Ilmax=100*10.**-3.##A #max current through load\n",
+ "Ilmin=12.*10.**-3.##A #min current through load\n",
+ "Vs=Vi-Vz# #Voltage drop across the series resistor\n",
+ "Is=Izmin+Ilmax# #Current through the series resistor\n",
+ "Rs=Vs/Is#\n",
+ "print '%s %.1f %s' %(\"The series resistor so that 10mA current flow through zener diode is =\",Rs,\"ohm\\n\")#\n",
+ "Izmax=Is-Ilmin#max zener through zener diode\n",
+ "Pmax=Izmax*Vz#\n",
+ "print '%s %.1f %s' %(\"The maximum wattage rating is =\",Pmax*1000,\"mW\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resistor so that 10mA current flow through zener diode is = 43.6 ohm\n",
+ "\n",
+ "The maximum wattage rating is = 705.6 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the capacitance of a varactor diode\n",
+ "#given\n",
+ "import math\n",
+ "C=5.;#pf#capcitance of varactor diode at V=4V\n",
+ "V=4.;#V\n",
+ "K=C*math.sqrt(4.);\n",
+ "#When bias voltage is increased upto 6 V\n",
+ "Vn=6.;#V#new bias voltage\n",
+ "Cn=K/(math.sqrt(Vn));\n",
+ "print '%s %.3f %s' %(\"Capacitance (At 6 V ) =\",Cn,\"pf\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance (At 6 V ) = 4.082 pf\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03_1.ipynb new file mode 100755 index 00000000..280ee382 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03_1.ipynb @@ -0,0 +1,644 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1e101b9e385e167bfc6f71dcc655515c9c3942d49c6f6361f5ace95f1aed05a9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 03:Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Page 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value of threshold voltage\n",
+ "#given\n",
+ "t1=25.;#degrees C#initial temperature\n",
+ "t2=100.;#degrees C#final temperature\n",
+ "V=2.*10.**-3.;#V per celsius degree#decrease in barrier potential per degree\n",
+ "V0=0.7#V#Potential at normal temperature\n",
+ "Vd=(t2-t1)*V;#decrease in barrier potential\n",
+ "Vt=V0-Vd;#threshold volatge at 100degree C\n",
+ "print '%s %.2f %s' %(\"Threshold volatge at 100 degrees C =\",Vt,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Threshold volatge at 100 degrees C = 0.55 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detrenmine dc resistance of silicon diode\n",
+ "#given\n",
+ "#At Id = 2 mA\n",
+ "Id=2.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.5;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Id = 20 mA\n",
+ "Id=20.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.75;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.1f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Vd = - 10 V \n",
+ "Id=-2.*10.**-6.;#Ampere#diode current(from given curve)\n",
+ "Vd=-10.;#V#voltage\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf/10**6,\"M ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance is = 250 ohm\n",
+ "\n",
+ "The dc resistance is = 37.5 ohm\n",
+ "\n",
+ "The dc resistance is = 5 M ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc & ac resistance of silicon diode\n",
+ "#given\n",
+ "Id=20.*10.**-3.;#A#diode current\n",
+ "Vd=0.75;#V# as given in the V-I graph\n",
+ "Rf=Vd/Id;\n",
+ "print '%s %.1f %s' %(\"The dc resistance of diode is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#From Graph the values of dynamic voltage and current are\n",
+ "#which is equal to MN and NL repectively (in graph)\n",
+ "del_Vd=(0.8-0.68);#V\n",
+ "del_Id=(40-0)*10.**-3.;#A\n",
+ "rf=del_Vd/del_Id;\n",
+ "print '%s %.f %s' %(\"The ac resistance of the diode is =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance of diode is = 37.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is = 3 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine ac resistance of silicon diode\n",
+ "#given\n",
+ "#At Id =10mA\n",
+ "Id=10.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.1f %s' %(\"The ac resistance of the diode is(At Id= 10mA) =\",rf,\"ohm\\n\")\n",
+ "\n",
+ "#At Id =20mA\n",
+ "Id=20.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.2f %s' %(\"The ac resistance of the diode is(At Id= 20mA) =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode is(At Id= 10mA) = 2.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is(At Id= 20mA) = 1.25 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through diode\n",
+ "#given\n",
+ "Vt=0.3;#V#Threshold voltage\n",
+ "rf=25.;#ohm# average resistance\n",
+ "\n",
+ "#assuming it to be ideal\n",
+ "#from fig 3.19\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=45.;#ohm\n",
+ "R2=5.;#ohm\n",
+ "Vab=Vaa*R2/(R1+R2);\n",
+ "#Vab>Vt therefore diode is forward bias and no current flow through R2\n",
+ "Idi=Vaa/R1; #for ideal\n",
+ "print '%s %.f %s' %(\"The diode current (for ideal) is =\",Idi*1000,\"mA\\n\");\n",
+ "\n",
+ "#assuming it to be real\n",
+ "#Thevenins equivalent circuit parameters of fig 3.19\n",
+ "Vth=Vaa*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "Idr=(Vth-Vt)/(Rth+rf); #for real\n",
+ "print '%s %.1f %s' %(\"The diode current (for real) is =\",Idr*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diode current (for ideal) is = 222 mA\n",
+ "\n",
+ "The diode current (for real) is = 23.7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through resistance in given figure\n",
+ "#From fig\n",
+ "Vaa=20.;#V#supply\n",
+ "Vt=0.7;#V#threshold voltage of diode\n",
+ "rf=5.;#ohm #forward resistance\n",
+ "R=90.;#ohm#given resistor\n",
+ "\n",
+ "#Diode D1 and D4 are forward bias and D2 and D3 are reverse biased\n",
+ "\n",
+ "Vnet=Vaa-Vt-Vt;\n",
+ "Rt=R+rf+rf;\n",
+ "I=Vnet/Rt;\n",
+ "print '%s %.f %s' %(\"Current through 90 ohm resistor is =\",I*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 90 ohm resistor is = 186 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current drawn by the battery\n",
+ "#From fig\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=100.;#ohm\n",
+ "R2=100.;#ohm\n",
+ "\n",
+ "#Forward Bias\n",
+ "Id=Vaa/R1;\n",
+ "print '%s %.1f %s' %(\"Current drawn from battery (forward bias) =\",Id,\"A\\n\");\n",
+ "\n",
+ "#Reverse Bias\n",
+ "Rnet=R1+R2;\n",
+ "Id=Vaa/Rnet;\n",
+ "print '%s %.2f %s' %(\"Current drawn from battery (reverse bias) =\",Id,\"A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from battery (forward bias) = 0.1 A\n",
+ "\n",
+ "Current drawn from battery (reverse bias) = 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc current through load and rectification efficiency and peak inverse voltage\n",
+ "#given\n",
+ "import math\n",
+ "TR=31./2.;#Turn ratio of the transformer\n",
+ "rf=20.;#ohm#Dynamic forward resistance\n",
+ "Rl=1000.;#ohm#Load resistance\n",
+ "Vt=0.66;#V#Threshold voltage of diode\n",
+ "V=220.;#V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp;\n",
+ "Im=(Vm-Vt)/(rf+Rl);\n",
+ "Idc=Im/math.pi;\n",
+ "n=40.6/(1.+rf/Rl);\n",
+ "print '%s %.f %s' %(\"The dc current through load is =\",Idc*1000,\"mA\\n\");\n",
+ "print '%s %.1f %s' %(\"The rectification efficiency is =\",n,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"Peak inverse voltage =Vm = \",Vm,\"V\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current through load is = 6 mA\n",
+ "\n",
+ "The rectification efficiency is = 39.8 percent\n",
+ "\n",
+ "Peak inverse voltage =Vm = 20.07 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc voltage across load and peak inverse voltage across each diode\n",
+ "#given\n",
+ "import math\n",
+ "TR=12./1.##Turn ratio of the transformer\n",
+ "V=220.##V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp#\n",
+ "Vdc=(2.*Vm)/math.pi#\n",
+ "print '%s %.1f %s' %(\"The dc voltage across load =\",Vdc,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for bridge rectifier) =\",Vm,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for centre tap rectifier) =\",2*Vm,\"V\\n\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc voltage across load = 16.5 V\n",
+ "\n",
+ "Peak inverse voltage (for bridge rectifier) = 25.9 V\n",
+ "\n",
+ "Peak inverse voltage (for centre tap rectifier) = 51.9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc power supplied to load and efficiency and PIV rating of the diode\n",
+ "#given\n",
+ "import math\n",
+ "rf=2.;#ohm#Dynamic forward resistance\n",
+ "Rs=5.;#ohm#resistaqnce of secondary\n",
+ "Rl=25.;#ohm#Load resistance\n",
+ "Idc=0.1;#A#dc current to a load\n",
+ "Pdc=Idc**2.*Rl; #dc power\n",
+ "n=(81.2*Rl)/(Rl+rf+Rs); #efficiency\n",
+ "Im=(math.pi*Idc)/2.; #peak value current\n",
+ "Vm=Im*(Rl+rf+Rs); #peak voltage\n",
+ "Vlm=Vm-Im*(rf+Rs); #peak voltage across load\n",
+ "PIV=Vm+Vlm;\n",
+ "print '%s %.2f %s' %(\"The dc power supplied to the load is =\",Pdc,'W\\n');\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,'percent\\n');\n",
+ "print '%s %.3f %s' %(\"The peak inverse voltage is =\",PIV,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc power supplied to the load is = 0.25 W\n",
+ "\n",
+ "Efficiency = 63.44 percent\n",
+ "\n",
+ "The peak inverse voltage is = 8.954 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate output voltage and current through load and voltage across series resistor and current and power dissipated in zener diode\n",
+ "#given\n",
+ "Vi=110.;#V #input voltage\n",
+ "Rl=6.*10.**3.;# ohm #load resistance\n",
+ "Rs=2.*10.**3.;#ohm #series resistance\n",
+ "Vz=60.;#V #Zener voltage\n",
+ "V=Vi*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Vs=Vi-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Iz=Is-Il #/By applying kirchhoffs law\n",
+ "Pz=Vz*Iz #Power dissipated accross zener diode\n",
+ "\n",
+ "print '%s %.f %s' %(\"The output voltage is =\",Vo,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The current through load resistance is =\",Il*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"Voltage across series resistor is =\",Vs,\"V\\n\")\n",
+ "print '%s %.f %s' %(\"Current in zener diode is =\",Iz*1000,\"mA\\n\")\n",
+ "print '%s %.f %s' %(\"Power dissipated by zener diode =\",Pz*1000,'mW');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 60 V\n",
+ "\n",
+ "The current through load resistance is = 10 mA\n",
+ "\n",
+ "Voltage across series resistor is = 50 V\n",
+ "\n",
+ "Current in zener diode is = 15 mA\n",
+ "\n",
+ "Power dissipated by zener diode = 900 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate max and min values of zener diode current\n",
+ "#given\n",
+ "Vimin=80.;#V #minimum input voltage\n",
+ "Vimax=120.;#V #maximum input voltage\n",
+ "Rl=10.*10.**3.;# ohm #load resistance\n",
+ "Rs=5.*10.**3.;#ohm #series resistance\n",
+ "Vz=50.;#V #Zener voltage\n",
+ "V=Vimin*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "#For minimum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimin-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmin=Is-Il;\n",
+ "print '%s %.f %s' %(\"Minimum values of zener diode current is =\",Izmin*1000,\"mA\\n\");\n",
+ "\n",
+ "#For maximum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimax-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmax=Is-Il;\n",
+ "print '%s %.f %s' %(\"Maximum values of zener diode current is =\",Izmax*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum values of zener diode current is = 1 mA\n",
+ "\n",
+ "Maximum values of zener diode current is = 9 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine value of the series resistor and wattage rating\n",
+ "#given\n",
+ "Vi=12.##V #input voltage\n",
+ "Vz=7.2##V #Zener voltage\n",
+ "Izmin=10.*10.**-3.##A #min current through zener diode\n",
+ "Ilmax=100*10.**-3.##A #max current through load\n",
+ "Ilmin=12.*10.**-3.##A #min current through load\n",
+ "Vs=Vi-Vz# #Voltage drop across the series resistor\n",
+ "Is=Izmin+Ilmax# #Current through the series resistor\n",
+ "Rs=Vs/Is#\n",
+ "print '%s %.1f %s' %(\"The series resistor so that 10mA current flow through zener diode is =\",Rs,\"ohm\\n\")#\n",
+ "Izmax=Is-Ilmin#max zener through zener diode\n",
+ "Pmax=Izmax*Vz#\n",
+ "print '%s %.1f %s' %(\"The maximum wattage rating is =\",Pmax*1000,\"mW\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resistor so that 10mA current flow through zener diode is = 43.6 ohm\n",
+ "\n",
+ "The maximum wattage rating is = 705.6 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the capacitance of a varactor diode\n",
+ "#given\n",
+ "import math\n",
+ "C=5.;#pf#capcitance of varactor diode at V=4V\n",
+ "V=4.;#V\n",
+ "K=C*math.sqrt(4.);\n",
+ "#When bias voltage is increased upto 6 V\n",
+ "Vn=6.;#V#new bias voltage\n",
+ "Cn=K/(math.sqrt(Vn));\n",
+ "print '%s %.3f %s' %(\"Capacitance (At 6 V ) =\",Cn,\"pf\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance (At 6 V ) = 4.082 pf\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04.ipynb new file mode 100755 index 00000000..1d5b5c35 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04.ipynb @@ -0,0 +1,420 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:17fddcb6590702d38f46f2b5d25907fb7a3d2becfbec4029a12516743d1ef624"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 04 - Bipolar Junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the collector and base current\n",
+ "#given\n",
+ "a=0.98;#dc alpha\n",
+ "Ie=5.*10.**-3.;#A#emitter current\n",
+ "Ico=2.*10.**-6.;#A#collector reverse leakage current\n",
+ "Ic=a*Ie+Ico;\n",
+ "Ib=Ie-Ic;\n",
+ "print '%s %.3f %s' %(\"The collector current is =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is = 4.902 mA\n",
+ "\n",
+ "The base current is = 98 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the base and collector current and exact and approax dc alpha \n",
+ "#given\n",
+ "Ie=8.4*10.**-3.#A#emitter current\n",
+ "Icbo=0.1*10.**-6.##A#reverse leakage current\n",
+ "Ib=0.008*Ie##A#base current\n",
+ "Ic=Ie-Ib#\n",
+ "Icinj=Ic-Icbo#\n",
+ "a0=Icinj/Ie#\n",
+ "a=Ic/Ie#\n",
+ "print '%s %.1f %s' %(\"Base current is =\",Ib*10**6,\"uA\\n\")#\n",
+ "print '%s %.4f %s' %(\"Collector current =\",Ic*1000,\"mA\\n\",)#\n",
+ "print '%s %.7f %s' %(\"Exact value of alphha =\",a0,\"\\n\")#\n",
+ "print '%s %.3f' %(\"Approax value of alpha =\",a)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current is = 67.2 uA\n",
+ "\n",
+ "Collector current = 8.3328 mA\n",
+ "\n",
+ "Exact value of alphha = 0.9919881 \n",
+ "\n",
+ "Approax value of alpha = 0.992\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the base current\n",
+ "#given\n",
+ "a=0.96; #dc alpha\n",
+ "Rc=2.*10.**3.;#ohm #resistor across collector\n",
+ "Vc=4.;#V #Voltage drop across the collector resistor\n",
+ "Ic=Vc/Rc; #Colletor current\n",
+ "Ie=Ic/a; #Emmiter current\n",
+ "Ib=Ie-Ic; #Base current\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\",)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is = 83 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Ie=2.;#mA\n",
+ "Vcb=10.;#V\n",
+ "\n",
+ "#Taking points around Ie & Vcb from graph\n",
+ "del_Ie=(2.5-1.5)*10.**-3.;#A\n",
+ "\n",
+ "#corresponding change in Veb\n",
+ "del_Veb=(0.9-0.8);#V\n",
+ "rib=del_Veb/del_Ie;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rib,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 100 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc current gain in common emitter configuration\n",
+ "#given\n",
+ "a=0.98;#dc current gain in common base configuration\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The dc current gain in common emitter configuration is=\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current gain in common emitter configuration is= 49\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac alpha and beta\n",
+ "#given\n",
+ "ic=0.995#mA#Emitter current change\n",
+ "ie=1.#mA#collector current change\n",
+ "a=ic/ie;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.3f %s' %(\"The ac alpha is =\",a,\"\\n\")\n",
+ "print '%s %.f' %(\"The common emitter ac current gain is =\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac alpha is = 0.995 \n",
+ "\n",
+ "The common emitter ac current gain is = 199\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate beta and Iceo and exact and approax collector current\n",
+ "#given\n",
+ "a0=0.992;#dc current gain in common base configuration\n",
+ "Icbo=48.*10.**-9.;#A\n",
+ "Ib=30.*10.**-6.;#A#base current\n",
+ "B=a0/(1.-a0);\n",
+ "Iceo=Icbo/(1.-a0);\n",
+ "print '%s %.f %s' %(\"Beta=\",B,\"\\n\");\n",
+ "print '%s %.f %s' %(\"Iceo=\",Iceo*10**6,\"uA\\n\");\n",
+ "Ic=B*Ib+Iceo;\n",
+ "Ica=B*Ib;#approax\n",
+ "print '%s %.3f %s' %(\"Exact collector current =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"Approax collector current =\",Ica*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 124 \n",
+ "\n",
+ "Iceo= 6 uA\n",
+ "\n",
+ "Exact collector current = 3.726 mA\n",
+ "\n",
+ "Approax collector current = 3.72 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Vbe=0.75;#V\n",
+ "Vce=2.;#V\n",
+ "\n",
+ "#Taking points around Vbe=0.75V from graph\n",
+ "del_Vbe=(0.98-0.9);#V\n",
+ "\n",
+ "#corresponding change in ib\n",
+ "del_ib=(68.-48.)*10.**-6.;#A\n",
+ "\n",
+ "rie=del_Vbe/del_ib;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rie/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 4 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance and dc and ac current gain\n",
+ "#given\n",
+ "Ib=30.*10.**-6.;#A\n",
+ "Vce=10.;#V\n",
+ "Ic=3.6*10.**-3.;#A #from graph\n",
+ "\n",
+ "#Taking points around Vce = 10V from graph\n",
+ "del_Vce=(12.5-7.5);#V\n",
+ "\n",
+ "#corresponding change in ic\n",
+ "del_ic=(3.7-3.5)*10.**-3.;#A\n",
+ "\n",
+ "roe=del_Vce/del_ic;\n",
+ "print '%s %.f %s' %(\"The dynamic output resistance of transistor is =\",roe/1000,\"k ohm\\n\");\n",
+ "\n",
+ "#dc current gain\n",
+ "Bo=Ic/Ib;\n",
+ "print '%s %.f %s' %(\"The dc current gain is =\",Bo,\"\\n\");\n",
+ "\n",
+ "#ac current gain\n",
+ "\n",
+ "del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA\n",
+ "del_ib=(40.-20.)*10.**-6.;\n",
+ "B=del_ic/del_ib;\n",
+ "print '%s %.f %s' %(\"The ac current gain is =\",B,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic output resistance of transistor is = 25 k ohm\n",
+ "\n",
+ "The dc current gain is = 120 \n",
+ "\n",
+ "The ac current gain is = 110 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac current gain in CE and CC configuration\n",
+ "#given\n",
+ "a=0.99;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The ac current gain in CE configuration is =\",B);\n",
+ "y=1.+B;\n",
+ "print '%s %.f' %(\"\\nThe ac current gain in CC configuration is =\",y);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac current gain in CE configuration is = 99\n",
+ "\n",
+ "The ac current gain in CC configuration is = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04_1.ipynb new file mode 100755 index 00000000..1d5b5c35 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04_1.ipynb @@ -0,0 +1,420 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:17fddcb6590702d38f46f2b5d25907fb7a3d2becfbec4029a12516743d1ef624"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 04 - Bipolar Junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the collector and base current\n",
+ "#given\n",
+ "a=0.98;#dc alpha\n",
+ "Ie=5.*10.**-3.;#A#emitter current\n",
+ "Ico=2.*10.**-6.;#A#collector reverse leakage current\n",
+ "Ic=a*Ie+Ico;\n",
+ "Ib=Ie-Ic;\n",
+ "print '%s %.3f %s' %(\"The collector current is =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is = 4.902 mA\n",
+ "\n",
+ "The base current is = 98 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the base and collector current and exact and approax dc alpha \n",
+ "#given\n",
+ "Ie=8.4*10.**-3.#A#emitter current\n",
+ "Icbo=0.1*10.**-6.##A#reverse leakage current\n",
+ "Ib=0.008*Ie##A#base current\n",
+ "Ic=Ie-Ib#\n",
+ "Icinj=Ic-Icbo#\n",
+ "a0=Icinj/Ie#\n",
+ "a=Ic/Ie#\n",
+ "print '%s %.1f %s' %(\"Base current is =\",Ib*10**6,\"uA\\n\")#\n",
+ "print '%s %.4f %s' %(\"Collector current =\",Ic*1000,\"mA\\n\",)#\n",
+ "print '%s %.7f %s' %(\"Exact value of alphha =\",a0,\"\\n\")#\n",
+ "print '%s %.3f' %(\"Approax value of alpha =\",a)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current is = 67.2 uA\n",
+ "\n",
+ "Collector current = 8.3328 mA\n",
+ "\n",
+ "Exact value of alphha = 0.9919881 \n",
+ "\n",
+ "Approax value of alpha = 0.992\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the base current\n",
+ "#given\n",
+ "a=0.96; #dc alpha\n",
+ "Rc=2.*10.**3.;#ohm #resistor across collector\n",
+ "Vc=4.;#V #Voltage drop across the collector resistor\n",
+ "Ic=Vc/Rc; #Colletor current\n",
+ "Ie=Ic/a; #Emmiter current\n",
+ "Ib=Ie-Ic; #Base current\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\",)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is = 83 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Ie=2.;#mA\n",
+ "Vcb=10.;#V\n",
+ "\n",
+ "#Taking points around Ie & Vcb from graph\n",
+ "del_Ie=(2.5-1.5)*10.**-3.;#A\n",
+ "\n",
+ "#corresponding change in Veb\n",
+ "del_Veb=(0.9-0.8);#V\n",
+ "rib=del_Veb/del_Ie;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rib,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 100 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc current gain in common emitter configuration\n",
+ "#given\n",
+ "a=0.98;#dc current gain in common base configuration\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The dc current gain in common emitter configuration is=\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current gain in common emitter configuration is= 49\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac alpha and beta\n",
+ "#given\n",
+ "ic=0.995#mA#Emitter current change\n",
+ "ie=1.#mA#collector current change\n",
+ "a=ic/ie;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.3f %s' %(\"The ac alpha is =\",a,\"\\n\")\n",
+ "print '%s %.f' %(\"The common emitter ac current gain is =\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac alpha is = 0.995 \n",
+ "\n",
+ "The common emitter ac current gain is = 199\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate beta and Iceo and exact and approax collector current\n",
+ "#given\n",
+ "a0=0.992;#dc current gain in common base configuration\n",
+ "Icbo=48.*10.**-9.;#A\n",
+ "Ib=30.*10.**-6.;#A#base current\n",
+ "B=a0/(1.-a0);\n",
+ "Iceo=Icbo/(1.-a0);\n",
+ "print '%s %.f %s' %(\"Beta=\",B,\"\\n\");\n",
+ "print '%s %.f %s' %(\"Iceo=\",Iceo*10**6,\"uA\\n\");\n",
+ "Ic=B*Ib+Iceo;\n",
+ "Ica=B*Ib;#approax\n",
+ "print '%s %.3f %s' %(\"Exact collector current =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"Approax collector current =\",Ica*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 124 \n",
+ "\n",
+ "Iceo= 6 uA\n",
+ "\n",
+ "Exact collector current = 3.726 mA\n",
+ "\n",
+ "Approax collector current = 3.72 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Vbe=0.75;#V\n",
+ "Vce=2.;#V\n",
+ "\n",
+ "#Taking points around Vbe=0.75V from graph\n",
+ "del_Vbe=(0.98-0.9);#V\n",
+ "\n",
+ "#corresponding change in ib\n",
+ "del_ib=(68.-48.)*10.**-6.;#A\n",
+ "\n",
+ "rie=del_Vbe/del_ib;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rie/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 4 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance and dc and ac current gain\n",
+ "#given\n",
+ "Ib=30.*10.**-6.;#A\n",
+ "Vce=10.;#V\n",
+ "Ic=3.6*10.**-3.;#A #from graph\n",
+ "\n",
+ "#Taking points around Vce = 10V from graph\n",
+ "del_Vce=(12.5-7.5);#V\n",
+ "\n",
+ "#corresponding change in ic\n",
+ "del_ic=(3.7-3.5)*10.**-3.;#A\n",
+ "\n",
+ "roe=del_Vce/del_ic;\n",
+ "print '%s %.f %s' %(\"The dynamic output resistance of transistor is =\",roe/1000,\"k ohm\\n\");\n",
+ "\n",
+ "#dc current gain\n",
+ "Bo=Ic/Ib;\n",
+ "print '%s %.f %s' %(\"The dc current gain is =\",Bo,\"\\n\");\n",
+ "\n",
+ "#ac current gain\n",
+ "\n",
+ "del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA\n",
+ "del_ib=(40.-20.)*10.**-6.;\n",
+ "B=del_ic/del_ib;\n",
+ "print '%s %.f %s' %(\"The ac current gain is =\",B,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic output resistance of transistor is = 25 k ohm\n",
+ "\n",
+ "The dc current gain is = 120 \n",
+ "\n",
+ "The ac current gain is = 110 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac current gain in CE and CC configuration\n",
+ "#given\n",
+ "a=0.99;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The ac current gain in CE configuration is =\",B);\n",
+ "y=1.+B;\n",
+ "print '%s %.f' %(\"\\nThe ac current gain in CC configuration is =\",y);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac current gain in CE configuration is = 99\n",
+ "\n",
+ "The ac current gain in CC configuration is = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05.ipynb new file mode 100755 index 00000000..cc2f0691 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05.ipynb @@ -0,0 +1,348 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:146587be2a76fdde5f5bc903bd6d5642ad5cd4039750758587537929c4991265"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 05 - Field Effect Transistors (FETs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate saturation voltage and saturation current\n",
+ "#given\n",
+ "Vp=-4.#V #pinch off voltage\n",
+ "Idss=12.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Vgs=-2.;#V #gate to source voltage\n",
+ "Vds=Vgs-Vp;\n",
+ "Id=Idss*(Vds/Vp)**2.;\n",
+ "print '%s %.f %s' %(\"Saturation Voltage is =\",Vds,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Saturation current is =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Voltage is = 2 V\n",
+ "\n",
+ "Saturation current is = 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vgso=-5.;#V #gate to source cut off voltage\n",
+ "Idss=20.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#At vgs = -2 V\n",
+ "vgs=-2.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -2 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -4 V\n",
+ "vgs=-4.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -4 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -8 V\n",
+ "print '%s' %(\"Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current is (At vgs = -2 V) = 7.2 mA\n",
+ "\n",
+ "Drain current is (At vgs = -4 V) = 0.8 mA\n",
+ "\n",
+ "Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Vds saturation\n",
+ "#given\n",
+ "import math\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=-15.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Id=-3.*10.**-3.;#A #saturation current\n",
+ "Vgs=Vp*(1.-math.sqrt(Id/Idss));\n",
+ "Vds=Vgs-Vp;\n",
+ "print '%s %.3f %s' %(\"The gate to source voltage (Vgs) is =\",Vgs,\"V\\n\");\n",
+ "print '%s %.3f %s' %(\"The saturation voltage is Vds(sat) =\",Vds,\"V\");\n",
+ "\n",
+ "print '\\nThe value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gate to source voltage (Vgs) is = 2.764 V\n",
+ "\n",
+ "The saturation voltage is Vds(sat) = -2.236 V\n",
+ "\n",
+ "The value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for N channel\n",
+ "#given\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= - 3 V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id(For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5 V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id(For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id(For Vgs= -3V) = 2.88 mA\n",
+ "\n",
+ "The drain current Id(For Vgs= 2.5V) = 40.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for P channel\n",
+ "#given\n",
+ "Vp=-5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= -3V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id (For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id (For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id (For Vgs= -3V) = 46.08 mA\n",
+ "\n",
+ "The drain current Id (For Vgs= 2.5V) = 4.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vt=2.;#V #threshold voltage\n",
+ "K=0.25*10.**-3.;# A/V**2 #conductivity parameter\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=2.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "Id=K*(Vgs-Vt)**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 0.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of Id\n",
+ "#given\n",
+ "Vt=1.5;#V #threshold voltage\n",
+ "Id=2.*10.**-3.;#A\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=5.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "# Calculating K\n",
+ "K=Id/((Vgs-Vt)**2.); # A/V**2 #conductivity parameter\n",
+ "\n",
+ "#Calculating Id for Vgs= 5 V and Vds= 6 V\n",
+ "Vgs=5;#V #gate supply\n",
+ "Vds=6;#V #saturation voltage\n",
+ "Id=K*((Vgs-Vt)**2);\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 10.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the dynamic drain resistance\n",
+ "#given\n",
+ "gm=200.*10.**-6.;#S transconductance\n",
+ "u=80.;#amplification factor\n",
+ "rd=u/gm;\n",
+ "print '%s %.f %s' %(\"The dynamic drain resistance is =\",rd/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic drain resistance is = 400 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05_1.ipynb new file mode 100755 index 00000000..cc2f0691 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05_1.ipynb @@ -0,0 +1,348 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:146587be2a76fdde5f5bc903bd6d5642ad5cd4039750758587537929c4991265"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 05 - Field Effect Transistors (FETs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate saturation voltage and saturation current\n",
+ "#given\n",
+ "Vp=-4.#V #pinch off voltage\n",
+ "Idss=12.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Vgs=-2.;#V #gate to source voltage\n",
+ "Vds=Vgs-Vp;\n",
+ "Id=Idss*(Vds/Vp)**2.;\n",
+ "print '%s %.f %s' %(\"Saturation Voltage is =\",Vds,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Saturation current is =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Voltage is = 2 V\n",
+ "\n",
+ "Saturation current is = 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vgso=-5.;#V #gate to source cut off voltage\n",
+ "Idss=20.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#At vgs = -2 V\n",
+ "vgs=-2.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -2 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -4 V\n",
+ "vgs=-4.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -4 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -8 V\n",
+ "print '%s' %(\"Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current is (At vgs = -2 V) = 7.2 mA\n",
+ "\n",
+ "Drain current is (At vgs = -4 V) = 0.8 mA\n",
+ "\n",
+ "Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Vds saturation\n",
+ "#given\n",
+ "import math\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=-15.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Id=-3.*10.**-3.;#A #saturation current\n",
+ "Vgs=Vp*(1.-math.sqrt(Id/Idss));\n",
+ "Vds=Vgs-Vp;\n",
+ "print '%s %.3f %s' %(\"The gate to source voltage (Vgs) is =\",Vgs,\"V\\n\");\n",
+ "print '%s %.3f %s' %(\"The saturation voltage is Vds(sat) =\",Vds,\"V\");\n",
+ "\n",
+ "print '\\nThe value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gate to source voltage (Vgs) is = 2.764 V\n",
+ "\n",
+ "The saturation voltage is Vds(sat) = -2.236 V\n",
+ "\n",
+ "The value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for N channel\n",
+ "#given\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= - 3 V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id(For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5 V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id(For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id(For Vgs= -3V) = 2.88 mA\n",
+ "\n",
+ "The drain current Id(For Vgs= 2.5V) = 40.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for P channel\n",
+ "#given\n",
+ "Vp=-5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= -3V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id (For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id (For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id (For Vgs= -3V) = 46.08 mA\n",
+ "\n",
+ "The drain current Id (For Vgs= 2.5V) = 4.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vt=2.;#V #threshold voltage\n",
+ "K=0.25*10.**-3.;# A/V**2 #conductivity parameter\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=2.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "Id=K*(Vgs-Vt)**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 0.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of Id\n",
+ "#given\n",
+ "Vt=1.5;#V #threshold voltage\n",
+ "Id=2.*10.**-3.;#A\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=5.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "# Calculating K\n",
+ "K=Id/((Vgs-Vt)**2.); # A/V**2 #conductivity parameter\n",
+ "\n",
+ "#Calculating Id for Vgs= 5 V and Vds= 6 V\n",
+ "Vgs=5;#V #gate supply\n",
+ "Vds=6;#V #saturation voltage\n",
+ "Id=K*((Vgs-Vt)**2);\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 10.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the dynamic drain resistance\n",
+ "#given\n",
+ "gm=200.*10.**-6.;#S transconductance\n",
+ "u=80.;#amplification factor\n",
+ "rd=u/gm;\n",
+ "print '%s %.f %s' %(\"The dynamic drain resistance is =\",rd/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic drain resistance is = 400 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06.ipynb new file mode 100755 index 00000000..5ae5962c --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06.ipynb @@ -0,0 +1,699 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c8db8211d13eaaf428f67dbff1442ccfba9da7e4976c038b176e3a26e0c5c3b6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 06 - Transistor Biasing and Stabilization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.2*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=270.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,'V',Ic*1000,'mA');\n",
+ "\n",
+ "#Note--In book Vce = 5.7 V because of approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 5.6 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=150.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=100.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ics*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 0 V 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Rb and percentage change in collector current due to temperature rise\n",
+ "#given\n",
+ "\n",
+ "#Calculating the base resistance\n",
+ "B=20.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Ic=1.*10.**-3.;#A #collector current\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Icbo=2.*10.**-6.;#A #collector to base leakage current\n",
+ "\n",
+ "Ib=(Ic-(1.+B)*Icbo)/B;\n",
+ "Rb=(Vcc-Vbe)/Ib;\n",
+ "\n",
+ "print '%s %.f %s' %(\"The value of resistor Ib is =\",120,'kohm');\n",
+ "\n",
+ "Rb=120.*10.**3.;#ohm approax\n",
+ "\n",
+ "#Now when temperature rise\n",
+ "Icbo=10.*10.**-6.;#A #collector to base leakage current\n",
+ "B=25.;#dc beta\n",
+ "Ic1=B*Ib+(B+1)*Icbo;# #changed collector current\n",
+ "perc=(Ic1-Ic)*100./Ic;#percentage increase\n",
+ "print '%s %.f %s' %(\"The percentage change in collector current is =\",perc,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistor Ib is = 120 kohm\n",
+ "The percentage change in collector current is = 46 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.1f %s' %(\"The Q point (At B=50) =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.; #dc beta\n",
+ "Ic1=B*Ib; #Colletor current\n",
+ "Ics1=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.1f %s' %(\"\\nThe Q point (At B=150) is =\",Vce,\"V\",Ics*1000,\"mA\");\n",
+ "\n",
+ "print '%s %.f' %(\"\\nThe factor at which collector current increases =\",Ics1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point (At B=50) = 6.00 V 1.5 mA\n",
+ "\n",
+ "The Q point (At B=150) is = 0 V 4.5 mA\n",
+ "\n",
+ "The factor at which collector current increases = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Q point in collector to base bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=500.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-(Ic+Ib)*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 9.1 V 1.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the collector current and change in it if B is changed by three times of previous B\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.3f %s' %(\"Collector current (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "#Now B=150\n",
+ "B=3.*B; #three times of previous B\n",
+ "Ib1=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic1=B*Ib1; #Colletor current\n",
+ "print '%s %.2f %s' %(\"Collector current (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.f' %(\"The factor at which collector current increases =\",Ic1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current (B=50)= 1.125 mA\n",
+ "\n",
+ "Collector current (B=150)= 2.25 mA\n",
+ "\n",
+ "The factor at which collector current increases = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of all three current Ie and Ic and Ib\n",
+ "#given\n",
+ "B=90.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ie=Ic+Ib; #Emitter current\n",
+ "print '%s %.1f %s %s %.3f %s %s %.3f %s' %(\"Base current =\",Ib*10**6,\"uA\\n\",\"\\nCollector current =\",Ic*10**3,\"mA\\n\",\"\\nEmitter current =\",Ie*10**3,\"mA\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 16.5 uA\n",
+ " \n",
+ "Collector current = 1.486 mA\n",
+ " \n",
+ "Emitter current = 1.503 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max and min value of emitter current\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=75.;#ohm #resistor connected to collector\n",
+ "Re=100.;#ohm #resistor connected to emitter\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Ib=(Vcc-Vbe)/(Rb+(1.+B)*Re); #Base current\n",
+ "Ie=(1.+B)*Ib;\n",
+ "Vce=Vcc-(Rc+Re)*Ie\n",
+ "print '%s %.2f %s' %(\"Minimum emitter current =\",Ie*10**3,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"The collector to emitter volatge =\",Vce,\"V\\n\");\n",
+ "\n",
+ "#At B=300 \n",
+ "\n",
+ "B1=300.; #dc beta\n",
+ "Ib1=(Vcc-Vbe)/(Rb+(1.+B1)*Re);#Base current\n",
+ "Ie1=(1.+B1)*Ib1;\n",
+ "Vce1=Vcc-(Rc+Re)*Ie1\n",
+ "#Here Vce1= -1.4874 V but can never have negative voltage because Ie1 is wrong as it cant be more than saturation value therefore\n",
+ "Ie1=Vcc/(Rc+Re);\n",
+ "\n",
+ "#And Vce=0 V\n",
+ "\n",
+ "Vce1=0;#V\n",
+ "print '%s %.2f %s' %(\"Maximum emitter current =\",Ie1*10**3,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The collector to emitter volatge(saturation) =\",Vce1,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum emitter current = 19.25 mA\n",
+ "\n",
+ "The collector to emitter volatge = 2.63 V\n",
+ "\n",
+ "Maximum emitter current = 34.29 mA\n",
+ "\n",
+ "The collector to emitter volatge(saturation) = 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of base resistance\n",
+ "#given\n",
+ "\n",
+ "B=100.; #dc beta\n",
+ "Rc=200.;#ohm #resistor connected to collector\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Vce=4.5;#V #Collector to emitter voltage\n",
+ "Ic=(Vcc-Vce)/(Rc+Re);\n",
+ "Ib=Ic/B;\n",
+ "Rb=(Vcc-B*Re*Ib)/Ib;\n",
+ "print '%s %.f %s' %(\"The value of base resistance is =\",Rb/1000,\"kohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistance is = 90 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the collector current at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.;#dc beta\n",
+ "Rc=2.;#ohm #resistor connected to collector\n",
+ "Re=1000.;#ohm #resistor connected to emitter\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.2f %s' %(\"The collector current at (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.;#dc beta\n",
+ "Ib1=Vcc/(Rb+B1*Re); #Base current\n",
+ "Ic1=B1*Ib1; #Colletor current\n",
+ "print '%s %.1f %s' %(\"The collector current at (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.1f' %(\"The factor at which collector current increases=\",Ic1/Ic);\n",
+ "\n",
+ "#IN BOOK Ic(AT B=50)= 1.25 mA and Ic1/Ic=2.4 DUE TO APPROAXIMATION\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current at (B=50)= 1.29 mA\n",
+ "\n",
+ "The collector current at (B=150)= 3.0 mA\n",
+ "\n",
+ "The factor at which collector current increases= 2.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Q point in voltage divider\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.*10.**3.;#ohm #voltage divider resistor 1\n",
+ "R2=1.*10.**3.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "I=Vcc/(R1+R2); #current through voltage divider\n",
+ "Vb=I*R2; #voltage at base\n",
+ "Ve=Vb-Vbe;\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie #approaximating Ib is nearly equal to 0\n",
+ "Vc=Vcc-Ic*Rc;\n",
+ "Vce=(Vc)-Ve; \n",
+ "print '%s %.1f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Ibc=I/20.; #critical value of base current\n",
+ "Ib=Ic/B; #actual base current\n",
+ "\n",
+ "#Since Ib < Ibc, hence assumption is alright\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 3.3 V 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Solve the voltage divider accurately by applying thevenin's theorem\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.;#ohm #voltage divider resistor 1\n",
+ "R2=1.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "\n",
+ "Vth=Vcc*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent voltage Vth =\",Vth,\"V\");\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent resistance Rth =\",Rth,\"kohm\");\n",
+ "\n",
+ "Ib=(Vth-Vbe)/(Rth+(1.+B)*Re);\n",
+ "Ic=B*Ib;\n",
+ "Ie=Ic+Ib;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re; \n",
+ "print '%s %.4f %s' %(\"\\nThe accurate value of Ic =\",Ic*10**3,\"mA\");\n",
+ "print '%s %.5f %s' %(\"\\nThe accurate value of Vce =\",Vce,\"V\");\n",
+ "Icp=3.*10.**-3.; # Current calculated by voltage divider in previous example\n",
+ "Vcep=3.4; # Voltage calculated by voltage divider in previous example\n",
+ "Err_Ic=(Ic-Icp)*100./Ic;\n",
+ "Err_Vce=(Vce-Vcep)*100./Vce;\n",
+ "print '%s %.1f %s' %(\"\\nError in Ic =\",Err_Ic,\"percent\\n\");\n",
+ "print '%s %.1f %s' %(\"\\nError in Vce =\",Err_Vce,\"percent\");\n",
+ "\n",
+ "# The errors and The accurate values are different \n",
+ "# because of the approaximation in Vth and Rth in book\n",
+ "\n",
+ "# In Book Ic = 2.8436 mA and Vce = 3.73839 V\n",
+ "# Error in Ic = -5.5% \n",
+ "# Error in Vce = +9% \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin equivalent voltage Vth = 0.9 V\n",
+ "\n",
+ "Thevenin equivalent resistance Rth = 0.9 kohm\n",
+ "\n",
+ "The accurate value of Ic = 3.0152 mA\n",
+ "\n",
+ "The accurate value of Vce = 3.36060 V\n",
+ "\n",
+ "Error in Ic = 0.5 percent\n",
+ "\n",
+ "\n",
+ "Error in Vce = -1.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the Q point for the emitter bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=5.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=10.*10.**3.;#ohm #resistor connected to emitter \n",
+ "Vcc=12.;#V #Voltage supply across the collector resistor\n",
+ "Vee=15;#V #supply at emitter\n",
+ "Ie=Vee/Re;\n",
+ "Ic=Ie;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 4.5 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Rs\n",
+ "#given\n",
+ "import math\n",
+ "Vp=2.;#V\n",
+ "Idss=1.75*10.**-3.;#A #drain current at Vgs=0\n",
+ "Vdd=24.;#V #drain to supply source\n",
+ "Id=1.*10.**-3.;#A #drain current\n",
+ "Vgs=(-Vp)*(1-math.sqrt(Id/Idss));\n",
+ "Rs=abs(Vgs)/Id;\n",
+ "print '%s %.3f %s' %(\"Vgs =\",Vgs,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Rs =\",Rs,\"ohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vgs = -0.488 V\n",
+ "\n",
+ "Rs = 488 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06_1.ipynb new file mode 100755 index 00000000..5ae5962c --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06_1.ipynb @@ -0,0 +1,699 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c8db8211d13eaaf428f67dbff1442ccfba9da7e4976c038b176e3a26e0c5c3b6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 06 - Transistor Biasing and Stabilization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.2*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=270.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,'V',Ic*1000,'mA');\n",
+ "\n",
+ "#Note--In book Vce = 5.7 V because of approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 5.6 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=150.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=100.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ics*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 0 V 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Rb and percentage change in collector current due to temperature rise\n",
+ "#given\n",
+ "\n",
+ "#Calculating the base resistance\n",
+ "B=20.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Ic=1.*10.**-3.;#A #collector current\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Icbo=2.*10.**-6.;#A #collector to base leakage current\n",
+ "\n",
+ "Ib=(Ic-(1.+B)*Icbo)/B;\n",
+ "Rb=(Vcc-Vbe)/Ib;\n",
+ "\n",
+ "print '%s %.f %s' %(\"The value of resistor Ib is =\",120,'kohm');\n",
+ "\n",
+ "Rb=120.*10.**3.;#ohm approax\n",
+ "\n",
+ "#Now when temperature rise\n",
+ "Icbo=10.*10.**-6.;#A #collector to base leakage current\n",
+ "B=25.;#dc beta\n",
+ "Ic1=B*Ib+(B+1)*Icbo;# #changed collector current\n",
+ "perc=(Ic1-Ic)*100./Ic;#percentage increase\n",
+ "print '%s %.f %s' %(\"The percentage change in collector current is =\",perc,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistor Ib is = 120 kohm\n",
+ "The percentage change in collector current is = 46 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.1f %s' %(\"The Q point (At B=50) =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.; #dc beta\n",
+ "Ic1=B*Ib; #Colletor current\n",
+ "Ics1=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.1f %s' %(\"\\nThe Q point (At B=150) is =\",Vce,\"V\",Ics*1000,\"mA\");\n",
+ "\n",
+ "print '%s %.f' %(\"\\nThe factor at which collector current increases =\",Ics1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point (At B=50) = 6.00 V 1.5 mA\n",
+ "\n",
+ "The Q point (At B=150) is = 0 V 4.5 mA\n",
+ "\n",
+ "The factor at which collector current increases = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Q point in collector to base bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=500.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-(Ic+Ib)*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 9.1 V 1.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the collector current and change in it if B is changed by three times of previous B\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.3f %s' %(\"Collector current (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "#Now B=150\n",
+ "B=3.*B; #three times of previous B\n",
+ "Ib1=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic1=B*Ib1; #Colletor current\n",
+ "print '%s %.2f %s' %(\"Collector current (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.f' %(\"The factor at which collector current increases =\",Ic1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current (B=50)= 1.125 mA\n",
+ "\n",
+ "Collector current (B=150)= 2.25 mA\n",
+ "\n",
+ "The factor at which collector current increases = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of all three current Ie and Ic and Ib\n",
+ "#given\n",
+ "B=90.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ie=Ic+Ib; #Emitter current\n",
+ "print '%s %.1f %s %s %.3f %s %s %.3f %s' %(\"Base current =\",Ib*10**6,\"uA\\n\",\"\\nCollector current =\",Ic*10**3,\"mA\\n\",\"\\nEmitter current =\",Ie*10**3,\"mA\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 16.5 uA\n",
+ " \n",
+ "Collector current = 1.486 mA\n",
+ " \n",
+ "Emitter current = 1.503 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max and min value of emitter current\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=75.;#ohm #resistor connected to collector\n",
+ "Re=100.;#ohm #resistor connected to emitter\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Ib=(Vcc-Vbe)/(Rb+(1.+B)*Re); #Base current\n",
+ "Ie=(1.+B)*Ib;\n",
+ "Vce=Vcc-(Rc+Re)*Ie\n",
+ "print '%s %.2f %s' %(\"Minimum emitter current =\",Ie*10**3,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"The collector to emitter volatge =\",Vce,\"V\\n\");\n",
+ "\n",
+ "#At B=300 \n",
+ "\n",
+ "B1=300.; #dc beta\n",
+ "Ib1=(Vcc-Vbe)/(Rb+(1.+B1)*Re);#Base current\n",
+ "Ie1=(1.+B1)*Ib1;\n",
+ "Vce1=Vcc-(Rc+Re)*Ie1\n",
+ "#Here Vce1= -1.4874 V but can never have negative voltage because Ie1 is wrong as it cant be more than saturation value therefore\n",
+ "Ie1=Vcc/(Rc+Re);\n",
+ "\n",
+ "#And Vce=0 V\n",
+ "\n",
+ "Vce1=0;#V\n",
+ "print '%s %.2f %s' %(\"Maximum emitter current =\",Ie1*10**3,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The collector to emitter volatge(saturation) =\",Vce1,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum emitter current = 19.25 mA\n",
+ "\n",
+ "The collector to emitter volatge = 2.63 V\n",
+ "\n",
+ "Maximum emitter current = 34.29 mA\n",
+ "\n",
+ "The collector to emitter volatge(saturation) = 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of base resistance\n",
+ "#given\n",
+ "\n",
+ "B=100.; #dc beta\n",
+ "Rc=200.;#ohm #resistor connected to collector\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Vce=4.5;#V #Collector to emitter voltage\n",
+ "Ic=(Vcc-Vce)/(Rc+Re);\n",
+ "Ib=Ic/B;\n",
+ "Rb=(Vcc-B*Re*Ib)/Ib;\n",
+ "print '%s %.f %s' %(\"The value of base resistance is =\",Rb/1000,\"kohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistance is = 90 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the collector current at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.;#dc beta\n",
+ "Rc=2.;#ohm #resistor connected to collector\n",
+ "Re=1000.;#ohm #resistor connected to emitter\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.2f %s' %(\"The collector current at (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.;#dc beta\n",
+ "Ib1=Vcc/(Rb+B1*Re); #Base current\n",
+ "Ic1=B1*Ib1; #Colletor current\n",
+ "print '%s %.1f %s' %(\"The collector current at (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.1f' %(\"The factor at which collector current increases=\",Ic1/Ic);\n",
+ "\n",
+ "#IN BOOK Ic(AT B=50)= 1.25 mA and Ic1/Ic=2.4 DUE TO APPROAXIMATION\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current at (B=50)= 1.29 mA\n",
+ "\n",
+ "The collector current at (B=150)= 3.0 mA\n",
+ "\n",
+ "The factor at which collector current increases= 2.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Q point in voltage divider\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.*10.**3.;#ohm #voltage divider resistor 1\n",
+ "R2=1.*10.**3.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "I=Vcc/(R1+R2); #current through voltage divider\n",
+ "Vb=I*R2; #voltage at base\n",
+ "Ve=Vb-Vbe;\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie #approaximating Ib is nearly equal to 0\n",
+ "Vc=Vcc-Ic*Rc;\n",
+ "Vce=(Vc)-Ve; \n",
+ "print '%s %.1f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Ibc=I/20.; #critical value of base current\n",
+ "Ib=Ic/B; #actual base current\n",
+ "\n",
+ "#Since Ib < Ibc, hence assumption is alright\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 3.3 V 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Solve the voltage divider accurately by applying thevenin's theorem\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.;#ohm #voltage divider resistor 1\n",
+ "R2=1.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "\n",
+ "Vth=Vcc*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent voltage Vth =\",Vth,\"V\");\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent resistance Rth =\",Rth,\"kohm\");\n",
+ "\n",
+ "Ib=(Vth-Vbe)/(Rth+(1.+B)*Re);\n",
+ "Ic=B*Ib;\n",
+ "Ie=Ic+Ib;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re; \n",
+ "print '%s %.4f %s' %(\"\\nThe accurate value of Ic =\",Ic*10**3,\"mA\");\n",
+ "print '%s %.5f %s' %(\"\\nThe accurate value of Vce =\",Vce,\"V\");\n",
+ "Icp=3.*10.**-3.; # Current calculated by voltage divider in previous example\n",
+ "Vcep=3.4; # Voltage calculated by voltage divider in previous example\n",
+ "Err_Ic=(Ic-Icp)*100./Ic;\n",
+ "Err_Vce=(Vce-Vcep)*100./Vce;\n",
+ "print '%s %.1f %s' %(\"\\nError in Ic =\",Err_Ic,\"percent\\n\");\n",
+ "print '%s %.1f %s' %(\"\\nError in Vce =\",Err_Vce,\"percent\");\n",
+ "\n",
+ "# The errors and The accurate values are different \n",
+ "# because of the approaximation in Vth and Rth in book\n",
+ "\n",
+ "# In Book Ic = 2.8436 mA and Vce = 3.73839 V\n",
+ "# Error in Ic = -5.5% \n",
+ "# Error in Vce = +9% \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin equivalent voltage Vth = 0.9 V\n",
+ "\n",
+ "Thevenin equivalent resistance Rth = 0.9 kohm\n",
+ "\n",
+ "The accurate value of Ic = 3.0152 mA\n",
+ "\n",
+ "The accurate value of Vce = 3.36060 V\n",
+ "\n",
+ "Error in Ic = 0.5 percent\n",
+ "\n",
+ "\n",
+ "Error in Vce = -1.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the Q point for the emitter bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=5.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=10.*10.**3.;#ohm #resistor connected to emitter \n",
+ "Vcc=12.;#V #Voltage supply across the collector resistor\n",
+ "Vee=15;#V #supply at emitter\n",
+ "Ie=Vee/Re;\n",
+ "Ic=Ie;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 4.5 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Rs\n",
+ "#given\n",
+ "import math\n",
+ "Vp=2.;#V\n",
+ "Idss=1.75*10.**-3.;#A #drain current at Vgs=0\n",
+ "Vdd=24.;#V #drain to supply source\n",
+ "Id=1.*10.**-3.;#A #drain current\n",
+ "Vgs=(-Vp)*(1-math.sqrt(Id/Idss));\n",
+ "Rs=abs(Vgs)/Id;\n",
+ "print '%s %.3f %s' %(\"Vgs =\",Vgs,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Rs =\",Rs,\"ohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vgs = -0.488 V\n",
+ "\n",
+ "Rs = 488 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07.ipynb new file mode 100755 index 00000000..ac95ccf3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07.ipynb @@ -0,0 +1,591 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c1a591eccedac3b03d639316b4632fe3e03a9db06d23d730c93344ae026326fb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 07 - Small Signal SIngle-Stage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max current and check will the capacitor act as short for given frequency\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "Vs=1.;#V\n",
+ "Imax=Vs/(Rs+Rl);\n",
+ "fc=1./(2.*math.pi*(Rs+Rl)*C) #critical frequency\n",
+ "fh=10.*fc; #Border frequency\n",
+ "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
+ "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
+ "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
+ "\n",
+ "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current is = 200 uA\n",
+ "\n",
+ "fh = 3.18 Hz\n",
+ "\n",
+ "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "f=20.;#Hz #lowest frequency\n",
+ "Xc=1./(2.*math.pi*f*C) #reactance of capacitor at 20Hz\n",
+ "Rth=Rs*Rl/(Rs+Rl); #Thevenins equivalent resistance\n",
+ "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
+ "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
+ " \n",
+ "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of capacitor required\n",
+ "#given\n",
+ "import math\n",
+ "Rs1=20.*10.**3.;#ohm\n",
+ "Rs2=30.*10.**3.;#ohm\n",
+ "Rl1=40.*10.**3.;#ohm\n",
+ "Rl2=80.*10.**3.;#ohm\n",
+ "Rl3=80.*10.**3.;#ohm\n",
+ "Rth=Rs1*Rs2/(Rs1+Rs2); #Thevenins equivalent resistance\n",
+ "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
+ "Rl=Rl1*Rl_/(Rl1+Rl_); #Equivalent load\n",
+ "f=50.;#Hz #lowest frequency\n",
+ "R=Rth+Rl;\n",
+ "C=10./(2.*math.pi*f*R)\n",
+ "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of coupling capacitor is = 1 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage and current gain and input and output resistance\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "#given\n",
+ "\n",
+ "#DC analysis\n",
+ "Vcc=12.;#V\n",
+ "Rb=200.*10.**3.;#ohm\n",
+ "Rc=1.*10.**3.;#ohm\n",
+ "B=100.;# beta\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#AC analysis\n",
+ "Rl=1.*10.**3.;#ohm\n",
+ "hfe=B;\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "hoe_1=40.*10.**3.;#ohm # 1/hoe\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-hfe*Rac/hie;\n",
+ "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "\n",
+ "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
+ "Io=-100.*Ib;\n",
+ "Ac=Io/Ib;\n",
+ "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
+ "\n",
+ "Ri=prll(Rb,hie);\n",
+ "Ro=prll(Rl,prll(Rc,hoe_1));\n",
+ "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
+ "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
+ "\n",
+ "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 6.00 V 6.00 mA\n",
+ "\n",
+ "The voltage gain = -25.00 \n",
+ "\n",
+ "The current gain = -100.00 \n",
+ "\n",
+ "The input resistance = 2 kohm\n",
+ "\n",
+ "The output resistance = 0.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solve previous example using hybrid pie model\n",
+ "#soltion\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "Vcc=12.##V\n",
+ "Rb=200.*10.**3.##ohm\n",
+ "Rc=1.*10.**3.##ohm\n",
+ "Rl=1.*10.**3.##ohm\n",
+ "B=100.## beta\n",
+ "hie=2.*10.**3.##ohm\n",
+ "hoe_1=40.*10.**3.##ohm # 1/hoe\n",
+ "\n",
+ "Ib=Vcc/Rb#\n",
+ "Ic=B*Ib#\n",
+ "Rac=prll(Rc,Rl)#\n",
+ "gm=Ic/(25.*10.**-3.)#\n",
+ "rpi=B/gm#\n",
+ "ri=hie#\n",
+ "rb=ri-rpi#\n",
+ "ro=hoe_1#\n",
+ "Vpi=rpi/(rpi+rb)#\n",
+ "Vo=-gm*Vpi*Rac# #output voltage\n",
+ "Av=Vo#\n",
+ "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
+ "#In book voltage gain is -24.96 due to appraoximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain -25.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of output voltage\n",
+ "#given\n",
+ "Vcc=12.;#V\n",
+ "Rb=150.*10.**3.;#ohm\n",
+ "Rc=5.*10.**3.;#ohm\n",
+ "B=200.;# beta\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "ro=60.*10.**3.;#ohm # 1/hoe\n",
+ "Vi=1.*10.**-3.;#V\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
+ "Vo=0;\n",
+ "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input resistance\n",
+ "# Function definition is here\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2);\n",
+ "\treturn z\n",
+ "\n",
+ "R1=75.*10.**3.;#ohm\n",
+ "R2=7.5*10.**3.;#ohm\n",
+ "Rc=4.7*10.**3.;#ohm\n",
+ "Re=1.2*10.**3.;#ohm\n",
+ "Rl=12.*10.**3.;#ohm\n",
+ "B=150.;\n",
+ "ri=2.*10.**3.;#ohm\n",
+ "Vcc=15.;#V\n",
+ "Vb=Vcc*R2/(R1+R2);\n",
+ "Ve=Vb; #since Vbe=0\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie;\n",
+ "Icsat=Vcc/(Rc+Re);\n",
+ "# Ic < Icsat therefore transistor is in active mode\n",
+ "Vce=Vcc-Ic*(Rc+Re);\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-B*Rac/ri;\n",
+ "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "Ri_=prll(ri,R2);\n",
+ "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 8.30 V 1.14 mA\n",
+ "\n",
+ "The voltage gain = -253.3 \n",
+ "\n",
+ "The input resistance= 1.58 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of gm at different values of Vgs\n",
+ "#given\n",
+ "\n",
+ "Idss=8.*10.**-3.;#A\n",
+ "Vp=4;#V\n",
+ "#At Vgs= -0.5 V\n",
+ "Vgs= -0.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -1.5 V\n",
+ "Vgs= -1.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -2.5 V\n",
+ "Vgs= -2.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gmo = 4 mS\n",
+ "\n",
+ "gm (At Vgs = -0.5V) = 3.5 mS\n",
+ "\n",
+ "gm (At Vgs = -1.5V) = 2.5 mS\n",
+ "\n",
+ "gm (At Vgs = -2.5V) = 1.5 mS\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output signal voltage of the amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Rd=12.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Cs=25.*10.**-6.;#F\n",
+ "u=80.; #amplification factor\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Vi=0.1;#V\n",
+ "f=1.*10.**3.;#Hz #input frequency\n",
+ "Xcs=1./(2.*math.pi*f*Cs);\n",
+ "#This is much smaller than Rs therefore it is bypassed\n",
+ "\n",
+ "gm=u/rd;\n",
+ "Av=gm*(rd*Rd/(rd+Rd));\n",
+ "Vo=Av*Vi;\n",
+ "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 0.453 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "Rd=2.*10.**3.;#ohm\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Av=-gm*(rd*Rd/(rd+Rd));\n",
+ "Ri=Rg;\n",
+ "Ro=rd*Rd/(rd+Rd);\n",
+ "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -4 \n",
+ "input resistance= 1 Mohm \n",
+ "output resistance = 2 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=500.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Rd=5.*10.**3.;#ohm\n",
+ "Rs=100.;#ohm\n",
+ "Rl=5.*10.**3.;#ohm\n",
+ "gm=1.5*10.**-3.;#S\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Rg=R1*R2/(R1+R2);\n",
+ "Rac=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*Rac;\n",
+ "Ri=Rg;\n",
+ "Ro=(rd*Rac/(rd+Rac));\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -3.75 \n",
+ "Input resistance = 45.45 kohm \n",
+ "Output resistance = 2.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the voltage gain of the FET\n",
+ "#given\n",
+ "Idss=8.*10.**-3.##A\n",
+ "Vp=4.##V\n",
+ "rd=25.*10.**3.##ohm\n",
+ "Rd=2.2*10.**3.##ohm #by the help of figure\n",
+ "Vgs=-1.8##V\n",
+ "gmo=2.*Idss/(abs(Vp))#\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
+ "Av=-gm*(rd*Rd/(rd+Rd))#\n",
+ "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain of the FET = -4.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07_1.ipynb new file mode 100755 index 00000000..ac95ccf3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07_1.ipynb @@ -0,0 +1,591 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c1a591eccedac3b03d639316b4632fe3e03a9db06d23d730c93344ae026326fb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 07 - Small Signal SIngle-Stage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max current and check will the capacitor act as short for given frequency\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "Vs=1.;#V\n",
+ "Imax=Vs/(Rs+Rl);\n",
+ "fc=1./(2.*math.pi*(Rs+Rl)*C) #critical frequency\n",
+ "fh=10.*fc; #Border frequency\n",
+ "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
+ "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
+ "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
+ "\n",
+ "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current is = 200 uA\n",
+ "\n",
+ "fh = 3.18 Hz\n",
+ "\n",
+ "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "f=20.;#Hz #lowest frequency\n",
+ "Xc=1./(2.*math.pi*f*C) #reactance of capacitor at 20Hz\n",
+ "Rth=Rs*Rl/(Rs+Rl); #Thevenins equivalent resistance\n",
+ "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
+ "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
+ " \n",
+ "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of capacitor required\n",
+ "#given\n",
+ "import math\n",
+ "Rs1=20.*10.**3.;#ohm\n",
+ "Rs2=30.*10.**3.;#ohm\n",
+ "Rl1=40.*10.**3.;#ohm\n",
+ "Rl2=80.*10.**3.;#ohm\n",
+ "Rl3=80.*10.**3.;#ohm\n",
+ "Rth=Rs1*Rs2/(Rs1+Rs2); #Thevenins equivalent resistance\n",
+ "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
+ "Rl=Rl1*Rl_/(Rl1+Rl_); #Equivalent load\n",
+ "f=50.;#Hz #lowest frequency\n",
+ "R=Rth+Rl;\n",
+ "C=10./(2.*math.pi*f*R)\n",
+ "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of coupling capacitor is = 1 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage and current gain and input and output resistance\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "#given\n",
+ "\n",
+ "#DC analysis\n",
+ "Vcc=12.;#V\n",
+ "Rb=200.*10.**3.;#ohm\n",
+ "Rc=1.*10.**3.;#ohm\n",
+ "B=100.;# beta\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#AC analysis\n",
+ "Rl=1.*10.**3.;#ohm\n",
+ "hfe=B;\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "hoe_1=40.*10.**3.;#ohm # 1/hoe\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-hfe*Rac/hie;\n",
+ "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "\n",
+ "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
+ "Io=-100.*Ib;\n",
+ "Ac=Io/Ib;\n",
+ "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
+ "\n",
+ "Ri=prll(Rb,hie);\n",
+ "Ro=prll(Rl,prll(Rc,hoe_1));\n",
+ "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
+ "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
+ "\n",
+ "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 6.00 V 6.00 mA\n",
+ "\n",
+ "The voltage gain = -25.00 \n",
+ "\n",
+ "The current gain = -100.00 \n",
+ "\n",
+ "The input resistance = 2 kohm\n",
+ "\n",
+ "The output resistance = 0.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solve previous example using hybrid pie model\n",
+ "#soltion\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "Vcc=12.##V\n",
+ "Rb=200.*10.**3.##ohm\n",
+ "Rc=1.*10.**3.##ohm\n",
+ "Rl=1.*10.**3.##ohm\n",
+ "B=100.## beta\n",
+ "hie=2.*10.**3.##ohm\n",
+ "hoe_1=40.*10.**3.##ohm # 1/hoe\n",
+ "\n",
+ "Ib=Vcc/Rb#\n",
+ "Ic=B*Ib#\n",
+ "Rac=prll(Rc,Rl)#\n",
+ "gm=Ic/(25.*10.**-3.)#\n",
+ "rpi=B/gm#\n",
+ "ri=hie#\n",
+ "rb=ri-rpi#\n",
+ "ro=hoe_1#\n",
+ "Vpi=rpi/(rpi+rb)#\n",
+ "Vo=-gm*Vpi*Rac# #output voltage\n",
+ "Av=Vo#\n",
+ "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
+ "#In book voltage gain is -24.96 due to appraoximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain -25.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of output voltage\n",
+ "#given\n",
+ "Vcc=12.;#V\n",
+ "Rb=150.*10.**3.;#ohm\n",
+ "Rc=5.*10.**3.;#ohm\n",
+ "B=200.;# beta\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "ro=60.*10.**3.;#ohm # 1/hoe\n",
+ "Vi=1.*10.**-3.;#V\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
+ "Vo=0;\n",
+ "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input resistance\n",
+ "# Function definition is here\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2);\n",
+ "\treturn z\n",
+ "\n",
+ "R1=75.*10.**3.;#ohm\n",
+ "R2=7.5*10.**3.;#ohm\n",
+ "Rc=4.7*10.**3.;#ohm\n",
+ "Re=1.2*10.**3.;#ohm\n",
+ "Rl=12.*10.**3.;#ohm\n",
+ "B=150.;\n",
+ "ri=2.*10.**3.;#ohm\n",
+ "Vcc=15.;#V\n",
+ "Vb=Vcc*R2/(R1+R2);\n",
+ "Ve=Vb; #since Vbe=0\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie;\n",
+ "Icsat=Vcc/(Rc+Re);\n",
+ "# Ic < Icsat therefore transistor is in active mode\n",
+ "Vce=Vcc-Ic*(Rc+Re);\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-B*Rac/ri;\n",
+ "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "Ri_=prll(ri,R2);\n",
+ "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 8.30 V 1.14 mA\n",
+ "\n",
+ "The voltage gain = -253.3 \n",
+ "\n",
+ "The input resistance= 1.58 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of gm at different values of Vgs\n",
+ "#given\n",
+ "\n",
+ "Idss=8.*10.**-3.;#A\n",
+ "Vp=4;#V\n",
+ "#At Vgs= -0.5 V\n",
+ "Vgs= -0.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -1.5 V\n",
+ "Vgs= -1.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -2.5 V\n",
+ "Vgs= -2.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gmo = 4 mS\n",
+ "\n",
+ "gm (At Vgs = -0.5V) = 3.5 mS\n",
+ "\n",
+ "gm (At Vgs = -1.5V) = 2.5 mS\n",
+ "\n",
+ "gm (At Vgs = -2.5V) = 1.5 mS\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output signal voltage of the amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Rd=12.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Cs=25.*10.**-6.;#F\n",
+ "u=80.; #amplification factor\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Vi=0.1;#V\n",
+ "f=1.*10.**3.;#Hz #input frequency\n",
+ "Xcs=1./(2.*math.pi*f*Cs);\n",
+ "#This is much smaller than Rs therefore it is bypassed\n",
+ "\n",
+ "gm=u/rd;\n",
+ "Av=gm*(rd*Rd/(rd+Rd));\n",
+ "Vo=Av*Vi;\n",
+ "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 0.453 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "Rd=2.*10.**3.;#ohm\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Av=-gm*(rd*Rd/(rd+Rd));\n",
+ "Ri=Rg;\n",
+ "Ro=rd*Rd/(rd+Rd);\n",
+ "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -4 \n",
+ "input resistance= 1 Mohm \n",
+ "output resistance = 2 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=500.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Rd=5.*10.**3.;#ohm\n",
+ "Rs=100.;#ohm\n",
+ "Rl=5.*10.**3.;#ohm\n",
+ "gm=1.5*10.**-3.;#S\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Rg=R1*R2/(R1+R2);\n",
+ "Rac=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*Rac;\n",
+ "Ri=Rg;\n",
+ "Ro=(rd*Rac/(rd+Rac));\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -3.75 \n",
+ "Input resistance = 45.45 kohm \n",
+ "Output resistance = 2.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the voltage gain of the FET\n",
+ "#given\n",
+ "Idss=8.*10.**-3.##A\n",
+ "Vp=4.##V\n",
+ "rd=25.*10.**3.##ohm\n",
+ "Rd=2.2*10.**3.##ohm #by the help of figure\n",
+ "Vgs=-1.8##V\n",
+ "gmo=2.*Idss/(abs(Vp))#\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
+ "Av=-gm*(rd*Rd/(rd+Rd))#\n",
+ "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain of the FET = -4.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08.ipynb new file mode 100755 index 00000000..8771f780 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6dc14d0f3e52d6546555bedb4c03e69e0077a9e9ecdeb40a1fe337170a8ca497"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 08 - Multistage Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Express the gain in decibel\n",
+ "#given\n",
+ "#Powere gain of 1000\n",
+ "import math\n",
+ "Pg1=1000.;\n",
+ "Pgd1=10.*math.log10(Pg1);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1000\n",
+ "Vg1=1000.;\n",
+ "Vgd1=20.*math.log10(Vg1);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
+ "\n",
+ "#Powere gain of 1/100\n",
+ "Pg2=1./100.;\n",
+ "Pgd2=10.*math.log10(Pg2);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1/100\n",
+ "Vg2=1./100.;\n",
+ "Vgd2=20.*math.log10(Vg2);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain (in dB)= 30 dB\n",
+ "\n",
+ "Voltage gain (in dB)= 60 dB\n",
+ "\n",
+ "Power gain (in dB)= -20 dB\n",
+ "\n",
+ "Voltage gain (in dB)= -40 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine power and voltage gain\n",
+ "#given\n",
+ "#For Gain = 10 dB\n",
+ "G=10.;#dB\n",
+ "Pg1=10.**(G/10.); #taking antilog\n",
+ "Vg1=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
+ "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
+ "\n",
+ "#For Gain 3 dB\n",
+ "G=3.;#dB\n",
+ "Pg2=10.**(G/10.); #taking antilog\n",
+ "Vg2=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
+ "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Gain 10 dB\n",
+ "\n",
+ "Power gain ratio = 10 \n",
+ "\n",
+ "Voltage gain ratio = 3.16 \n",
+ "\n",
+ "For Gain 3 dB\n",
+ "\n",
+ "Power gain ratio = 2.00 \n",
+ "\n",
+ "Voltage gain ratio = 1.413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the overall voltage gain\n",
+ "#given\n",
+ "import math\n",
+ "A1=80.\n",
+ "A2=50.\n",
+ "A3=30.\n",
+ "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
+ "\n",
+ "#Alternatively\n",
+ "A=A1*A2*A3;\n",
+ "Ad=20.*math.log10(A);\n",
+ "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage gain is = 101.58 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate quiescent output voltage and small signal voltage gain\n",
+ "#given\n",
+ "#At input Voltage =3V\n",
+ "Vi1=3.##V #input voltage\n",
+ "Vbe=0.7##V\n",
+ "B=250.#\n",
+ "Vcc=10.##V #Supply\n",
+ "Re1=1.*10.**3.##ohm\n",
+ "Rc1=3.*10.**3.##ohm\n",
+ "Re2=2.*10.**3.##ohm\n",
+ "Rc2=4.*10.**3.##ohm\n",
+ "Vb1=Vi1# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo1=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
+ "\n",
+ "#At input Voltage =3.2 V\n",
+ "Vi2=3.2##V #input voltage\n",
+ "Vb1=Vi2# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo2=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
+ "\n",
+ "#Small Signal input and output voltage\n",
+ "vi=Vi2-Vi1#\n",
+ "vo=Vo2-Vo1#\n",
+ "Av=vo/vi#\n",
+ "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
+ "\n",
+ "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
+ "\n",
+ "The small signal voltage gain is = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
+ "#FUNCTIONS\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
+ "Rd=10.*10.**3.;#ohm\n",
+ "Rs=500.;#ohm\n",
+ "Rg=470.*10.**3.;#ohm\n",
+ "Rl=470.*10.**3.;#ohm\n",
+ "Cc=0.01*10.**-6.;#Farad\n",
+ "Csh=100.*10.**-12.;#Farad\n",
+ "Cs=50.*10.**-6.;#Farad\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Rac2=prll(Rd,Rl);\n",
+ "Rac1=prll(Rd,Rg);\n",
+ "Req=prll(rd,prll(Rd,Rl));\n",
+ "Am=math.ceil(gm*Req);\n",
+ "Am2=Am*Am; #Voltage gain of two stage amplifier\n",
+ "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
+ "R_=prll(rd,Rd)+prll(Rg,rin);\n",
+ "f1=1./(2.*math.pi*Cc*R_); #lower cutoff frequency\n",
+ "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
+ "f2=1./(2.*math.pi*Csh*Req); #upper cutoff frequency\n",
+ "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
+ "BW=f2_-f1_;\n",
+ "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
+ "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain of two stage amplifier= 324 \n",
+ "\n",
+ "Bandwidth= 115 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Am=8.##midband voltage gain of individual MOSFET\n",
+ "BW=500.*10.**3.#Hz\n",
+ "f2=BW#\n",
+ "n=4.#\n",
+ "A2m=Am**n#\n",
+ "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
+ "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
+ "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Midband voltage gain = 4096 \n",
+ "\n",
+ "Overall Bandwidth = 217.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the input and output impedance and voltage gain\n",
+ "#FUNCTIONS\n",
+ "\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "hie=1.1*10.**3.;#ohm=rin\n",
+ "hfe=120.;#=B\n",
+ "#the values of Rac2, Zi, Zo are as per diagram\n",
+ "Rac2=prll(3.3*10**3,2.2*10**3);\n",
+ "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
+ "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
+ "Zo=prll(3.3*10**3,2.2*10**3);\n",
+ "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
+ "Am2=-hfe*Rac2/(hie);\n",
+ "Am1=-hfe*Rac1/(hie);\n",
+ "Am=Am1*Am2;\n",
+ "Am=20.*math.log10(Am);\n",
+ "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input Resistance = 0.905 kohm\n",
+ " \n",
+ "Output Resistance = 1.32 kohm\n",
+ "\n",
+ "The Overall Voltage gain is 81.97 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08_1.ipynb new file mode 100755 index 00000000..8771f780 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08_1.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6dc14d0f3e52d6546555bedb4c03e69e0077a9e9ecdeb40a1fe337170a8ca497"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 08 - Multistage Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Express the gain in decibel\n",
+ "#given\n",
+ "#Powere gain of 1000\n",
+ "import math\n",
+ "Pg1=1000.;\n",
+ "Pgd1=10.*math.log10(Pg1);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1000\n",
+ "Vg1=1000.;\n",
+ "Vgd1=20.*math.log10(Vg1);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
+ "\n",
+ "#Powere gain of 1/100\n",
+ "Pg2=1./100.;\n",
+ "Pgd2=10.*math.log10(Pg2);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1/100\n",
+ "Vg2=1./100.;\n",
+ "Vgd2=20.*math.log10(Vg2);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain (in dB)= 30 dB\n",
+ "\n",
+ "Voltage gain (in dB)= 60 dB\n",
+ "\n",
+ "Power gain (in dB)= -20 dB\n",
+ "\n",
+ "Voltage gain (in dB)= -40 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine power and voltage gain\n",
+ "#given\n",
+ "#For Gain = 10 dB\n",
+ "G=10.;#dB\n",
+ "Pg1=10.**(G/10.); #taking antilog\n",
+ "Vg1=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
+ "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
+ "\n",
+ "#For Gain 3 dB\n",
+ "G=3.;#dB\n",
+ "Pg2=10.**(G/10.); #taking antilog\n",
+ "Vg2=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
+ "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Gain 10 dB\n",
+ "\n",
+ "Power gain ratio = 10 \n",
+ "\n",
+ "Voltage gain ratio = 3.16 \n",
+ "\n",
+ "For Gain 3 dB\n",
+ "\n",
+ "Power gain ratio = 2.00 \n",
+ "\n",
+ "Voltage gain ratio = 1.413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the overall voltage gain\n",
+ "#given\n",
+ "import math\n",
+ "A1=80.\n",
+ "A2=50.\n",
+ "A3=30.\n",
+ "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
+ "\n",
+ "#Alternatively\n",
+ "A=A1*A2*A3;\n",
+ "Ad=20.*math.log10(A);\n",
+ "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage gain is = 101.58 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate quiescent output voltage and small signal voltage gain\n",
+ "#given\n",
+ "#At input Voltage =3V\n",
+ "Vi1=3.##V #input voltage\n",
+ "Vbe=0.7##V\n",
+ "B=250.#\n",
+ "Vcc=10.##V #Supply\n",
+ "Re1=1.*10.**3.##ohm\n",
+ "Rc1=3.*10.**3.##ohm\n",
+ "Re2=2.*10.**3.##ohm\n",
+ "Rc2=4.*10.**3.##ohm\n",
+ "Vb1=Vi1# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo1=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
+ "\n",
+ "#At input Voltage =3.2 V\n",
+ "Vi2=3.2##V #input voltage\n",
+ "Vb1=Vi2# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo2=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
+ "\n",
+ "#Small Signal input and output voltage\n",
+ "vi=Vi2-Vi1#\n",
+ "vo=Vo2-Vo1#\n",
+ "Av=vo/vi#\n",
+ "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
+ "\n",
+ "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
+ "\n",
+ "The small signal voltage gain is = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
+ "#FUNCTIONS\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
+ "Rd=10.*10.**3.;#ohm\n",
+ "Rs=500.;#ohm\n",
+ "Rg=470.*10.**3.;#ohm\n",
+ "Rl=470.*10.**3.;#ohm\n",
+ "Cc=0.01*10.**-6.;#Farad\n",
+ "Csh=100.*10.**-12.;#Farad\n",
+ "Cs=50.*10.**-6.;#Farad\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Rac2=prll(Rd,Rl);\n",
+ "Rac1=prll(Rd,Rg);\n",
+ "Req=prll(rd,prll(Rd,Rl));\n",
+ "Am=math.ceil(gm*Req);\n",
+ "Am2=Am*Am; #Voltage gain of two stage amplifier\n",
+ "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
+ "R_=prll(rd,Rd)+prll(Rg,rin);\n",
+ "f1=1./(2.*math.pi*Cc*R_); #lower cutoff frequency\n",
+ "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
+ "f2=1./(2.*math.pi*Csh*Req); #upper cutoff frequency\n",
+ "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
+ "BW=f2_-f1_;\n",
+ "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
+ "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain of two stage amplifier= 324 \n",
+ "\n",
+ "Bandwidth= 115 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Am=8.##midband voltage gain of individual MOSFET\n",
+ "BW=500.*10.**3.#Hz\n",
+ "f2=BW#\n",
+ "n=4.#\n",
+ "A2m=Am**n#\n",
+ "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
+ "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
+ "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Midband voltage gain = 4096 \n",
+ "\n",
+ "Overall Bandwidth = 217.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the input and output impedance and voltage gain\n",
+ "#FUNCTIONS\n",
+ "\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "hie=1.1*10.**3.;#ohm=rin\n",
+ "hfe=120.;#=B\n",
+ "#the values of Rac2, Zi, Zo are as per diagram\n",
+ "Rac2=prll(3.3*10**3,2.2*10**3);\n",
+ "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
+ "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
+ "Zo=prll(3.3*10**3,2.2*10**3);\n",
+ "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
+ "Am2=-hfe*Rac2/(hie);\n",
+ "Am1=-hfe*Rac1/(hie);\n",
+ "Am=Am1*Am2;\n",
+ "Am=20.*math.log10(Am);\n",
+ "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input Resistance = 0.905 kohm\n",
+ " \n",
+ "Output Resistance = 1.32 kohm\n",
+ "\n",
+ "The Overall Voltage gain is 81.97 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09.ipynb new file mode 100755 index 00000000..5ab169a5 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09.ipynb @@ -0,0 +1,277 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6837e0c595278402d51f86daeb96971ef73b1c2af8634ab23c1555337d40807f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 09 - Power Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the turns ratio of the transformer\n",
+ "#given\n",
+ "import math\n",
+ "Rl=8.;#ohm\n",
+ "Rl_=5.*10.**3.;#ohm\n",
+ "TR=math.sqrt(Rl_/Rl); #Turns ratio\n",
+ "print '%s %.f %s' %(\"Turns Ratio =\",TR,\": 1\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Turns Ratio = 25 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the output impedance of the transistor\n",
+ "#given\n",
+ "TR=16./1.; #turn ratio\n",
+ "Rl=4.;#ohm #loudspeaker impedance\n",
+ "ro=(TR**2.)*Rl;\n",
+ "print '%s %.f %s' %(\"The output impedance of the transistor =\",ro,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output impedance of the transistor = 1024 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Determine the efficiency of a single ended transformer\n",
+ "#given\n",
+ "Vceq=10.;#V #supply voltage\n",
+ "\n",
+ "#At Vp=10V\n",
+ "Vp=10.;#V\n",
+ "Vce_max1=Vceq+Vp;\n",
+ "Vce_min1=Vceq-Vp;\n",
+ "n1=50.*((Vce_max1-Vce_min1)/(Vce_max1+Vce_min1))**2.;\n",
+ "print '%s %.f %s' %(\"Efficiency (At Vp = 10V)=\",n1,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=5V\n",
+ "Vp=5.;#V\n",
+ "Vce_max2=Vceq+Vp;\n",
+ "Vce_min2=Vceq-Vp;\n",
+ "n2=50.*((Vce_max2-Vce_min2)/(Vce_max2+Vce_min2))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 5V)=\",n2,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=1V\n",
+ "Vp=1.;#V\n",
+ "Vce_max3=Vceq+Vp;\n",
+ "Vce_min3=Vceq-Vp;\n",
+ "n3=50.*((Vce_max3-Vce_min3)/(Vce_max3+Vce_min3))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 1V)=\",n3,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency (At Vp = 10V)= 50 percent\n",
+ "\n",
+ "Efficiency (At Vp = 5V)= 12.5 percent\n",
+ "\n",
+ "Efficiency (At Vp = 1V)= 0.5 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine input and output power and efficiency\n",
+ "#given\n",
+ "import math\n",
+ "Vcc=20.;#V#supply voltage\n",
+ "Rl=4.;#ohm\n",
+ "Vp=15.;#V\n",
+ "Ip=Vp/Rl;\n",
+ "Idc=Ip/math.pi;\n",
+ "Pi=Vcc*Idc;\n",
+ "Po=((Vp/2.)**2.)/Rl;\n",
+ "n=100.*Po/Pi;\n",
+ "print '%s %.1f %s' %(\"Input power =\",Pi,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Output power =\",Po,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 23.9 W\n",
+ "\n",
+ "Output power = 14.06 W\n",
+ "\n",
+ "Efficiency = 58.90 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage increase in output power\n",
+ "#given\n",
+ "D=0.2;#harmonic distortion\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power=\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage increase in output power= 4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n",
+ "\n",
+ "The percentage increase in output power = 1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09_1.ipynb new file mode 100755 index 00000000..5ab169a5 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09_1.ipynb @@ -0,0 +1,277 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6837e0c595278402d51f86daeb96971ef73b1c2af8634ab23c1555337d40807f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 09 - Power Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the turns ratio of the transformer\n",
+ "#given\n",
+ "import math\n",
+ "Rl=8.;#ohm\n",
+ "Rl_=5.*10.**3.;#ohm\n",
+ "TR=math.sqrt(Rl_/Rl); #Turns ratio\n",
+ "print '%s %.f %s' %(\"Turns Ratio =\",TR,\": 1\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Turns Ratio = 25 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the output impedance of the transistor\n",
+ "#given\n",
+ "TR=16./1.; #turn ratio\n",
+ "Rl=4.;#ohm #loudspeaker impedance\n",
+ "ro=(TR**2.)*Rl;\n",
+ "print '%s %.f %s' %(\"The output impedance of the transistor =\",ro,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output impedance of the transistor = 1024 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Determine the efficiency of a single ended transformer\n",
+ "#given\n",
+ "Vceq=10.;#V #supply voltage\n",
+ "\n",
+ "#At Vp=10V\n",
+ "Vp=10.;#V\n",
+ "Vce_max1=Vceq+Vp;\n",
+ "Vce_min1=Vceq-Vp;\n",
+ "n1=50.*((Vce_max1-Vce_min1)/(Vce_max1+Vce_min1))**2.;\n",
+ "print '%s %.f %s' %(\"Efficiency (At Vp = 10V)=\",n1,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=5V\n",
+ "Vp=5.;#V\n",
+ "Vce_max2=Vceq+Vp;\n",
+ "Vce_min2=Vceq-Vp;\n",
+ "n2=50.*((Vce_max2-Vce_min2)/(Vce_max2+Vce_min2))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 5V)=\",n2,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=1V\n",
+ "Vp=1.;#V\n",
+ "Vce_max3=Vceq+Vp;\n",
+ "Vce_min3=Vceq-Vp;\n",
+ "n3=50.*((Vce_max3-Vce_min3)/(Vce_max3+Vce_min3))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 1V)=\",n3,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency (At Vp = 10V)= 50 percent\n",
+ "\n",
+ "Efficiency (At Vp = 5V)= 12.5 percent\n",
+ "\n",
+ "Efficiency (At Vp = 1V)= 0.5 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine input and output power and efficiency\n",
+ "#given\n",
+ "import math\n",
+ "Vcc=20.;#V#supply voltage\n",
+ "Rl=4.;#ohm\n",
+ "Vp=15.;#V\n",
+ "Ip=Vp/Rl;\n",
+ "Idc=Ip/math.pi;\n",
+ "Pi=Vcc*Idc;\n",
+ "Po=((Vp/2.)**2.)/Rl;\n",
+ "n=100.*Po/Pi;\n",
+ "print '%s %.1f %s' %(\"Input power =\",Pi,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Output power =\",Po,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 23.9 W\n",
+ "\n",
+ "Output power = 14.06 W\n",
+ "\n",
+ "Efficiency = 58.90 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage increase in output power\n",
+ "#given\n",
+ "D=0.2;#harmonic distortion\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power=\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage increase in output power= 4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n",
+ "\n",
+ "The percentage increase in output power = 1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10.ipynb new file mode 100755 index 00000000..7db9ea32 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1f2e4043038005e29398e6a31d23669297bf42551e1af00fba80d3d1e6cbef7d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 - Feedback in Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier\n",
+ "#given\n",
+ "A=100.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 9.09 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=60.;#dB #internal gain in dB\n",
+ "A=10.**(Ad/20.); #internal gain\n",
+ "B=1./20.;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "Afd=20.*math.log10(Af);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 25.85 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of output fed back to input\n",
+ "#given\n",
+ "A=600.;#internal gain\n",
+ "Af=50.;#gain of feedback amplifier\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of output fed back to input = 1.833 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the internal gain and percentage of output fed back to input\n",
+ "#given\n",
+ "Af=80.;#gain of feedback amplifier\n",
+ "Vi=0.05;#V#input with feedback\n",
+ "Vi_=4.*10.**-3.;#V#input without feedback\n",
+ "Vo_=Af*Vi;\n",
+ "A=Vo_/Vi_;\n",
+ "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal gain is = 1000 \n",
+ "\n",
+ "The percentage of output fed back to input = 1.15 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain with and without feedback and feedback factor\n",
+ "#given\n",
+ "Vo_=5.;#V #output voltage\n",
+ "Vi=0.2;#V #input with feedback\n",
+ "Vi_=0.05;#V #input without feedback\n",
+ "A=Vo_/Vi_;\n",
+ "Af=Vo_/Vi;\n",
+ "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain without feedback is = 100 \n",
+ "\n",
+ "The gain with feedback is = 25 \n",
+ "\n",
+ "The feedback factor = 3 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain of feedback amplifier and feedback factor\n",
+ "#given\n",
+ "A=100.; #internal gain\n",
+ "N=20.;#dB #negative feedback\n",
+ "B=(10.**(-N/(-20.))-1.)/A; #taking antilog\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
+ "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The feedback factor = 9 percent\n",
+ "\n",
+ "The gain of the feedback amplifier is = 10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "A=1000.;#internal gain\n",
+ "N=40.;#dB#negative feedback\n",
+ "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
+ "dA_A=10.;#percent#dA/A\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain = 0.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "Adb=60.;#dB#internal gain in dB\n",
+ "B=0.005;#feedback factor\n",
+ "A=10.**(Adb/(20.));#taking antilog\n",
+ "dA_A=-12.;#percent #dA/A\n",
+ "D=(1.+A*B);#D=(1+AB)desensitivity\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain reduces by = 2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the input resistance of feedback amplifier\n",
+ "#given\n",
+ "A=250.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Ri=1.1*10.**3.;#ohm #input resistance\n",
+ "Rif=Ri*(1.+A*B);\n",
+ "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
+ "\n",
+ "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input resistance of feedback amplifier = 28.6 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of negative feedback to input\n",
+ "#given\n",
+ "Adb=60.;#dB #internal gain in dB\n",
+ "A=10.**(Adb/(20.)); #taking antilog\n",
+ "Ro=12.*10.**3.;#ohm #output resistance\n",
+ "Rof=600.;#ohm\n",
+ "B=(Ro/Rof-1.)/A;\n",
+ "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of negative feedback to input = 1.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10_1.ipynb new file mode 100755 index 00000000..7db9ea32 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10_1.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1f2e4043038005e29398e6a31d23669297bf42551e1af00fba80d3d1e6cbef7d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 - Feedback in Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier\n",
+ "#given\n",
+ "A=100.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 9.09 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=60.;#dB #internal gain in dB\n",
+ "A=10.**(Ad/20.); #internal gain\n",
+ "B=1./20.;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "Afd=20.*math.log10(Af);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 25.85 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of output fed back to input\n",
+ "#given\n",
+ "A=600.;#internal gain\n",
+ "Af=50.;#gain of feedback amplifier\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of output fed back to input = 1.833 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the internal gain and percentage of output fed back to input\n",
+ "#given\n",
+ "Af=80.;#gain of feedback amplifier\n",
+ "Vi=0.05;#V#input with feedback\n",
+ "Vi_=4.*10.**-3.;#V#input without feedback\n",
+ "Vo_=Af*Vi;\n",
+ "A=Vo_/Vi_;\n",
+ "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal gain is = 1000 \n",
+ "\n",
+ "The percentage of output fed back to input = 1.15 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain with and without feedback and feedback factor\n",
+ "#given\n",
+ "Vo_=5.;#V #output voltage\n",
+ "Vi=0.2;#V #input with feedback\n",
+ "Vi_=0.05;#V #input without feedback\n",
+ "A=Vo_/Vi_;\n",
+ "Af=Vo_/Vi;\n",
+ "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain without feedback is = 100 \n",
+ "\n",
+ "The gain with feedback is = 25 \n",
+ "\n",
+ "The feedback factor = 3 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain of feedback amplifier and feedback factor\n",
+ "#given\n",
+ "A=100.; #internal gain\n",
+ "N=20.;#dB #negative feedback\n",
+ "B=(10.**(-N/(-20.))-1.)/A; #taking antilog\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
+ "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The feedback factor = 9 percent\n",
+ "\n",
+ "The gain of the feedback amplifier is = 10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "A=1000.;#internal gain\n",
+ "N=40.;#dB#negative feedback\n",
+ "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
+ "dA_A=10.;#percent#dA/A\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain = 0.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "Adb=60.;#dB#internal gain in dB\n",
+ "B=0.005;#feedback factor\n",
+ "A=10.**(Adb/(20.));#taking antilog\n",
+ "dA_A=-12.;#percent #dA/A\n",
+ "D=(1.+A*B);#D=(1+AB)desensitivity\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain reduces by = 2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the input resistance of feedback amplifier\n",
+ "#given\n",
+ "A=250.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Ri=1.1*10.**3.;#ohm #input resistance\n",
+ "Rif=Ri*(1.+A*B);\n",
+ "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
+ "\n",
+ "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input resistance of feedback amplifier = 28.6 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of negative feedback to input\n",
+ "#given\n",
+ "Adb=60.;#dB #internal gain in dB\n",
+ "A=10.**(Adb/(20.)); #taking antilog\n",
+ "Ro=12.*10.**3.;#ohm #output resistance\n",
+ "Rof=600.;#ohm\n",
+ "B=(Ro/Rof-1.)/A;\n",
+ "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of negative feedback to input = 1.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11.ipynb new file mode 100755 index 00000000..206b57f3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9f145e3575abf583b905671dc9c265339855396c0056b7d05cbca68c581ff19b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 - Tuned Volatge AMplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current and voltage across each element at resonance\n",
+ "#given\n",
+ "import math\n",
+ "R=12.;#ohm\n",
+ "L=200.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "Vs=9.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Z=R;#impedance\n",
+ "print '%s %.1f %s' %(\"The Resonant frequency =\",fo/1000,\"kHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Z,\"ohm\\n\");\n",
+ "\n",
+ "Io=Vs/R;\n",
+ "print '%s %.2f %s' %(\"The Source current =\",Io,\"A\\n\");\n",
+ "\n",
+ "Vl=Io*(2.*math.pi*fo*L);\n",
+ "Vc=Io/(2.*math.pi*fo*C);\n",
+ "Vr=Io*R;\n",
+ "print '%s %.1f %s' %(\"The voltage across the inductor =\",Vl,\"V\\n\");\n",
+ "print '%s %.1f %s' %(\"The voltage across the capacitor =\",Vc,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The voltage across the resistor =\",Vr,\"V\\n\");\n",
+ "#There is a slight variation in voltage across capacitor due to the approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 649.7 kHz\n",
+ "\n",
+ "The impedance Z = 12 ohm\n",
+ "\n",
+ "The Source current = 0.75 A\n",
+ "\n",
+ "The voltage across the inductor = 612.4 V\n",
+ "\n",
+ "The voltage across the capacitor = 612.4 V\n",
+ "\n",
+ "The voltage across the resistor = 9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current at resonance and current in coil and capacitor\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=100.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "Vs=10.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.3f %s' %(\"The Resonant frequency =\",fo/10**6,\"MHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Io=Vs/Zp;\n",
+ "print '%s %.f %s' %(\"The Source current =\",Io*10**6,\"uA\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Xc=1./(2.*math.pi*fo*C);\n",
+ "Z1=math.sqrt(Xl**2.+R**2.);\n",
+ "Z2=Xc;\n",
+ "Ic=Vs/Z2;\n",
+ "Il=Ic;\n",
+ "print '%s %.f %s' %(\"The current in the coil =\",1000,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"The current in the capacitor =\",Ic*1000,\"mA\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 1.592 MHz\n",
+ "\n",
+ "The impedance Z = 100 kohm\n",
+ "\n",
+ "The Source current = 100 uA\n",
+ "\n",
+ "The current in the coil = 1000 ohm\n",
+ "\n",
+ "The current in the capacitor = 10 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate impedance and quality factor and bandwidth\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=150.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1/(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Q=Xl/R;\n",
+ "BW=fo/Q;\n",
+ "print '%s %.1f %s' %(\"The Quality factor of the circuit =\",Q,\"\\n\");\n",
+ "print '%s %.1f %s' %(\"The Band width of the circuit =\",BW/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance Z = 150 kohm\n",
+ "\n",
+ "The Quality factor of the circuit = 122.5 \n",
+ "\n",
+ "The Band width of the circuit = 10.6 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11_1.ipynb new file mode 100755 index 00000000..206b57f3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11_1.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9f145e3575abf583b905671dc9c265339855396c0056b7d05cbca68c581ff19b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 - Tuned Volatge AMplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current and voltage across each element at resonance\n",
+ "#given\n",
+ "import math\n",
+ "R=12.;#ohm\n",
+ "L=200.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "Vs=9.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Z=R;#impedance\n",
+ "print '%s %.1f %s' %(\"The Resonant frequency =\",fo/1000,\"kHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Z,\"ohm\\n\");\n",
+ "\n",
+ "Io=Vs/R;\n",
+ "print '%s %.2f %s' %(\"The Source current =\",Io,\"A\\n\");\n",
+ "\n",
+ "Vl=Io*(2.*math.pi*fo*L);\n",
+ "Vc=Io/(2.*math.pi*fo*C);\n",
+ "Vr=Io*R;\n",
+ "print '%s %.1f %s' %(\"The voltage across the inductor =\",Vl,\"V\\n\");\n",
+ "print '%s %.1f %s' %(\"The voltage across the capacitor =\",Vc,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The voltage across the resistor =\",Vr,\"V\\n\");\n",
+ "#There is a slight variation in voltage across capacitor due to the approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 649.7 kHz\n",
+ "\n",
+ "The impedance Z = 12 ohm\n",
+ "\n",
+ "The Source current = 0.75 A\n",
+ "\n",
+ "The voltage across the inductor = 612.4 V\n",
+ "\n",
+ "The voltage across the capacitor = 612.4 V\n",
+ "\n",
+ "The voltage across the resistor = 9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current at resonance and current in coil and capacitor\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=100.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "Vs=10.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.3f %s' %(\"The Resonant frequency =\",fo/10**6,\"MHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Io=Vs/Zp;\n",
+ "print '%s %.f %s' %(\"The Source current =\",Io*10**6,\"uA\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Xc=1./(2.*math.pi*fo*C);\n",
+ "Z1=math.sqrt(Xl**2.+R**2.);\n",
+ "Z2=Xc;\n",
+ "Ic=Vs/Z2;\n",
+ "Il=Ic;\n",
+ "print '%s %.f %s' %(\"The current in the coil =\",1000,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"The current in the capacitor =\",Ic*1000,\"mA\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 1.592 MHz\n",
+ "\n",
+ "The impedance Z = 100 kohm\n",
+ "\n",
+ "The Source current = 100 uA\n",
+ "\n",
+ "The current in the coil = 1000 ohm\n",
+ "\n",
+ "The current in the capacitor = 10 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate impedance and quality factor and bandwidth\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=150.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1/(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Q=Xl/R;\n",
+ "BW=fo/Q;\n",
+ "print '%s %.1f %s' %(\"The Quality factor of the circuit =\",Q,\"\\n\");\n",
+ "print '%s %.1f %s' %(\"The Band width of the circuit =\",BW/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance Z = 150 kohm\n",
+ "\n",
+ "The Quality factor of the circuit = 122.5 \n",
+ "\n",
+ "The Band width of the circuit = 10.6 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12.ipynb new file mode 100755 index 00000000..c079ebc3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12.ipynb @@ -0,0 +1,214 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:37c2b25ec56000b266acadb14fe6e60b4724f33d464388671c9f9fac03fcf98c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 - Sinusoidal Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "L=55.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.f %s' %(\"The frequency of oscillations =\",fo/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1239 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations and feedback factor and voltage gain\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "C1=0.001*10.**-6.;#F\n",
+ "C2=0.01*10.**-6.;#F\n",
+ "L=15.*10.**-6.;#H\n",
+ "C=prll(C1,C2);\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/10**6,\"MHz\\n\");\n",
+ "B=C1/C2;\n",
+ "Amin=1./B;\n",
+ "print '%s %.1f %s' %(\"The feedback factor of the circuit =\",B,\"\\n\");\n",
+ "print '%s %.f' %(\"The circuit needs a minimum voltage gain of\",Amin);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1.36 MHz\n",
+ "\n",
+ "The feedback factor of the circuit = 0.1 \n",
+ "\n",
+ "The circuit needs a minimum voltage gain of 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=10.*10.**3.;#ohm\n",
+ "C=0.01*10.**-6.;#F\n",
+ "fo=1./(2.*math.pi*R*C*math.sqrt(6.));\n",
+ "print '%s %.1f %s' %(\"The frequency of oscillations =\",fo,\"Hz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 649.7 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=22.*10.**3.;#ohm\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*R*C);\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/1000,\"KHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 72.34 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12_1.ipynb new file mode 100755 index 00000000..c079ebc3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12_1.ipynb @@ -0,0 +1,214 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:37c2b25ec56000b266acadb14fe6e60b4724f33d464388671c9f9fac03fcf98c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 - Sinusoidal Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "L=55.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.f %s' %(\"The frequency of oscillations =\",fo/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1239 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations and feedback factor and voltage gain\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "C1=0.001*10.**-6.;#F\n",
+ "C2=0.01*10.**-6.;#F\n",
+ "L=15.*10.**-6.;#H\n",
+ "C=prll(C1,C2);\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/10**6,\"MHz\\n\");\n",
+ "B=C1/C2;\n",
+ "Amin=1./B;\n",
+ "print '%s %.1f %s' %(\"The feedback factor of the circuit =\",B,\"\\n\");\n",
+ "print '%s %.f' %(\"The circuit needs a minimum voltage gain of\",Amin);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1.36 MHz\n",
+ "\n",
+ "The feedback factor of the circuit = 0.1 \n",
+ "\n",
+ "The circuit needs a minimum voltage gain of 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=10.*10.**3.;#ohm\n",
+ "C=0.01*10.**-6.;#F\n",
+ "fo=1./(2.*math.pi*R*C*math.sqrt(6.));\n",
+ "print '%s %.1f %s' %(\"The frequency of oscillations =\",fo,\"Hz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 649.7 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=22.*10.**3.;#ohm\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*R*C);\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/1000,\"KHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 72.34 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14.ipynb new file mode 100755 index 00000000..25528876 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14.ipynb @@ -0,0 +1,211 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b4488c471131cb2740294216bf346ae5af2217796203e0f650c4ac980ef092c1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 - Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "Acl=-Rf/R1;\n",
+ "Ricl=R1;\n",
+ "Ro=0;\n",
+ "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -100 \n",
+ "\n",
+ "The input resistance = 20 kohm\n",
+ "\n",
+ "The output resistance = 0 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output voltage\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "v1=4.;#V\n",
+ "v2=3.8;#V\n",
+ "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
+ "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -16.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design an adder circuit using an op amp\n",
+ "#given\n",
+ "#Vo=-(V1+10*V2+100*V3)\n",
+ "Rf=100.*10.**3.;#ohm\n",
+ "C1=1.;#coefficient of V1\n",
+ "C2=10.;#coefficient of V2\n",
+ "C3=100.;#coefficient of V3\n",
+ "R1=Rf/C1;\n",
+ "R2=Rf/C2;\n",
+ "R3=Rf/C3;\n",
+ "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 kohm\n",
+ "\n",
+ "R2 = 10 kohm\n",
+ "\n",
+ "R3 = 1 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate CMRR in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=100.;#differential mode gain\n",
+ "Ac=0.01;#common mode gain\n",
+ "CMRR=20.*math.log10(Ad/Ac);\n",
+ "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The CMRR in dB = 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the output voltage\n",
+ "#given\n",
+ "Ad=2000.;#differential mode gain\n",
+ "CMRR=10000.;\n",
+ "V1=10.**-3.;#V\n",
+ "V2=0.9*10.**-3.;#V\n",
+ "Vd=V1-V2;\n",
+ "Vc=(V1+V2)/2.;\n",
+ "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
+ "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 200.19 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14_1.ipynb new file mode 100755 index 00000000..25528876 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14_1.ipynb @@ -0,0 +1,211 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b4488c471131cb2740294216bf346ae5af2217796203e0f650c4ac980ef092c1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 - Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "Acl=-Rf/R1;\n",
+ "Ricl=R1;\n",
+ "Ro=0;\n",
+ "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -100 \n",
+ "\n",
+ "The input resistance = 20 kohm\n",
+ "\n",
+ "The output resistance = 0 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output voltage\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "v1=4.;#V\n",
+ "v2=3.8;#V\n",
+ "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
+ "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -16.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design an adder circuit using an op amp\n",
+ "#given\n",
+ "#Vo=-(V1+10*V2+100*V3)\n",
+ "Rf=100.*10.**3.;#ohm\n",
+ "C1=1.;#coefficient of V1\n",
+ "C2=10.;#coefficient of V2\n",
+ "C3=100.;#coefficient of V3\n",
+ "R1=Rf/C1;\n",
+ "R2=Rf/C2;\n",
+ "R3=Rf/C3;\n",
+ "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 kohm\n",
+ "\n",
+ "R2 = 10 kohm\n",
+ "\n",
+ "R3 = 1 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate CMRR in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=100.;#differential mode gain\n",
+ "Ac=0.01;#common mode gain\n",
+ "CMRR=20.*math.log10(Ad/Ac);\n",
+ "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The CMRR in dB = 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the output voltage\n",
+ "#given\n",
+ "Ad=2000.;#differential mode gain\n",
+ "CMRR=10000.;\n",
+ "V1=10.**-3.;#V\n",
+ "V2=0.9*10.**-3.;#V\n",
+ "Vd=V1-V2;\n",
+ "Vc=(V1+V2)/2.;\n",
+ "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
+ "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 200.19 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15.ipynb new file mode 100755 index 00000000..b1eefe60 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15.ipynb @@ -0,0 +1,321 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:67e3656843a7080f843112749639096f02a0ede27ef825412c11d2b5c764c0b2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 - Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance and multiplying factor\n",
+ "#given\n",
+ "Im=5.*10.**-3.;#A\n",
+ "Rm=20.;#ohm\n",
+ "I=5.;#A\n",
+ "Rsh=Rm*Im/(I-Im);\n",
+ "n=I/Im;\n",
+ "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 0.02002 ohm\n",
+ "\n",
+ "Multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance\n",
+ "#given\n",
+ "#At I= 1 mA\n",
+ "I1=1.*10.**-3.;#A\n",
+ "Im=0.1*10.**-3.;#A\n",
+ "Rm=500.;#ohm\n",
+ "Rsh=Rm*Im/(I1-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I2=10.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I2-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I3=100.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I3-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 55.5556 ohm\n",
+ "\n",
+ "Shunt resistance = 5.0505 ohm\n",
+ "\n",
+ "Shunt resistance = 0.5005 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caluclate the series resistance to convert it into voltmeter\n",
+ "#given\n",
+ "Im=100.*10.**-6.;#A\n",
+ "Rm=100.;#ohm\n",
+ "V=100.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of series resistance is 999.9 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate multiplier resistance and voltage multiplying factor\n",
+ "#given\n",
+ "Im=50.*10.**-6.;#A\n",
+ "Rm=1000.;#ohm\n",
+ "V=50.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
+ "Vm=Im*Rm;\n",
+ "n=V/Vm;\n",
+ "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of multiplier resistance is 999 kohm\n",
+ "\n",
+ "Voltage multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reading and error of each voltmeter\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "S_A=1000.;# ohm/V#sensitivity\n",
+ "S_B=20000.;# ohm/V#sensitivity\n",
+ "R=50.;#V#range of voltmeter\n",
+ "Vs=150.;#V#Supply\n",
+ "R1=100.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Vt=Vs*(R2/(R1+R2));\n",
+ "\n",
+ "#Voltmeter A\n",
+ "Ri1=S_A*R;\n",
+ "Rxy_A=prll(Ri1,R2); #total resistance at X and Y\n",
+ "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
+ "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
+ "\n",
+ "#Voltmeter B\n",
+ "Ri2=S_B*R;\n",
+ "Rxy_B=prll(Ri2,R2); #total resistance at X and Y\n",
+ "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
+ "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
+ "\n",
+ "e1=(Vt-V1)*100./Vt;\n",
+ "e2=(Vt-V2)*100./Vt;\n",
+ "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltmeter indicates 30 V\n",
+ "\n",
+ "The voltmeter indicates 48.39 V\n",
+ "\n",
+ "The error in the reading of voltmeter A = 40 percent\n",
+ "\n",
+ "The error in the reading of voltmeter A = 3.23 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value of the ac voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=8.3;#cm#length of the trace\n",
+ "D=5.;# V/cm#deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/(2.*math.sqrt(2.));\n",
+ "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the ac voltage 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value and frequency of the sine voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=3.5;#cm #length of the trace\n",
+ "D=2.;# V/cm #deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/math.sqrt(2.);\n",
+ "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
+ "x=4.;#cm #one cycle length on x axis\n",
+ "t=0.5*10.**-3.;# s/cm #timebase setting\n",
+ "T=x*t;\n",
+ "f=1./T;\n",
+ "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sine voltage = 4.95 V\n",
+ "\n",
+ "The frequency of the sine voltage = 0.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15_1.ipynb new file mode 100755 index 00000000..b1eefe60 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15_1.ipynb @@ -0,0 +1,321 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:67e3656843a7080f843112749639096f02a0ede27ef825412c11d2b5c764c0b2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 - Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance and multiplying factor\n",
+ "#given\n",
+ "Im=5.*10.**-3.;#A\n",
+ "Rm=20.;#ohm\n",
+ "I=5.;#A\n",
+ "Rsh=Rm*Im/(I-Im);\n",
+ "n=I/Im;\n",
+ "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 0.02002 ohm\n",
+ "\n",
+ "Multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance\n",
+ "#given\n",
+ "#At I= 1 mA\n",
+ "I1=1.*10.**-3.;#A\n",
+ "Im=0.1*10.**-3.;#A\n",
+ "Rm=500.;#ohm\n",
+ "Rsh=Rm*Im/(I1-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I2=10.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I2-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I3=100.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I3-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 55.5556 ohm\n",
+ "\n",
+ "Shunt resistance = 5.0505 ohm\n",
+ "\n",
+ "Shunt resistance = 0.5005 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caluclate the series resistance to convert it into voltmeter\n",
+ "#given\n",
+ "Im=100.*10.**-6.;#A\n",
+ "Rm=100.;#ohm\n",
+ "V=100.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of series resistance is 999.9 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate multiplier resistance and voltage multiplying factor\n",
+ "#given\n",
+ "Im=50.*10.**-6.;#A\n",
+ "Rm=1000.;#ohm\n",
+ "V=50.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
+ "Vm=Im*Rm;\n",
+ "n=V/Vm;\n",
+ "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of multiplier resistance is 999 kohm\n",
+ "\n",
+ "Voltage multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reading and error of each voltmeter\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "S_A=1000.;# ohm/V#sensitivity\n",
+ "S_B=20000.;# ohm/V#sensitivity\n",
+ "R=50.;#V#range of voltmeter\n",
+ "Vs=150.;#V#Supply\n",
+ "R1=100.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Vt=Vs*(R2/(R1+R2));\n",
+ "\n",
+ "#Voltmeter A\n",
+ "Ri1=S_A*R;\n",
+ "Rxy_A=prll(Ri1,R2); #total resistance at X and Y\n",
+ "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
+ "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
+ "\n",
+ "#Voltmeter B\n",
+ "Ri2=S_B*R;\n",
+ "Rxy_B=prll(Ri2,R2); #total resistance at X and Y\n",
+ "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
+ "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
+ "\n",
+ "e1=(Vt-V1)*100./Vt;\n",
+ "e2=(Vt-V2)*100./Vt;\n",
+ "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltmeter indicates 30 V\n",
+ "\n",
+ "The voltmeter indicates 48.39 V\n",
+ "\n",
+ "The error in the reading of voltmeter A = 40 percent\n",
+ "\n",
+ "The error in the reading of voltmeter A = 3.23 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value of the ac voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=8.3;#cm#length of the trace\n",
+ "D=5.;# V/cm#deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/(2.*math.sqrt(2.));\n",
+ "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the ac voltage 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value and frequency of the sine voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=3.5;#cm #length of the trace\n",
+ "D=2.;# V/cm #deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/math.sqrt(2.);\n",
+ "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
+ "x=4.;#cm #one cycle length on x axis\n",
+ "t=0.5*10.**-3.;# s/cm #timebase setting\n",
+ "T=x*t;\n",
+ "f=1./T;\n",
+ "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sine voltage = 4.95 V\n",
+ "\n",
+ "The frequency of the sine voltage = 0.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter01.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter01.ipynb new file mode 100755 index 00000000..770288b1 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter01.ipynb @@ -0,0 +1,243 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c4a6fc97804f83d8aaf3c5e868daac688906bc270dd8b654ea3123010aa41bfa"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter01:Introduction to Electronics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#pg 8\n",
+ "#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",
+ "\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/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter02.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter02.ipynb new file mode 100755 index 00000000..5d8b1cb8 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter02.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:96fc4c09dfce5677e2fc09153fe84516b5c59a5f1f64280b5ec7d1d13cd315c4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter02:Semiconductor Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the conductivity and resistivity of germanium\n",
+ "#!/usr/bin/env/ python\n",
+ "#-*- coding: utf-8 -*-\n",
+ "q=1.6*10.**-19.#Coulomb #charge of an electron\n",
+ "ni=2.5*10.**19.#per m**3 #concentration\n",
+ "un=0.36#m**2/Vs #mobility of electron\n",
+ "up=0.17#m**2/Vs #mobility of holes\n",
+ "con=q*ni*(un+up); #conductivity\n",
+ "res=(1./con); #resistivity\n",
+ "print '%s %.2f %s' %(\"The conductivty is =\",con,'S/m');\n",
+ "print '%s %.2f %s' %(\"The resistivity is =\",res,'ohm m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is = 2.12 S/m\n",
+ "The resistivity is = 0.47 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the conductivity of extrinsic semiconductor\n",
+ "#given\n",
+ "e=1.6*10.**-19.;#Coulomb #charge of an electron\n",
+ "ni=1.5*10.**16.;#per m**3 #concentration\n",
+ "un=0.13;#m**2/Vs #mobility of electron\n",
+ "up=0.05;#m**2/Vs #mobility of holes\n",
+ "Si=5.*10.**28.;#per m**3 #atomic density in silicon\n",
+ "dop=(1./(2.*10.**8.)); #concentration of an antimony per silicon atoms\n",
+ "Nd=dop*Si;#per m**3 #donor concentraion\n",
+ "n=Nd;#per m**3 #free electron concentration\n",
+ "p=(ni**2/Nd);#per m **3 # hole concentration\n",
+ "con=e*(n*un+p*up);\n",
+ "print '%s %.1f %s' %(\"The conductivty is=\",con, 'S/m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is= 5.2 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter03.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter03.ipynb new file mode 100755 index 00000000..c483de7a --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter03.ipynb @@ -0,0 +1,644 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:996be6d9ddaa0bf73287e9f8387b49ed0c7806d0e7dbe4ba43b1c30f0c65dc07"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter03:Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value of threshold voltage\n",
+ "#given\n",
+ "t1=25.;#degrees C#initial temperature\n",
+ "t2=100.;#degrees C#final temperature\n",
+ "V=2.*10.**-3.;#V per celsius degree#decrease in barrier potential per degree\n",
+ "V0=0.7#V#Potential at normal temperature\n",
+ "Vd=(t2-t1)*V;#decrease in barrier potential\n",
+ "Vt=V0-Vd;#threshold volatge at 100degree C\n",
+ "print '%s %.2f %s' %(\"Threshold volatge at 100 degrees C =\",Vt,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Threshold volatge at 100 degrees C = 0.55 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detrenmine dc resistance of silicon diode\n",
+ "#given\n",
+ "#At Id = 2 mA\n",
+ "Id=2.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.5;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Id = 20 mA\n",
+ "Id=20.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.75;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.1f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Vd = - 10 V \n",
+ "Id=-2.*10.**-6.;#Ampere#diode current(from given curve)\n",
+ "Vd=-10.;#V#voltage\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf/10**6,\"M ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance is = 250 ohm\n",
+ "\n",
+ "The dc resistance is = 37.5 ohm\n",
+ "\n",
+ "The dc resistance is = 5 M ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc & ac resistance of silicon diode\n",
+ "#given\n",
+ "Id=20.*10.**-3.;#A#diode current\n",
+ "Vd=0.75;#V# as given in the V-I graph\n",
+ "Rf=Vd/Id;\n",
+ "print '%s %.1f %s' %(\"The dc resistance of diode is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#From Graph the values of dynamic voltage and current are\n",
+ "#which is equal to MN and NL repectively (in graph)\n",
+ "del_Vd=(0.8-0.68);#V\n",
+ "del_Id=(40-0)*10.**-3.;#A\n",
+ "rf=del_Vd/del_Id;\n",
+ "print '%s %.f %s' %(\"The ac resistance of the diode is =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance of diode is = 37.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is = 3 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine ac resistance of silicon diode\n",
+ "#given\n",
+ "#At Id =10mA\n",
+ "Id=10.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.1f %s' %(\"The ac resistance of the diode is(At Id= 10mA) =\",rf,\"ohm\\n\")\n",
+ "\n",
+ "#At Id =20mA\n",
+ "Id=20.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.2f %s' %(\"The ac resistance of the diode is(At Id= 20mA) =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode is(At Id= 10mA) = 2.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is(At Id= 20mA) = 1.25 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through diode\n",
+ "#given\n",
+ "Vt=0.3;#V#Threshold voltage\n",
+ "rf=25.;#ohm# average resistance\n",
+ "\n",
+ "#assuming it to be ideal\n",
+ "#from fig 3.19\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=45.;#ohm\n",
+ "R2=5.;#ohm\n",
+ "Vab=Vaa*R2/(R1+R2);\n",
+ "#Vab>Vt therefore diode is forward bias and no current flow through R2\n",
+ "Idi=Vaa/R1; #for ideal\n",
+ "print '%s %.f %s' %(\"The diode current (for ideal) is =\",Idi*1000,\"mA\\n\");\n",
+ "\n",
+ "#assuming it to be real\n",
+ "#Thevenins equivalent circuit parameters of fig 3.19\n",
+ "Vth=Vaa*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "Idr=(Vth-Vt)/(Rth+rf); #for real\n",
+ "print '%s %.1f %s' %(\"The diode current (for real) is =\",Idr*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diode current (for ideal) is = 222 mA\n",
+ "\n",
+ "The diode current (for real) is = 23.7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through resistance in given figure\n",
+ "#From fig\n",
+ "Vaa=20.;#V#supply\n",
+ "Vt=0.7;#V#threshold voltage of diode\n",
+ "rf=5.;#ohm #forward resistance\n",
+ "R=90.;#ohm#given resistor\n",
+ "\n",
+ "#Diode D1 and D4 are forward bias and D2 and D3 are reverse biased\n",
+ "\n",
+ "Vnet=Vaa-Vt-Vt;\n",
+ "Rt=R+rf+rf;\n",
+ "I=Vnet/Rt;\n",
+ "print '%s %.f %s' %(\"Current through 90 ohm resistor is =\",I*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 90 ohm resistor is = 186 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current drawn by the battery\n",
+ "#From fig\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=100.;#ohm\n",
+ "R2=100.;#ohm\n",
+ "\n",
+ "#Forward Bias\n",
+ "Id=Vaa/R1;\n",
+ "print '%s %.1f %s' %(\"Current drawn from battery (forward bias) =\",Id,\"A\\n\");\n",
+ "\n",
+ "#Reverse Bias\n",
+ "Rnet=R1+R2;\n",
+ "Id=Vaa/Rnet;\n",
+ "print '%s %.2f %s' %(\"Current drawn from battery (reverse bias) =\",Id,\"A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from battery (forward bias) = 0.1 A\n",
+ "\n",
+ "Current drawn from battery (reverse bias) = 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc current through load and rectification efficiency and peak inverse voltage\n",
+ "#given\n",
+ "import math\n",
+ "TR=31./2.;#Turn ratio of the transformer\n",
+ "rf=20.;#ohm#Dynamic forward resistance\n",
+ "Rl=1000.;#ohm#Load resistance\n",
+ "Vt=0.66;#V#Threshold voltage of diode\n",
+ "V=220.;#V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp;\n",
+ "Im=(Vm-Vt)/(rf+Rl);\n",
+ "Idc=Im/math.pi;\n",
+ "n=40.6/(1.+rf/Rl);\n",
+ "print '%s %.f %s' %(\"The dc current through load is =\",Idc*1000,\"mA\\n\");\n",
+ "print '%s %.1f %s' %(\"The rectification efficiency is =\",n,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"Peak inverse voltage =Vm = \",Vm,\"V\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current through load is = 6 mA\n",
+ "\n",
+ "The rectification efficiency is = 39.8 percent\n",
+ "\n",
+ "Peak inverse voltage =Vm = 20.07 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc voltage across load and peak inverse voltage across each diode\n",
+ "#given\n",
+ "import math\n",
+ "TR=12./1.##Turn ratio of the transformer\n",
+ "V=220.##V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp#\n",
+ "Vdc=(2.*Vm)/math.pi#\n",
+ "print '%s %.1f %s' %(\"The dc voltage across load =\",Vdc,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for bridge rectifier) =\",Vm,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for centre tap rectifier) =\",2*Vm,\"V\\n\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc voltage across load = 16.5 V\n",
+ "\n",
+ "Peak inverse voltage (for bridge rectifier) = 25.9 V\n",
+ "\n",
+ "Peak inverse voltage (for centre tap rectifier) = 51.9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc power supplied to load and efficiency and PIV rating of the diode\n",
+ "#given\n",
+ "import math\n",
+ "rf=2.;#ohm#Dynamic forward resistance\n",
+ "Rs=5.;#ohm#resistaqnce of secondary\n",
+ "Rl=25.;#ohm#Load resistance\n",
+ "Idc=0.1;#A#dc current to a load\n",
+ "Pdc=Idc**2.*Rl; #dc power\n",
+ "n=(81.2*Rl)/(Rl+rf+Rs); #efficiency\n",
+ "Im=(math.pi*Idc)/2.; #peak value current\n",
+ "Vm=Im*(Rl+rf+Rs); #peak voltage\n",
+ "Vlm=Vm-Im*(rf+Rs); #peak voltage across load\n",
+ "PIV=Vm+Vlm;\n",
+ "print '%s %.2f %s' %(\"The dc power supplied to the load is =\",Pdc,'W\\n');\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,'percent\\n');\n",
+ "print '%s %.3f %s' %(\"The peak inverse voltage is =\",PIV,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc power supplied to the load is = 0.25 W\n",
+ "\n",
+ "Efficiency = 63.44 percent\n",
+ "\n",
+ "The peak inverse voltage is = 8.954 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate output voltage and current through load and voltage across series resistor and current and power dissipated in zener diode\n",
+ "#given\n",
+ "Vi=110.;#V #input voltage\n",
+ "Rl=6.*10.**3.;# ohm #load resistance\n",
+ "Rs=2.*10.**3.;#ohm #series resistance\n",
+ "Vz=60.;#V #Zener voltage\n",
+ "V=Vi*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Vs=Vi-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Iz=Is-Il #/By applying kirchhoffs law\n",
+ "Pz=Vz*Iz #Power dissipated accross zener diode\n",
+ "\n",
+ "print '%s %.f %s' %(\"The output voltage is =\",Vo,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The current through load resistance is =\",Il*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"Voltage across series resistor is =\",Vs,\"V\\n\")\n",
+ "print '%s %.f %s' %(\"Current in zener diode is =\",Iz*1000,\"mA\\n\")\n",
+ "print '%s %.f %s' %(\"Power dissipated by zener diode =\",Pz*1000,'mW');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 60 V\n",
+ "\n",
+ "The current through load resistance is = 10 mA\n",
+ "\n",
+ "Voltage across series resistor is = 50 V\n",
+ "\n",
+ "Current in zener diode is = 15 mA\n",
+ "\n",
+ "Power dissipated by zener diode = 900 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate max and min values of zener diode current\n",
+ "#given\n",
+ "Vimin=80.;#V #minimum input voltage\n",
+ "Vimax=120.;#V #maximum input voltage\n",
+ "Rl=10.*10.**3.;# ohm #load resistance\n",
+ "Rs=5.*10.**3.;#ohm #series resistance\n",
+ "Vz=50.;#V #Zener voltage\n",
+ "V=Vimin*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "#For minimum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimin-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmin=Is-Il;\n",
+ "print '%s %.f %s' %(\"Minimum values of zener diode current is =\",Izmin*1000,\"mA\\n\");\n",
+ "\n",
+ "#For maximum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimax-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmax=Is-Il;\n",
+ "print '%s %.f %s' %(\"Maximum values of zener diode current is =\",Izmax*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum values of zener diode current is = 1 mA\n",
+ "\n",
+ "Maximum values of zener diode current is = 9 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine value of the series resistor and wattage rating\n",
+ "#given\n",
+ "Vi=12.##V #input voltage\n",
+ "Vz=7.2##V #Zener voltage\n",
+ "Izmin=10.*10.**-3.##A #min current through zener diode\n",
+ "Ilmax=100*10.**-3.##A #max current through load\n",
+ "Ilmin=12.*10.**-3.##A #min current through load\n",
+ "Vs=Vi-Vz# #Voltage drop across the series resistor\n",
+ "Is=Izmin+Ilmax# #Current through the series resistor\n",
+ "Rs=Vs/Is#\n",
+ "print '%s %.1f %s' %(\"The series resistor so that 10mA current flow through zener diode is =\",Rs,\"ohm\\n\")#\n",
+ "Izmax=Is-Ilmin#max zener through zener diode\n",
+ "Pmax=Izmax*Vz#\n",
+ "print '%s %.1f %s' %(\"The maximum wattage rating is =\",Pmax*1000,\"mW\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resistor so that 10mA current flow through zener diode is = 43.6 ohm\n",
+ "\n",
+ "The maximum wattage rating is = 705.6 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the capacitance of a varactor diode\n",
+ "#given\n",
+ "import math\n",
+ "C=5.;#pf#capcitance of varactor diode at V=4V\n",
+ "V=4.;#V\n",
+ "K=C*math.sqrt(4.);\n",
+ "#When bias voltage is increased upto 6 V\n",
+ "Vn=6.;#V#new bias voltage\n",
+ "Cn=K/(math.sqrt(Vn));\n",
+ "print '%s %.3f %s' %(\"Capacitance (At 6 V ) =\",Cn,\"pf\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance (At 6 V ) = 4.082 pf\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter04.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter04.ipynb new file mode 100755 index 00000000..9ad4ce75 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter04.ipynb @@ -0,0 +1,420 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:12896fc25e43375cf1d0cff293b48413389e0aa67a527bcf3d773f54a9aaa70f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter04:Bipolar Junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the collector and base current\n",
+ "#given\n",
+ "a=0.98;#dc alpha\n",
+ "Ie=5.*10.**-3.;#A#emitter current\n",
+ "Ico=2.*10.**-6.;#A#collector reverse leakage current\n",
+ "Ic=a*Ie+Ico;\n",
+ "Ib=Ie-Ic;\n",
+ "print '%s %.3f %s' %(\"The collector current is =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is = 4.902 mA\n",
+ "\n",
+ "The base current is = 98 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the base and collector current and exact and approax dc alpha \n",
+ "#given\n",
+ "Ie=8.4*10.**-3.#A#emitter current\n",
+ "Icbo=0.1*10.**-6.##A#reverse leakage current\n",
+ "Ib=0.008*Ie##A#base current\n",
+ "Ic=Ie-Ib#\n",
+ "Icinj=Ic-Icbo#\n",
+ "a0=Icinj/Ie#\n",
+ "a=Ic/Ie#\n",
+ "print '%s %.1f %s' %(\"Base current is =\",Ib*10**6,\"uA\\n\")#\n",
+ "print '%s %.4f %s' %(\"Collector current =\",Ic*1000,\"mA\\n\",)#\n",
+ "print '%s %.7f %s' %(\"Exact value of alphha =\",a0,\"\\n\")#\n",
+ "print '%s %.3f' %(\"Approax value of alpha =\",a)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current is = 67.2 uA\n",
+ "\n",
+ "Collector current = 8.3328 mA\n",
+ "\n",
+ "Exact value of alphha = 0.9919881 \n",
+ "\n",
+ "Approax value of alpha = 0.992\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the base current\n",
+ "#given\n",
+ "a=0.96; #dc alpha\n",
+ "Rc=2.*10.**3.;#ohm #resistor across collector\n",
+ "Vc=4.;#V #Voltage drop across the collector resistor\n",
+ "Ic=Vc/Rc; #Colletor current\n",
+ "Ie=Ic/a; #Emmiter current\n",
+ "Ib=Ie-Ic; #Base current\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\",)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is = 83 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Ie=2.;#mA\n",
+ "Vcb=10.;#V\n",
+ "\n",
+ "#Taking points around Ie & Vcb from graph\n",
+ "del_Ie=(2.5-1.5)*10.**-3.;#A\n",
+ "\n",
+ "#corresponding change in Veb\n",
+ "del_Veb=(0.9-0.8);#V\n",
+ "rib=del_Veb/del_Ie;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rib,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 100 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc current gain in common emitter configuration\n",
+ "#given\n",
+ "a=0.98;#dc current gain in common base configuration\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The dc current gain in common emitter configuration is=\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current gain in common emitter configuration is= 49\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac alpha and beta\n",
+ "#given\n",
+ "ic=0.995#mA#Emitter current change\n",
+ "ie=1.#mA#collector current change\n",
+ "a=ic/ie;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.3f %s' %(\"The ac alpha is =\",a,\"\\n\")\n",
+ "print '%s %.f' %(\"The common emitter ac current gain is =\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac alpha is = 0.995 \n",
+ "\n",
+ "The common emitter ac current gain is = 199\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate beta and Iceo and exact and approax collector current\n",
+ "#given\n",
+ "a0=0.992;#dc current gain in common base configuration\n",
+ "Icbo=48.*10.**-9.;#A\n",
+ "Ib=30.*10.**-6.;#A#base current\n",
+ "B=a0/(1.-a0);\n",
+ "Iceo=Icbo/(1.-a0);\n",
+ "print '%s %.f %s' %(\"Beta=\",B,\"\\n\");\n",
+ "print '%s %.f %s' %(\"Iceo=\",Iceo*10**6,\"uA\\n\");\n",
+ "Ic=B*Ib+Iceo;\n",
+ "Ica=B*Ib;#approax\n",
+ "print '%s %.3f %s' %(\"Exact collector current =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"Approax collector current =\",Ica*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 124 \n",
+ "\n",
+ "Iceo= 6 uA\n",
+ "\n",
+ "Exact collector current = 3.726 mA\n",
+ "\n",
+ "Approax collector current = 3.72 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Vbe=0.75;#V\n",
+ "Vce=2.;#V\n",
+ "\n",
+ "#Taking points around Vbe=0.75V from graph\n",
+ "del_Vbe=(0.98-0.9);#V\n",
+ "\n",
+ "#corresponding change in ib\n",
+ "del_ib=(68.-48.)*10.**-6.;#A\n",
+ "\n",
+ "rie=del_Vbe/del_ib;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rie/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 4 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance and dc and ac current gain\n",
+ "#given\n",
+ "Ib=30.*10.**-6.;#A\n",
+ "Vce=10.;#V\n",
+ "Ic=3.6*10.**-3.;#A #from graph\n",
+ "\n",
+ "#Taking points around Vce = 10V from graph\n",
+ "del_Vce=(12.5-7.5);#V\n",
+ "\n",
+ "#corresponding change in ic\n",
+ "del_ic=(3.7-3.5)*10.**-3.;#A\n",
+ "\n",
+ "roe=del_Vce/del_ic;\n",
+ "print '%s %.f %s' %(\"The dynamic output resistance of transistor is =\",roe/1000,\"k ohm\\n\");\n",
+ "\n",
+ "#dc current gain\n",
+ "Bo=Ic/Ib;\n",
+ "print '%s %.f %s' %(\"The dc current gain is =\",Bo,\"\\n\");\n",
+ "\n",
+ "#ac current gain\n",
+ "\n",
+ "del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA\n",
+ "del_ib=(40.-20.)*10.**-6.;\n",
+ "B=del_ic/del_ib;\n",
+ "print '%s %.f %s' %(\"The ac current gain is =\",B,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic output resistance of transistor is = 25 k ohm\n",
+ "\n",
+ "The dc current gain is = 120 \n",
+ "\n",
+ "The ac current gain is = 110 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac current gain in CE and CC configuration\n",
+ "#given\n",
+ "a=0.99;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The ac current gain in CE configuration is =\",B);\n",
+ "y=1.+B;\n",
+ "print '%s %.f' %(\"\\nThe ac current gain in CC configuration is =\",y);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac current gain in CE configuration is = 99\n",
+ "\n",
+ "The ac current gain in CC configuration is = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter05.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter05.ipynb new file mode 100755 index 00000000..a9d55805 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter05.ipynb @@ -0,0 +1,347 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c38375c3ed3aba849cd6bba227790fa8eedb466f2a80c8f732771b0fc6e2b503"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter05:Field Effect Transistors (FETs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate saturation voltage and saturation current\n",
+ "#given\n",
+ "Vp=-4.#V #pinch off voltage\n",
+ "Idss=12.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Vgs=-2.;#V #gate to source voltage\n",
+ "Vds=Vgs-Vp;\n",
+ "Id=Idss*(Vds/Vp)**2.;\n",
+ "print '%s %.f %s' %(\"Saturation Voltage is =\",Vds,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Saturation current is =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Voltage is = 2 V\n",
+ "\n",
+ "Saturation current is = 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vgso=-5.;#V #gate to source cut off voltage\n",
+ "Idss=20.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#At vgs = -2 V\n",
+ "vgs=-2.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -2 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -4 V\n",
+ "vgs=-4.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -4 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -8 V\n",
+ "print '%s' %(\"Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current is (At vgs = -2 V) = 7.2 mA\n",
+ "\n",
+ "Drain current is (At vgs = -4 V) = 0.8 mA\n",
+ "\n",
+ "Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Vds saturation\n",
+ "#given\n",
+ "import math\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=-15.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Id=-3.*10.**-3.;#A #saturation current\n",
+ "Vgs=Vp*(1.-math.sqrt(Id/Idss));\n",
+ "Vds=Vgs-Vp;\n",
+ "print '%s %.3f %s' %(\"The gate to source voltage (Vgs) is =\",Vgs,\"V\\n\");\n",
+ "print '%s %.3f %s' %(\"The saturation voltage is Vds(sat) =\",Vds,\"V\");\n",
+ "\n",
+ "print '\\nThe value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gate to source voltage (Vgs) is = 2.764 V\n",
+ "\n",
+ "The saturation voltage is Vds(sat) = -2.236 V\n",
+ "\n",
+ "The value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for N channel\n",
+ "#given\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= - 3 V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id(For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5 V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id(For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id(For Vgs= -3V) = 2.88 mA\n",
+ "\n",
+ "The drain current Id(For Vgs= 2.5V) = 40.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for P channel\n",
+ "#given\n",
+ "Vp=-5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= -3V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id (For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id (For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id (For Vgs= -3V) = 46.08 mA\n",
+ "\n",
+ "The drain current Id (For Vgs= 2.5V) = 4.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vt=2.;#V #threshold voltage\n",
+ "K=0.25*10.**-3.;# A/V**2 #conductivity parameter\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=2.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "Id=K*(Vgs-Vt)**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 0.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of Id\n",
+ "#given\n",
+ "Vt=1.5;#V #threshold voltage\n",
+ "Id=2.*10.**-3.;#A\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=5.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "# Calculating K\n",
+ "K=Id/((Vgs-Vt)**2.); # A/V**2 #conductivity parameter\n",
+ "\n",
+ "#Calculating Id for Vgs= 5 V and Vds= 6 V\n",
+ "Vgs=5;#V #gate supply\n",
+ "Vds=6;#V #saturation voltage\n",
+ "Id=K*((Vgs-Vt)**2);\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 10.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the dynamic drain resistance\n",
+ "#given\n",
+ "gm=200.*10.**-6.;#S transconductance\n",
+ "u=80.;#amplification factor\n",
+ "rd=u/gm;\n",
+ "print '%s %.f %s' %(\"The dynamic drain resistance is =\",rd/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic drain resistance is = 400 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter06.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter06.ipynb new file mode 100755 index 00000000..5865234b --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter06.ipynb @@ -0,0 +1,698 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7be33daa1d7e9b1e217f1a71b195a0e8c1c9026233035f683a45d209e0003c84"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter06:Transistor Biasing and Stabilization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.2*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=270.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,'V',Ic*1000,'mA');\n",
+ "\n",
+ "#Note--In book Vce = 5.7 V because of approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 5.6 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=150.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=100.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ics*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 0 V 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Rb and percentage change in collector current due to temperature rise\n",
+ "#given\n",
+ "\n",
+ "#Calculating the base resistance\n",
+ "B=20.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Ic=1.*10.**-3.;#A #collector current\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Icbo=2.*10.**-6.;#A #collector to base leakage current\n",
+ "\n",
+ "Ib=(Ic-(1.+B)*Icbo)/B;\n",
+ "Rb=(Vcc-Vbe)/Ib;\n",
+ "\n",
+ "print '%s %.f %s' %(\"The value of resistor Ib is =\",120,'kohm');\n",
+ "\n",
+ "Rb=120.*10.**3.;#ohm approax\n",
+ "\n",
+ "#Now when temperature rise\n",
+ "Icbo=10.*10.**-6.;#A #collector to base leakage current\n",
+ "B=25.;#dc beta\n",
+ "Ic1=B*Ib+(B+1)*Icbo;# #changed collector current\n",
+ "perc=(Ic1-Ic)*100./Ic;#percentage increase\n",
+ "print '%s %.f %s' %(\"The percentage change in collector current is =\",perc,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistor Ib is = 120 kohm\n",
+ "The percentage change in collector current is = 46 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.1f %s' %(\"The Q point (At B=50) =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.; #dc beta\n",
+ "Ic1=B*Ib; #Colletor current\n",
+ "Ics1=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.1f %s' %(\"\\nThe Q point (At B=150) is =\",Vce,\"V\",Ics*1000,\"mA\");\n",
+ "\n",
+ "print '%s %.f' %(\"\\nThe factor at which collector current increases =\",Ics1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point (At B=50) = 6.00 V 1.5 mA\n",
+ "\n",
+ "The Q point (At B=150) is = 0 V 4.5 mA\n",
+ "\n",
+ "The factor at which collector current increases = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Q point in collector to base bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=500.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-(Ic+Ib)*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 9.1 V 1.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the collector current and change in it if B is changed by three times of previous B\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.3f %s' %(\"Collector current (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "#Now B=150\n",
+ "B=3.*B; #three times of previous B\n",
+ "Ib1=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic1=B*Ib1; #Colletor current\n",
+ "print '%s %.2f %s' %(\"Collector current (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.f' %(\"The factor at which collector current increases =\",Ic1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current (B=50)= 1.125 mA\n",
+ "\n",
+ "Collector current (B=150)= 2.25 mA\n",
+ "\n",
+ "The factor at which collector current increases = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of all three current Ie and Ic and Ib\n",
+ "#given\n",
+ "B=90.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ie=Ic+Ib; #Emitter current\n",
+ "print '%s %.1f %s %s %.3f %s %s %.3f %s' %(\"Base current =\",Ib*10**6,\"uA\\n\",\"\\nCollector current =\",Ic*10**3,\"mA\\n\",\"\\nEmitter current =\",Ie*10**3,\"mA\");\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 16.5 uA\n",
+ " \n",
+ "Collector current = 1.486 mA\n",
+ " \n",
+ "Emitter current = 1.503 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max and min value of emitter current\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=75.;#ohm #resistor connected to collector\n",
+ "Re=100.;#ohm #resistor connected to emitter\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Ib=(Vcc-Vbe)/(Rb+(1.+B)*Re); #Base current\n",
+ "Ie=(1.+B)*Ib;\n",
+ "Vce=Vcc-(Rc+Re)*Ie\n",
+ "print '%s %.2f %s' %(\"Minimum emitter current =\",Ie*10**3,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"The collector to emitter volatge =\",Vce,\"V\\n\");\n",
+ "\n",
+ "#At B=300 \n",
+ "\n",
+ "B1=300.; #dc beta\n",
+ "Ib1=(Vcc-Vbe)/(Rb+(1.+B1)*Re);#Base current\n",
+ "Ie1=(1.+B1)*Ib1;\n",
+ "Vce1=Vcc-(Rc+Re)*Ie1\n",
+ "#Here Vce1= -1.4874 V but can never have negative voltage because Ie1 is wrong as it cant be more than saturation value therefore\n",
+ "Ie1=Vcc/(Rc+Re);\n",
+ "\n",
+ "#And Vce=0 V\n",
+ "\n",
+ "Vce1=0;#V\n",
+ "print '%s %.2f %s' %(\"Maximum emitter current =\",Ie1*10**3,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The collector to emitter volatge(saturation) =\",Vce1,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum emitter current = 19.25 mA\n",
+ "\n",
+ "The collector to emitter volatge = 2.63 V\n",
+ "\n",
+ "Maximum emitter current = 34.29 mA\n",
+ "\n",
+ "The collector to emitter volatge(saturation) = 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of base resistance\n",
+ "#given\n",
+ "\n",
+ "B=100.; #dc beta\n",
+ "Rc=200.;#ohm #resistor connected to collector\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Vce=4.5;#V #Collector to emitter voltage\n",
+ "Ic=(Vcc-Vce)/(Rc+Re);\n",
+ "Ib=Ic/B;\n",
+ "Rb=(Vcc-B*Re*Ib)/Ib;\n",
+ "print '%s %.f %s' %(\"The value of base resistance is =\",Rb/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistance is = 90 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the collector current at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.;#dc beta\n",
+ "Rc=2.;#ohm #resistor connected to collector\n",
+ "Re=1000.;#ohm #resistor connected to emitter\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.2f %s' %(\"The collector current at (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.;#dc beta\n",
+ "Ib1=Vcc/(Rb+B1*Re); #Base current\n",
+ "Ic1=B1*Ib1; #Colletor current\n",
+ "print '%s %.1f %s' %(\"The collector current at (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.1f' %(\"The factor at which collector current increases=\",Ic1/Ic);\n",
+ "\n",
+ "#IN BOOK Ic(AT B=50)= 1.25 mA and Ic1/Ic=2.4 DUE TO APPROAXIMATION\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current at (B=50)= 1.29 mA\n",
+ "\n",
+ "The collector current at (B=150)= 3.0 mA\n",
+ "\n",
+ "The factor at which collector current increases= 2.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Q point in voltage divider\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.*10.**3.;#ohm #voltage divider resistor 1\n",
+ "R2=1.*10.**3.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "I=Vcc/(R1+R2); #current through voltage divider\n",
+ "Vb=I*R2; #voltage at base\n",
+ "Ve=Vb-Vbe;\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie #approaximating Ib is nearly equal to 0\n",
+ "Vc=Vcc-Ic*Rc;\n",
+ "Vce=(Vc)-Ve; \n",
+ "print '%s %.1f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Ibc=I/20.; #critical value of base current\n",
+ "Ib=Ic/B; #actual base current\n",
+ "\n",
+ "#Since Ib < Ibc, hence assumption is alright\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 3.3 V 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Solve the voltage divider accurately by applying thevenin's theorem\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.;#ohm #voltage divider resistor 1\n",
+ "R2=1.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "\n",
+ "Vth=Vcc*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent voltage Vth =\",Vth,\"V\");\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent resistance Rth =\",Rth,\"kohm\");\n",
+ "\n",
+ "Ib=(Vth-Vbe)/(Rth+(1.+B)*Re);\n",
+ "Ic=B*Ib;\n",
+ "Ie=Ic+Ib;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re; \n",
+ "print '%s %.4f %s' %(\"\\nThe accurate value of Ic =\",Ic*10**3,\"mA\");\n",
+ "print '%s %.5f %s' %(\"\\nThe accurate value of Vce =\",Vce,\"V\");\n",
+ "Icp=3.*10.**-3.; # Current calculated by voltage divider in previous example\n",
+ "Vcep=3.4; # Voltage calculated by voltage divider in previous example\n",
+ "Err_Ic=(Ic-Icp)*100./Ic;\n",
+ "Err_Vce=(Vce-Vcep)*100./Vce;\n",
+ "print '%s %.1f %s' %(\"\\nError in Ic =\",Err_Ic,\"percent\\n\");\n",
+ "print '%s %.1f %s' %(\"\\nError in Vce =\",Err_Vce,\"percent\");\n",
+ "\n",
+ "# The errors and The accurate values are different \n",
+ "# because of the approaximation in Vth and Rth in book\n",
+ "\n",
+ "# In Book Ic = 2.8436 mA and Vce = 3.73839 V\n",
+ "# Error in Ic = -5.5% \n",
+ "# Error in Vce = +9% "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin equivalent voltage Vth = 0.9 V\n",
+ "\n",
+ "Thevenin equivalent resistance Rth = 0.9 kohm\n",
+ "\n",
+ "The accurate value of Ic = 3.0152 mA\n",
+ "\n",
+ "The accurate value of Vce = 3.36060 V\n",
+ "\n",
+ "Error in Ic = 0.5 percent\n",
+ "\n",
+ "\n",
+ "Error in Vce = -1.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the Q point for the emitter bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=5.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=10.*10.**3.;#ohm #resistor connected to emitter \n",
+ "Vcc=12.;#V #Voltage supply across the collector resistor\n",
+ "Vee=15;#V #supply at emitter\n",
+ "Ie=Vee/Re;\n",
+ "Ic=Ie;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 4.5 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Rs\n",
+ "#given\n",
+ "import math\n",
+ "Vp=2.;#V\n",
+ "Idss=1.75*10.**-3.;#A #drain current at Vgs=0\n",
+ "Vdd=24.;#V #drain to supply source\n",
+ "Id=1.*10.**-3.;#A #drain current\n",
+ "Vgs=(-Vp)*(1-math.sqrt(Id/Idss));\n",
+ "Rs=abs(Vgs)/Id;\n",
+ "print '%s %.3f %s' %(\"Vgs =\",Vgs,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Rs =\",Rs,\"ohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vgs = -0.488 V\n",
+ "\n",
+ "Rs = 488 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter07.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter07.ipynb new file mode 100755 index 00000000..6bd6d425 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter07.ipynb @@ -0,0 +1,592 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c173021e2b7fbdc477decea90b9573f8e45713d84c6fe5e0bdfc01c8abeb68c8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter07:Small Signal SIngle-Stage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max current and check will the capacitor act as short for given frequency\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "Vs=1.;#V\n",
+ "Imax=Vs/(Rs+Rl);\n",
+ "fc=1./(2.*math.pi*(Rs+Rl)*C) #critical frequency\n",
+ "fh=10.*fc; #Border frequency\n",
+ "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
+ "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
+ "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
+ "\n",
+ "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current is = 200 uA\n",
+ "\n",
+ "fh = 3.18 Hz\n",
+ "\n",
+ "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "f=20.;#Hz #lowest frequency\n",
+ "Xc=1./(2.*math.pi*f*C) #reactance of capacitor at 20Hz\n",
+ "Rth=Rs*Rl/(Rs+Rl); #Thevenins equivalent resistance\n",
+ "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
+ "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
+ " \n",
+ "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of capacitor required\n",
+ "#given\n",
+ "import math\n",
+ "Rs1=20.*10.**3.;#ohm\n",
+ "Rs2=30.*10.**3.;#ohm\n",
+ "Rl1=40.*10.**3.;#ohm\n",
+ "Rl2=80.*10.**3.;#ohm\n",
+ "Rl3=80.*10.**3.;#ohm\n",
+ "Rth=Rs1*Rs2/(Rs1+Rs2); #Thevenins equivalent resistance\n",
+ "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
+ "Rl=Rl1*Rl_/(Rl1+Rl_); #Equivalent load\n",
+ "f=50.;#Hz #lowest frequency\n",
+ "R=Rth+Rl;\n",
+ "C=10./(2.*math.pi*f*R)\n",
+ "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of coupling capacitor is = 1 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage and current gain and input and output resistance\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "#given\n",
+ "\n",
+ "#DC analysis\n",
+ "Vcc=12.;#V\n",
+ "Rb=200.*10.**3.;#ohm\n",
+ "Rc=1.*10.**3.;#ohm\n",
+ "B=100.;# beta\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#AC analysis\n",
+ "Rl=1.*10.**3.;#ohm\n",
+ "hfe=B;\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "hoe_1=40.*10.**3.;#ohm # 1/hoe\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-hfe*Rac/hie;\n",
+ "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "\n",
+ "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
+ "Io=-100.*Ib;\n",
+ "Ac=Io/Ib;\n",
+ "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
+ "\n",
+ "Ri=prll(Rb,hie);\n",
+ "Ro=prll(Rl,prll(Rc,hoe_1));\n",
+ "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
+ "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
+ "\n",
+ "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 6.00 V 6.00 mA\n",
+ "\n",
+ "The voltage gain = -25.00 \n",
+ "\n",
+ "The current gain = -100.00 \n",
+ "\n",
+ "The input resistance = 2 kohm\n",
+ "\n",
+ "The output resistance = 0.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solve previous example using hybrid pie model\n",
+ "#soltion\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "Vcc=12.##V\n",
+ "Rb=200.*10.**3.##ohm\n",
+ "Rc=1.*10.**3.##ohm\n",
+ "Rl=1.*10.**3.##ohm\n",
+ "B=100.## beta\n",
+ "hie=2.*10.**3.##ohm\n",
+ "hoe_1=40.*10.**3.##ohm # 1/hoe\n",
+ "\n",
+ "Ib=Vcc/Rb#\n",
+ "Ic=B*Ib#\n",
+ "Rac=prll(Rc,Rl)#\n",
+ "gm=Ic/(25.*10.**-3.)#\n",
+ "rpi=B/gm#\n",
+ "ri=hie#\n",
+ "rb=ri-rpi#\n",
+ "ro=hoe_1#\n",
+ "Vpi=rpi/(rpi+rb)#\n",
+ "Vo=-gm*Vpi*Rac# #output voltage\n",
+ "Av=Vo#\n",
+ "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
+ "#In book voltage gain is -24.96 due to appraoximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain -25.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of output voltage\n",
+ "#given\n",
+ "Vcc=12.;#V\n",
+ "Rb=150.*10.**3.;#ohm\n",
+ "Rc=5.*10.**3.;#ohm\n",
+ "B=200.;# beta\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "ro=60.*10.**3.;#ohm # 1/hoe\n",
+ "Vi=1.*10.**-3.;#V\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
+ "Vo=0;\n",
+ "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input resistance\n",
+ "# Function definition is here\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2);\n",
+ "\treturn z\n",
+ "\n",
+ "R1=75.*10.**3.;#ohm\n",
+ "R2=7.5*10.**3.;#ohm\n",
+ "Rc=4.7*10.**3.;#ohm\n",
+ "Re=1.2*10.**3.;#ohm\n",
+ "Rl=12.*10.**3.;#ohm\n",
+ "B=150.;\n",
+ "ri=2.*10.**3.;#ohm\n",
+ "Vcc=15.;#V\n",
+ "Vb=Vcc*R2/(R1+R2);\n",
+ "Ve=Vb; #since Vbe=0\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie;\n",
+ "Icsat=Vcc/(Rc+Re);\n",
+ "# Ic < Icsat therefore transistor is in active mode\n",
+ "Vce=Vcc-Ic*(Rc+Re);\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-B*Rac/ri;\n",
+ "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "Ri_=prll(ri,R2);\n",
+ "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 8.30 V 1.14 mA\n",
+ "\n",
+ "The voltage gain = -253.3 \n",
+ "\n",
+ "The input resistance= 1.58 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate the value of gm at different values of Vgs\n",
+ "#given\n",
+ "\n",
+ "Idss=8.*10.**-3.;#A\n",
+ "Vp=4;#V\n",
+ "#At Vgs= -0.5 V\n",
+ "Vgs= -0.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -1.5 V\n",
+ "Vgs= -1.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -2.5 V\n",
+ "Vgs= -2.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gmo = 4 mS\n",
+ "\n",
+ "gm (At Vgs = -0.5V) = 3.5 mS\n",
+ "\n",
+ "gm (At Vgs = -1.5V) = 2.5 mS\n",
+ "\n",
+ "gm (At Vgs = -2.5V) = 1.5 mS\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output signal voltage of the amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Rd=12.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Cs=25.*10.**-6.;#F\n",
+ "u=80.; #amplification factor\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Vi=0.1;#V\n",
+ "f=1.*10.**3.;#Hz #input frequency\n",
+ "Xcs=1./(2.*math.pi*f*Cs);\n",
+ "#This is much smaller than Rs therefore it is bypassed\n",
+ "\n",
+ "gm=u/rd;\n",
+ "Av=gm*(rd*Rd/(rd+Rd));\n",
+ "Vo=Av*Vi;\n",
+ "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 0.453 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "Rd=2.*10.**3.;#ohm\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Av=-gm*(rd*Rd/(rd+Rd));\n",
+ "Ri=Rg;\n",
+ "Ro=rd*Rd/(rd+Rd);\n",
+ "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -4 \n",
+ "input resistance= 1 Mohm \n",
+ "output resistance = 2 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=500.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Rd=5.*10.**3.;#ohm\n",
+ "Rs=100.;#ohm\n",
+ "Rl=5.*10.**3.;#ohm\n",
+ "gm=1.5*10.**-3.;#S\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Rg=R1*R2/(R1+R2);\n",
+ "Rac=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*Rac;\n",
+ "Ri=Rg;\n",
+ "Ro=(rd*Rac/(rd+Rac));\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -3.75 \n",
+ "Input resistance = 45.45 kohm \n",
+ "Output resistance = 2.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the voltage gain of the FET\n",
+ "#given\n",
+ "Idss=8.*10.**-3.##A\n",
+ "Vp=4.##V\n",
+ "rd=25.*10.**3.##ohm\n",
+ "Rd=2.2*10.**3.##ohm #by the help of figure\n",
+ "Vgs=-1.8##V\n",
+ "gmo=2.*Idss/(abs(Vp))#\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
+ "Av=-gm*(rd*Rd/(rd+Rd))#\n",
+ "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain of the FET = -4.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter08.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter08.ipynb new file mode 100755 index 00000000..7ccf524b --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter08.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5a78eb3c7cc2f82cd21ccad707b4376bdb45f22452d4892c16308b1bdd58f45f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter08:Multistage Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Express the gain in decibel\n",
+ "#given\n",
+ "#Powere gain of 1000\n",
+ "import math\n",
+ "Pg1=1000.;\n",
+ "Pgd1=10.*math.log10(Pg1);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1000\n",
+ "Vg1=1000.;\n",
+ "Vgd1=20.*math.log10(Vg1);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
+ "\n",
+ "#Powere gain of 1/100\n",
+ "Pg2=1./100.;\n",
+ "Pgd2=10.*math.log10(Pg2);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1/100\n",
+ "Vg2=1./100.;\n",
+ "Vgd2=20.*math.log10(Vg2);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain (in dB)= 30 dB\n",
+ "\n",
+ "Voltage gain (in dB)= 60 dB\n",
+ "\n",
+ "Power gain (in dB)= -20 dB\n",
+ "\n",
+ "Voltage gain (in dB)= -40 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine power and voltage gain\n",
+ "#given\n",
+ "#For Gain = 10 dB\n",
+ "G=10.;#dB\n",
+ "Pg1=10.**(G/10.); #taking antilog\n",
+ "Vg1=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
+ "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
+ "\n",
+ "#For Gain 3 dB\n",
+ "G=3.;#dB\n",
+ "Pg2=10.**(G/10.); #taking antilog\n",
+ "Vg2=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
+ "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Gain 10 dB\n",
+ "\n",
+ "Power gain ratio = 10 \n",
+ "\n",
+ "Voltage gain ratio = 3.16 \n",
+ "\n",
+ "For Gain 3 dB\n",
+ "\n",
+ "Power gain ratio = 2.00 \n",
+ "\n",
+ "Voltage gain ratio = 1.413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the overall voltage gain\n",
+ "#given\n",
+ "import math\n",
+ "A1=80.\n",
+ "A2=50.\n",
+ "A3=30.\n",
+ "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
+ "\n",
+ "#Alternatively\n",
+ "A=A1*A2*A3;\n",
+ "Ad=20.*math.log10(A);\n",
+ "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage gain is = 101.58 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate quiescent output voltage and small signal voltage gain\n",
+ "#given\n",
+ "#At input Voltage =3V\n",
+ "Vi1=3.##V #input voltage\n",
+ "Vbe=0.7##V\n",
+ "B=250.#\n",
+ "Vcc=10.##V #Supply\n",
+ "Re1=1.*10.**3.##ohm\n",
+ "Rc1=3.*10.**3.##ohm\n",
+ "Re2=2.*10.**3.##ohm\n",
+ "Rc2=4.*10.**3.##ohm\n",
+ "Vb1=Vi1# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo1=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
+ "\n",
+ "#At input Voltage =3.2 V\n",
+ "Vi2=3.2##V #input voltage\n",
+ "Vb1=Vi2# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo2=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
+ "\n",
+ "#Small Signal input and output voltage\n",
+ "vi=Vi2-Vi1#\n",
+ "vo=Vo2-Vo1#\n",
+ "Av=vo/vi#\n",
+ "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
+ "\n",
+ "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
+ "\n",
+ "The small signal voltage gain is = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
+ "#FUNCTIONS\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
+ "Rd=10.*10.**3.;#ohm\n",
+ "Rs=500.;#ohm\n",
+ "Rg=470.*10.**3.;#ohm\n",
+ "Rl=470.*10.**3.;#ohm\n",
+ "Cc=0.01*10.**-6.;#Farad\n",
+ "Csh=100.*10.**-12.;#Farad\n",
+ "Cs=50.*10.**-6.;#Farad\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Rac2=prll(Rd,Rl);\n",
+ "Rac1=prll(Rd,Rg);\n",
+ "Req=prll(rd,prll(Rd,Rl));\n",
+ "Am=math.ceil(gm*Req);\n",
+ "Am2=Am*Am; #Voltage gain of two stage amplifier\n",
+ "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
+ "R_=prll(rd,Rd)+prll(Rg,rin);\n",
+ "f1=1./(2.*math.pi*Cc*R_); #lower cutoff frequency\n",
+ "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
+ "f2=1./(2.*math.pi*Csh*Req); #upper cutoff frequency\n",
+ "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
+ "BW=f2_-f1_;\n",
+ "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
+ "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain of two stage amplifier= 324 \n",
+ "\n",
+ "Bandwidth= 115 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Am=8.##midband voltage gain of individual MOSFET\n",
+ "BW=500.*10.**3.#Hz\n",
+ "f2=BW#\n",
+ "n=4.#\n",
+ "A2m=Am**n#\n",
+ "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
+ "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
+ "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Midband voltage gain = 4096 \n",
+ "\n",
+ "Overall Bandwidth = 217.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the input and output impedance and voltage gain\n",
+ "#FUNCTIONS\n",
+ "\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "hie=1.1*10.**3.;#ohm=rin\n",
+ "hfe=120.;#=B\n",
+ "#the values of Rac2, Zi, Zo are as per diagram\n",
+ "Rac2=prll(3.3*10**3,2.2*10**3);\n",
+ "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
+ "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
+ "Zo=prll(3.3*10**3,2.2*10**3);\n",
+ "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
+ "Am2=-hfe*Rac2/(hie);\n",
+ "Am1=-hfe*Rac1/(hie);\n",
+ "Am=Am1*Am2;\n",
+ "Am=20.*math.log10(Am);\n",
+ "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input Resistance = 0.905 kohm\n",
+ " \n",
+ "Output Resistance = 1.32 kohm\n",
+ "\n",
+ "The Overall Voltage gain is 81.97 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter09.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter09.ipynb new file mode 100755 index 00000000..1d9f850d --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter09.ipynb @@ -0,0 +1,311 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8ef26de80c6669dcd55ce081279263a5231dd84d81c7a5c7530a5f89da39e8f3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter09:Power Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the turns ratio of the transformer\n",
+ "#given\n",
+ "import math\n",
+ "Rl=8.;#ohm\n",
+ "Rl_=5.*10.**3.;#ohm\n",
+ "TR=math.sqrt(Rl_/Rl); #Turns ratio\n",
+ "print '%s %.f %s' %(\"Turns Ratio =\",TR,\": 1\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Turns Ratio = 25 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the output impedance of the transistor\n",
+ "#given\n",
+ "TR=16./1.; #turn ratio\n",
+ "Rl=4.;#ohm #loudspeaker impedance\n",
+ "ro=(TR**2.)*Rl;\n",
+ "print '%s %.f %s' %(\"The output impedance of the transistor =\",ro,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output impedance of the transistor = 1024 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Determine the efficiency of a single ended transformer\n",
+ "#given\n",
+ "Vceq=10.;#V #supply voltage\n",
+ "\n",
+ "#At Vp=10V\n",
+ "Vp=10.;#V\n",
+ "Vce_max1=Vceq+Vp;\n",
+ "Vce_min1=Vceq-Vp;\n",
+ "n1=50.*((Vce_max1-Vce_min1)/(Vce_max1+Vce_min1))**2.;\n",
+ "print '%s %.f %s' %(\"Efficiency (At Vp = 10V)=\",n1,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=5V\n",
+ "Vp=5.;#V\n",
+ "Vce_max2=Vceq+Vp;\n",
+ "Vce_min2=Vceq-Vp;\n",
+ "n2=50.*((Vce_max2-Vce_min2)/(Vce_max2+Vce_min2))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 5V)=\",n2,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=1V\n",
+ "Vp=1.;#V\n",
+ "Vce_max3=Vceq+Vp;\n",
+ "Vce_min3=Vceq-Vp;\n",
+ "n3=50.*((Vce_max3-Vce_min3)/(Vce_max3+Vce_min3))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 1V)=\",n3,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency (At Vp = 10V)= 50 percent\n",
+ "\n",
+ "Efficiency (At Vp = 5V)= 12.5 percent\n",
+ "\n",
+ "Efficiency (At Vp = 1V)= 0.5 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine input and output power and efficiency\n",
+ "#given\n",
+ "import math\n",
+ "Vcc=20.;#V#supply voltage\n",
+ "Rl=4.;#ohm\n",
+ "Vp=15.;#V\n",
+ "Ip=Vp/Rl;\n",
+ "Idc=Ip/math.pi;\n",
+ "Pi=Vcc*Idc;\n",
+ "Po=((Vp/2.)**2.)/Rl;\n",
+ "n=100.*Po/Pi;\n",
+ "print '%s %.1f %s' %(\"Input power =\",Pi,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Output power =\",Po,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 23.9 W\n",
+ "\n",
+ "Output power = 14.06 W\n",
+ "\n",
+ "Efficiency = 58.90 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage increase in output power\n",
+ "#given\n",
+ "D=0.2;#harmonic distortion\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power=\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage increase in output power= 4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n",
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The percentage increase in output power = 1 percent\n",
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n",
+ "\n",
+ "The percentage increase in output power = 1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter10.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter10.ipynb new file mode 100755 index 00000000..eade58c0 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter10.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:350cd45bd4706ef780ba3db9c23f80c7425e6c49ca99aabcbf016879dc8eee58"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter10:Feedback in Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier\n",
+ "#given\n",
+ "A=100.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 9.09 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=60.;#dB #internal gain in dB\n",
+ "A=10.**(Ad/20.); #internal gain\n",
+ "B=1./20.;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "Afd=20.*math.log10(Af);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 25.85 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of output fed back to input\n",
+ "#given\n",
+ "A=600.;#internal gain\n",
+ "Af=50.;#gain of feedback amplifier\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of output fed back to input = 1.833 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the internal gain and percentage of output fed back to input\n",
+ "#given\n",
+ "Af=80.;#gain of feedback amplifier\n",
+ "Vi=0.05;#V#input with feedback\n",
+ "Vi_=4.*10.**-3.;#V#input without feedback\n",
+ "Vo_=Af*Vi;\n",
+ "A=Vo_/Vi_;\n",
+ "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal gain is = 1000 \n",
+ "\n",
+ "The percentage of output fed back to input = 1.15 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain with and without feedback and feedback factor\n",
+ "#given\n",
+ "Vo_=5.;#V #output voltage\n",
+ "Vi=0.2;#V #input with feedback\n",
+ "Vi_=0.05;#V #input without feedback\n",
+ "A=Vo_/Vi_;\n",
+ "Af=Vo_/Vi;\n",
+ "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain without feedback is = 100 \n",
+ "\n",
+ "The gain with feedback is = 25 \n",
+ "\n",
+ "The feedback factor = 3 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain of feedback amplifier and feedback factor\n",
+ "#given\n",
+ "A=100.; #internal gain\n",
+ "N=20.;#dB #negative feedback\n",
+ "B=(10.**(-N/(-20.))-1.)/A; #taking antilog\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
+ "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The feedback factor = 9 percent\n",
+ "\n",
+ "The gain of the feedback amplifier is = 10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "A=1000.;#internal gain\n",
+ "N=40.;#dB#negative feedback\n",
+ "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
+ "dA_A=10.;#percent#dA/A\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain = 0.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "Adb=60.;#dB#internal gain in dB\n",
+ "B=0.005;#feedback factor\n",
+ "A=10.**(Adb/(20.));#taking antilog\n",
+ "dA_A=-12.;#percent #dA/A\n",
+ "D=(1.+A*B);#D=(1+AB)desensitivity\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain reduces by = 2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the input resistance of feedback amplifier\n",
+ "#given\n",
+ "A=250.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Ri=1.1*10.**3.;#ohm #input resistance\n",
+ "Rif=Ri*(1.+A*B);\n",
+ "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
+ "\n",
+ "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input resistance of feedback amplifier = 28.6 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of negative feedback to input\n",
+ "#given\n",
+ "Adb=60.;#dB #internal gain in dB\n",
+ "A=10.**(Adb/(20.)); #taking antilog\n",
+ "Ro=12.*10.**3.;#ohm #output resistance\n",
+ "Rof=600.;#ohm\n",
+ "B=(Ro/Rof-1.)/A;\n",
+ "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of negative feedback to input = 1.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter11.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter11.ipynb new file mode 100755 index 00000000..1e3dc387 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter11.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9a7fe549367b746663f0b647c4096703a98ac7fb9574e6f135fdada17ce95d67"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter11:Tuned Volatge Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current and voltage across each element at resonance\n",
+ "#given\n",
+ "import math\n",
+ "R=12.;#ohm\n",
+ "L=200.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "Vs=9.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Z=R;#impedance\n",
+ "print '%s %.1f %s' %(\"The Resonant frequency =\",fo/1000,\"kHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Z,\"ohm\\n\");\n",
+ "\n",
+ "Io=Vs/R;\n",
+ "print '%s %.2f %s' %(\"The Source current =\",Io,\"A\\n\");\n",
+ "\n",
+ "Vl=Io*(2.*math.pi*fo*L);\n",
+ "Vc=Io/(2.*math.pi*fo*C);\n",
+ "Vr=Io*R;\n",
+ "print '%s %.1f %s' %(\"The voltage across the inductor =\",Vl,\"V\\n\");\n",
+ "print '%s %.1f %s' %(\"The voltage across the capacitor =\",Vc,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The voltage across the resistor =\",Vr,\"V\\n\");\n",
+ "#There is a slight variation in voltage across capacitor due to the approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 649.7 kHz\n",
+ "\n",
+ "The impedance Z = 12 ohm\n",
+ "\n",
+ "The Source current = 0.75 A\n",
+ "\n",
+ "The voltage across the inductor = 612.4 V\n",
+ "\n",
+ "The voltage across the capacitor = 612.4 V\n",
+ "\n",
+ "The voltage across the resistor = 9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current at resonance and current in coil and capacitor\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=100.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "Vs=10.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.3f %s' %(\"The Resonant frequency =\",fo/10**6,\"MHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Io=Vs/Zp;\n",
+ "print '%s %.f %s' %(\"The Source current =\",Io*10**6,\"uA\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Xc=1./(2.*math.pi*fo*C);\n",
+ "Z1=math.sqrt(Xl**2.+R**2.);\n",
+ "Z2=Xc;\n",
+ "Ic=Vs/Z2;\n",
+ "Il=Ic;\n",
+ "print '%s %.f %s' %(\"The current in the coil =\",1000,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"The current in the capacitor =\",Ic*1000,\"mA\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 1.592 MHz\n",
+ "\n",
+ "The impedance Z = 100 kohm\n",
+ "\n",
+ "The Source current = 100 uA\n",
+ "\n",
+ "The current in the coil = 1000 ohm\n",
+ "\n",
+ "The current in the capacitor = 10 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate impedance and quality factor and bandwidth\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=150.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1/(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Q=Xl/R;\n",
+ "BW=fo/Q;\n",
+ "print '%s %.1f %s' %(\"The Quality factor of the circuit =\",Q,\"\\n\");\n",
+ "print '%s %.1f %s' %(\"The Band width of the circuit =\",BW/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance Z = 150 kohm\n",
+ "\n",
+ "The Quality factor of the circuit = 122.5 \n",
+ "\n",
+ "The Band width of the circuit = 10.6 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter12.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter12.ipynb new file mode 100755 index 00000000..30b79553 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter12.ipynb @@ -0,0 +1,232 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ea4ffd68aac20fcc9a7413fc9ab8e0a2e574e16a66c6b5413621ddd0c8d4148d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter12:Sinusoidal Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "L=55.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.f %s' %(\"The frequency of oscillations =\",fo/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1239 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations and feedback factor and voltage gain\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "C1=0.001*10.**-6.;#F\n",
+ "C2=0.01*10.**-6.;#F\n",
+ "L=15.*10.**-6.;#H\n",
+ "C=prll(C1,C2);\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/10**6,\"MHz\\n\");\n",
+ "B=C1/C2;\n",
+ "Amin=1./B;\n",
+ "print '%s %.1f %s' %(\"The feedback factor of the circuit =\",B,\"\\n\");\n",
+ "print '%s %.f' %(\"The circuit needs a minimum voltage gain of\",Amin);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1.36 MHz\n",
+ "\n",
+ "The feedback factor of the circuit = 0.1 \n",
+ "\n",
+ "The circuit needs a minimum voltage gain of 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=10.*10.**3.;#ohm\n",
+ "C=0.01*10.**-6.;#F\n",
+ "fo=1./(2.*math.pi*R*C*math.sqrt(6.));\n",
+ "print '%s %.1f %s' %(\"The frequency of oscillations =\",fo,\"Hz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 649.7 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=22.*10.**3.;#ohm\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*R*C);\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/1000,\"KHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 72.34 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n",
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n",
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter14.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter14.ipynb new file mode 100755 index 00000000..673776d8 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter14.ipynb @@ -0,0 +1,211 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7c251177630c670baed25ee0afd361e04e5bd22335ff25a75110b7cde3268100"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter14:Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "Acl=-Rf/R1;\n",
+ "Ricl=R1;\n",
+ "Ro=0;\n",
+ "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -100 \n",
+ "\n",
+ "The input resistance = 20 kohm\n",
+ "\n",
+ "The output resistance = 0 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output voltage\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "v1=4.;#V\n",
+ "v2=3.8;#V\n",
+ "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
+ "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -16.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design an adder circuit using an op amp\n",
+ "#given\n",
+ "#Vo=-(V1+10*V2+100*V3)\n",
+ "Rf=100.*10.**3.;#ohm\n",
+ "C1=1.;#coefficient of V1\n",
+ "C2=10.;#coefficient of V2\n",
+ "C3=100.;#coefficient of V3\n",
+ "R1=Rf/C1;\n",
+ "R2=Rf/C2;\n",
+ "R3=Rf/C3;\n",
+ "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 kohm\n",
+ "\n",
+ "R2 = 10 kohm\n",
+ "\n",
+ "R3 = 1 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate CMRR in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=100.;#differential mode gain\n",
+ "Ac=0.01;#common mode gain\n",
+ "CMRR=20.*math.log10(Ad/Ac);\n",
+ "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The CMRR in dB = 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the output voltage\n",
+ "#given\n",
+ "Ad=2000.;#differential mode gain\n",
+ "CMRR=10000.;\n",
+ "V1=10.**-3.;#V\n",
+ "V2=0.9*10.**-3.;#V\n",
+ "Vd=V1-V2;\n",
+ "Vc=(V1+V2)/2.;\n",
+ "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
+ "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 200.19 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter15.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter15.ipynb new file mode 100755 index 00000000..cd977045 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter15.ipynb @@ -0,0 +1,321 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:246707d96e3b84083bd218a775428cfb0782bf8a60e397f9fdb6240bd50142c9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter15:Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance and multiplying factor\n",
+ "#given\n",
+ "Im=5.*10.**-3.;#A\n",
+ "Rm=20.;#ohm\n",
+ "I=5.;#A\n",
+ "Rsh=Rm*Im/(I-Im);\n",
+ "n=I/Im;\n",
+ "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 0.02002 ohm\n",
+ "\n",
+ "Multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance\n",
+ "#given\n",
+ "#At I= 1 mA\n",
+ "I1=1.*10.**-3.;#A\n",
+ "Im=0.1*10.**-3.;#A\n",
+ "Rm=500.;#ohm\n",
+ "Rsh=Rm*Im/(I1-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I2=10.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I2-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I3=100.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I3-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 55.5556 ohm\n",
+ "\n",
+ "Shunt resistance = 5.0505 ohm\n",
+ "\n",
+ "Shunt resistance = 0.5005 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caluclate the series resistance to convert it into voltmeter\n",
+ "#given\n",
+ "Im=100.*10.**-6.;#A\n",
+ "Rm=100.;#ohm\n",
+ "V=100.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of series resistance is 999.9 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate multiplier resistance and voltage multiplying factor\n",
+ "#given\n",
+ "Im=50.*10.**-6.;#A\n",
+ "Rm=1000.;#ohm\n",
+ "V=50.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
+ "Vm=Im*Rm;\n",
+ "n=V/Vm;\n",
+ "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of multiplier resistance is 999 kohm\n",
+ "\n",
+ "Voltage multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reading and error of each voltmeter\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "S_A=1000.;# ohm/V#sensitivity\n",
+ "S_B=20000.;# ohm/V#sensitivity\n",
+ "R=50.;#V#range of voltmeter\n",
+ "Vs=150.;#V#Supply\n",
+ "R1=100.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Vt=Vs*(R2/(R1+R2));\n",
+ "\n",
+ "#Voltmeter A\n",
+ "Ri1=S_A*R;\n",
+ "Rxy_A=prll(Ri1,R2); #total resistance at X and Y\n",
+ "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
+ "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
+ "\n",
+ "#Voltmeter B\n",
+ "Ri2=S_B*R;\n",
+ "Rxy_B=prll(Ri2,R2); #total resistance at X and Y\n",
+ "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
+ "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
+ "\n",
+ "e1=(Vt-V1)*100./Vt;\n",
+ "e2=(Vt-V2)*100./Vt;\n",
+ "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltmeter indicates 30 V\n",
+ "\n",
+ "The voltmeter indicates 48.39 V\n",
+ "\n",
+ "The error in the reading of voltmeter A = 40 percent\n",
+ "\n",
+ "The error in the reading of voltmeter A = 3.23 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value of the ac voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=8.3;#cm#length of the trace\n",
+ "D=5.;# V/cm#deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/(2.*math.sqrt(2.));\n",
+ "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the ac voltage 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value and frequency of the sine voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=3.5;#cm #length of the trace\n",
+ "D=2.;# V/cm #deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/math.sqrt(2.);\n",
+ "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
+ "x=4.;#cm #one cycle length on x axis\n",
+ "t=0.5*10.**-3.;# s/cm #timebase setting\n",
+ "T=x*t;\n",
+ "f=1./T;\n",
+ "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sine voltage = 4.95 V\n",
+ "\n",
+ "The frequency of the sine voltage = 0.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer/screenshots/ch16.png b/Elements_Of_Heat_Transfer/screenshots/ch16.png Binary files differnew file mode 100755 index 00000000..9e6301d7 --- /dev/null +++ b/Elements_Of_Heat_Transfer/screenshots/ch16.png diff --git a/Elements_Of_Heat_Transfer/screenshots/ch3.png b/Elements_Of_Heat_Transfer/screenshots/ch3.png Binary files differnew file mode 100755 index 00000000..c2318359 --- /dev/null +++ b/Elements_Of_Heat_Transfer/screenshots/ch3.png diff --git a/Elements_Of_Heat_Transfer/screenshots/ch9.png b/Elements_Of_Heat_Transfer/screenshots/ch9.png Binary files differnew file mode 100755 index 00000000..f2408791 --- /dev/null +++ b/Elements_Of_Heat_Transfer/screenshots/ch9.png diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch10.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch10.ipynb new file mode 100755 index 00000000..32fdea1f --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch10.ipynb @@ -0,0 +1,69 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:90b86c74c02a5cfd535e4124a528b3b6a3a7b98a6c61d92af77cd6f9cfc20248" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 : Heat transfer in condensing and boiling" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 page : 206" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "y = 1.9; # Density in slug/ft**-2\n", + "u = 0.0354; # Vismath.cosity in slug/ft-hr\n", + "k = 0.376; # Thermal conductivity in Btu/hr-ft-degF\n", + "l = 32600.; # Heat of condensation in Btu/slug\n", + "Tg = 142.; # Temperature of steam in degF\n", + "Tw = 138.; # Temperature of wall in degF\n", + "\n", + "# Calculations \n", + "delT = Tg-Tw; # Temperature driving force in degF\n", + "g = 418*10**6; # Gravity in ft/sec**2\n", + "L = 1./12; # Outside diameter of horizontal tube in ft\n", + "C = 0.725; # For horizontal tube\n", + "h = C*(g*y**2*l*k**3/(L*u*delT))**0.25; # Heat transfer coefficient in Btu/hr-ft**2-degF\n", + "\n", + "# Results\n", + "print \"The heat transfer coefficient for steam condensing on a horizontal tube is %d Btu/hr-ft**2-degF\"%(h);\n", + "\n", + "# note: rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The heat transfer coefficient for steam condensing on a horizontal tube is 2797 Btu/hr-ft**2-degF\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch11.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch11.ipynb new file mode 100755 index 00000000..7c85bf16 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch11.ipynb @@ -0,0 +1,325 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:ea51998c9ed8fc31d28e8820c364744f5d4a29678b776aceb60dcd5d71257d27" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 : Heat transfer by radiation" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 page : 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "# Variables\n", + "T1 = 1660./100; # Temperature of first black plane in degR\n", + "T2 = 1260./100; # Temperature of second black plane in degR\n", + "s = 0.174; # Stephan Boltzman's consmath.tant\n", + "\n", + "# Calculations \n", + "q = s*(T1**4-T2**4);\n", + "\n", + "# Results\n", + "print \"The net radiant interchange between two bodies of unit area is %d Btu/hr-ft**2\"%(q);\n", + "\n", + "# book answer is rounded off." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The net radiant interchange between two bodies of unit area is 8826 Btu/hr-ft**2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2 page : 224" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Variables\n", + "A1 = 15.*15; # Area of floor in ft**2\n", + "A2 = A1; # Area of roof in ft**2\n", + "T1 = 2460./100; # Temperature of floor in degR\n", + "T2 = 1060./100; # temperature of roof in degR\n", + "s = 0.174; # Stephan Boltzman's consmath.tant\n", + "# S/L = 1.5, So considering graph F12 = 0.31 \n", + "\n", + "# Calculations \n", + "F12 = 0.31;\n", + "q = s*F12*A1*(T1**4-T2**4);\n", + "\n", + "# Results\n", + "print \"The net radiant interchange between two bodies of unit area is %d Btu/hr-ft**2\"%(q);\n", + "\n", + "# note : book answer is rounded off." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The net radiant interchange between two bodies of unit area is 4291391 Btu/hr-ft**2\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 page : 225" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Variables\n", + "x = 6.; # length of wall in ft\n", + "y = 12.; # breadth of wall in ft\n", + "z = 18.; # height of wall in ft\n", + "A1 = x*y;\n", + "s = 0.174; # Stephan Boltzman's consmath.tant\n", + "T1 = 1000.; # Temperature of floor in degF\n", + "T2 = 500.; # Temperature of wall in degF\n", + "Y = y/x; # Ratios\n", + "Z = z/x; \n", + "\n", + "# Calculations \n", + "# Seeing the graph, F12 could be found out\n", + "F12 = 0.165;\n", + "q12 = s*F12*A1*((((T1+460)/100)**4)-((T2+460)/100)**4); # Radiant interchange\n", + "\n", + "# Results\n", + "print \"The net radiant interchange between two bodies of unit area is %d Btu/hr-ft**2\"%(q12);\n", + "\n", + "# note : book answer is rounded off." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The net radiant interchange between two bodies of unit area is 76367 Btu/hr-ft**2\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 page : 227" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "D = 10./12; # Diameter of black disc\n", + "L = 5./12; # distance between two discs\n", + "T1 = (1500.+460)/100; # Temperature of disc 1 in degR\n", + "T2 = (1000.+460)/100; # Temperature of disc 2 in degR\n", + "# From the ratio of S/L, the value of F1r2 can be found out\n", + "F1r2 = 0.669; # Shape factor\n", + "\n", + "# Calculations \n", + "A1 = math.pi*D*D/4; # Area of disc 1 in ft**2\n", + "A2 = math.pi*D*D/4; # Area of disc 2 in ft**2\n", + "s = 0.174; # Stephan Boltzman's consmath.tant\n", + "q12 = s*F1r2*A1*((T1**4)-(T2**4)); # Radiant interchange in Btu/hr\n", + "\n", + "# Results\n", + "print \"The net radiant interchange between two parallel black discs is %d Btu/hr\"%(q12);\n", + "\n", + "# note : book answer is rounded off " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The net radiant interchange between two parallel black discs is 6484 Btu/hr\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5 page : 228" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T1 = (1500.+460)/100; # Temperature of plane 1 in degR\n", + "T2 = (1000.+460)/100; # Temperature of plane 2 in degR\n", + "e1 = 0.8; # Emmisivity for higher temperature\n", + "e2 = 0.6; # Emmisivity for lower temperature\n", + "s = 0.174; # Stephan Boltzman's consmath.tant\n", + "D = 10./12; # Diameter of disc in ft\n", + "\n", + "# Calculations \n", + "A = math.pi/4*D**2; # Area of disc in ft**2\n", + "F1r2 = 0.669;\n", + "F1r2g = 1/((1/F1r2)+(1/e1)+(1/e2)-2); # Shape factor\n", + "q12 = s*F1r2g*A*((T1**4)-(T2**4)); # Radiant interchange in Btu/hr\n", + "\n", + "# Results\n", + "print \"The net radiant interchange between two parallel very large planes per square foot is %d Btu/hr\"%(q12);\n", + "\n", + "# book answer is rounded off." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The net radiant interchange between two parallel very large planes per square foot is 4019 Btu/hr\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6 page : 230" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 1460./100; # Temperature of first black plane in degK\n", + "T2 = 1060./100; # temperature of second black plane in degK\n", + "s = 0.174; # Stephan Boltzman's consmath.tant\n", + "e1 = 0.9; # Emmisivity for higher temperature\n", + "e2 = 0.7; # Emmisivity for higher temperature\n", + "\n", + "# Calculations \n", + "F1r2 = 1./((1/e1)+(1/e2)-1); # Shape factor\n", + "\n", + "q = s*F1r2*(T1**4-T2**4);\n", + "\n", + "# Results\n", + "print \"The net radiant interchange between two bodies of unit area is %d Btu/hr-ft**2\"%(round(q,-1));\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The net radiant interchange between two bodies of unit area is 3710 Btu/hr-ft**2\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.7 page : 231" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "e = 0.8; # emmisivity of pipe metal\n", + "D = 2.375/12; # Diameter of pipe in ft\n", + "s = 0.174; # Stephans Boltzman's consmath.tant\n", + "T1 = (300.+460)/100; # Temperature of disc 1 in degF\n", + "T2 = (80.+460)/100; # Temperature of disc 2 in degF\n", + "\n", + "# Calculations \n", + "A1 = math.pi*D; # Area of one foot of pipe in ft**2\n", + "q12 = s*e*A1*((T1**4)-(T2**4)); # Radiant interchange in Btu/hr\n", + "\n", + "# Results\n", + "print \"The net radiant interchange per foot length of pipe is %.1f Btu/hr-ft\"%(q12);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The net radiant interchange per foot length of pipe is 215.2 Btu/hr-ft\n" + ] + } + ], + "prompt_number": 14 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch12.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch12.ipynb new file mode 100755 index 00000000..715c06e2 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch12.ipynb @@ -0,0 +1,111 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:17761ba512bc0b023540f9905054102a15b8bb79b2b864b5b4b96b8c4e380b86" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 : Heat transfer by the combined effect of conduction, convection and radiation" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 page : 240" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "D = 4.5/12; # Outer diameter of pipe in ft\n", + "D2 = 6.5/12; # Outer diameter of insulation in ft\n", + "k = 0.035; # Thermal conductivity in Btu/hr-ft-degF\n", + "T1 = 400.; # Temperature of pipe in degF\n", + "T3 = 70.; # Temperature of air in degF\n", + "T2 = 120.; # Assumed temperature in degF \n", + "\n", + "# Calculations and Results\n", + "h = 2*k*(T1-T2)/(D2*(T2-T3)*math.log(D2/D)); # Sum of coefficient of convection and radiation\n", + "delT = T2-T3; # Temperature differnce in degF\n", + "T2 = 120.; # Assumed temperature in degF \n", + "print \"The assumption of T2 = 120 comes out to be satisfactory and hc+hr = %.2f \"%(h);\n", + "q = h*math.pi*D2*delT; # Heat loss in Btu/hr\n", + "print \"The heat loss per unit foot of pipe is %d Btu/hr-ft\"%(q);\n", + "\n", + "# book answer is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The assumption of T2 = 120 comes out to be satisfactory and hc+hr = 1.97 \n", + "The heat loss per unit foot of pipe is 167 Btu/hr-ft\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.2 page : 241" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 2.375/12; # Outer diameter of pipe in ft\n", + "k = 0.035; # Thermal conductivity in Btu/hr-ft-degF\n", + "T1 = 400.; # Temperature of pipe in degF\n", + "T2 = 70.; # Temperature of air in degF\n", + "\n", + "# Calculations \n", + "delT = T1-T2; # Temperature differnce in degF\n", + "T2 = 120; # Assumed temperature in degF \n", + "h = 3.67; \n", + "# As seen from the table , for delT = 330. the value of hc+hr = 3.67\n", + "q = h*delT; # Heat loss in Btu/hr\n", + "\n", + "# Results\n", + "print \"The heat loss per square foot of pipe is %d Btu/hr-ft\"%(round(q,-1));\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The heat loss per square foot of pipe is 1210 Btu/hr-ft\n" + ] + } + ], + "prompt_number": 5 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch14.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch14.ipynb new file mode 100755 index 00000000..c699a0fc --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch14.ipynb @@ -0,0 +1,70 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:416e096697d823a7b0f0b132a663e9d4b0bf5d87790da5d7bb8fd3f672fe0580" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14 : Heat transfer in temperature measurements" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1 page : 233" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D1 = 36./12; # diameter of circular duct in ft\n", + "D2 = 5./96; # diameter of tube in ft\n", + "Tl = 800.; # Temperature of tube in degF\n", + "To = 500.; # Temperature of duct in degF\n", + "k = 0.02; # Thermal conductivity in lb/ft**-2-hr\n", + "u = 0.18*(10**-9)*(3600**2); # Vismath.cosity in slug/ft-hr\n", + "p = 0.04/32.2; # Density in slug/ft**3\n", + "n = u/p; # Kinematic vismath.cosity in ft**2/hr\n", + "v = 15.*3600; # Velocity in ft/hr\n", + "e = 0.8; # Emmisivity \n", + "\n", + "# Calculations \n", + "Nre = v*D2/n; # Reynolds number\n", + "Nnu = 0.3*(Nre**0.57); # Nusselt number\n", + "h = Nnu*k/D2; # Heat transfer coefficient\n", + "Tg = Tl+0.174*e*((((Tl+460)/100)**4)-((To+460)/100)**4)/h; # Gas temperature in degF\n", + "\n", + "# Results\n", + "print \"The temperature of gas is %.f degF\"%(Tg);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The temperature of gas is 1113 degF\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch15.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch15.ipynb new file mode 100755 index 00000000..ecbb9486 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch15.ipynb @@ -0,0 +1,85 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:6e1e01b593960bc19a29a3f7d1a6cb2e3ebc85a1d52dce60007beb73ddc83f3b" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 15 : Heat transfer and fluid friction" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.1 page : 267" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Tm = 70.; # Average air temperature in degF\n", + "Tw = 60.; # Pipe wall temperature in degF\n", + "thm = Tm-Tw; # Mean temperature difference in degF\n", + "# Thm is so small that the fluid properties may be based on 70 degF\n", + "\n", + "v = 30.; # Velocity in ft/sec \n", + "L = 1000.; # Length of pipe\n", + "D = 3./12; # Diameter in ft\n", + "y = 0.15; # Specific weight in lb/ft**3\n", + "p = 0.15/32.2; # Density in slug/ft**3\n", + "u = 0.00137; # Vismath.cosity in slug/ft/hr\n", + "\n", + "# Calculations and Results\n", + "Nre = v*3600*D*p/u; # Reynolds number\n", + "f = 0.08/(Nre)**.25; # Nusselt number\n", + "delp = 2*f*L*p*(v**2)/D; # Pressure drop in lb/sq.in\n", + "print \"The pressure drop is %d lb/sq.ft \"%(delp);\n", + "\n", + "\n", + "cp = 0.24*32.2; # Specific heat capacity in slug/degF\n", + "Cp = 0.24*0.15; # Heat capacity in Btu/ft**3-degF\n", + "k = 0.0148; # Thermal conductivity in Btu/ft-hr-degF\n", + "Npr = u*cp/k; # Prandtls number\n", + "phi = math.sqrt(Npr)/(1+(750*math.sqrt(Npr)/Nre)+7.5*(Npr**0.25)/math.sqrt(Nre));\n", + "A = math.pi*L*D; # Area in ft**2\n", + "q = phi*f*Cp*A*v*thm*3600/(2*Npr); # Heat loss in Btu/hr\n", + "print \"Heat loss per hour of air is %.3f Btu/hr \"%(phi);\n", + "h = q/(A*thm); # Film coefficient\n", + "print \"The film coefficient of heat transfer on the inner pipe wall is %.1f Btu/hr-ft**2-degF\"%(h);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The pressure drop is 154 lb/sq.ft \n", + "Heat loss per hour of air is 0.821 Btu/hr \n", + "The film coefficient of heat transfer on the inner pipe wall is 10.3 Btu/hr-ft**2-degF\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch16.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch16.ipynb new file mode 100755 index 00000000..9318301e --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch16.ipynb @@ -0,0 +1,455 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:a19443db3b3cc7d7784951a18a27973d385afbd40e88ac5039bbf1ebefefa4a7" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 16 : Mass Transfer" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.1 page : 276" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T = 25.+273; # Temperature in degK\n", + "p = 1.; # Pressure in atm\n", + "Va = 18.9; # Molecular volume of water vapour in cm**3/gm-mol\n", + "Vb = 29.9; # Molecular volume of air in cm**3/gm-mol \n", + "Ma = 18.; # Molecular weight of water vapour in gm/mol\n", + "Mb = 29.; # Molecular weight of air in gm/mol\n", + "\n", + "# Calculations \n", + "Dab = 0.0043*(T**1.5)*math.sqrt((1/Ma)+(1/Mb))/(p*(Va**(1./3)+Vb**(1./3))**2);\n", + "\n", + "# Results\n", + "print \"The diffusion coefficient is %.3f cm**3/sec \"%(Dab);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The diffusion coefficient is 0.200 cm**3/sec \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.2 page : 278" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\n", + "# Variables\n", + "T = 25.+273; # Temperature in degK\n", + "p = 1.; # Pressure in atm\n", + "Va = 96.; # Molecular volume of benzene in cm**3/gm-mol\n", + "Vb = 29.9; # Molecular volume of air in cm**3/gm-mol \n", + "Ma = 78.; # Molecular weight of benzene in gm/mol\n", + "Mb = 29.; # Molecular weight of air in gm/mol\n", + "\n", + "# Calculations \n", + "Dab = 0.0043*(T**1.5)*math.sqrt((1/Ma)+(1/Mb))/(p*(Va**(1./3)+Vb**(1./3))**2);\n", + "\n", + "# Results\n", + "print \"The diffusion coefficient is %.3f cm**3/sec \"%(Dab);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The diffusion coefficient is 0.082 cm**3/sec \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.3 page : 283" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "x = 0.1/12; # thickness of still air layer in ft\n", + "T = 77.+460; # temperature in degR\n", + "p = 1.; # Atmospheric pressure in atm\n", + "pa1 = 0.3; # Pressure of ammonia in still air in atm\n", + "pb1 = p-pa1; # pressure of air in atm\n", + "pa2 = 0; # pressure of ammonia in the absorption plane\n", + "pb2 = p-pa2; # pressure of air in absorption plane\n", + "\n", + "# Calculations \n", + "pbm = (pb2-pb1)/(math.log(pb2/pb1)); # Logarithmic mean pressure\n", + "D = 0.914; # Diffusion coefficient for ammonia\n", + "R = 0.729; # Gas consmath.tant in ft**3-atm/lb-mole-degR\n", + "N = D*p*(pa1-pa2)/(R*T*x*pbm);\n", + "\n", + "# Results\n", + "print \"The amount of ammonia diffusing through the stagnant air is %.1f lb-mol/hr-ft**2\"%(N);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The amount of ammonia diffusing through the stagnant air is 0.1 lb-mol/hr-ft**2\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.4 page : 287" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "ri = 3./96; # Inner radius of pipe in ft\n", + "ro = 1./24; # Outer radius of pipe in ft\n", + "Ca1 = 0.0003; # Concentration at the inner hose of pipe in lb-mol/ft**2\n", + "Ca2 = 0; # Concentration at the outer surface\n", + "\n", + "# Calculations \n", + "D = 0.7*10**-5; # Diffusion coefficient of hydrogen in rubber in ft**2/hr\n", + "N = 2*math.pi*D*(Ca1-Ca2)/math.log(ro/ri); # Rate of diffusion in lb-mol/hr\n", + "\n", + "# Results\n", + "print \"The rate of diffusion iof hydrogen in rubber is %.2f*10**-8 lb-mole/hr\"%(N*10**8);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The rate of diffusion iof hydrogen in rubber is 4.59*10**-8 lb-mole/hr\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.5 page : 296" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "u = 0.0437; # Vismath.cosity in lb/hr-ft\n", + "rho = 0.077; # Density in lb-ft**2\n", + "D = 0.992; # Diameter of pipe in ft\n", + "v = 4.*3600; # Velocity in ft/sec\n", + "L = 6./12; # Length of pipe parallel to direction of air flow in ft \n", + "p = 14.7; # Atmospheric pressure in psi \n", + "T = 460.+65; # Temperature in degR\n", + "\n", + "# Calculations \n", + "# Heat transfer equation for laminar flow of a flat surface\n", + "Nre = L*v*rho/u; # Reynolds number\n", + "Ns = u/(rho*D); # Schimdt mumber\n", + "Nnu = 0.662*(Ns)**(1./3)*math.sqrt(Nre); # Nusselt number\n", + "hmc = Nnu*D/L; # Heat transfer coefficient\n", + "pv1 = 0.144; # Vapour pressure at 40% humidity\n", + "pv2 = 0.252; # Vapour pressure at saturation\n", + "pa1 = p-pv1; # Absolute pressure of air at 40% rel. humidity in psi\n", + "pa2 = p-pv2; # Absolute pressure of saturated air in psi\n", + "pbm = (pa1+pa2)/2; # Log mean pressure in psi\n", + "R = 1544.; # Universal gas consmath.tant in ft**3-psi/lbmol-degR\n", + "N = hmc*p*(pa1-pa2)*144/(R*T*pbm);\n", + "\n", + "# Results\n", + "print \"The amount of water evaporated per hour is %.4f lb mol/hr-ft**2\"%(N);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The amount of water evaporated per hour is 0.0024 lb mol/hr-ft**2\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.6 page : 297" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "u = 0.047; # Vismath.cosity in lb/hr-ft\n", + "rho = 0.069; # Density in lb-ft**2\n", + "D = 0.992; # Diameter of pipe in ft\n", + "v = 7.5*3600; # Velocity in ft/sec\n", + "L = 2.; # Length of pipe parallel to direction of air flow in ft \n", + "M = 0.992; # Molecular weight\n", + "p = 14.696; # Atmospheric pressure in psi \n", + "T = 460.+65; # Temperature in degR\n", + "M = 29.; # molecular weight of air\n", + "M2 = 18.; # Molecular weight of water vapour\n", + "A = 4.; # Area of water surface in ft**2\n", + "\n", + "# Calculations \n", + "# Heat transfer equation for laminar flow of a flat surface\n", + "Nre = L*v*rho/u; # Reynolds number\n", + "\n", + "# Assuming the case that of a fluid flowing parallel to a flat plate , jm = 0.0039\n", + "jm = 0.0039;\n", + "Ns = u/(rho*D); # Schimdt mumber\n", + "Gm = v*rho/M; # Mole flow rate\n", + "pv1 = 0.672; # Vapour pressure at 40% humidity\n", + "pv2 = 0.600; # Vapour pressure at saturation\n", + "pa1 = p-pv1; # Absolute pressure of air at 40% rel. humidity in psi\n", + "pa2 = p-pv2; # Absolute pressure of saturated air in psi\n", + "pbm = (pa1+pa2)/2; # Log mean pressure in psi\n", + "hmp = jm*Gm/(pbm*144*Ns**(2./3)); # Heat transfer coefficient in lbmol/ft**2-hr-psi\n", + "N = hmp*(pv1-pv2)*144; # Mass transfer rate in lb mol/hr-ft**2\n", + "W = N*A*M2;\n", + "\n", + "# Results\n", + "print \"The amount of water evaporated per hour is %.3f lb mol/hr-ft**2\"%(W);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The amount of water evaporated per hour is 0.119 lb mol/hr-ft**2\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.7 page : 300" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "u = 3.82*10**-7; # Vismath.cosity in lb-sec/ft**2\n", + "rho = 2.3*10**-3; # Density in lbsec**2/ft**4\n", + "A = 1.; # Area in ft**2\n", + "Cp = 0.24; # Specific heat capacity in abtu/lbm-degF\n", + "v = 4.*3600; # Velocity in ft/sec\n", + "k = 0.015; # Thermal conductivity in Btu/hr-ft-degF\n", + "p = 14.7; # Atmospheric pressure in psi \n", + "M = 29.; # Avg. molecular weight of air\n", + "T1 = 70.+460; # Temperature of still air in degF\n", + "T2 = 90.+460; # temperature of surface of water in degF\n", + "L = 1.; # For characteristic of 1 ft \n", + "D = 0.992; # Diffusivity in ft**2/sec \n", + " \n", + "# Calculations \n", + "# Heat transfer equation for laminar flow of a flat surface\n", + "Ngr = 32.2*L**3*((T2/T1)-1)/(u/rho)**2; # Grasshops number\n", + "Npr = u*3600*Cp*32.2/k; # Prandtls number\n", + "Nnu = 0.75*(Ngr*Npr)**.25; # Nusselt number\n", + "h = Nnu*k/L; # Heat transfer coefficient\n", + "Ns = u*3600/(rho*D); # Schimdt mumber\n", + "hmc = h*D*(Ns/Npr)**0.25/k; # Heat transfer coe\n", + "pv1 = 0.18; # Vapour pressure at 40% humidity\n", + "pv2 = 0.69; # Vapour pressure at saturation\n", + "pa1 = p-pv1; # Absolute pressure of air at 40% rel. humidity in psi\n", + "pa2 = p-pv2; # Absolute pressure of saturated air in psi\n", + "pbm = (pa1+pa2)/2; # Log mean pressure in psi\n", + "R = 1544; # Universal gas consmath.tant in ft**3-psi/lbmol-degR\n", + "T = (T1+T2)/2; # Average temperature in degR\n", + "N = hmc*p*(pv2-pv1)*144/(R*T*pbm)*18; # mass transfer rate in lbmol/hr-ft**2\n", + "\n", + "# Results\n", + "print \"The amount of water evaporated per hour is %.4f lb mol/hr-ft**2\"%(N);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The amount of water evaporated per hour is 0.0873 lb mol/hr-ft**2\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.8 page : 303" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Td = 70.+460; # Dry bulb temperature in degR\n", + "Tw = 60.+460; # Wet bulb temperature in degR\n", + "a = 0.26; # Ratio of coefficients ie. h/hmw from table \n", + "L = 1059.9; # Latent heat Btu/lbmol\n", + "p = 14.7; # Atmospheric pressure in psi\n", + "pa = 0.259; # Partial pressure of water in psi\n", + "Ma = 18.; # Molecular weight of water vapour \n", + "Mb = 29.; # Molecular weight of air\n", + "\n", + "# Calculations \n", + "Wwb = pa*Ma/(Mb*(p-pa)); # Absolte dry bulb humidity of air\n", + "Wdb = Wwb-(a*(Td-Tw)/L); # Absolte dry bulb humidity of air\n", + "\n", + "# Results\n", + "print \"The humidity of air at dry conditions is %.5f lbm/lbm of dry air\"%(Wdb);\n", + " \n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The humidity of air at dry conditions is 0.00868 lbm/lbm of dry air\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.9 page : 305" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "v = 20.; # Velocity of air ammonia mixture in ft/sec\n", + "Npr = 0.72; # Prandtls number\n", + "Ns = 0.60; # Schimdt number\n", + "pbm = 14.7; # math.log mean pressure in psi\n", + "Mm = 29.; # Molecular weight of mixture\n", + "Mv = 17.; # Molecular weight of ammonia \n", + "Ma = 29.; # Molecular weight of air\n", + "Cp = 0.24; # specific heat capacity in Btu/lbm-degF\n", + "h = 8.; # Heat transfer coefficient\n", + "p = 1.; # Atospheric pressure in atm\n", + "\n", + "# Calculations \n", + "hmp = h*Mv*(Npr/Ns)**(2./3)/(Cp*p*Ma); # Mass transfer coefficient based on pressure\n", + "\n", + "# Results\n", + "print \"The mass transfer coefficient based on pressure is %.1f lbm/hr-ft**2-atm\"%(hmp);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mass transfer coefficient based on pressure is 22.1 lbm/hr-ft**2-atm\n" + ] + } + ], + "prompt_number": 11 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch3.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch3.ipynb new file mode 100755 index 00000000..8bb835c0 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch3.ipynb @@ -0,0 +1,458 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:96c4eafa14e71d2a7ad08a3f1ed53ae85acbccb4e9c40ff9d082a4b129e50e09" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Conduction of heat in the steady state" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 page no : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "deltax = 9./12; # thickness of wall in ft\n", + "k = 0.18; # thermal conductivity of wall in B/hr-ft-degF\n", + "t1 = 1500; # inside temperature of oven wall in degF\n", + "t2 = 400; # outside temperature of oven wall in degF\n", + "\n", + "# Calculations \n", + "q = k*(t1-t2)/deltax; # heat loss in Btu/hr\n", + "\n", + "# Results\n", + "print \" The heat loss for each square foot of wall surface is %d Btu/hr-ft**2\"%(q);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The heat loss for each square foot of wall surface is 264 Btu/hr-ft**2\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 page : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "x1 = 9./12; # thickness of firebrick in ft\n", + "k1 = 0.72; # thermal conductivity of firebrick in Btu/hr-ft-degF\n", + "x2 = 5./12; # thickness of insulating brick in ft\n", + "k2 = 0.08; # thermal conductivity of insulating brick in Btu/hr-ft-degF\n", + "x3 = 7.5/12; # thickness of redbrick in ft\n", + "k3 = 0.5; # thermal conductivity of firebrick in Btu/hr-ft-degF\n", + "t1 = 1500.; # inner temperature of wall in degF\n", + "t2 = 150.; # outer temperature of wall in degF\n", + "\n", + "# Calculations and Results\n", + "# resistances of mortar joints are neglected\n", + "q = (t1-t2)/(x1/k1+x2/k2+x3/k3); # heat flow per square ft in Btu/hr\n", + "t2 = t1-(q*x1/k1); # first contact temperature in degF\n", + "print \" The temperature at the contact of firebrick and insulating brick is %d degF\"%(t2);\n", + "\n", + "t3 = t2-(q*x2/k2); # second contact temperature in degF\n", + "print \" The temperature at the contact of insulating brick and red brick is %d degF\"%(t3);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The temperature at the contact of firebrick and insulating brick is 1312 degF\n", + " The temperature at the contact of insulating brick and red brick is 375 degF\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 page : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "d1 = 2.375/12; # internal diameter of pipe in ft\n", + "t = 1./12; # thickness of insulating material in ft\n", + "d2 = d1+2*t; # external (insulation)diameter of pipe in ft\n", + "k = 0.0375; # thermal conductivity of insulating material in Btu/hr-ft-F\n", + "l = 30.; # length of pipe in ft\n", + "t1 = 380.; # inner surface temperature of insulation\n", + "t2 = 80.; # outer surface temperature of insulation\n", + "\n", + "# Calculations and Results\n", + "q = 2*math.pi*k*(t1-t2)/math.log(d2/d1); # heat loss per unit length\n", + "print \" Heat loss per linear foot is %.f Btu/hr\"%(q)\n", + "\n", + "qtot = round(q)*l; # heat loss for 30 ft pipe\n", + "print \" Total heat loss through 30 ft of pipe is %d Btu/hr\"%(qtot)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Heat loss per linear foot is 116 Btu/hr\n", + " Total heat loss through 30 ft of pipe is 3480 Btu/hr\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 page :33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "d1 = 10.75/12; # outer diameter of pipe in ft\n", + "x1 = 1.5/12; # thickness of insulation 1 in ft\n", + "x2 = 2./12; # thickness of insulation 2 in ft\n", + "d2 = d1+2*x1; # diameter of insulation 1 in ft\n", + "d3 = d2+2*x2; # diameter of insulation 1 in ft\n", + "t1 = 700.; # inner surface temperature of composite insulation in degF\n", + "t2 = 110.; # outer surface temperature of composite insulation in degF\n", + "k1 = 0.05; #thermal conductivity of material 1 in Btu/hr-ft-degF\n", + "k2 = 0.039; # thermal conductivity of material 2 in Btu/hr-ft-degF\n", + "\n", + "# Calculations \n", + "q = 2*math.pi*(t1-t2)/(math.log(d2/d1)/k1+math.log(d3/d2)/k2); # heat loss per linear foot in Btu/hr\n", + "\n", + "# Results\n", + "print \" The heat loss is found to be %d Btu/hr-ft\"%( q);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The heat loss is found to be 323 Btu/hr-ft\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 page : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Variables\n", + "km = 0.0377; # Mean thermal conductivity at 220degF\n", + "t1 = 260.; # Inner surface temperature of slab in degF \n", + "t2 = 180.; # Outer surface temperature of slab in degF\n", + "A = 1.; # Area of slab in ft\n", + "x = 2./12; # Thickness of insulation in ft\n", + "\n", + "# Calculations \n", + "q = km*A*(t1-t2)/x; # Heat loss through slab in Btu/hr\n", + "\n", + "# Results\n", + "print \" Heat loss through flat slab is %.1f Btu/hr\"%(q);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Heat loss through flat slab is 18.1 Btu/hr\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.6 page : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "# Variables\n", + "k = 0.8 # Avg. thermal conductivity in Btu/hr-ft-degF\n", + "T1 = 400. # Inner surface temperature of furnace in degF \n", + "T2 = 100. # Outer surface temperature of furnace in degF\n", + "a = 3. # Length of furnace in ft\n", + "b = 4. # Breadth of furnace in ft\n", + "c = 2.5 # Height of furnace in ft\n", + "Aa = 2*a*b # Area of surface A in ft**2\n", + "Ab = 2*b*c # Area of surface A in ft**2\n", + "Ac = 2*a*c # Area of surface A in ft**2\n", + "x = 4.5/12 # Thickness of insulation in ft\n", + "t = 24. # Time elapsed in hr\n", + "M = 4. # Number of edges\n", + "N = 8. # Number of corners\n", + "\n", + "# Calculations \n", + "S = Aa/x+Ab/x+Ac/x+0.54*(a+b+c)*M+0.15*x*N # Shape factor\n", + "qo = round(S*k*(T1-T2),-2) # Heat flow per hour\n", + "q = qo*t # Heat loss in 24 hr\n", + "\n", + "# Results\n", + "print \"The heat loss in 24 hr is %d Btu\"%(q)\n", + "\n", + "# note : book answer is wrong. Kindly check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The heat loss in 24 hr is 1027200 Btu\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.7 page : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "# Variables\n", + "M = 8*9; # number of flow channels for the entire section\n", + "N = 8.37; # number of equal channel intervals\n", + "# the fractional part arises due to the fractional part of temperature close to border EG\n", + "\n", + "# Calculations \n", + "k = M/N; # Ratio of shape factor to wall length\n", + "\n", + "# Results\n", + "print \" Shape factor for the special section where the ratio of radius of\\\n", + " circle to half side length is 0.5,S is %.2fL\"%( k );\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Shape factor for the special section where the ratio of radius of circle to half side length is 0.5,S is 8.60L\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.8 page : 43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import zeros\n", + "# Variables\n", + "t1 = 800.; # inner surface temperature of wall in degF\n", + "t4 = 200.; # outer surface temperature of wall in degF\n", + "\n", + "#Grids are square in shape so delx = dely where delx,y sre dimensions of square grid \n", + "t2 = [700, 550 ,550, 587.5, 587.5, 596.9, 596.9, 599.3, 599.3, 599.8]; # Assumed temperature of grid point 1\n", + "t3 = [300, 300 ,375 ,375, 393.8, 393.8, 398.5, 398.5, 399.6, 399.6]; # Assumed temperature of grid point 2\n", + "\n", + "th2 = zeros(9)\n", + "th3 = zeros(9)\n", + "\n", + "# Calculations and Results\n", + "for i in range(9):\n", + " th2[i] = t1+t3[i]-2*t2[i]; # th1 = q/kz at grid pt1\n", + " th3[i] = t2[i]+t4-2*t3[i];# th2 = q/kz at grid pt2\n", + " print \" Assuming t2 = %.1f degF and t2 = %.1f degF th1[%d] = %.1f degF and th2[%d] = %.1f degF \"%(t2[i],t3[i],i,th2[i],i,th3[i]); \n", + " print \" Since th2[%d] is not equal to th3[%d], hence other values of t2 and t3 are to be assumed\"%(i,i);\n", + "\n", + "\n", + "print \"Assuming t2 = 600 degF and t3 = 400 degF, th2 = th3.\"\n", + "print \"Hence Steady state condition is satisfied at grid temperatures of 400 degF and 600 degF\";\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Assuming t2 = 700.0 degF and t2 = 300.0 degF th1[0] = -300.0 degF and th2[0] = 300.0 degF \n", + " Since th2[0] is not equal to th3[0], hence other values of t2 and t3 are to be assumed\n", + " Assuming t2 = 550.0 degF and t2 = 300.0 degF th1[1] = 0.0 degF and th2[1] = 150.0 degF \n", + " Since th2[1] is not equal to th3[1], hence other values of t2 and t3 are to be assumed\n", + " Assuming t2 = 550.0 degF and t2 = 375.0 degF th1[2] = 75.0 degF and th2[2] = 0.0 degF \n", + " Since th2[2] is not equal to th3[2], hence other values of t2 and t3 are to be assumed\n", + " Assuming t2 = 587.5 degF and t2 = 375.0 degF th1[3] = 0.0 degF and th2[3] = 37.5 degF \n", + " Since th2[3] is not equal to th3[3], hence other values of t2 and t3 are to be assumed\n", + " Assuming t2 = 587.5 degF and t2 = 393.8 degF th1[4] = 18.8 degF and th2[4] = -0.1 degF \n", + " Since th2[4] is not equal to th3[4], hence other values of t2 and t3 are to be assumed\n", + " Assuming t2 = 596.9 degF and t2 = 393.8 degF th1[5] = 0.0 degF and th2[5] = 9.3 degF \n", + " Since th2[5] is not equal to th3[5], hence other values of t2 and t3 are to be assumed\n", + " Assuming t2 = 596.9 degF and t2 = 398.5 degF th1[6] = 4.7 degF and th2[6] = -0.1 degF \n", + " Since th2[6] is not equal to th3[6], hence other values of t2 and t3 are to be assumed\n", + " Assuming t2 = 599.3 degF and t2 = 398.5 degF th1[7] = -0.1 degF and th2[7] = 2.3 degF \n", + " Since th2[7] is not equal to th3[7], hence other values of t2 and t3 are to be assumed\n", + " Assuming t2 = 599.3 degF and t2 = 399.6 degF th1[8] = 1.0 degF and th2[8] = 0.1 degF \n", + " Since th2[8] is not equal to th3[8], hence other values of t2 and t3 are to be assumed\n", + "Assuming t2 = 600 degF and t3 = 400 degF, th2 = th3.\n", + "Hence Steady state condition is satisfied at grid temperatures of 400 degF and 600 degF\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.10 page : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "k = 0.9; # thermal conductivity of section material in Btu/hr-ft-degF\n", + "\n", + "# Heat is considered to flow through fictitious rods and only half of the heat flows through symmetry axes \n", + "Ta = 300.;\n", + "Tb = 441.;\n", + "Tc = 600.;\n", + "Td = 300.;\n", + "Te = 432.;\n", + "Tf = 600.;\n", + "Tg = 600.;\n", + "Th = 600.;\n", + "Ti = 300.;\n", + "Tj = 384.;\n", + "Tk = 461.;\n", + "Tl = 485.;\n", + "Tm = 490.;\n", + "Tn = 300.;\n", + "To = 340.;\n", + "Tp = 372.;\n", + "Tq = 387.;\n", + "Tr = 391.;\n", + "Ts = 300.;\n", + "Tt = 300.;\n", + "Tu = 300.;\n", + "Tv = 300.;\n", + "Tw = 300.;\n", + "\n", + "# Calculations and Results\n", + "# Above grid point temperatures are given in the question for the quarter section considered in degF(a,b,c...w are grid points)\n", + "q1 = 4*k*((Tc-Tb)/2+(Tf-Te)+(Tf-Tk)+(Tg-Tl)+(Th-Tm)/2); # Amount of heat coming from inside in Btu/hr\n", + "q2 = 4*k*((Tb-Ta)/2+(Te-Td)+(Tj-Ti)+(To-Tn)+(To-Tt)+(Tp-Tu)+(Tq-Tu)+(Tr-Tw)/2); # Amount of heat going outside in Btu/hr\n", + "q = (q1+q2)/2; # average of heat going in and heat coming out\n", + "print \" Total heat flow per unit depth is %.1fBtu/hr\"%(q);\n", + "\n", + "S = q/(k*(Tc-Ta)); # shape factor in ft\n", + "print \" Shape factor is %.2fft\"%(S)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Total heat flow per unit depth is 2029.5Btu/hr\n", + " Shape factor is 7.52ft\n" + ] + } + ], + "prompt_number": 14 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch4.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch4.ipynb new file mode 100755 index 00000000..2d1bf2f0 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch4.ipynb @@ -0,0 +1,531 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:762c657ca63f4bd96f109e4e82b32740084456d360cd020253f718b992f3cd8d" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : Conduction of heat in the unsteady state" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 page : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "b = 9.; # Thickness of the wall in ft\n", + "A = 5.; # Area of wall \n", + "k = 0.44; # Thermal conductivity in Btu/hr-ft-degF\n", + "Cp = .202; # Specific heat in Btu/lbm-degF\n", + "rho = 136.; # Density in lb/ft**3\n", + "\n", + "\n", + "# Calculations and Results\n", + "\n", + "def derivative(f):\n", + " def df(x, h=0.1e-5):\n", + " return ( f(x+h/2) - f(x-h/2) )/h\n", + " return df\n", + "\n", + "def templength(x): # Temperature function in terms of length \n", + " return 90 - 80*x +16*x**2 +32*x**3 -25.6*x**4;\n", + "\n", + "tgo = derivative(templength)(0); # Temperature gradient at x = 0ft\n", + "tgl = derivative(templength)(9./12); # Temperature gradient at x = 9/12ft\n", + "\n", + "qo = -k*A*tgo; # Heat entering per unit time in Btu/hr\n", + "print \"Heat entering per unit time is %.2f Btu/hr \"%(qo);\n", + "ql = -k*A*tgl; # Heat coming out per unit time in Btu/hr\n", + "print \" Heat coming per unit time is %.2f Btu/hr \"%(ql);\n", + "q3 = qo-ql; #Heat energy stored in Btu/hr\n", + "print \" Heat energy stored in wall is %.2f Btu/hr \"%(q3);\n", + "\n", + "a = k/(rho*Cp); # Thermal diffusivity\n", + "def doublederivative(y): # Derivative of tempearture with respect to length in degF/ft\n", + " return -80+32*y+96*y**2-102.4*y**3;\n", + "\n", + "timeder0 = a*derivative(doublederivative)(0); # derivative of temperature wrt time at x = 0 in degF\n", + "print \" Time derivative of temperature wrt time at x = 0ft is %.2f degF/hr\"%(timeder0);\n", + "timeder1 = a*derivative(doublederivative)(9./12); # derivative of temperature wrt time at x = 9/12 in degF \n", + "print \" Time derivative of temperature wrt time at x = 9/12ft is %.2f degF/hr\"%(timeder1);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat entering per unit time is 176.00 Btu/hr \n", + " Heat coming per unit time is 99.44 Btu/hr \n", + " Heat energy stored in wall is 76.56 Btu/hr \n", + " Time derivative of temperature wrt time at x = 0ft is 0.51 degF/hr\n", + " Time derivative of temperature wrt time at x = 9/12ft is 0.05 degF/hr\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 page :60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "b = 9.; # thickness of the wall in ft\n", + "A = 5.; # area of wall in ft**2\n", + "k = 0.44; # Thermal conductivity in Btu/hr-ft-degF\n", + "Cp = .202; # Specific heat in Btu/lbm-degF\n", + "rho = 136.; # density in lb/ft**3\n", + "\n", + "# Calculations and Results\n", + "def derivative(f):\n", + " def df(x, h=0.1e-5):\n", + " return ( f(x+h/2) - f(x-h/2) )/h\n", + " return df\n", + "\n", + "def templength(x):\n", + " return 90 - 8*x-80*x**2; \n", + "\n", + "\n", + "tgo = derivative(templength)(0); # temperature gradient at x = 0ft\n", + "tgl = derivative(templength)(9./12); # temperature gradient at x = 9/12ft\n", + "\n", + "qo = -k*A*tgo; # Heat entering per unit time in Btu/hr\n", + "print \"Heat entering per unit time is %.2f Btu/hr \"%(qo);\n", + "ql = -k*A*tgl; # Heat coming out per unit time in Btu/hr\n", + "print \" Heat coming per unit time is %.2f Btu/hr \"%(ql);\n", + "q3 = qo-ql; #Heat energy stored in Btu/hr\n", + "print \" Heat energy stored in wall is %.2f Btu/hr \"%(q3);\n", + "\n", + "a = k/(rho*Cp); # Thermal diffusivity in ft**2/hr\n", + "def doublederivative(y): # derivative of tempearture with respect to length in degF/ft\n", + " return -8-160*y;\n", + "\n", + "timeder0 = a*derivative(doublederivative)(0); # derivative of temperature wrt time at x = 0 in degF\n", + "print \" Time derivative of temperature wrt time at x = 0ft is %.2f degF/hr\"%(timeder0);\n", + "timeder1 = a*derivative(doublederivative)(9./12); # derivative of temperature wrt time at x = 9/12 in degF \n", + "print \" Time derivative of temperature wrt time at x = 9/12ft is %.2f degF/hr\"%(timeder1);\n", + "print \" Teperature at each part of wall decreases equally\";\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat entering per unit time is 17.60 Btu/hr \n", + " Heat coming per unit time is 281.60 Btu/hr \n", + " Heat energy stored in wall is -264.00 Btu/hr \n", + " Time derivative of temperature wrt time at x = 0ft is -2.56 degF/hr\n", + " Time derivative of temperature wrt time at x = 9/12ft is -2.56 degF/hr\n", + " Teperature at each part of wall decreases equally\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 page : 65" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "t = 10.; # time elapsed in hr\n", + "Ti = 70.; # tempearature of wall initially in degF\n", + "Ts = 1500.; # temperature of surface when suddenly changed in degF\n", + "a = 0.03; # thermal diffusivity in ft**2/hr\n", + "k = 0.5; # thermal conductivity in Btu/hr-ft-degF\n", + "A = 10.; # area of wall in sq ft\n", + "x = 7./12; # distance from surface where tempearture is to be found in ft\n", + "f = x/(2*math.sqrt(a*t)); \n", + "# From gaussian error function table erf can be found\n", + "errorf = 0.55; # Referred from table\n", + "\n", + "# Calculations and Results\n", + "T = Ts+(Ti-Ts)*errorf;\n", + "print \"Temperaure at a distance of 7/12ft from surface is %.1f degF \"%(T);\n", + "q = -k*A*(Ti-Ts)*math.exp(-x**2/(4*a*t))/math.sqrt(t*math.pi*a); # heat flow rate at a distance\n", + "qtot = -k*A*(Ti-Ts)*2*math.sqrt(t/(math.pi*a)); # total heat flowing after 10 hrs in Btu\n", + "print \" Heat flowing at a distance of 7/12 ft from surface is %d Btu/hr\"%(q); \n", + "print \" Total heat flow after 10hrs is %.f Btu\"%(qtot);\n", + "\n", + "# note : book answer are wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperaure at a distance of 7/12ft from surface is 713.5 degF \n", + " Heat flowing at a distance of 7/12 ft from surface is 5546 Btu/hr\n", + " Total heat flow after 10hrs is 147299 Btu\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 page :67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "d = 16./12; # Diameter of sphere in ft\n", + "t = 20./60; # Time elapsed in hr\n", + "a = 0.31; # thermal diffusivity of steel in ft**2/hr\n", + "Ti = 80.; # Temperature of steel sphere initially in degF\n", + "Ts = 1200.; # Temperature of surface suddenly changed in degF\n", + "\n", + "# Calculations \n", + "s = 4*a*t/d**2; # A parameter \n", + "# From table the value of F(s) can be known \n", + "Fs = 0.20; \n", + "Tc = Ts+(Ti-Ts)*Fs; # Tempearture at the center of sphere in degF\n", + "\n", + "# Results\n", + "print \"The tempearture at the center of steel sphere after 20 mins is %d degF\"%(Tc); \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The tempearture at the center of steel sphere after 20 mins is 976 degF\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 page : 69" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "t = 24.; # Time period of tempearture wave in hr\n", + "k = 0.6; # Thermal conductivity of wall in Btu/hr-ft-degF\n", + "Cp = 0.2; # Specific heat capacity of wall in Btu/lb-degF\n", + "y = 110.; # specific gravity in lb/ft**3\n", + "x = 8./12; # distance from surface in ft\n", + "\n", + "# Calculations \n", + "a = k/(y*Cp); # Thermal diffusivity in ft**2/hr\n", + "n = 1./t; # frequency in /hr\n", + "delr = x/(2*math.sqrt(a*math.pi*n)); # Time lag in hr\n", + "\n", + "# Results\n", + "print \"Time lag of the temperature at a point 8 in from surface is %.1f hr\"%delr;\n", + "\n", + "# book answer is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time lag of the temperature at a point 8 in from surface is 5.6 hr\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 page : 69" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T1 = -15.; # Min temperature at surface in degF\n", + "T2 = 25.; # Max temperature at surface in degF\n", + "t = 24.; # time gap in hrs\n", + "k = 1.3; # thermal conductivity in Btu/hr-ft-degF\n", + "Cp = 0.4; # heat capacity in lb/ft-degF\n", + "y = 126.1; # specific gravity in lb/ft**3\n", + "n = 1./t; # frequency in /hr \n", + "Tm = (T1+T2)/2;\n", + "a = k/(y*Cp); # thermal diffusivity in ft**2\n", + "\n", + "# Calculations and Results\n", + "x1 = 2;\n", + "x2 = 6;\n", + "th0 = (T1-T2)/2;\n", + "th1 = th0*-math.exp(-x1*math.sqrt(math.pi*n/a)); # temperature range at 2 ft depth\n", + "th2 = th0*-math.exp(-x2*math.sqrt(math.pi*n/a)); # temperature range at 6 ft depth \n", + "print \"Amplitude of tempearture at 2ft deep is %.2f degF\"%(th1);\n", + "print \" Amplitude of tempearture at 6ft deep is %.2f degF\"%(th2);\n", + "print \" At a depth of 2ft , temperature varies from 4.78 degF to 5.22 degF and \\\n", + "at a depth of 6 ft, temperature remains constant at 5 degF\"\n", + "delr1 = x1/2*math.sqrt(1/(a*math.pi*n)); # time lag at 2 ft depth\n", + "delr2 = x2/2*math.sqrt(1/(a*math.pi*n)); # time lag at 6 ft depth\n", + "print \" Lag of temperature wave at a depth 2 ft is %.1f hr \"%(delr1);\n", + "print \" Lag of temperature wave at a depth 6 ft is %.1f hr \"%(delr2);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amplitude of tempearture at 2ft deep is 0.22 degF\n", + " Amplitude of tempearture at 6ft deep is 0.00 degF\n", + " At a depth of 2ft , temperature varies from 4.78 degF to 5.22 degF and at a depth of 6 ft, temperature remains constant at 5 degF\n", + " Lag of temperature wave at a depth 2 ft is 17.2 hr \n", + " Lag of temperature wave at a depth 6 ft is 51.6 hr \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 page : 70" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T1 = 10.; # Min temperature at surface in degF\n", + "T2 = -10.; # Max temperature at surface in degF\n", + "t1 = 24.;\n", + "t2 = 5.; # Time gap in hrs\n", + "k = 0.3; # Thermal conductivity in Btu/hr-ft-degF\n", + "Cp = 0.47; # Heat capacity in lb/ft-degF\n", + "y = 100.; # Specific gravity in lb/ft**3\n", + "n1 = 1/t1; # Frequency in /hr \n", + "Tm = (T1+T2)/2;a = k/(y*Cp); # thermal diffusivity in ft**2\n", + "n = 1./t1; # Frequency in /sec\n", + "x1 = 1.;\n", + "x2 = 1.;\n", + "\n", + "# Calculations and Results # Depth in ft\n", + "th0 = (T1-T2)/2;th1 = th0*math.exp(-x1*math.sqrt(math.pi*n/a)); # temperature range at 2 ft depth\n", + "th2 = th0*math.exp(-x2*math.sqrt(math.pi*n/a)); # Temperature range at 6 ft depth \n", + "print \"Amplitude of tempearture at 2ft deep is %.2f degF\"%(th1);\n", + "delr1 = x1/2*math.sqrt(1/(a*math.pi*n)); # Time lag at 2 ft depth\n", + "print \" Lag of temperature wave at a depth 2 ft is %.1f hr \"%(delr1);\n", + "# To calculate the temperature at a depth of 1 ft , 5 hr after the srface temperature reaches the minimum temperature \n", + "r = 3/(4*n); # Time at which minimum surface temperature occurs for the first time in hr\n", + "r1 = r+5; # Time ar which temperature is to be found out in degF\n", + "th3 = th0*math.exp(-x1*math.sqrt(math.pi*n/a))*math.sin(2*math.pi*r1/24-4.53);\n", + "Tr = Tm+th3; # Temperature to be found out in degF\n", + "print \" The temperaure at 1 ft depth is %.2f degF \"%(Tr);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amplitude of tempearture at 2ft deep is 0.11 degF\n", + " Lag of temperature wave at a depth 2 ft is 17.3 hr \n", + " The temperaure at 1 ft depth is 0.11 degF \n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.8 page : 72" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "a = 0.02; # thermal diffusivity in ft**2/hr\n", + "M = 4.; # the value of 4 is selected for M\n", + "\n", + "# Calculations and Results\n", + "x = 9./12; # thickness of wall in ft\n", + "delx = 1.5/12;\n", + "delr = delx**2/(a*M); # at time interval the heat transfeered will change the temperature of math.sink from tb2 to tb2o\n", + "print \"The time interval is to be of %.3f hr \"%(delr);\n", + "\n", + "t1o = 370; \n", + "t2o = 435; \n", + "t3o = 480; \n", + "t4o = 485; \n", + "t5o = 440; \n", + "t6o = 360; \n", + "t7o = 250;\n", + " \n", + "# tempetaures at different positions at wall in degF initially\n", + "# we know qo = Z*delx*dely*rho*Cp(tb2'-tb2)/delr So on solving equations we get tb2' = (tb1+tb3+ta2+tc2)/4\n", + "# using above formula, temperaures at different positions as shown below can be calculated in degF\n", + "\n", + "ta = [370, 430, 470, 473, 431, 352, 250];\n", + "tb = [370, 425, 461, 462, 422, 346, 250]; \n", + "tc = [370, 420, 452, 452, 413, 341, 250];\n", + "td = [370, 415, 444, 442, 404, 336, 250];\n", + "print \" The temperatures at different positions 0.78 hr after, are as follows \"\n", + "for i in range(7):\n", + " print \" The temperature at point %d is %d degF \"%(i,td[i]);\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The time interval is to be of 0.195 hr \n", + " The temperatures at different positions 0.78 hr after, are as follows \n", + " The temperature at point 0 is 370 degF \n", + " The temperature at point 1 is 415 degF \n", + " The temperature at point 2 is 444 degF \n", + " The temperature at point 3 is 442 degF \n", + " The temperature at point 4 is 404 degF \n", + " The temperature at point 5 is 336 degF \n", + " The temperature at point 6 is 250 degF \n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.9 page : 73" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "a = 0.53; # thermal diffusivity in ft**2/hr\n", + "M = 4.; # the value of 4 is selected for M\n", + "x = 6./12; # thickness of wall in ft\n", + "delx = 2./12;\n", + "delr = delx**2/(a*M); # at time interval the heat transfeered will change the temperature of math.sink from tb2 to tb2o\n", + "print \"the time interval is to be of %.3f hr \"%(delr);\n", + "\n", + "# the temperature is consmath.tant in the whole wall initiallt 100 degF and afterwards it changes to 1000 degF. \n", + "# we know qo = Z*delx*dely*rho*Cp(tb2'-tb2)/delr So on solving equations we get tb2' = (tb1+tb3+ta2+tc2)/4\n", + "# using above formula we can calculate the different temperatures as given below in degF\n", + "\n", + "ta = [100, 550, 775, 888, 944];\n", + "tb = [100, 550, 775, 888, 944];\n", + "tc = [100, 550, 775, 888, 944];\n", + "td = [100, 550, 775, 888, 944];\n", + "print \" the temperatures at different positions 0.052 hr after, are as follows \"\n", + "print \" the temperature at point a is %d degF \"%ta[4]\n", + "print \" the temperature at point a is %d degF \"%tb[4]\n", + "print \" the temperature at point a is %d degF \"%tc[4];\n", + "print \" the temperature at point a is %d degF \"%td[4]\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the time interval is to be of 0.013 hr \n", + " the temperatures at different positions 0.052 hr after, are as follows \n", + " the temperature at point a is 944 degF \n", + " the temperature at point a is 944 degF \n", + " the temperature at point a is 944 degF \n", + " the temperature at point a is 944 degF \n" + ] + } + ], + "prompt_number": 16 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch5.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch5.ipynb new file mode 100755 index 00000000..f47a12b9 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch5.ipynb @@ -0,0 +1,116 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:fe9888844b12ba5958c49565e95cfea393aa060fdc976c61a0bc940d6b9f2946" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : Steady-state heat conduction in bodies with heat sources" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 page : 108" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Di = 10./12; # inside diameter of the coil in ft\n", + "x = 7./48; # thickness of coil in ft\n", + "ts = 70.5; # Initial temp. of coil in degF\n", + "Rm = 12.1; # resistance of coil \n", + "e = 0.0024; # Temperature coefficient of coil in degF\n", + "i = 0.009; # Initial current in amp\n", + "V = 0.1; # Initial Voltage in volts\n", + "\n", + "# Calculations \n", + "Rs = V/i; # Initial resistance in ohms\n", + "Thm = (Rm/Rs-1)/e; # Mean temperature in degF\n", + "Th0 = 1.5*Thm; # Increase in temperature in degF\n", + "to = ts+Th0; # Maximum temperature in degF\n", + "\n", + "# Results\n", + "print \"The maximum temperature of the coil was %.1f degF\"%(to);\n", + "\n", + "# note : rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum temperature of the coil was 126.1 degF\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 page : 109" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "# Variables\n", + "r = 1./4; # radius in inches\n", + "to = 300.; # outer surface temperature of cylinder in degF\n", + "q0 = 10.; # i2r heat loss in Btu-in**2/hr\n", + "k = 10.; # thermal conductivity of the material in Btu/hr-ft-degF\n", + "\n", + "# Calculations and Results\n", + "tc = to+(q0*r*r)*12 /(4*k); # temperature at center\n", + "delt = tc-to;\n", + "print \"The temperature diference between center and outer surface is %.2f degF\"%(delt);\n", + "\n", + "\n", + "# Total energy within the cylinder must be transferred to as heat to outer surface\n", + "\n", + "v = math.pi*r**2; # Volume of heatinf element in in**3\n", + "q1 = q0*v; # heat flow to outer surface in Btu/sec\n", + "tr = -q1*r/(2*k); # derivative of temperature wrt radius\n", + "q = q1*12; # Heat flow at the outer surfae in Btu/hr-ft\n", + "print \" Heat transfer per unit length at the outer surface is %.1f Btu/hr\"%(q);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The temperature diference between center and outer surface is 0.19 degF\n", + " Heat transfer per unit length at the outer surface is 23.6 Btu/hr\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch6.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch6.ipynb new file mode 100755 index 00000000..12a7053a --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch6.ipynb @@ -0,0 +1,104 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:18c228d58d470b34fe9051b63d44f3937080680555b2c8754edba1efb886ef0e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 : Introduction to the dimensional analysis of convection" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 page : 116" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "u = 2.08/32.2; # vismath.cosity of water at 80degF in slug/ft-hr\n", + "rho = 62.4/32.2; # density of water in slug/ft**3\n", + "d = 2./12; # inner diameter of tube in ft\n", + "v = 10.; # average water velocity in ft/sec\n", + "\n", + "# Calculations \n", + "V = 0.0648/1.94\n", + "Nre = d*v*3600/V; # reynolds number\n", + "# 3600 is multiplies to convert sec into hrs\n", + "\n", + "# Results\n", + "print \"Reynolds Number is %d\"%(Nre);\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Reynolds Number is 179629\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 page : 116" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Variables\n", + "u = 2.08/32.16; # vismath.cosity of water at 80 degF in slug/ft-hr\n", + "m = 965000/32.16; # mass velocity of water in slug/hr-ft\n", + "\n", + "# Calculations \n", + "d = 1./12; # inner diameter of tube in ft\n", + "Nre = m*d/u; # reynolds number\n", + "\n", + "# Results\n", + "# 3600 is multiplies to convert sec into hrs\n", + "print \"Reynolds Number is %d\"%(Nre);\n", + "\n", + "# book answer is rounded off." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Reynolds Number is 38661\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch7.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch7.ipynb new file mode 100755 index 00000000..3c26f249 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch7.ipynb @@ -0,0 +1,216 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:5d41e84969ad0d553e20f8c382a4e66b5d40a08c263504221ff91368c27885dd" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 : Heat transfer by free convection" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 page : 129" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Variables\n", + "tp = 200.; # Temperature of heated plate in degF\n", + "ta = 60.; # Temperature of air in degF\n", + "tf = (tp+ta)/2; # Temperature of film in degF\n", + "delt = tp-ta; # Temperature difference in degF\n", + "Z = 950000.; # As referred from the chart for corresponding temperature \n", + "L = 18/12.; # Height of vertical plate in ft \n", + "\n", + "# Calculations \n", + "X = L**3*(delt)*Z;\n", + "# This value shows that it is laminar range so formula is as follows\n", + "h = 0.29*(delt/L)**.25; # Heat transfer coeeficient in Btu/hr-ft**2-degF\n", + "\n", + "# Results\n", + "print \"The film coefficient for free convetion for the heated plate is %.1f Btu/hr-ft**2/degF\"%(h)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The film coefficient for free convetion for the heated plate is 0.9 Btu/hr-ft**2/degF\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 page : 131" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "tp = 300.; # Temperature of heated plate in degF\n", + "ta = 80.; # Temperature of air in degF\n", + "tf = (tp+ta)/2; # Temperature of film in degF\n", + "delt = tp-ta; # Temperature difference in degF\n", + "Z = 610000.; # As referred from the chart for corresponding temperature \n", + "L = 7./12; # Height of vertical plate in ft \n", + "\n", + "# Calculations \n", + "A = L*L; # Area of square plate in ft**2\n", + "X = L**3*(delt)*Z;\n", + "\n", + "# This value shows that it is turbulent range , so formula for heat transfer coefficient is as follow \n", + "h = 0.22*delt**(1./3); # Temperature coeeficient in Btu/hr-ft**2-degF\n", + "q = h*A*delt; # Heat loss in Btu/hr\n", + "\n", + "# Results\n", + "print \"The film coefficient for free convetion for the heated plate is %.2f Btu/hr-ft**2-degF\"%(h);\n", + "print \" The heat loss by natural convection from the square plate is %.2f Btu/hr\"%(q);\n", + "\n", + "# book answer is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The film coefficient for free convetion for the heated plate is 1.33 Btu/hr-ft**2-degF\n", + " The heat loss by natural convection from the square plate is 99.42 Btu/hr\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 page : 132" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "D = 0.375; # Outer diameter in ft\n", + "T1 = 200.; # Pipe surface temperature in degF\n", + "T2 = 70.; # Air temperature in degF\n", + "Tf = (T1+T2)/2; # Film temperature at whih physical properties is to be measured\n", + "delT = T1-T2;\n", + "rho = 0.0667/32.2; # Density in slug/ft**3\n", + "u = 0.0482/32.2; # Vismath.cosity in slug/ft-hr\n", + "b = 1./(460+T2 );\n", + "Cp = 0.241*32.2; # Heat capacity in Btu/slug-ft\n", + "\n", + "# Calculations \n", + "# The value of specific heat is related to 1 lb mass so it must be multiplied to 32.2 to convert it into slugs\n", + "k = 0.0164; # Thermal conductivity in Btu/hr-ft-degF\n", + "g = 32.2*3600;\n", + "# Unit of time used is hour so it must be converted to sec. Hence 3600 is multiplied \n", + "Ngr = D**3*rho**2*b*g*delT/(u**3); # Grasshops number\n", + "Npr = u*Cp/k; # Prandtls number\n", + "A = math.log(Ngr*Npr);\n", + "\n", + "# Tha value of A is 6.866\n", + "# Now seeing the value of nusselt number from the table\n", + "Nnu = 25.2; # Nusselt number\n", + "h = Nnu*k/D; # Heat transfer coefficient \n", + "q = h*delT; # Heat loss per unit area in Btu/hr\n", + "\n", + "# Results\n", + "print \"Heat loss per unit square foot is %d Btu/hr-ft**2\"%(q);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat loss per unit square foot is 143 Btu/hr-ft**2\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 page : 134" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "tp = 200.; # Temperature of heated plate in degF\n", + "ta = 70.; # Temperature of air in degF\n", + "tf = (tp+ta)/2; # Temperature of film in degF\n", + "delt = tp-ta; # Temperature difference in degF\n", + "Z = 910000.; # As referred from the chart for corresponding temperature \n", + "D = 4.5/12; # Diameter of pipe in ft\n", + "\n", + "# Calculations \n", + "X = D**3*(delt)*Z;\n", + "# This value lies between X = 1000 to X = 10**9 , so formula for heat transfer coefficient is as follow \n", + "\n", + "h = 0.27*(delt/D)**(1./4); # Temperature coeeficient in Btu/hr-ft**2-degF\n", + "q = h*delt; # Heat loss in Btu/hr\n", + "\n", + "# Results\n", + "print \"The film coefficient for free convetion for the heated plate is %.2f Btu/hr-ft**2-degF\"%(h);\n", + "print \" The heat loss by natural convection from the square plateis %d Btu/hr\"%(q);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The film coefficient for free convetion for the heated plate is 1.17 Btu/hr-ft**2-degF\n", + " The heat loss by natural convection from the square plateis 151 Btu/hr\n" + ] + } + ], + "prompt_number": 5 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch8.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch8.ipynb new file mode 100755 index 00000000..2998d414 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch8.ipynb @@ -0,0 +1,110 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:03a60b955bd5b845faaf3c52cc11def91eec2fb940a1e39ca9c6a713b78f373f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 : Heat transfer by forced convection" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 page : 139" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.0752; # Outer diameter in ft\n", + "T1 = 61.4; # Pipe surface temperature in degF\n", + "T2 = 69.9; # Air temperature in degF\n", + "Tf = (T1+T2)/2; # Film temperature at whih physical properties is to be measured\n", + "delT = T1-T2;\n", + "rho = 1.94; # Density in slug/ft**3 , 62.3/32.2\n", + "u = 0.0780; # vismath.cosity in slug/ft-hr , 2.51/32.2\n", + "Cp = 1*32.2; # heat capacity in Btu/slug-ft\n", + "k = 0.340; # thermal conductivity in Btu/hr-ft-degF\n", + "v = 7*3600; # velocity in ft/sec\n", + "\n", + "# Calculations \n", + "Nre = D*v*rho/u; # Reynolds number\n", + "Npr = u*Cp/k; # Prandtls number\n", + "Nnu = 0.023*Nre**.8*Npr**.4;\n", + "h = Nnu*k/D; # heat transfer coefficient \n", + "\n", + "# Results\n", + "print \"The average film coefficient of heat transfer is %.d Btu/hr-ft**2-degF\"%(h);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The average film coefficient of heat transfer is 1267 Btu/hr-ft**2-degF\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 page : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 1./12; # Inner diameter of pipe in ft\n", + "k = 0.0174; # Thermal conductivity in btu/hr-ft-degF\n", + "Nre = 8000.; # Reynolds number\n", + "\n", + "# Calculations \n", + "# From table we can find out nusselt number\n", + "Nnu = 0.3*Nre**0.57; # Nusselt number\n", + "h = round(Nnu)*k/D; # Heat transfer coefficient in btu/hr-ft**2-degF\n", + "\n", + "# Results\n", + "print \"heat transfer coefficient for air flowing is %.1f Btu/hr-ft**2-degF\"%(h);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "heat transfer coefficient for air flowing is 10.4 Btu/hr-ft**2-degF\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch9.ipynb b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch9.ipynb new file mode 100755 index 00000000..5b8119c9 --- /dev/null +++ b/Elements_Of_Heat_Transfer_by_M._Jacob_And_G._A._Hawkins/ch9.ipynb @@ -0,0 +1,651 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b84dc3021bf00fa69e8fa42a6cbf4b1ad563cdbb8726721608219def960b394a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Heat transfer by the combined effect of conduction and convection" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 page : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "D = 3./48; # diameter in ft\n", + "L = 9./12; # Length of steam vessel in ft\n", + "T1 = 210.; # Vessel temperature in degF\n", + "T2 = 80.; # Air temperature in degF\n", + "th0 = T1-T2; # Temperature difference in degF\n", + "h = 1.44; # Assumed heat coefficient in Btu/hr-ft**2-degF\n", + "C = math.pi*D; # Circumference of vessel in ft \n", + "A = math.pi*D*D/4; # Area of vessel in ft**2\n", + "\n", + "# Calculations and Results\n", + "# For copper\n", + "k1 = 219; # Heat conductivity of copper in Btu/hr-ft-degF\n", + "m1 = math.sqrt(h*C/(k1*A)); # in /ft\n", + "th1 = th0*2/(math.exp(m1*L)+math.exp(-m1*L)); \n", + "Tl1 = round(th1+T2); # The temperaure at the free end in degF\n", + "print \"Temperature at free end of the copper rod is %d degF \"%(Tl1);\n", + "\n", + "# For iron\n", + "k2 = 36; # heat conductivity of copper in Btu/hr-ft-degF\n", + "m2 = math.sqrt(h*C/(k2*A)); # in /ft\n", + "th2 = th0*2/(math.exp(m2*L)+math.exp(-m2*L)); \n", + "Tl2 = th2+T2; # The temperaure at the free end in degF\n", + "print \" Temperature at free end of the iron rod is %.2f degF \"%(Tl2);\n", + "\n", + "# For glass\n", + "k3 = 0.64; # Heat conductivity of copper in Btu/hr-ft-degF\n", + "m3 = math.sqrt(h*C/(k3*A)); # in /ft\n", + "th3 = th0*2/(math.exp(m3*L)+math.exp(-m3*L));\n", + "Tl3 = th3+T2; # The temperaure at the free end in degF\n", + "print \" Temperature at free end of the glass rod is %.2f degF \"%(Tl3);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature at free end of the copper rod is 196 degF \n", + " Temperature at free end of the iron rod is 151.80 degF \n", + " Temperature at free end of the glass rod is 80.03 degF \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 page : 163" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "D = 3./48; # diameter in ft\n", + "L = 9./12; # Length of steam vessel in ft\n", + "T1 = 210.; # Vessel temperature in degF\n", + "T2 = 80.; # Air temperature in degF\n", + "th0 = T1-T2; # Temperature difference in degF\n", + "h = 1.44; # Assumed heat coefficient in Btu/hr-ft**2-degF\n", + "C = math.pi*D; # Circumference of vessel in ft \n", + "A = math.pi*D*D/4; # Area of vessel in ft**2\n", + "\n", + "# Calculations \n", + "k = 36; # heat conductivity of copper in Btu/hr-ft-degF\n", + "m = math.sqrt(h*C/(k*A)); # in /ft\n", + "q = k*A*m*th0*(math.exp(m*L)-math.exp(-m*L))/(math.exp(m*L)+math.exp(-m*L)); \n", + "# Heat loss by iron rod in Btu/hr\n", + "\n", + "# Results\n", + "print \"The rate of heat loss by iron rod is %.1f Btu/hr\"%(q);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The rate of heat loss by iron rod is 19.2 Btu/hr\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 page : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "x = 3./96; # Thickness of plate in ft\n", + "k = 220.; # thermal conductivity in Btu/hr-ft-degF\n", + "h1 = 480.; # Inner film coefficient in Btu/hr-ft**2-degF\n", + "h2 = 1250.; # Outer film coefficient in Btu/hr-ft**2-degF\n", + "\n", + "# Calculations \n", + "U = 1./((1/h1)+(x/k)+(1/h2)); # Overall heat transer coeeficient in Btu-hr-ft**2-degF\n", + "\n", + "# Results\n", + "print \"Overall heat transfer coefficient is %.f Btu/hr-ft**2-degF\"%(U);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Overall heat transfer coefficient is 331 Btu/hr-ft**2-degF\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 page : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "r2 = 3./96; # Outer radius in ft\n", + "x = 0.1/12; # Thickness of plate in ft\n", + "r1 = r2-x; # Outer radius in ft\n", + "k = 200.; # thermal conductivity in Btu/hr-ft-degF\n", + "h1 = 280.; # Inner film coefficient in Btu/hr-ft**2-degF\n", + "h2 = 2000.; # Outer film coefficient in Btu/hr-ft**2-degF\n", + "\n", + "# Calculations \n", + "U = 1/((r2/(h1*r1))+(r2*math.log(r2/r1)/k)+(1/h2)); # Overall heat transer coeeficient in Btu-hr-ft**2-degF\n", + "\n", + "# Results\n", + "print \"Overall heat transfer coefficient is %d Btu/hr-ft**2-degF\"%(U);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Overall heat transfer coefficient is 184 Btu/hr-ft**2-degF\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5 page : 176" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Tc1 = 120.; # Inlet cold fluid temperature in degF\n", + "Tc2 = 310.; # Outlet cold fluid temperature in degF\n", + "Th1 = 500.; # Inlet hot fluid temperature in degF\n", + "Th2 = 400.; # Outlet hot fluid temperature in degF\n", + "\n", + "# Calculations \n", + "delt1 = Th2-Tc1; # Maximum temperature difference in degF\n", + "delt2 = Th1-Tc2; # Minimum temperature difference in degF\n", + "LMTD = (delt1-delt2)/math.log(delt1/delt2); # Log mean temperature difference \n", + "\n", + "# Results\n", + "print \"The log mean temperature difference is %d degF\"%(LMTD) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The log mean temperature difference is 232 degF\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.6 page : 178" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Tc1 = 120.; # Inlet cold fluid temperature in degF\n", + "Tc2 = 310.; # Outlet cold fluid temperature in degF\n", + "Th1 = 500.; # Inlet hot fluid temperature in degF\n", + "Th2 = 400.; # Outlet hot fluid temperature in degF\n", + "\n", + "# Calculations \n", + "K = (Tc2-Tc1)/(Th2-Tc2); # Temperature ratio\n", + "R = (Th1-Th2)/(Tc2-Tc1); # Temperature ratio \n", + "delt1 = Th2-Tc1; # Maximum temperature difference in degF\n", + "delt2 = Th1-Tc2; # Minimum temperature difference in degF\n", + "LMTD = (delt1-delt2)/math.log(delt1/delt2); # Log mean temperature difference\n", + "f = 0.99; # Correction factor as seen from figure\n", + "LMTDc = round(LMTD*f); # Corrected math.log mean temperature difference\n", + "\n", + "# Results\n", + "print \"Log mean temperature difference is %d degF\"%(LMTDc);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Log mean temperature difference is 230 degF\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.7 page : 181" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Do = 1./12; # Outside diameter of the condenser in ft\n", + "Di = 0.902/12; # Outside diameter of the condenser in ft\n", + "Ts = 81.7; # Steam temperature in degF\n", + "Tw1 = 61.4; # Water inlet temperature in degF\n", + "Tw2 = 69.9; # Water outlet temperature in degF\n", + "k = 63.; # Thermal conductivity in Btu/hr-ft-degF\n", + "v = 7.; # average velocity in ft/sec\n", + "h1 = 1270.; # water side film coefficient i Btu/hr-ft**2-degF\n", + "h2 = 1000.; # Steam side film coefficient in Btu/hr-ft**2-degF\n", + "\n", + "# Calculations \n", + "U = 1/((Do/(Di*h1))+(Do*math.log(Do/Di)/(2*k))+(1/h2)); # Heat transfer coefficient\n", + "LMTD = ((Ts-Tw1)-(Ts-Tw2))/math.log((Ts-Tw1)/(Ts-Tw2)); # Log mean temperature diff.\n", + "m = 731300; # Saturated steam to be handled in lb/hr\n", + "L = 1097.4-49.7; # Change in enthalpy in Btu/lb\n", + "q = m*L; # Heat required in Btu/hr\n", + "A = q/(U*LMTD); # Area of condenser in ft**2\n", + "\n", + "# Results\n", + "print \"The area of steam condenser is %d ft**2\"%(A);\n", + "\n", + "# book answer is rounded. kindly check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The area of steam condenser is 94927 ft**2\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.8 page : 182" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Tc1 = 139.7; # Inlet cold fluid temperature in degF\n", + "Tc2 = 59.5; # Outlet cold fluid temperature in degF\n", + "Th1 = 108.7; # Inlet hot fluid temperature in degF\n", + "Th2 = 97.2; # Outlet hot fluid temperature in degF\n", + "\n", + "# Calculations and Results\n", + "delt1 = Tc1-Th2; # Maximum temperature difference in degF\n", + "delt2 = Th1-Tc2; # Minimum temperature difference in degF\n", + "LMTD = round((delt1-delt2)/math.log(delt1/delt2));\n", + "print \" The math.log mean temperature difference is %d degF\"%(LMTD); \n", + "\n", + "m = 18210.; # Flow rate through tubes\n", + "q = m*(Th2-Tc2); # Heat loss in Btu/hr\n", + "A = 48.1; # Area in ft**2\n", + "U = q/(A*LMTD); # Overall heat transfer coefficient\n", + "print \" The overall heat transfer coefficient is %d Btu/hr-ft**2-degF \"%(U);\n", + "\n", + "\n", + "# To calcalute using equations estabilished by correlation\n", + "Ts = 113.; # Average tube temperature in degF\n", + "Tf = (123.9+Ts)/2; # Film temperature in degF\n", + "# At this temperature thermal properties are considered\n", + "p1 = 61.7/32.2; # Density in slug/ft**3\n", + "u1 = 1.38/32.2; # Vismath.cosity in slug/ft-hr\n", + "Cp1 = 1*32.2; # Btu/slug/ft\n", + "k1 = 0.366; # Thermal conductivity in Btu/hr-ft-degF\n", + "D1 = 0.375/12; # Diameter in ft\n", + "v1 = 7610.; # Velocity in ft/sec\n", + "Nre1 = v1*D1*p1/u1; # Reynolds number\n", + "Npr1 = u1*Cp1/k1; # Prandtls number\n", + "Nnu1 = 0.33*Nre1**0.6*Npr1**(1./3); # Nusselt number\n", + "h1 = Nnu1*k1/D1; # Heat transfer coefficient\n", + "print \" The outer heat transfer coefficient is %d Btu/hr-ft**2-degF \"%(h1);\n", + "\n", + "# Taking the thermal properties at 78.3 degF\n", + "p2 = 62.2/32.2; # Density in slug/ft**3\n", + "u2 = 2.13/32.2; # Vismath.cosity in slug/ft-hr\n", + "Cp2 = 1*32.2; # Heat capacity in Btu/slug/ft\n", + "k2 = 0.348; # Thermal conductivity in Btu/hr-ft-degF\n", + "D2 = 0.277/12; # Diameter in ft\n", + "v2 = 7140; # Velocity in ft/sec\n", + "Nre2 = v2*D2*p2/u2; # Reynolds number\n", + "Npr2 = u2*Cp2/k2; # Prandtls number\n", + "Nnu2 = 0.023*Nre2**0.8*Npr2**(0.4); # Nusselt number\n", + "h2 = Nnu2*k2/D2; # Heat transfer coefficient\n", + "print \" The inner heat transfer coefficient is %d Btu/hr-ft**2-degF\"%(h2);\n", + "\n", + "k3 = 58;\n", + "U1 = 1/((D1/(D2*h2))+(D1*math.log(D1/D2)/(2*k3))+(1/h1)); # Heat transfer coefficient \n", + "print \" The overall heat transfer coefficient accordind to estabilished correlation is %d Btu/hr-ft**2-degF \"%(U1);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The math.log mean temperature difference is 46 degF\n", + " The overall heat transfer coefficient is 310 Btu/hr-ft**2-degF \n", + " The outer heat transfer coefficient is 1567 Btu/hr-ft**2-degF \n", + " The inner heat transfer coefficient is 631 Btu/hr-ft**2-degF\n", + " The overall heat transfer coefficient accordind to estabilished correlation is 349 Btu/hr-ft**2-degF \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.9 page : 188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "To1 = 140.; # inlet temperature of oil in degF\n", + "To2 = 90.; # Outlet temperature of oil in degf\n", + "Cpo = 0.5; # Specific heat capacity in Btu/lb-degf\n", + "Tw1 = 60.; # Inlet tempearture of water in degF\n", + "Tw2 = 80.; # Outlet temperature of water in degF\n", + "mo = 2000.; # Mass flow rate of oil in lb/hr\n", + "\n", + "# Calculations \n", + "q = mo*Cpo*(To1-To2); # Heat transferred in Btu/hr\n", + "Cpw = 1; # Heat capacity of water in Btu/hr\n", + "mw = q/(Cpw*(Tw2-Tw1)); # Mass flow rate in lb/hr\n", + "E1 = (Tw1-Tw2)/(Tw1-To2); # Effective ratio\n", + "# Seeing the effective ratio and mass flow rate ratio, from the graph we get UA\n", + "UA = 1.15*mo*Cpo;\n", + "\n", + "# Results\n", + "print \"The product of overall heat transfer and total area is %d Btu/hr-degF\"%(UA);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The product of overall heat transfer and total area is 1150 Btu/hr-degF\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.9 page : 191\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "t = 2.; # Thickness of wall in ft\n", + "To = 100.; # Initial temperature of wall in degF\n", + "Tg = 1000.; # Temperature of hot gases math.exposed in degF\n", + "k = 8.; # Thermal conductivity in Btu/hr-ft-degF\n", + "p = 162.; # density in lb/ft**-3\n", + "Cp = 0.3; # Heat capacity in Btu/lb-degF\n", + "h = 1.6; # Heat transfer coefficient in Btu/hr-ft**-2-degF\n", + "a = k/(p*Cp); # Thermal diffusivity\n", + "\n", + "# Considering the values of a and 4at/L**2 and hl/2k, the value of Phis, Phic and Si can be obtained\n", + "Phis = 0.37;\n", + "Phic = 0.41;\n", + "Si = 0.62;\n", + "\n", + "# Calculations and Results\n", + "Ta = Tg+(To-Tg)*Phis; # Temperature of surface in degF\n", + "print \"The temperature of surface is %d degF \"%(Ta);\n", + "Tc = Tg+(To-Tg)*Phic; # Temperature of center plane in degF\n", + "print \"The temperature of surface is %d degF \"%(Tc);\n", + "A = 10; # area of wall through which heat is absorbed\n", + "q = p*Cp*t*A*Si*(To-Tg); # Heat absorbed in Btu/hr\n", + "print \"The heat absorbed by wall is %d Btu\"%(q);\n", + "\n", + "# note : book answer is rounded off." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The temperature of surface is 667 degF \n", + "The temperature of surface is 631 degF \n", + "The heat absorbed by wall is -542376 Btu\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.10 page : 189" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "To1 = 160.; # inlet temperature of oil in degF\n", + "Cpo = 0.5; # Specific heat capacity in Btu/lb-degf\n", + "Tw1 = 60.; # Inlet temperature of water in degF\n", + "mo = 1000.; # Mass flow rate of oil in lb/hr\n", + "mw = 2500.; # Mass flow rate of water in lb/hr\n", + "Cpw = 1.; # Heat capacity of water in Btu/hr\n", + "\n", + "# Calculations and Results\n", + "X = mo*Cpo/(mw*Cpw); # Ratio of flow rates \n", + "UA = 1.15*mo*Cpo;\n", + "B = UA/mo*Cpo;\n", + "\n", + "# from the graph, we can locate the point of A and B And corresponding effectiveness ratio\n", + "E = 0.86; # Effectiveness ratio\n", + "To2 = To1-E*(To1-Tw1); # Outlet temperature of oil in degF\n", + "print \"The outlet temperature of oil is %d degF \"%(To2);\n", + "\n", + "q = mo*Cpo*(To1-To2); # Heat transferred in Btu/hr\n", + "Tw2 = Tw1+(q/(mw*Cpw)); # Outlet temperature of oil in degF\n", + "print \" The outlet tempearture of water is %.1f degF\"%(Tw2);\n", + "\n", + "\n", + "\n", + " \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The outlet temperature of oil is 74 degF \n", + " The outlet tempearture of water is 77.2 degF\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.11 page : 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import zeros, nan\n", + "\n", + "# To compute the temprature distribution\n", + "h = 1.; # Heat transfer coefficient in Btu/hr-ft**2-degF\n", + "x = 1.; # Assumed thickness in ft\n", + "k = 1.; # Thermal conductivity in Btu/hr-ft-degF\n", + "N = h*x/k;\n", + "t0 = 600.;\n", + "t4 = 200.;\n", + "t1 = [500, 550, 550, 525, 525, 512.5, 512.5, 512.5, 506.2, 506.2, 506.2, 506.2, 503.1, 503.1];\n", + "t2 = [450, 450, 450, 450, 425, 425, 425, 412.5, 412.5, 412.5, 406.3, 406.3, 406.3, 403.1];\n", + "t3 = [350, 350, 325, 325 ,325, 325, 312.5, 312.5, 312.5 ,306.3, 306.3, 303.1, 303.1, 303.1];\n", + "th1 = zeros(14)\n", + "th2 = zeros(14)\n", + "th3 = zeros(14)\n", + "th1[0] = nan\n", + "th2[0] = nan\n", + "th3[0] = nan\n", + "\n", + "# Assumed temperatures in degF for points 1 2 & 3 respectively\n", + "for i in range(0,14):\n", + " th1[i] = th1[i]+t0+t2[i]-2*t1[i];\n", + " th2[i] = th2[i]+t1[i]+t3[i]-2*t2[i];\n", + " th3[i] = th3[i]+t2[i]+t4-2*t3[i];\n", + " print \"Assuming t1 = %.1f degF t2 = %.1fdegF t3 = %.1fdegF th1 = %.1f degF th2 = %.1f degF th3 = %.1f degF \"%(t1[i],t2[i],t3[i],th1[i],th2[i],th3[i]);\n", + "\n", + "print \"This way assumption must be continued till all sink strengths are zero\";\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Assuming t1 = 500.0 degF t2 = 450.0degF t3 = 350.0degF th1 = nan degF th2 = nan degF th3 = nan degF \n", + "Assuming t1 = 550.0 degF t2 = 450.0degF t3 = 350.0degF th1 = -50.0 degF th2 = 0.0 degF th3 = -50.0 degF \n", + "Assuming t1 = 550.0 degF t2 = 450.0degF t3 = 325.0degF th1 = -50.0 degF th2 = -25.0 degF th3 = 0.0 degF \n", + "Assuming t1 = 525.0 degF t2 = 450.0degF t3 = 325.0degF th1 = 0.0 degF th2 = -50.0 degF th3 = 0.0 degF \n", + "Assuming t1 = 525.0 degF t2 = 425.0degF t3 = 325.0degF th1 = -25.0 degF th2 = 0.0 degF th3 = -25.0 degF \n", + "Assuming t1 = 512.5 degF t2 = 425.0degF t3 = 325.0degF th1 = 0.0 degF th2 = -12.5 degF th3 = -25.0 degF \n", + "Assuming t1 = 512.5 degF t2 = 425.0degF t3 = 312.5degF th1 = 0.0 degF th2 = -25.0 degF th3 = 0.0 degF \n", + "Assuming t1 = 512.5 degF t2 = 412.5degF t3 = 312.5degF th1 = -12.5 degF th2 = 0.0 degF th3 = -12.5 degF \n", + "Assuming t1 = 506.2 degF t2 = 412.5degF t3 = 312.5degF th1 = 0.1 degF th2 = -6.3 degF th3 = -12.5 degF \n", + "Assuming t1 = 506.2 degF t2 = 412.5degF t3 = 306.3degF th1 = 0.1 degF th2 = -12.5 degF th3 = -0.1 degF \n", + "Assuming t1 = 506.2 degF t2 = 406.3degF t3 = 306.3degF th1 = -6.1 degF th2 = -0.1 degF th3 = -6.3 degF \n", + "Assuming t1 = 506.2 degF t2 = 406.3degF t3 = 303.1degF th1 = -6.1 degF th2 = -3.3 degF th3 = 0.1 degF \n", + "Assuming t1 = 503.1 degF t2 = 406.3degF t3 = 303.1degF th1 = 0.1 degF th2 = -6.4 degF th3 = 0.1 degF \n", + "Assuming t1 = 503.1 degF t2 = 403.1degF t3 = 303.1degF th1 = -3.1 degF th2 = 0.0 degF th3 = -3.1 degF \n", + "This way assumption must be continued till all sink strengths are zero\n" + ] + } + ], + "prompt_number": 22 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering/screenshots/ch1.png b/Elements_of_Mechanical_Engineering/screenshots/ch1.png Binary files differnew file mode 100755 index 00000000..c6caf373 --- /dev/null +++ b/Elements_of_Mechanical_Engineering/screenshots/ch1.png diff --git a/Elements_of_Mechanical_Engineering/screenshots/ch13.png b/Elements_of_Mechanical_Engineering/screenshots/ch13.png Binary files differnew file mode 100755 index 00000000..d7f4c209 --- /dev/null +++ b/Elements_of_Mechanical_Engineering/screenshots/ch13.png diff --git a/Elements_of_Mechanical_Engineering/screenshots/ch7.png b/Elements_of_Mechanical_Engineering/screenshots/ch7.png Binary files differnew file mode 100755 index 00000000..b86d3f11 --- /dev/null +++ b/Elements_of_Mechanical_Engineering/screenshots/ch7.png diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch1.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch1.ipynb new file mode 100755 index 00000000..447111ca --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch1.ipynb @@ -0,0 +1,333 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8f094d0c4cf495fdfc5bbc6742f795b8dc8b4a8387568c58f3d9b226833df09f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Introduction" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1 pg : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "# Calculations\n", + "Q = 84-8.4-21+4.2;\n", + "\n", + "# Results\n", + "print 'The Net Work Done = %2.1f kJ'%(Q); #Displaying result\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Net Work Done = 58.8 kJ\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2 pg : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Declaring values\n", + "Q = -700.;\n", + "W = -3000.;\n", + "m = 5.;\n", + "\n", + "# Calculations\n", + "U = Q-W;\n", + "Us = U/m;\n", + "\n", + "# Results\n", + "print 'Change in Specific Energy = %3.0f J/kg'%(Us); #print laying result\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in Specific Energy = 460 J/kg\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3 pg : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Declaring values\n", + "Q = 50;\n", + "W = 40;\n", + "\n", + "# Calculations\n", + "U = Q-W;\n", + "\n", + "# Results\n", + "print 'Change in Internal Energy = %2.0f kJ'%(U);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in Internal Energy = 10 kJ\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4 pg : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "m = 3000.; #mass in kg\n", + "P = 736.; #Power in kW\n", + "t = 5.*3600; #Time in seconds\n", + "HV = 27170. #Heating value in kJ/kg\n", + "\n", + "# Calculations\n", + "E = P/((m/t)*HV);\n", + "Eff = E*100;\n", + "\n", + "# Results\n", + "print 'Thermal Efficiency = %2.2f %%'%(Eff);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal Efficiency = 16.25 %\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.5 pg : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "U = 22.; #Internal Energy in kJ/s\n", + "P2 = 0.95*1000; #Pressure in kPa\n", + "V2 = 0.09; #Volume in m**3/s;\n", + "P1 = 0.5*1000;\n", + "V1 = 0.15;\n", + "\n", + "# Calculations\n", + "X = (P2*V2)-(P1*V1);\n", + "H = U+X;\n", + "\n", + "# Results\n", + "print 'Change in Enthalpy: %2.1f kJ/s'%(H);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in Enthalpy: 32.5 kJ/s\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.6 pg : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Th = 0.22; #Thermal Efficiency\n", + "Hr = 1260.; #Heat Rejected in MJ/hr\n", + "CV = 42.; #Calorific Value of Coal\n", + "X = 1-Th;\n", + "HI = Hr/X; #Heat Input in MJ/hr\n", + "\n", + "# Calculations\n", + "O = ((HI-Hr)*1000)/3600; #Output\n", + "Mf = HI/CV; #Mass of Fuel Used\n", + "\n", + "# Results\n", + "print 'Power Output is %2.2f kW'%(O);\n", + "print 'Mass of Fuel used per hour: %2.1f kg/hr'%(Mf);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power Output is 98.72 kW\n", + "Mass of Fuel used per hour: 38.5 kg/hr\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.7 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "# Variables\n", + "m = 2.; #mass in kg\n", + "T1 = 30.+273; #Temperature in K\n", + "T2 = 60.+273; \n", + "Cp = 4.187;\n", + "\n", + "# Calculations\n", + "T = T2/T1;\n", + "X = (math.log(T));\n", + "S = m*Cp*X;\n", + "\n", + "# Results\n", + "print 'Entropy Change of Water: %1.4f kJ/K'%(S);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Entropy Change of Water: 0.7906 kJ/K\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.8 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Declaring Values\n", + "m = 600.; #Mass in kg\n", + "z = 50000.; #Dismath.tance in meters\n", + "V = 2500000.; #Velocity in m/hr\n", + "g = 7.9; #Gravitational Field in m/s**2\n", + "\n", + "# Results\n", + "Vel = V/3600;\n", + "KE = (0.5*m*Vel*Vel)/1000000; #Kinetic Energy in MJ\n", + "PE = (m*g*z)/1000000; #Potential Energy in MJ\n", + "\n", + "#Displaying Results\n", + "print 'The Kinetic Energy is %3.2f MJ'%(KE);\n", + "print 'The Potential Energy is %3.2f MJ'%(PE);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Kinetic Energy is 144.68 MJ\n", + "The Potential Energy is 237.00 MJ\n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch13.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch13.ipynb new file mode 100755 index 00000000..da0c4841 --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch13.ipynb @@ -0,0 +1,296 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:63a8f3970ffbe49d9b078bab5bbc3e79ff8dea43fdff0ed63ed5c10d237afeed" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 : Transmission of motion and power" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 pg : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "N1 = 250.;\n", + "D1 = 53.;\n", + "D2 = 32.;\n", + "\n", + "# Calculations\n", + "N2 = N1*(D1/D2);\n", + "\n", + "# Results\n", + "print 'Speed of shaft: %2.2f RPM'%(N2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of shaft: 414.06 RPM\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2 pg : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D1 = 600.;\n", + "D2 = 300.;\n", + "N1 = 100.;\n", + "VR = D1/D2;\n", + "N2 = VR*N1;\n", + "\n", + "# Calculations and Results\n", + "print 'Case One ';\n", + "print 'Velocity Ratio = %2.2f'%(VR);\n", + "\n", + "print 'Speed of driven shaft = %2.2f RPM'%(N2);\n", + "\n", + "\n", + "print 'Case Two ';\n", + "VR = (D1+5)/(D2+5);\n", + "N2 = VR*N1;\n", + "print 'Velocity Ratio = %2.2f'%(VR);\n", + "\n", + "print 'Speed of driven shaft = %2.2f RPM'%(N2);\n", + "\n", + "\n", + "print 'Case Three ';\n", + "S = 4.;\n", + "VR = ((D1+5)/(D2+5))*((100-S)/100.);\n", + "N2 = VR*N1;\n", + "print 'Velocity Ratio = %2.2f'%(VR);\n", + "\n", + "print 'Speed of driven shaft = %2.2f RPM'%(N2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Case One \n", + "Velocity Ratio = 2.00\n", + "Speed of driven shaft = 200.00 RPM\n", + "Case Two \n", + "Velocity Ratio = 1.98\n", + "Speed of driven shaft = 198.36 RPM\n", + "Case Three \n", + "Velocity Ratio = 1.90\n", + "Speed of driven shaft = 190.43 RPM\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.3 pg : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D1 = 0.3;\n", + "D2 = 0.2;\n", + "C = 3.;\n", + "\n", + "# Calculations\n", + "L1 = ((22./7)*(1./2)*(D1+D2))+(((D1+D2)**2)/(4*C))+(2*C);\n", + "L2 = ((22./7)*(1./2)*(D1+D2))+(((D1-D2)**2)/(4*C))+(2*C);\n", + "L = L2-L1;\n", + "\n", + "# Results\n", + "print 'The belt length is to be reduced by %2.4f mm'%((-L)*1000);\n", + "\n", + "# note : answer is differ because of rounding off error. check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The belt length is to be reduced by 20.0000 mm\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.4 pg : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "D = 1.;\n", + "P = 5000.;\n", + "N = 250.;\n", + "Mew = 0.25;\n", + "PP = 20.;\n", + "Theta = 170*(22./7)*(1./180);\n", + "V = ((22./7)*D*N)/60;\n", + "\n", + "# Calculations\n", + "T12 = math.exp(Mew*Theta)-1;\n", + "T2 = (P/(V*T12));\n", + "T1 = (T12+1)*T2;\n", + "W = T1/PP;\n", + "\n", + "# Results\n", + "print 'Width of belt = %2.2f mm'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Width of belt = 36.44 mm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.5 pg : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "N1 = 1000.;\n", + "Z1 = 30.;\n", + "Z2 = 45.;\n", + "Z3 = 75.;\n", + "\n", + "# Calculations\n", + "N13 = Z3/Z1;\n", + "N3 = N1/N13;\n", + "\n", + "# Results\n", + "print 'Velocity Ratio of gear train = %2.1f '%(N13);\n", + "print 'N3 = %2.1f RPM'%(N3);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Velocity Ratio of gear train = 2.5 \n", + "N3 = 400.0 RPM\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.6 pg : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Na = 600.;\n", + "Za = 25.;\n", + "Zb = 50.;\n", + "Zc = 20.;\n", + "Zd = 40.;\n", + "\n", + "# Calculations\n", + "Nad = (Zb/Za)*(Zd/Zc);\n", + "Nd = Na/Nad;\n", + "\n", + "# Results\n", + "print 'Speed of Output Shaft = %2.1f RPM'%(Nd);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of Output Shaft = 150.0 RPM\n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch3.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch3.ipynb new file mode 100755 index 00000000..8865390a --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch3.ipynb @@ -0,0 +1,2365 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:6e5f6450704919e896069fe3805078dc314d91fc4c78029656065034fd428eff" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Properties of Gases" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 pg : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Declaring Values\n", + "V = 3.; #Volume in m**3\n", + "P1 = 2500.; #Pressure in kilobar\n", + "P2 = 1500.;\n", + "T2 = 21.+273; #Temperature in Kelvin\n", + "T1 = (T2*P1)/P2;\n", + "\n", + "# Calculations\n", + "Cp = 1.005;\n", + "Cv = 0.718;\n", + "R = Cp-Cv; #Universal Gas Consmath.tant\n", + "m = (P1*V)/(R*T1); #Calculating mass\n", + "H = m*Cp*(T2-T1);\n", + "U = m*Cv*(T2-T1);\n", + "Q = U; #Since Consmath.tant Volume Process: Work Done = 0\n", + "\n", + "#Displaying Results\n", + "print 'Change in Enthalpy: %5.2f kJ'%(H);\n", + "print 'Change in Internal Energy: %5.f kJ'%(U);\n", + "print 'Heat Transfer: %4.f kJ'%(Q);\n", + "print 'As Answer is negative, system rejects heat'\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in Enthalpy: -10505.23 kJ\n", + "Change in Internal Energy: -7505 kJ\n", + "Heat Transfer: -7505 kJ\n", + "As Answer is negative, system rejects heat\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 pg : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "m = 1.; #Mass in kg\n", + "P1 = 7.; #Pressure in bar\n", + "T1 = 90.+273; #Temperature in K\n", + "P2 = 1.4;\n", + "R = 0.287;\n", + "G = 1.4; #Gamma for air\n", + "\n", + "#Calculations according to data required\n", + "x = P2/P1;\n", + "y = 0.1/1.1;\n", + "z = x**y;\n", + "T2 = T1*z; #calculating T2\n", + "print 'Final Temperature is: %3.1f K'%(T2);\n", + "\n", + "W = (m*R*(T1-T2))/(1.1-1);\n", + "print 'Work Done is: %3.1f kJ'%(W);\n", + "\n", + "Cv = (R)/(G-1);\n", + "Cp = R+Cv;\n", + "CI = m*Cv*(T2-T1);\n", + "print 'Change in Internal Energy is: %3.2f kJ'%(CI);\n", + "\n", + "Q = CI+W;\n", + "print 'Heat Transfer is: %3.2f kJ'%(Q);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final Temperature is: 313.6 K\n", + "Work Done is: 141.8 kJ\n", + "Change in Internal Energy is: -35.45 kJ\n", + "Heat Transfer is: 106.35 kJ\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 2.75*100; #Pressure in kPa\n", + "V1 = 0.09 #Volume in m**3\n", + "T1 = 185.+273; #Temperature in Kelvin\n", + "T2 = 15.+273;\n", + "R = 0.29;\n", + "Cp = 1.005;\n", + "Cv = 0.715;\n", + "\n", + "# Calculations and Results\n", + "m = (P1*V1)/(R*T1);\n", + "V2 = (T2/T1)*V1;\n", + "W = P1*(V2-V1);\n", + "print 'The Work Done: %2.3f kJ'%(W);\n", + "\n", + "Q = m*Cp*(T2-T1);\n", + "print 'The Heat Transfer: %2.2f kJ'%(Q);\n", + "\n", + "U = Q-W;\n", + "print 'The change in Internal Energy: %2.2f kJ'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Work Done: -9.187 kJ\n", + "The Heat Transfer: -31.84 kJ\n", + "The change in Internal Energy: -22.65 kJ\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 pg : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "m = 0.67;\n", + "P1 = 14.;\n", + "T1 = 290.+273;\n", + "R = 287.;\n", + "\n", + "# Calculations and Results\n", + "V1 = (m*R*T1)/(14*(10**5));\n", + "print 'The Volume: %2.3f kJ'%(V1);\n", + "\n", + "V2 = 4*V1;\n", + "print 'The Final Volume: %2.3f kJ'%(V2);\n", + "\n", + "x = V1/V2;\n", + "y = x**1.3;\n", + "P2 = P1*y;\n", + "print 'The Final Pressure: %2.2f bar'%(P2);\n", + "\n", + "x = V1/V2;\n", + "y = x**0.3;\n", + "T2 = T1*y;\n", + "print 'The Final Temperature: %2.2f K'%(T2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Volume: 0.077 kJ\n", + "The Final Volume: 0.309 kJ\n", + "The Final Pressure: 2.31 bar\n", + "The Final Temperature: 371.44 K\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 pg : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P1 = 510.;\n", + "V1 = 0.142;\n", + "P2 = 170.;\n", + "V2 = 0.275;\n", + "H = -65.;\n", + "Cv = 0.718;\n", + "\n", + "# Calculations and Results\n", + "X = (P2*V2)-(P1*V1);\n", + "U = H-X;\n", + "print 'The Change in Internal Energy: %2.2f kJ'%(U);\n", + "\n", + "G = H/U;\n", + "Cp = G*Cv;\n", + "R = Cp-Cv;\n", + "print 'The Value of R: %2.3f kJ/kg K'%(R);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Change in Internal Energy: -39.33 kJ\n", + "The Value of R: 0.469 kJ/kg K\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.6 pg : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P1 = 25.;\n", + "T1 = 27.+273;\n", + "P2 = 5.;\n", + "T2 = 20.+273;\n", + "V1 = 0.7;\n", + "Et = 1.43;\n", + "Pn = 101.325;\n", + "Tn = 273.;\n", + "\n", + "#Calculations\n", + "R = (Pn)/(Et*Tn);\n", + "m1 = (Pn*V1)/(R*Tn);\n", + "V2 = (m1*R*T1)/(P1*100);\n", + "m2 = (P2*100*V2)/(R*T2);\n", + "mf = m1-m2;\n", + "\n", + "# Results\n", + "print 'The mass of Oxygen used: %3.3f kg'%(mf);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mass of Oxygen used: 0.796 kg\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.7 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "n = 1.3;\n", + "m = 1.;\n", + "T1 = 300.;\n", + "T2 = 200.;\n", + "W = 90.;\n", + "Ro = 8.3143;\n", + "\n", + "# Calculations\n", + "R = ((n-m)*W)/((T1-T2)*m);\n", + "M = Ro/R;\n", + "\n", + "# Results\n", + "print 'The molecular mass of gas is: %3.1f kg/kg mole'%(M);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The molecular mass of gas is: 30.8 kg/kg mole\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.8 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "m = 0.18;\n", + "V1 = 0.15;\n", + "T1 = 15.+273;\n", + "P1 = 100.;\n", + "V2 = 0.056;\n", + "P2 = 400.;\n", + "\n", + "# Calculations and Results\n", + "R = (P1*V1)/(m*T1);\n", + "print 'The Gas Consmath.tant: %3.3f kJ/kg K'%(R);\n", + "\n", + "M = 8.3141/R;\n", + "print 'The Molecular Mass of Gas: %3.2f kg/kg mole'%(M);\n", + "\n", + "x = math.log(P2/P1);\n", + "y = math.log(V2/V1);\n", + "G = -(x/y);\n", + "Cv = R/(G-1);\n", + "print 'The Cv: %3.2f kJ/kg K'%(Cv);\n", + "\n", + "Cp = Cv+R;\n", + "print 'The Cp: %3.2f kJ/kg K'%(Cp);\n", + "\n", + "x = (G-1)/G;\n", + "y = P2/P1;\n", + "z = y**x;\n", + "T2 = T1*z;\n", + "U = m*Cv*(T2-T1);\n", + "print 'The change in Internal Energy: %3.2f kJ'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Gas Consmath.tant: 0.289 kJ/kg K\n", + "The Molecular Mass of Gas: 28.73 kg/kg mole\n", + "The Cv: 0.71 kJ/kg K\n", + "The Cp: 1.00 kJ/kg K\n", + "The change in Internal Energy: 18.18 kJ\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.9 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P1 = 100.;\n", + "V1 = 0.25;\n", + "T1 = 100.+273;\n", + "V2 = 0.05;\n", + "P2 = 750.;\n", + "G = 1.4;\n", + "R = 0.298;\n", + "\n", + "# Calculations and Results\n", + "n = (math.log(P2/P1))/(math.log(V1/V2));\n", + "print 'The Index n: %1.2f '%(n);\n", + "\n", + "T2 = T1*((P2/P1)**((n-1)/n));\n", + "Cv = R/(G-1);\n", + "Cp = R+Cv;\n", + "m = (P1*V1)/(R*T1);\n", + "W = (m*R*(T1-T2))/(n-1);\n", + "Q = ((G-n)/(G-1))*W;\n", + "print 'The Heat change: %2.2f kJ'%(Q);\n", + "\n", + "U = m*Cv*(T2-T1);\n", + "print 'The change in Internal Energy: %2.2f kJ'%(U);\n", + "\n", + " \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Index n: 1.25 \n", + "The Heat change: -18.37 kJ\n", + "The change in Internal Energy: 31.25 kJ\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.13 pg : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "m = 1.;\n", + "P2 = 25.;\n", + "P1 = 1.;\n", + "pV = 260.;\n", + "T1 = 17.+273;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1;\n", + "V1 = (pV*T1)/(P1*100000);\n", + "print 'As process is Isothermal, Initial and Final Temperatures are same ';\n", + "print 'The Final Temperature: %3.0f K'%(T1);\n", + "\n", + "V2 = (pV*T2)/(P2*100000);\n", + "print 'The Final Volume: %3.5f m**3'%(V2);\n", + "\n", + "CR = P2/P1;\n", + "print 'The Compression Ratio: %3.0f '%(CR);\n", + "\n", + "print 'Change in Enthalpy is zero as it is Isothermal process ';\n", + "W = P1*100*V1*(math.log(P1/P2));\n", + "print 'Work Done is: %3.1f kJ'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "As process is Isothermal, Initial and Final Temperatures are same \n", + "The Final Temperature: 290 K\n", + "The Final Volume: 0.03016 m**3\n", + "The Compression Ratio: 25 \n", + "Change in Enthalpy is zero as it is Isothermal process \n", + "Work Done is: -242.7 kJ\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.14 pg : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P2 = 6.;\n", + "Cp = 1.75;\n", + "P1 = 1.;\n", + "n = 1.3;\n", + "T1 = 30.+273;\n", + "M = 30.;\n", + "m = 2.;\n", + "Ro = 8314.4;\n", + "\n", + "# Calculations and Results\n", + "R = (Ro/M)/1000;\n", + "print 'The Gas Consmath.tant: %3.3f kJ/kg K'%( R);\n", + "\n", + "Cv = Cp-R;\n", + "G = Cp/Cv;\n", + "print 'The value of Gamma: %1.2f '%(G);\n", + "\n", + "T2 = (T1)*((P2/P1)**((n-1)/n));\n", + "print 'Final Temperature: %3.2f K'%(T2);\n", + "\n", + "W = (m*R*(T1-T2))/(n-1);\n", + "print 'The work done on the gas: %3.2f kJ'%(W);\n", + "\n", + "Q = ((G-n)/(G-1))*W;\n", + "print 'The Heat Transfer is %3.2f kJ'%(Q);\n", + "\n", + "U = m*Cv*(T2-T1);\n", + "print 'The change in Internal Energy is %3.2f kJ'%(U);\n", + "\n", + "# note : answer may vary because of rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Gas Consmath.tant: 0.277 kJ/kg K\n", + "The value of Gamma: 1.19 \n", + "Final Temperature: 458.16 K\n", + "The work done on the gas: -286.68 kJ\n", + "The Heat Transfer is 170.37 kJ\n", + "The change in Internal Energy is 457.05 kJ\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.15 pg : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P1 = 350.;\n", + "P2 = 130.;\n", + "R = 0.287;\n", + "T1 = 450.;\n", + "G = 1.4;\n", + "m = 1.;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1*((P2/P1)**((G-1)/G));\n", + "W = (m*R*(T1-T2))/(G-1);\n", + "print 'Amount of External Work done: %3.2f kJ/kg'%(W);\n", + "\n", + "U = -W;\n", + "print 'Change in Internal Energy: %3.2f kJ/kg'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of External Work done: 79.58 kJ/kg\n", + "Change in Internal Energy: -79.58 kJ/kg\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.16 pg : 33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P1 = 1.5;\n", + "V1 = 0.1;\n", + "V2 = 0.04;\n", + "P2 = 7.5;\n", + "T1 = 30+273;\n", + "\n", + "# Calculations\n", + "#Umath.sing ideal gas equation\n", + "T2 = (P2*V2*T1)/(P1*V1);\n", + "\n", + "# Results\n", + "print 'The Value of Temperature of gas: %3.0f C'%(T2 - 273);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Value of Temperature of gas: 333 C\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.17 pg : 33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P1 = 1.5;\n", + "V1 = 3.;\n", + "T1 = 27.+273;\n", + "P2 = 30.;\n", + "T2 = 60.+273;\n", + "R = 0.287;\n", + "\n", + "# Calculations and Results\n", + "m1 = (P1*100*V1)/(R*T1);\n", + "m2 = (P2*100*V1)/(R*T2);\n", + "\n", + "m = m2-m1;\n", + "print 'The mass pumped: %2.2f kg'%(m);\n", + "\n", + "V = (m*R*(17+273))/(1*100);\n", + "\n", + "print 'Volume: %2.2f m**3'%(V);\n", + "\n", + "\n", + "T3 = 27+273;\n", + "P3 = (T3*P2)/T2;\n", + "\n", + "print 'Final air pressure in the vessel: %2.2f bar'%(P3);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mass pumped: 88.94 kg\n", + "Volume: 74.03 m**3\n", + "Final air pressure in the vessel: 27.03 bar\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.18 pg : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 1.5;\n", + "m = 2.;\n", + "T1 = 27.+273;\n", + "T2 = 207.+273;\n", + "V2 = V1;\n", + "M = 28.;\n", + "Ro = 8.314;\n", + "\n", + "# Calculations and Results\n", + "R = Ro/M;\n", + "P1 = (m*R*T1)/V1;\n", + "print 'The initial pressure of gas: %3.3f bar'%(P1/100);\n", + "\n", + "P2 = (P1*T2)/T1;\n", + "print 'The final pressure of gas: %3.3f bar'%(P2/100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The initial pressure of gas: 1.188 bar\n", + "The final pressure of gas: 1.900 bar\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.19 pg : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "T1 = 27.+273;\n", + "V1 = 0.06;\n", + "P1 = 150.;\n", + "Ro = 8.314;\n", + "M = 28.;\n", + "\n", + "# Calculations and Results\n", + "R = Ro/M;\n", + "m = (P1*100*V1)/(R*T1);\n", + "print 'Mass of gas at design condition: %2.1f kg'%(m);\n", + "\n", + "P2 = 170.;\n", + "T2 = (T1*P2)/P1;\n", + "print 'Fusible plug should melt at: %3.0f K'%(T2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of gas at design condition: 10.1 kg\n", + "Fusible plug should melt at: 340 K\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.20 pg : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P1 = 7.;\n", + "m = 3.7;\n", + "V1 = 1.5;\n", + "P2 = 1.4;\n", + "V2 = 4.5;\n", + "U = 648.;\n", + "Cv = 1.05;\n", + "\n", + "# Calculations and Results\n", + "RT1 = (P1*100*V1)/(m);\n", + "RT2 = (P2*100*V2)/(m);\n", + "\n", + "RT = RT1-RT2;\n", + "T = (U)/(m*Cv);\n", + "R = (RT/T)\n", + "print 'The value of R: %1.3f kJ/kg K'%(R);\n", + "\n", + "\n", + "Cp = Cv+R;\n", + "H = m*Cp*(-T);\n", + "print 'The change in enthalpy is: %4.2f kJ'%(H);\n", + "\n", + "\n", + "T1 = RT1/R;\n", + "T2 = RT2/R;\n", + "\n", + "print 'Initial Temperature: %3.2f K '%(T1);\n", + "print 'Final Temperature: %3.f K '%(T2);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of R: 0.681 kJ/kg K\n", + "The change in enthalpy is: -1068.00 kJ\n", + "Initial Temperature: 416.99 K \n", + "Final Temperature: 250 K \n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.21 pg : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V = 1.6;\n", + "P = 1.;\n", + "m = 2.;\n", + "T = 17.+273;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "R = (P*100*V)/(m*T);\n", + "Cv = (R)/(G-1);\n", + "print 'The Value of Cv: %1.2f kJ/kg K'%(Cv);\n", + "\n", + "\n", + "Cp = Cv+R;\n", + "print 'The Value of Cp: %1.3f kJ/kg K'%(Cp);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Value of Cv: 0.69 kJ/kg K\n", + "The Value of Cp: 0.966 kJ/kg K\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.22 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 0.091;\n", + "P1 = 2.73;\n", + "T1 = 187.+273;\n", + "T2 = 27.+273;\n", + "Cp = 1.005;\n", + "Cv = 0.718;\n", + "\n", + "# Calculations and Results\n", + "R = Cp-Cv;\n", + "\n", + "m = (P1*100*V1)/(R*T1);\n", + "Q = m*Cp*(T2-T1);\n", + "print 'The Value of heat transferred: %1.2f kJ'%(Q);\n", + "\n", + "\n", + "V2 = (T2*V1)/T1;\n", + "W = P1*100*(V2-V1);\n", + "print 'The Value of Work done: %1.2f kJ'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Value of heat transferred: -30.26 kJ\n", + "The Value of Work done: -8.64 kJ\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.23 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "m = 28.;\n", + "V1 = 3.;\n", + "T1 = 100.+273;\n", + "T2 = 37.+273;\n", + "G = 1.4;\n", + "Ro = 8.314;\n", + "\n", + "# Calculations and Results\n", + "v = V1/m;\n", + "R = Ro/m;\n", + "\n", + "P1 = (m*R*T1)/V1;\n", + "\n", + "print 'The Specific Volume: %1.3f m**3/kg'%(v);\n", + "\n", + "\n", + "print 'The Initial Pressure: %1.2f kPa'%(P1);\n", + "\n", + "\n", + "P2 = (P1*T2)/T1;\n", + "print 'The Final Pressure: %1.2f kPa'%(P2);\n", + "\n", + "\n", + "Cv = (R)/(G-1);\n", + "Cp = Cv*G;\n", + "U = m*Cv*(T2-T1);\n", + "H = m*Cp*(T2-T1);\n", + "\n", + "print 'Change in Internal Energy: %1.2f kJ'%(U);\n", + "\n", + "\n", + "\n", + "print 'Change in Heat energy: %1.2f kJ'%(H);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Specific Volume: 0.107 m**3/kg\n", + "The Initial Pressure: 1033.71 kPa\n", + "The Final Pressure: 859.11 kPa\n", + "Change in Internal Energy: -1309.46 kJ\n", + "Change in Heat energy: -1833.24 kJ\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.24 pg : 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 3.;\n", + "V1 = V1*100; #In kPa\n", + "P1 = 2.;\n", + "T1 = 73.+273;\n", + "P2 = 7.;\n", + "R = 0.287;\n", + "Cv = 0.718;\n", + "Cp = 1.005;\n", + "\n", + "# Calculations\n", + "m = (P1*V1)/(R*T1);\n", + "T2 = (P2*T1)/P1;\n", + "\n", + "U = m*Cv*(T2-T1);\n", + "H = m*Cp*(T2-T1);\n", + "\n", + "# Results\n", + "print 'Change in Internal Energy: %1.2f kJ'%(U);\n", + "print 'Change in heat Energy: %1.2f kJ'%(H);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in Internal Energy: 3752.61 kJ\n", + "Change in heat Energy: 5252.61 kJ\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.25 pg : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "m = 1.;\n", + "T1 = 27.+273;\n", + "T2 = 197.+273;\n", + "V1 = 2.1;\n", + "R = 0.287;\n", + "Cp = 1.005;\n", + "\n", + "# Calculations and Results\n", + "W = m*R*(T2-T1);\n", + "print 'Work Done: %1.2f kJ'%(W);\n", + "\n", + "\n", + "Q = m*Cp*(T2-T1);\n", + "U = Q-W;\n", + "\n", + "print 'Change in Heat Energy: %1.2f kJ'%(Q);\n", + "print 'Change in Internal Energy: %1.2f kJ'%(U);\n", + "\n", + "\n", + "P = (m*R*T1)/(V1);\n", + "V2 = (V1*T2)/(T1);\n", + "print 'Pressure: %1.2f kPa'%(P);\n", + "print 'Final Volume: %1.1f m**3'%(V2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work Done: 48.79 kJ\n", + "Change in Heat Energy: 170.85 kJ\n", + "Change in Internal Energy: 122.06 kJ\n", + "Pressure: 41.00 kPa\n", + "Final Volume: 3.3 m**3\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.26 pg : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 0.5;\n", + "P1 = 0.3;\n", + "V2 = 0.1;\n", + "\n", + "# Calculations and Results\n", + "P2 = (P1*V1)/(V2);\n", + "print 'Final Pressure: %1.2f bar'%(P2);\n", + "\n", + "W = (P1*100*V1)*(math.log(V2/V1));\n", + "print 'Work Done: %1.2f kJ'%(W);\n", + "print 'Change in Internal Energy: 0 kJ as it is Isothermal Process';\n", + "print 'Change in Heat Energy: %1.2f kJ'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final Pressure: 1.50 bar\n", + "Work Done: -24.14 kJ\n", + "Change in Internal Energy: 0 kJ as it is Isothermal Process\n", + "Change in Heat Energy: -24.14 kJ\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.27 pg : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "m = 0.19;\n", + "P1 = 1.;\n", + "V1 = 0.16;\n", + "T1 = 17.+273;\n", + "P2 = 4.1;\n", + "V2 = 0.046;\n", + "Ro = 8.314;\n", + "\n", + "# Calculations and Results\n", + "R = (P1*100*V1)/(m*T1);\n", + "print 'Gas Constant: %1.2f kJ/kg K'%(R);\n", + "\n", + "M = Ro/R;\n", + "print 'Molecular Mass: %1.2f kg/kg mole'%(M);\n", + "\n", + "G = (math.log(P1/P2))/(math.log(V2/V1));\n", + "print 'Ratio of Specific Heats: %1.2f '%(G);\n", + "\n", + "Cv = (R)/(G-1);\n", + "print 'Value of Cv: %1.2f kJ/kg K'%(Cv);\n", + "\n", + "Cp = G*Cv;\n", + "print 'Value of Cp: %1.2f kJ/kg K'%(Cp);\n", + "\n", + "T2 = (P2*100*V2)/(m*R);\n", + "U = m*Cv*(T2-T1);\n", + "print 'Change in Internal Energy: %1.2f kJ'%(U);\n", + "\n", + "H = m*Cp*(T2-T1);\n", + "print 'Heat Transfer: %1.2f kJ'%(H);\n", + "\n", + "W = ((P1*100*V1)-(P2*100*V2))/(G-1);\n", + "print 'Work Done: %1.2f kJ'%(W);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Gas Constant: 0.29 kJ/kg K\n", + "Molecular Mass: 28.63 kg/kg mole\n", + "Ratio of Specific Heats: 1.13 \n", + "Value of Cv: 2.20 kJ/kg K\n", + "Value of Cp: 2.49 kJ/kg K\n", + "Change in Internal Energy: 21.68 kJ\n", + "Heat Transfer: 24.54 kJ\n", + "Work Done: -21.68 kJ\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.28 pg : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 0.19;\n", + "P1 = 5.;\n", + "T1 = 190.+273;\n", + "P2 = 1.;\n", + "H = 100.;\n", + "G = 1.4;\n", + "R = 0.287;\n", + "Cp = 1.005;\n", + "\n", + "# Calculations\n", + "V2 = V1*((P1/P2)**(1./G));\n", + "W = ((P1*100*V1)-(P2*100*V2))/(G-1);\n", + "m = (P1*100*V1)/(R*T1);\n", + "T2 = T1*((P2/P1)**((G-1)/G))\n", + "x = H/(m*Cp);\n", + "T3 = x+T2;\n", + "\n", + "V3 = (V2*T3)/T2;\n", + "Wo = P2*100*(V3-V2);\n", + "Wf = W+Wo;\n", + "\n", + "# Results\n", + "print 'Total Work Done: %1.2f kJ'%(Wf);\n", + "\n", + "# note: rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total Work Done: 116.10 kJ\n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.29 pg : 42" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 0.1;\n", + "V3 = V1;\n", + "P1 = 10.;\n", + "T1 = 200.+273;\n", + "P2 = 3.;\n", + "R = 0.287;\n", + "G = 1.4;\n", + "Cv = 0.718;\n", + "\n", + "# Calculations and Results\n", + "m = (P1*100*V1)/(R*T1);\n", + "T2 = T1*((P2/P1)**((G-1)/G));\n", + "V2 = V1*((P1/P2)**((1)/G));\n", + "T3 = T2;\n", + "P3 = (P2*V2)/V3;\n", + "print 'Pressure after Isothermal Compression: %1.2f bar'%(P3);\n", + "print 'Temperature after isothermal compression: %1.2f K'%(T2);\n", + "\n", + "W1 = ((P1*100*V1)-(P2*100*V2))/(G-1);\n", + "print 'Work Developed during adiabatic expansion: %2.0f kJ'%(W1);\n", + "\n", + "W2 = (P2*100*V2)*math.log(V3/V2);\n", + "print 'Work of Compression: %1.2f kJ'%(W2);\n", + "\n", + "Q = m*Cv*(T1-T3);\n", + "print 'Heat supplied in 3rd Process: %1.2f kJ'%(Q);\n", + "\n", + "U = m*Cv*(T2-T1);\n", + "print 'Change in Internal Energy: %1.2f kJ'%(U);\n", + "\n", + "# note: rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure after Isothermal Compression: 7.09 bar\n", + "Temperature after isothermal compression: 335.33 K\n", + "Work Developed during adiabatic expansion: 73 kJ\n", + "Work of Compression: -60.97 kJ\n", + "Heat supplied in 3rd Process: 72.82 kJ\n", + "Change in Internal Energy: -72.82 kJ\n" + ] + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.30 pg : 44" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "V1 = 0.028;\n", + "P1 = 1.;\n", + "T1 = 27.+273;\n", + "n = 1.3;\n", + "V2 = 0.0046;\n", + "T3 = T1;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1*((V1/V2)**(n-1));\n", + "print 'Temperature after compression: %1.2f K'%(T2);\n", + "\n", + "\n", + "P2 = P1*((V1/V2)**n);\n", + "W = ((P1*100*V1)-(P2*100*V2))/(n-1);\n", + "print 'Work Done: %1.2f kJ'%(W);\n", + "\n", + "\n", + "P3 = (T3*P2)/T2;\n", + "print 'Final Pressure: %1.2f bar'%(P3);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature after compression: 515.75 K\n", + "Work Done: -6.71 kJ\n", + "Final Pressure: 6.09 bar\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.31 pg : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 0.15;\n", + "P1 = 900.;\n", + "T1 = 300.+273;\n", + "T3 = T1;\n", + "V2 = 3*V1;\n", + "R = 0.287;\n", + "Cp = 1.005;\n", + "G = 1.4;\n", + "n = 1.5;\n", + "Cv = 0.718;\n", + "\n", + "# Calculations and Results\n", + "m = (P1*V1)/(R*T1);\n", + "T2 = (V2*T1)/V1;\n", + "Q1 = m*Cp*(T2-T1);\n", + "print 'Heat Received: %3.2f kJ'%(Q1);\n", + "\n", + "\n", + "Q2 = (m*Cv)*((n-G)/(n-1))*(T3-T2);\n", + "Q3 = m*R*T3*(math.log(1./27));\n", + "Qr = 0-(Q2+Q3);\n", + "print 'Heat Rejected: %3.2f kJ'%(Qr);\n", + "\n", + "\n", + "Eff = (1-(Qr/Q1))*100;\n", + "print 'Efficiency: %3.2f percent'%(Eff);\n", + "\n", + "# rounding off error.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat Received: 945.47 kJ\n", + "Heat Rejected: 580.03 kJ\n", + "Efficiency: 38.65 percent\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.32 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "M = 27.;\n", + "P1 = 1.;\n", + "T1 = 60.+273;\n", + "n = 1.3;\n", + "Cvm = 21.;\n", + "Ro = 8.314;\n", + "R = Ro/M;\n", + "\n", + "# Calculations and Results\n", + "V1 = (R*T1)/(P1*100);\n", + "V2 = V1/12;\n", + "x = V1/V2;\n", + "P2 = P1*(x**n);\n", + "W = ((P1*100*V1)-(P2*100*V2))/(n-1);\n", + "print 'Work Done: %3.2f kJ/kg'%(W);\n", + "\n", + "\n", + "Cv = Cvm/M;\n", + "Cp = Cv+R;\n", + "G = Cp/Cv;\n", + "\n", + "Q = ((G-n)/(G-1))*W;\n", + "print 'Heat Transfer during the process: %3.2f kJ/kg'%(Q);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work Done: -378.52 kJ/kg\n", + "Heat Transfer during the process: -91.69 kJ/kg\n" + ] + } + ], + "prompt_number": 47 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.33 pg : 48" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "D = 0.550;\n", + "L = 0.740;\n", + "r = 12.;\n", + "P1 = 100.;\n", + "T1 = 27.+273;\n", + "n = 1.32;\n", + "R = 0.287;\n", + "G = 1.4;\n", + "V = ((22./7)/4)*D*D*L;\n", + "V2 = V/11;\n", + "\n", + "# Calculations and Results\n", + "V1 = V2+V;\n", + "P2 = P1*((r)**n);\n", + "T2 = T1*((r)**(n-1));\n", + "print 'The Pressure at end of Compression: %3.3f kPa'%(P2);\n", + "\n", + "print 'The Temperature at end of Compression: %3.3f K'%(T2);\n", + "\n", + "m = (P1*V1)/(R*T1);\n", + "print 'The Mass in the cylinder: %3.3f kg'%(m);\n", + "\n", + "W = ((P1*V1)-(P2*V2))/(n-1);\n", + "print 'The Work Done: %3.3f kJ'%(W);\n", + "\n", + "Q = ((G-n)/(G-1))*W;\n", + "print 'The Heat Transfer: %3.3f kJ'%(Q);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Pressure at end of Compression: 2657.781 kPa\n", + "The Temperature at end of Compression: 664.445 K\n", + "The Mass in the cylinder: 0.223 kg\n", + "The Work Done: -72.840 kJ\n", + "The Heat Transfer: -14.568 kJ\n" + ] + } + ], + "prompt_number": 49 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.34 pg : 49" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "m = 1.;\n", + "P1 = 10.;\n", + "T1 = 337.+273;\n", + "P2 = 1.;\n", + "V = 6.;\n", + "R = 0.287;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "x = math.log(P2/P1);\n", + "y = math.log(1./V);\n", + "n = x/y;\n", + "print 'The Value of n: %3.3f '%(n);\n", + "\n", + "V1 = (m*R*T1)/(P1*100);\n", + "V2 = V1*6;\n", + "W = ((P1*100*V1)-(P2*100*V2))/(n-1);\n", + "print 'The Work Done: %3.1f kJ'%(W);\n", + "\n", + "Q = ((G-n)/(G-1))*W;\n", + "print 'The Heat Transfer: %3.2f kJ'%(Q);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Value of n: 1.285 \n", + "The Work Done: 245.6 kJ\n", + "The Heat Transfer: 70.56 kJ\n" + ] + } + ], + "prompt_number": 50 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.37 pg : 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "T1 = 430.;\n", + "T2 = 289.25;\n", + "P2 = 100.;\n", + "P1 = 400.;\n", + "G = 1.4;\n", + "V1 = 0.2;\n", + "R = 287.;\n", + "Q = 60.;\n", + "Cp = 1.005;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1*((P2/P1)**((G-1)/G));\n", + "V2 = V1*((P1/P2)**(1./G));\n", + "m = (P1*1000*V1)/(R*T1);\n", + "W1 = (m*(R/1000)*(T1-T2))/(G-1);\n", + "T3 = (Q/(m*Cp))+T2;\n", + "V3 = (V2*T3)/T2;\n", + "W2 = P2*(V3-V2);\n", + "W = W1+W2;\n", + "print 'The Net Work Done: %3.3f kJ'%(W);\n", + "\n", + "n = ((m*(R/1000)*(T1-T3))/W)+1;\n", + "print 'The value of n: %3.2f '%(n);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Net Work Done: 82.544 kJ\n", + "The value of n: 1.11 \n" + ] + } + ], + "prompt_number": 51 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.38 pg : 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg Km = 1;\n", + "P1 = 6.;\n", + "V1 = 0.01;\n", + "V2 = 0.05;\n", + "P2 = 2;\n", + "\n", + "# Calculations and Results\n", + "W1 = (((P1+P2)/2)*100)*(V2-V1);\n", + "print 'The Work done for first cycle: %3.1f kJ'%(W1);\n", + "\n", + "P3 = P2;\n", + "V3 = (P1*V1)/P3;\n", + "W2 = P2*100*(V3-V2);\n", + "print 'The Work done for second cycle: %3.1f kJ'%(W2);\n", + "\n", + "W3 = (P3*100*V3)*(math.log(V1/V3));\n", + "print 'The Work done for third cycle: %3.2f kJ'%(W3);\n", + "\n", + "W = W1+W2+W3;\n", + "print 'The net Work done: %3.2f kJ'%(W);\n", + "\n", + "Q = W; #As process is cyclic\n", + "print 'The Heat Transfer: %3.2f kJ'%(Q);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Work done for first cycle: 16.0 kJ\n", + "The Work done for second cycle: -4.0 kJ\n", + "The Work done for third cycle: -6.59 kJ\n", + "The net Work done: 5.41 kJ\n", + "The Heat Transfer: 5.41 kJ\n" + ] + } + ], + "prompt_number": 52 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.39 pg : 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 0.6;\n", + "P1 = 1.;\n", + "T1 = 90.+273;\n", + "V2 = 0.18;\n", + "P2 = 5.;\n", + "R = 0.287;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "m = (P1*100*V1)/(R*T1);\n", + "print 'The mass of Gas: %3.4f kg'%(m);\n", + "\n", + "n = (math.log(P2/P1))/(math.log(V1/V2));\n", + "print 'The value of n: %3.3f '%(n);\n", + "\n", + "Cv = R/(G-1);\n", + "T2 = ((P2*V2)/(P1*V1))*T1;\n", + "U = m*Cv*(T2-T1);\n", + "print 'The change in Internal Energy: %3.3f kJ'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mass of Gas: 0.5759 kg\n", + "The value of n: 1.337 \n", + "The change in Internal Energy: 75.000 kJ\n" + ] + } + ], + "prompt_number": 53 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.40 pg : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "R = 0.29;\n", + "Cp = 1.005;\n", + "P1 = 2.75;\n", + "P2 = P1;\n", + "V1 = 0.09;\n", + "T1 = 185+273;\n", + "T2 = 15+273;\n", + "\n", + "# Calculations and Results\n", + "V2 = (V1*T2)/T1;\n", + "m = (P1*100*V1)/(R*T1);\n", + "Q = m*Cp*(T2-T1);\n", + "print 'The Heat Transfer: %3.3f kJ'%(Q);\n", + "\n", + "W = P1*100*(V2-V1);\n", + "print 'The Work done: %3.3f kJ'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Heat Transfer: -31.837 kJ\n", + "The Work done: -9.187 kJ\n" + ] + } + ], + "prompt_number": 54 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.41 pg : 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "T1 = 25.+273;\n", + "T2 = 145.+273;\n", + "m = 2.;\n", + "R = 267.;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "Cv = R/(G-1);\n", + "print 'The value of Cv: %3.1f J/kg K'%(Cv);\n", + "\n", + "Cp = G*Cv;\n", + "print 'The value of Cp: %3.1f J/kg K'%(Cp);\n", + "\n", + "U = m*Cv*(T2-T1)*(1./1000);\n", + "print 'The change in Internal Energy: %3.1f kJ'%(U);\n", + "\n", + "H = m*Cp*(T2-T1)*(1./1000);\n", + "print 'The Heat Transfer: %3.1f kJ'%(H);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of Cv: 667.5 J/kg K\n", + "The value of Cp: 934.5 J/kg K\n", + "The change in Internal Energy: 160.2 kJ\n", + "The Heat Transfer: 224.3 kJ\n" + ] + } + ], + "prompt_number": 55 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.42 pg : 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "D = 1.;\n", + "h = 4.;\n", + "P1 = 100.;\n", + "T1 = 27.+273;\n", + "P2 = 125.;\n", + "Cp = 14.307;\n", + "Cv = 10.183;\n", + "\n", + "# Calculations\n", + "V1 = (22./7)*(1./4)*(D*D*h);\n", + "R = Cp-Cv;\n", + "m = (P1*V1)/(R*T1);\n", + "T2 = (P2*T1)/P1;\n", + "Q = m*Cv*(T2-T1);\n", + "\n", + "# Results\n", + "print 'The Heat Transfer: %3.0f kJ'%(Q);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Heat Transfer: 194 kJ\n" + ] + } + ], + "prompt_number": 56 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.43 pg : 61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "V1 = 0.15;\n", + "V2 = 3*V1;\n", + "P1 = 900.;\n", + "P2 = P1;\n", + "T1 = 300.+273;\n", + "T3 = T1;\n", + "n = 1.5;\n", + "G = 1.4;\n", + "R = 0.287;\n", + "Cp = 1.005;\n", + "\n", + "# Calculations and Results\n", + "m = (P1*V1)/(R*T1);\n", + "T2 = (T1*V2)/V1;\n", + "Q1 = m*Cp*(T2-T1);\n", + "W1 = m*R*(T2-T3)/(n-1);\n", + "Q2 = (G-n)*W1/(G-1);\n", + "P3 = P2*((T3/T2)**(G/(G-1)));\n", + "Q3 = m*R*T1*math.log(P3/P1);\n", + "H_rec = Q1;\n", + "print 'The Heat received: %3.1f kJ'%(H_rec);\n", + "\n", + "H_rej = 0-(Q2+Q3);\n", + "print 'The Heat Rejected: %3.1f kJ'%(H_rej);\n", + "\n", + "eff = 100*(1-(H_rej/H_rec));\n", + "print 'Efficiency: %3.2f percent'%(eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Heat received: 945.5 kJ\n", + "The Heat Rejected: 654.1 kJ\n", + "Efficiency: 30.82 percent\n" + ] + } + ], + "prompt_number": 57 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.44 pg : 62" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg Km = 1;\n", + "V1 = 0.15;\n", + "P1 = 1.;\n", + "V2 = 0.05;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "P2 = (V1*P1)/V2;\n", + "W_it = P1*100*V1*math.log(P1/P2);\n", + "print 'Work done in Isothermal process: %2.2f kJ'%(W_it);\n", + "\n", + "P2 = P1*((V1/V2)**G);\n", + "W_ad = ((P1*100*V1)-(P2*100*V2))/(G-1);\n", + "print 'Work done in Adiabatic process: %2.2f kJ'%(W_ad);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done in Isothermal process: -16.48 kJ\n", + "Work done in Adiabatic process: -20.69 kJ\n" + ] + } + ], + "prompt_number": 58 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.45 pg : 63" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "m = 1.;\n", + "Cp = 1.005;\n", + "P1 = 100.;\n", + "T1 = 17.+273;\n", + "T2 = T1;\n", + "P2 = 2500.;\n", + "\n", + "# Calculations and Results\n", + "print 'Final Temperature: %2.2f K'%(T2);\n", + "\n", + "\n", + "V1 = (260*T1)/(P1*1000);\n", + "V2 = (P1*V1)/P2;\n", + "print 'Final Volume: %2.5f m**3'%(V2);\n", + "\n", + "n = P2/P1;\n", + "print 'Compression ratio: %2.0f '%(n);\n", + "\n", + "H = m*Cp*(T2-T1);\n", + "print 'Change in Enthalpy: %2.2f kJ'%(H);\n", + "\n", + "W = P1*V1*math.log(P1/P2);\n", + "print 'Work done: %2.2f kJ/kg'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final Temperature: 290.00 K\n", + "Final Volume: 0.03016 m**3\n", + "Compression ratio: 25 \n", + "Change in Enthalpy: 0.00 kJ\n", + "Work done: -242.70 kJ/kg\n" + ] + } + ], + "prompt_number": 59 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.46 pg: 64" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Inputs\n", + "#The Values in the program are as follows:\n", + "#Temperature in Celcius converted to Kelvin(by adding 273)\n", + "#Pressure in bar converted to kPa (by multiplying 100)\n", + "#Volume in m**3\n", + "#Value of R,Cp and Cv in kJ/kg K\n", + "P1 = 150.;\n", + "T1 = 17.+273;\n", + "P2 = 750.;\n", + "n = 1.3;\n", + "m = 1.;\n", + "R = 0.287;\n", + "Cp = 1.001;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1*((P2/P1)**((n-1)/n));\n", + "print 'The final temperature: %2.1f K'%(T2);\n", + "\n", + "W = m*R*(T1-T2)/(n-1);\n", + "print 'Work done: %2.2f kJ/kg'%(W);\n", + "\n", + "Cv = Cp-R;\n", + "U = m*Cv*(T2-T1);\n", + "print 'Change in internal energy: %2.2f kJ/kg'%(U);\n", + "\n", + "G = Cp/Cv;\n", + "Q = ((G-n)/(G-1))*W;\n", + "print 'Amount of heat transfer: %2.2f kJ/kg'%(Q);\n", + "\n", + "H = m*Cp*(T2-T1);\n", + "print 'Change in enthalpy: %2.2f kJ/kg'%(H);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The final temperature: 420.4 K\n", + "Work done: -124.78 kJ/kg\n", + "Change in internal energy: 93.13 kJ/kg\n", + "Amount of heat transfer: -31.65 kJ/kg\n", + "Change in enthalpy: 130.57 kJ/kg\n" + ] + } + ], + "prompt_number": 60 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch4.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch4.ipynb new file mode 100755 index 00000000..45e33df4 --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch4.ipynb @@ -0,0 +1,2415 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8541d544efae76213afa5d4f7227e30b2c1f7aeb3853d5fb321fd7df87752cbe" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : Properties of Steam" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 pg : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Case 1\n", + "Vg = 0.132;\n", + "SV = 0.12; #Specific Volume\n", + "#As SV is less than Vg, steam is wet\n", + "\n", + "# Calculations and Results\n", + "x = SV/Vg;\n", + "\n", + "print ' For Case 1 ';\n", + "print 'Part of wet steam: %2.2f'%(x);\n", + "\n", + "\n", + "#Case 2\n", + "T = 200;\n", + "Tsat = 179.9; #Satuaration Temperature\n", + "#Steam is superheated as T > Tsat\n", + "D_sh = T-Tsat;\n", + "\n", + "print ' For Case 2 ';\n", + "print 'Degree of Superheat: %2.1f C'%(D_sh);\n", + "\n", + "\n", + "#Case 3\n", + "P = 20.; #Pressure in bars\n", + "Hf = 908.8; #kJ/kg\n", + "Hfg = 1890.7; #kJ/kg\n", + "Hg = 2799.5; #kJ/kg\n", + "H = 2650;\n", + "\n", + "#Steam is wet as Specific enthalpy is less than Hg\n", + "\n", + "x = (H-Hf)/Hfg;\n", + "\n", + "print ' For Case 3 ';\n", + "print 'Part of wet steam: %2.2f'%(x);\n", + "\n", + "\n", + "#Case 4\n", + "T = 150; #in Celcius\n", + "SV = 0.3928; #Specific Volume in m**3/kg\n", + "Vg = 0.3928; #in m**3/kg\n", + "\n", + "print ' For Case 4 ';\n", + "print 'As SV = Vg , steam is dry saturated'\n", + "\n", + "\n", + "#Case 5\n", + "P = 10; #in bars\n", + "S = 5.697;\n", + "Sf = 2.319;\n", + "Sfg = 4.448;\n", + "Sg = 6.623;\n", + "#As Sample specific entropy is less than Sg and more than Sf, steam is wet\n", + "\n", + "x = (S-Sf)/Sfg;\n", + "print ' For Case 5 ';\n", + "print 'Part of wet steam: %2.1f'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " For Case 1 \n", + "Part of wet steam: 0.91\n", + " For Case 2 \n", + "Degree of Superheat: 20.1 C\n", + " For Case 3 \n", + "Part of wet steam: 0.92\n", + " For Case 4 \n", + "As SV = Vg , steam is dry saturated\n", + " For Case 5 \n", + "Part of wet steam: 0.8\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 pg : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 10 bar pressure\n", + "P = 10.; #in bars\n", + "x = 0.8;\n", + "Vg = 0.194; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "W = P*100*x*Vg;\n", + "print 'External Work Done: %3.2f kJ/kg'%(W);\n", + "\n", + "\n", + "Hf = 762.8; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "H = Hf+(x*Hfg);\n", + "U = H-W;\n", + "print 'Internal energy: %3.2f kJ/kg'%(U);\n", + "\n", + "\n", + "Vf = 0.001127; #in m**3/kg\n", + "Uf = Hf-(P*100*Vf);\n", + "Ux = U-Uf;\n", + "print 'Internal Heat of Evaporation: %3.2f kJ/kg'%(Ux);\n", + "\n", + "\n", + "Sf = 2.139; #in kJ/kg K\n", + "Sfg = 4.448; #in kJ/kg K\n", + "S = Sf+(x*Sfg);\n", + "print 'Entropy of steam: %3.3f kJ/kg'%(S);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "External Work Done: 155.20 kJ/kg\n", + "Internal energy: 2219.84 kJ/kg\n", + "Internal Heat of Evaporation: 1458.17 kJ/kg\n", + "Entropy of steam: 5.697 kJ/kg\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "# Variables\n", + "#Condition at 10 bar pressure\n", + "#Steam is wet\n", + "x = 0.95;\n", + "P = 10; #in bars\n", + "Hf = 762.8; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "H = Hf+(x*Hfg);\n", + "print 'Enthalpy : %3.2f kJ/kg'%(H);\n", + "\n", + "\n", + "#Now we calculate Work Done\n", + "Vg = 0.194; #in m**3/kg\n", + "W = P*100*x*Vg;\n", + "U = H-W;\n", + "print 'Internal energy: %3.0f kJ/kg'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy : 2677.34 kJ/kg\n", + "Internal energy: 2493 kJ/kg\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 pg: 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Condition at pressure 15 bars\n", + "P = 15.; #in bars\n", + "Hf = 844.9; # in kJ/kg\n", + "Hfg = 1947.3; #in kJ/kg\n", + "Vg = 0.132; #in m**3/kg\n", + "x = 0.9; #Dryness fraction\n", + "\n", + "# Calculations and Results\n", + "W = P*100*x*Vg;\n", + "print 'External Work Done: %3.2f kJ/kg'%(W);\n", + "\n", + "H = Hf+(x*Hfg);\n", + "U = H-W;\n", + "print 'Internal Energy: %3.1f kJ/kg'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "External Work Done: 178.20 kJ/kg\n", + "Internal Energy: 2419.3 kJ/kg\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 pg : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "x = 0.9; #Dryness Fraction\n", + "m = 1.5; #mass in kg\n", + "Cps = 2.1;\n", + "#Condition at 10 bars\n", + "P = 10.;\n", + "Tsat = 179.9; #in Celcius\n", + "T = 250.; #in Celcius\n", + "Hg = 2778.1; #in kJ/kg\n", + "Vg = 0.194; #in m**3/kg\n", + "Cps = 2.1;\n", + "H1 = Hg+(Cps*(T-Tsat));\n", + "Vsup = ((T+273)/(Tsat+273))*Vg;\n", + "U1 = H1-(P*100*Vsup);\n", + "Sf = 2.139; #in kJ/kg K\n", + "Sfg = 4.448; #in kJ/kg K\n", + "Sg = 6.623; #in kJ/kg K\n", + "S1 = Sg+(Cps*math.log((T+273)/(Tsat+273)));\n", + "\n", + "# Calculations and Results\n", + "#Conditions at 2.8 bars\n", + "P2 = 2.8;\n", + "Hf = 551.4; #in kJ/kg\n", + "Hfg = 2170.7; #in kJ/kg\n", + "Vg = 0.646; #in m**3/kg\n", + "H2 = Hf+(x*Hfg);\n", + "U2 = H2-(P2*100*x*Vg);\n", + "Sf = 1.647; #in kJ/kg K\n", + "Sfg = 5.368; #in kJ/kg K\n", + "S2 = Sf+(x*Sfg);\n", + "U = m*(U2-U1);\n", + "print 'The change in internal energy: %3.1f kJ/kg'%(U);\n", + "\n", + "S = S2-S1;\n", + "print 'The change in Entropy: %3.4f kJ/kg K'%(S);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The change in internal energy: -538.6 kJ/kg\n", + "The change in Entropy: -0.4470 kJ/kg K\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 pg : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "#Conditions at 8 bar\n", + "P = 8.; #Pressure in bar\n", + "x = 0.9; #dryness fraction\n", + "Hf = 721.1; #in kJ/kg\n", + "Hfg = 2048.0; #in kJ/kg\n", + "Vg = 0.240; #in m**3/kg\n", + "H1 = Hf+(x*Hfg);\n", + "V1 = x*Vg;\n", + "\n", + "# Calculations and Results\n", + "#Enthalpy of superheated steam at 8 bar and 200 Celcius\n", + "Hg = 2769.1;\n", + "Cps = 2.1;\n", + "Tsup = 200+273; #in Celcius\n", + "Tsat = 170.4+273; #in Celcius\n", + "H2 = Hg+(Cps*(Tsup-Tsat));\n", + "V2 = (Vg*Tsup)/Tsat;\n", + "H = H2-H1;\n", + "print 'Heat supplied: %3.1f kJ/kg'%(H);\n", + "\n", + "W = P*100*(V2-V1);\n", + "print 'Work Done: %3.3f kJ/kg'%(W);\n", + "\n", + "#At 8 bar\n", + "Sf = 2.046; #in kJ/kg K\n", + "Sfg = 4.617; #in kJ/kg K\n", + "Sg = 6.663; #in kJ/kg K\n", + "S1 = Sf+(x*Sfg);\n", + "S2 = Sg+(Cps*(math.log(Tsup/Tsat)));\n", + "S = S2-S1;\n", + "print 'The Enthalpy change during process: %3.1f kJ/kg K'%(S);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat supplied: 267.0 kJ/kg\n", + "Work Done: 32.017 kJ/kg\n", + "The Enthalpy change during process: 0.6 kJ/kg K\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Conditions at 10 bar\n", + "P1 = 10.; #in bars\n", + "Hg = 2778.1; #in kJ/kg\n", + "Tsat = 179.9+273; #Temperature in K\n", + "Vg = 0.194; #in m**3/kg\n", + "\n", + "# Calculations and Results\n", + "#Conditions at 10 bar and 300 Celcius\n", + "Cps = 2.1;\n", + "Tsup = 300+273;\n", + "H1 = Hg+(Cps*(Tsup-Tsat));\n", + "V1 = Vg*(Tsup/Tsat);\n", + "U1 = H1-(P1*100*V1);\n", + "print 'The Internal energy: %3.1f kJ/kg'%(U1);\n", + "\n", + "\n", + "#At 1.4 bar and other conditions\n", + "P2 = 1.4; #in bars\n", + "x = 0.8; #Dryness Fraction\n", + "Hf = 458.4; #in kJ/kg\n", + "Hfg = 2232.0; #in kJ/kg\n", + "Vg = 1.237; #in m**3/kg\n", + "H2 = Hf+(x*Hfg);\n", + "V2 = x*Vg;\n", + "U2 = H2-(P2*100*V2);\n", + "U = U2-U1;\n", + "print 'The change in internal energy: %3.1f kJ/kg'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Internal energy: 2784.9 kJ/kg\n", + "The change in internal energy: -679.4 kJ/kg\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.8 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Conditions at 8 bar\n", + "P = 8.; #in bars\n", + "x = 0.8; #Dryness Fraction\n", + "Hf = 721.1; #in kJ/kg\n", + "Hfg = 2048.0; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "H1 = Hf+(x*Hfg);\n", + "H2 = H1+410; #After adding 410 kJ of heat\n", + "Hg = 2769.1; #in kJ/kg\n", + "print 'The Enthalpy of steam: %3.1f kJ/kg'%(H2);\n", + "\n", + "print 'The steam is superheated'\n", + "\n", + "V2 = 0.240; #in m**3/kg\n", + "Vg = V2;\n", + "Den = 1./Vg;\n", + "print 'The Density of steam: %3.3f kg/m**3'%(Den);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Enthalpy of steam: 2769.5 kJ/kg\n", + "The steam is superheated\n", + "The Density of steam: 4.167 kg/m**3\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.9 pg : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#For throttling H1 = H2\n", + "\n", + "# Variables\n", + "#At 11 bar\n", + "Hf = 781.3; #in kJ/kg\n", + "Hfg = 2000.4; #in kJ/kg\n", + "\n", + "# Calculations\n", + "#At 1 bar\n", + "Hg = 2675.5; #in kJ/kg\n", + "x = (Hg-Hf)/Hfg;\n", + "\n", + "# Results\n", + "print 'The Dryness Fraction: %3.3f kJ/kg'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Dryness Fraction: 0.947 kJ/kg\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.10 pg : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Variables\n", + "#Conditions at 4 bar\n", + "P1 = 4.; #in bars\n", + "Hf = 604.7; #in kJ/kg\n", + "Hfg = 2133.8; #in kJ/kg\n", + "Vg = 0.463; #in m**3/kg\n", + "x1 = 0.9;\n", + "H1 = Hf+(x1*Hfg);\n", + "V1 = x1*Vg;\n", + "\n", + "# Calculations and Results\n", + "#Now at 12 bar pressure\n", + "P2 = 12; #in bars\n", + "V2 = (P1*V1)/P2;\n", + "Vg = 0.163; #in m**3/kg\n", + "print 'At 12 bar, V2: %3.3f kJ/kg'%(V2);\n", + "\n", + "print 'As Vg>V2, steam is wet'\n", + "\n", + "x2 = V2/Vg;\n", + "print 'The dryness fraction at 12 bars: %3.2f '%(x2);\n", + "\n", + "\n", + "Hf = 798.6; #in kJ/kg\n", + "Hfg = 1986.2; #in kJ/kg\n", + "H2 = Hf+(x2*Hfg);\n", + "print 'The Final enthalpy of steam: %3.1f kJ/kg'%(H2);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "At 12 bar, V2: 0.139 kJ/kg\n", + "As Vg>V2, steam is wet\n", + "The dryness fraction at 12 bars: 0.85 \n", + "The Final enthalpy of steam: 2491.1 kJ/kg\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.11 pg : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 20 degree Celcius\n", + "Cpw = 4.187; #in kJ/kg\n", + "Tw = 20.;\n", + "H1 = Cpw*Tw;\n", + "\n", + "# Calculations\n", + "#At 8 bar condition\n", + "m = 4; #mass in kg\n", + "Cps = 2.1; #in kJ/kg\n", + "Tsat = 170.4+273; #in K\n", + "Hg = 2769.1; #in kJ/kg\n", + "Tsup = 200+273; #in K\n", + "H2 = Hg+(Cps*(Tsup-Tsat));\n", + "Q = m*(H2-H1);\n", + "\n", + "# Results\n", + "print 'Heat to be added: %3.1f kJ'%(Q);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat to be added: 10990.1 kJ\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.12 pg : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Combined Seperating and Throttling Calorimeter\n", + "m1 = 2; #mass of water seperated in kg\n", + "m = 20.5; #Steam discharged from calorimeter in kg\n", + "mt = m1+m; #Steam inlet in kg\n", + "\n", + "# Calculations\n", + "x1 = m/(mt); #Dryness fraction\n", + "\n", + "#At 12 bar pressure\n", + "Hf = 798.6; #in kJ/kg\n", + "Hfg = 1986.2; #in kJ/kg\n", + "\n", + "P_bar = 760; #Pressure in mm\n", + "P_fin = 5; #Pressure in mm\n", + "P = (P_bar+P_fin)*1.01325/P_bar; #Absolute Pressure\n", + "\n", + "#Now at 1.02 bar\n", + "Cp = 2.2; #in kJ/kg K\n", + "Hg = 2676.34; #in kJ/kg\n", + "Tsat = 99.66+273; #in K\n", + "Tsup = 110+273; #in K\n", + "H2 = Hg+(Cp*(Tsup-Tsat));\n", + "x2 = (H2-Hf)/Hfg;\n", + "x = x1*x2;\n", + "\n", + "# Results\n", + "print 'The Dryness Fraction: %3.3f'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Dryness Fraction: 0.872\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.13 pg : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 7 bar and 300 Celcius\n", + "P = 7.; #in bars\n", + "Cps = 2.1;\n", + "Tsup = 300+273; #in K\n", + "Tsat = 165+273; #in K\n", + "Hg = 2763.5; #in kJ/kg\n", + "\n", + "# Calculations\n", + "H1 = Hg+(Cps*(Tsup-Tsat));\n", + "\n", + "x2 = 0.9; #Dryness Fraction\n", + "Hf = 697.2; #in kJ/kg\n", + "Hfg = 2066.3; #in kJ/kg\n", + "H2 = Hf+(x2*Hfg);\n", + "m = (H1-Hg)/(Hg-H2);\n", + "\n", + "# Results\n", + "print 'The mass flow rate of wet steam: %3.3f kg/kg'%(m);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mass flow rate of wet steam: 1.372 kg/kg\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.14 pg : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Conditions at 10 bar\n", + "P = 10.; #in bar\n", + "Tsat = 179.9+273; #in K\n", + "Hf = 762.8; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "Hg = 2778.1; #in kJ/kg\n", + "Vg = 0.194; #in m**3/kg\n", + "Sf = 2.139; #in kJ/kg K\n", + "Sg = 6.623; #in kJ/kg K\n", + "Sfg = 4.448; #in kJ/kg K\n", + "x = 0.91; #Dryness Fraction\n", + "m = 3.; #in kg\n", + "\n", + "# Calculations and Results\n", + "#Now for wet steam\n", + "H = Hf+(x*Hfg);\n", + "H_final = m*H;\n", + "print 'The total Enthalpy: %3.1f kJ'%(H_final);\n", + "\n", + "V = x*Vg;\n", + "U = H-(P*100*V);\n", + "U_final = m*U;\n", + "print 'The Internal Energy: %3.1f kJ'%(U_final);\n", + "\n", + "S = Sf+(x*Sfg);\n", + "S_final = m*S;\n", + "print 'The Entropy: %3.3f kJ/K'%(S_final);\n", + "\n", + "#Now Case 2\n", + "print 'Now for Case 2 ';\n", + "Tsat = 179.9+273; #in K\n", + "Tsup = 200+273; #in K\n", + "Cp = 2.1; #in kJ/kg K\n", + "H = Hg+(Cp*(Tsup-Tsat));\n", + "H_final = m*H;\n", + "print 'The Enthalpy: %3.1f kJ'%(H_final);\n", + "\n", + "Vsup = (Tsup*Vg)/Tsat;\n", + "U = H-(P*100*Vsup);\n", + "U_final = m*U;\n", + "print 'The change in internal energy: %3.1f kJ'%(U_final);\n", + "\n", + "S = Sg+(Cp*math.log(Tsup/Tsat));\n", + "S_final = m*S;\n", + "print 'The Entropy: %3.1f kJ/K'%(S_final);\n", + "\n", + "\n", + "#Now Case 3\n", + "print ' Now for case 3 ';\n", + "H = Hg;\n", + "H_final = m*H; #in kJ\n", + "print 'The total enthalpy: %3.1f kJ'%(H_final);\n", + "\n", + "V = Vg;\n", + "U = H-(P*100*V);\n", + "U_final = m*U;\n", + "print 'The change in internal energy: %3.1f kJ'%(U_final);\n", + "\n", + "S = Sg;\n", + "S_final = m*S;\n", + "print 'The total entropy: %3.3f kJ/kg'%(S_final);\n", + "\n", + "# note : rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total Enthalpy: 7790.2 kJ\n", + "The Internal Energy: 7260.5 kJ\n", + "The Entropy: 18.560 kJ/K\n", + "Now for Case 2 \n", + "The Enthalpy: 8460.9 kJ\n", + "The change in internal energy: 7853.1 kJ\n", + "The Entropy: 20.1 kJ/K\n", + " Now for case 3 \n", + "The total enthalpy: 8334.3 kJ\n", + "The change in internal energy: 7752.3 kJ\n", + "The total entropy: 19.869 kJ/kg\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.15 pg : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "#At 15 bar condition\n", + "Tsat = 198.3+273; #in K\n", + "m = 7.; #in kg\n", + "Hg = 2792.2; #in kJ/kg\n", + "Tsup = 300.+273; #in K\n", + "Cps = 2.1; #in kJ/kg K\n", + "\n", + "# Calculations and Results\n", + "H1 = Hg+(Cps*(Tsup-Tsat));\n", + "Cpw = 4.187; #in kJ/kg K\n", + "H2 = Cpw*50;\n", + "Q = m*(H1-H2);\n", + "print 'The total amount of heat required: %3.1f kJ'%(Q);\n", + "\n", + "Sg = 6.445; #in kJ/kg K\n", + "S2 = Sg+(Cps*math.log(Tsup/Tsat));\n", + "Sf = 0.704; #in kJ/kg K\n", + "S1 = Sf;\n", + "S = m*(S2-S1);\n", + "print 'The change in Entropy: %3.2f kJ/K'%(S);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total amount of heat required: 19574.9 kJ\n", + "The change in Entropy: 43.06 kJ/K\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.16 pg : 33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Conditions at 10 bar\n", + "P = 10.; #in bar\n", + "Tsat = 179.9+273; #in K\n", + "Hf = 762.8; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "Hg = 2778.1; #in kJ/kg\n", + "Vg = 0.194; #in m**3/kg\n", + "x = 0.7; #Dryness Fraction\n", + "V = x*Vg;\n", + "m = 0.2/V; #mass in kg\n", + "mf = 2/V; #mass in kg\n", + "\n", + "# Calculations and Results\n", + "H = Hf+(x*Hfg);\n", + "H_tot = H*mf;\n", + "print 'The total enthalpy: %3.1f kJ'%(H_tot);\n", + "\n", + "U = H-(P*100*V);\n", + "U_tot = U*mf;\n", + "print 'The internal energy: %3.1f kJ'%(U_tot);\n", + "\n", + "W = P*100*V;\n", + "W_tot = W*mf;\n", + "print 'The external work of evaporation: %3.1f kJ'%(W_tot);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total enthalpy: 32010.5 kJ\n", + "The internal energy: 30010.5 kJ\n", + "The external work of evaporation: 2000.0 kJ\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.17 pg : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Conditions at 10 bar pressure\n", + "P = 10.; #in bar\n", + "Tsat = 179.9+273; #in K\n", + "Tsup = 350+273;\n", + "x = 0.9; #Dryness Fraction\n", + "Hf = 762.8; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "Hg = 2778.1; #in kJ/kg\n", + "Vg = 0.194; #in m**3/kg\n", + "Cps = 2.1; #in kJ/kg K\n", + "\n", + "# Calculations\n", + "Ha = Hg+(Cps*(Tsup-Tsat));\n", + "Hb = Hf+(x*Hfg);\n", + "H_mix = (Ha+Hb)/2;\n", + "Tsupe = ((H_mix-Hg)/Cps)+Tsat;\n", + "Tsuper = Tsupe-273;\n", + "\n", + "\n", + "# Results\n", + "print 'Temperature of superheated steam: %3.0f Celcius'%(Tsuper);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of superheated steam: 217 Celcius\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.18 pg: 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Now at 10 bar pressure\n", + "V = 1.5; #Volume in m**3\n", + "P = 10; #Pressure in bar\n", + "x = 0.91; #Dryness fraction\n", + "Vg = 0.194; #in m**3/kg\n", + "m = V/Vg;\n", + "\n", + "# Calculations\n", + "Vf = x*Vg;\n", + "m_f = V/Vf;\n", + "\n", + "# Results\n", + "print 'Amount of water to be placed in container: %2.2f kg'%(m);\n", + "print 'Mass of water required: %2.2f kg'%(m_f);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of water to be placed in container: 7.73 kg\n", + "Mass of water required: 8.50 kg\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.19 pg : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Conditions at 7 bat\n", + "P = 7.; #in bar\n", + "Tsat = 165.+273; #in K\n", + "Hf = 697.2; #in kJ/kg\n", + "Hfg = 2066.3; #in kJ/kg\n", + "Hg = 2763.5; #in kJ/kg\n", + "Vg = 0.273; #in m**3/kg\n", + "D = 0.02; #in m\n", + "vel = 17.; #in m/s\n", + "Cps = 4.187; #in kJ/kg K\n", + "Tw1 = 25.; #in Celcius\n", + "Tw2 = 100.; #in Celcius\n", + "Vfr = (22./7)*D*D*vel*(1./4)*60; #Volume flow rate in m**3/min\n", + "x = 0.9; #Dryness Fraction\n", + "V = x*Vg;\n", + "\n", + "# Calculations and Results\n", + "Mfr = Vfr/V; #Mass flow rate\n", + "print 'The mass flow rate of steam: %2.2f kg/min'%(Mfr);\n", + "\n", + "H1 = Hf+(x*Hfg);\n", + "H2 = Cps*100;\n", + "Mw = (Mfr*(H1-H2))/(Cps*(Tw2-Tw1));\n", + "print 'The mass flow rate of water: %2.2f kg/min'%(Mw);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mass flow rate of steam: 1.30 kg/min\n", + "The mass flow rate of water: 8.88 kg/min\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.20 pg : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Conditions at 9 bar\n", + "P = 9.; #in bar\n", + "Tsat = 175.4+273; #in K\n", + "Vg = 0.215; #in m**3/kg\n", + "Hf = 742.8; #in kJ/kg\n", + "Hfg = 2031.1; #in kJ/kg\n", + "Hg = 2773.9; #in kJ/kg\n", + "T2 = 250.+273; #in K\n", + "x = 0.91; #Dryness Fraction\n", + "V1 = x*Vg;\n", + "\n", + "# Calculations and Results\n", + "V2 = 0.2696; #From Steam Table\n", + "W = P*100*(V2-V1);\n", + "print 'The Work Output: %2.2f kJ/kg'%(W);\n", + "\n", + "H1 = Hf+(x*Hfg);\n", + "H2 = 2946.3; #From steam table in kJ/kg\n", + "Q = H2-H1;\n", + "print 'The heat supplied to steam: %2.2f kJ/kg'%(Q);\n", + "\n", + "U = Q-W;\n", + "print 'The internal energy of steam increases by: %2.2f kJ/kg'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Work Output: 66.56 kJ/kg\n", + "The heat supplied to steam: 355.20 kJ/kg\n", + "The internal energy of steam increases by: 288.64 kJ/kg\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.21 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Conditions at 16 bar\n", + "P = 16.; #in bar\n", + "Vov = 0.015; #Volume of Vessel\n", + "Mos = 0.1; #Mass of steam\n", + "SV = Vov/Mos; #Specific Volume\n", + "Vg = 0.124; #in m**3/kg\n", + "\n", + "# Calculations and Results\n", + "Tsat = 201.4+273; #in K\n", + "Tsup = (SV/Vg)*Tsat;\n", + "print 'The temperature of steam: %2.2f K'%(Tsup);\n", + "\n", + "\n", + "#Now cooling takes place\n", + "Tsat = 191.16; #From steam table\n", + "print 'After cooling, temperature of steam: %2.2f K'%(Tsat);\n", + "\n", + "\n", + "#Now cooled to 10 bar pressure\n", + "P1 = 16; #in bar\n", + "Vg = 0.194; #in m**3/kg\n", + "v = 0.15; #in m**3/kg\n", + "x = v/Vg; #Dryness Fraction\n", + "\n", + "#For consmath.tant Volume process W = 0\n", + "Hg = 2794.0; #in kJ/kg\n", + "Hf = 762.8; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "Cps = 2.1; #in kJ/kg K\n", + "Tsup = 300.84; #in C\n", + "Tsat = 201.4; #in C\n", + "H1 = Hg+(Cps*(Tsup-Tsat));\n", + "U1 = H1-(P1*100*v);\n", + "P2 = 10; #in bar\n", + "H2 = Hf+(x*Hfg);\n", + "U2 = H2-(P2*100*v);\n", + "Q = U2-U1;\n", + "print 'Heat rejected by system: %2.2f kJ/kg'%(Q);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The temperature of steam: 573.87 K\n", + "After cooling, temperature of steam: 191.16 K\n", + "Heat rejected by system: -591.80 kJ/kg\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.22 pg : 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Isothermal process\n", + "P = 10.; #in bar\n", + "Tsat = 179.9+273; #in K\n", + "Vg = 0.194; #in m**3/kg\n", + "Hf = 762.6; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "Hg = 2778.1; #in kJ/kg\n", + "x1 = 1.; #Dryness Fraction\n", + "Sf = 2.139; #in kJ/kg K\n", + "Sfg = 4.448; #in kJ/kg K\n", + "Sg = 6.623; #in kJ/kg K\n", + "V = 0.3; #in m**3\n", + "m = V/Vg; #in kg\n", + "V2 = Vg/2;\n", + "x2 = V2/Vg; #Dryness Fraction\n", + "\n", + "# Calculations and Results\n", + "W = P*100*(V2-Vg)*m;\n", + "print 'Work Done: %2.2f kJ'%(W);\n", + "\n", + "H1 = Hg;\n", + "H2 = Hf+(x2*Hfg);\n", + "Q = m*(H2-H1);\n", + "print 'Change in Enthalpy: %2.2f kJ'%(Q);\n", + "\n", + "U = (Q-W);\n", + "print 'Change in total Internal Energy: %2.2f kJ'%(U);\n", + "\n", + "S1 = Sg;\n", + "S2 = Sf+(x2*Sfg);\n", + "S = m*(S2-S1);\n", + "print 'Change in Entropy: %2.2f kJ/K'%(S);\n", + "\n", + "\n", + "#Now for case 2 where PV = C\n", + "print 'Now for case 2';\n", + "\n", + "\n", + "V01 = 0.097;\n", + "V02 = 0.5*V01;\n", + "P1 = 10; #in bars\n", + "P2 = (P1*V01)/V02; #in bars\n", + "\n", + "#Now at 20 bars\n", + "Vg1 = 0.0996; #in m**3/kg\n", + "V2 = 0.097;\n", + "x2 = V2/Vg1; #Dryness Fraction\n", + "Hf = 908.8; #in kJ/kg\n", + "Hfg = 1890.7; #in kJ/kg\n", + "H2 = Hf+(x2*Hfg);\n", + "H = m*(H2-Hg);\n", + "print 'Change in Enthalpy: %2.2f kJ'%(H);\n", + "\n", + "\n", + "W = m*P1*100*Vg*(math.log(V02/V01));\n", + "print 'Total work done: %2.2f kJ'%(W);\n", + "\n", + "\n", + "U = H; #as P1 V1 = P2 V2\n", + "Q = U+W;\n", + "print 'Change in Enthalpy: %2.2f kJ'%(Q);\n", + "\n", + "\n", + "#Now at 20 bar pressure\n", + "Sf = 2.447; #in kJ/kg K\n", + "Sfg = 3.894; #in kJ/kg K\n", + "Sg1 = 6.341; #in kJ/kg K\n", + "S2 = Sf+(x2*Sfg);\n", + "S1 = Sg;\n", + "S = m*(S2-S1)\n", + "print 'Change in Entropy: %2.3f kJ/K'%(S);\n", + "\n", + "# note : rounding off error.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work Done: -150.00 kJ\n", + "Change in Enthalpy: -1558.53 kJ\n", + "Change in total Internal Energy: -1408.53 kJ\n", + "Change in Entropy: -3.49 kJ/K\n", + "Now for case 2\n", + "Change in Enthalpy: -43.23 kJ\n", + "Total work done: -207.94 kJ\n", + "Change in Enthalpy: -251.17 kJ\n", + "Change in Entropy: -0.593 kJ/K\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.23 pg : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "#Initial conditions at 7 bar pressure\n", + "P1 = 7.; #in bars\n", + "Vg1 = 0.273; #in m**3/kg\n", + "V1 = Vg1; #in m**3/kg\n", + "Hg1 = 2763.5; #in kJ/kg\n", + "H1 = Hg1;\n", + "Tsat = 165+273; #in K\n", + "Sf = 1.992; #in kJ/kg K\n", + "Sfg = 4.716; #in kJ/kg K\n", + "Sg = 6.708; #in kJ/kg K\n", + "n = 1.1;\n", + "\n", + "# Calculations and Results\n", + "#Final conditions at 0.5 bar\n", + "P2 = 0.5; #in bars\n", + "V2 = ((P1*(V1**1.1))/P2)**(1./1.1); #umath.sing P(V)**1.1 = Consmath.tant\n", + "\n", + "W = ((P1*100*V1)-(P2*100*V2))/(n-1);\n", + "print 'Work Done: %3.2f kJ'%(W);\n", + "\n", + "\n", + "Hf2 = 340.6; #in kJ/kg\n", + "Hfg2 = 2305.4; #in kJ/kg\n", + "Vg2 = 3.24; #in m**3/kg\n", + "x2 = V2/Vg2; #Dryness Fraction\n", + "\n", + "H2 = Hf2+(x2*Hfg2);\n", + "\n", + "U1 = H1-(P1*100*V1);\n", + "U2 = H2-(P2*100*V2);\n", + "U = U2-U1;\n", + "print 'Change in Internal Energy: %3.2f kJ/kg'%(U);\n", + "\n", + "\n", + "Q = U+W; #From First law of Thermodynamics\n", + "print 'Heat Transferred: %3.2f kJ/kg'%(Q);\n", + "\n", + "\n", + "S1 = Sg;\n", + "#At 0.5 bar\n", + "Sf2 = 1.091; #in kJ/kg K\n", + "Sfg2 = 6.503; #in kJ/kg K\n", + "Sg2 = 7.594; #in kJ/kg K\n", + "S2 = Sf2+(x2*Sfg2);\n", + "S = S2-S1;\n", + "print 'Change in Entropy: %3.2f kJ/kg K'%(S);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work Done: 407.63 kJ\n", + "Change in Internal Energy: -242.71 kJ/kg\n", + "Heat Transferred: 164.92 kJ/kg\n", + "Change in Entropy: 0.42 kJ/kg K\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.24 pg :43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "#At state 1\n", + "P1 = 20; #in bar\n", + "V = 2;\n", + "Vg1 = 0.0996; #in m**3/kg\n", + "Tsat1 = 212.4+273; #in K\n", + "Tsup1 = 573; #in K\n", + "V1 = Vg1*(Tsup1/Tsat1);\n", + "m = V/V1;\n", + "\n", + "#At state 2\n", + "V2 = V1;\n", + "Vg2 = V2;\n", + "P2 = 16.9; #From Steam Table\n", + "\n", + "#Calculations\n", + "Hg1 = 2799.5; #in kJ/kg\n", + "Cps = 2.1; #in kJ/kg K\n", + "H1 = m*(Hg1+(Cps*(Tsup1-Tsat1)));\n", + "U1 = H1-(P1*100*V);\n", + "\n", + "Hg2 = 2795.5; #in kJ/kg from Steam table\n", + "H2 = m*Hg2;\n", + "U2 = H2-(P2*100*V);\n", + "\n", + "# Calculations and Results\n", + "Q = U2-U1;\n", + "print 'Heat Transferred: %3.1f kJ'%(Q);\n", + "\n", + "\n", + "Sg1 = 6.341; #in kJ/kg K\n", + "S1 = Sg1+(Cps*math.log(Tsup1/Tsat1));\n", + "\n", + "S2 = 6.4022; #From Steam Table\n", + "S = m*(S2-S1);\n", + "print 'Change in Entropy: %3.3f kJ/K'%(S);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat Transferred: -2577.3 kJ\n", + "Change in Entropy: -4.886 kJ/K\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.25 pg : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "#For Throttling process, H1 = H2\n", + "#At 15 bar pressure\n", + "P1 = 15.; #in bar\n", + "Hf1 = 844.9; #in kJ/kg\n", + "Hfg1 = 1947.3; #in kJ/kg\n", + "x1 = 0.73; #Dryness Fraction\n", + "\n", + "#At 1 bar pressure\n", + "P2 = 1.; #in bar\n", + "Hf2 = 417.5; #in kJ/kg\n", + "Hfg2 = 2258.0; #in kJ/kg\n", + "Hg2 = 2675.5; #in kJ/kg\n", + "H2 = 2266.4; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "H1 = Hf1+(x1*Hfg1);\n", + "x2 = (H2-Hf2)/Hfg2;\n", + "\n", + "#Now if x1 = 0.95\n", + "H1 = Hf1+(0.95*Hfg1);\n", + "H2 = H1;\n", + "\n", + "#At 1 bar\n", + "Hg = 2675.5;\n", + "Cps = 2.1;\n", + "x = 0.93; #New dryness fraction\n", + "T = (H2-Hg)/Cps; #Temperature difference\n", + "Tsat = 99; #in Celcius\n", + "Tsup = Tsat+T;\n", + "print 'Temperature of superheated steam: %3.1f Celcius'%(Tsup);\n", + "\n", + "\n", + "#Now at 15 bar\n", + "Sf = 2.315; #in kJ/kg K\n", + "Sfg = 4.130; #in kJ/kg K\n", + "Sg = 6.445; #in kJ/kg K\n", + "S1 = Sf+(x*Sfg);\n", + "\n", + "#Now at 1 bar\n", + "Sg1 = 7.360; #in kJ/kg K\n", + "S2 = Sg1+(Cps*math.log((Tsup+273)/(Tsat+273)));\n", + "S = S2-S1;\n", + "print 'Change in Entropy: %3.2f kJ/kg K'%(S);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of superheated steam: 108.2 Celcius\n", + "Change in Entropy: 1.26 kJ/kg K\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.26 pg : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Heat lost by Steam = Heat gained by water and calorimeter\n", + "# Variables\n", + "ms = 2.; #in kg\n", + "Hf1 = 697.2; #in kJ/kg\n", + "Hfg1 = 2066.3; #in kJ/kg\n", + "Hf2 = 146.7; #in kJ/kg\n", + "T2 = 35.; #in Celcius\n", + "T1 = 15.; #in Celcius\n", + "mg = 56; #in kg\n", + "\n", + "# Calculations\n", + "Cpw = 4.187; #in kJ/kg K\n", + "H_gained = mg*Cpw*(T2-T1);\n", + "x = (((H_gained)/2)+(Hf2-Hf1))/Hfg1;\n", + "\n", + "# Results\n", + "print 'The dryness fraction is %2.2f '%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The dryness fraction is 0.87 \n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.27 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ms = 10.;\n", + "Mw = 1.;\n", + "\n", + "# Calculations\n", + "x = (100*Ms)/(Ms+Mw);\n", + "\n", + "# Results\n", + "print 'The Dryness Fraction of steam is %2.1f percent'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Dryness Fraction of steam is 90.9 percent\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.28 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P1 = 11.; #in bar\n", + "P2 = 1.1; #in bar\n", + "T2 = 130.+273; #in K\n", + "Cps = 2.1; #in kJ/kg K\n", + "\n", + "# Calculations\n", + "#At 11 bar\n", + "Hf1 = 781.3; #in kJ/kg\n", + "Hfg1 = 2000.4; #in kJ/kg\n", + "\n", + "#At 1.1 bar\n", + "Hg2 = 2679.7; #in kJ/kg\n", + "Tsat = 102.3+273; #in K\n", + "Tsup = 130+273;\n", + "\n", + "#Now for throttling process, H1 = H2\n", + "H2 = Hg2+(Cps*(Tsup-Tsat));\n", + "x = ((H2-Hf1)*100)/Hfg1;\n", + "\n", + "# Results\n", + "print 'The dryness fraction of steam: %2.1f'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The dryness fraction of steam: 97.8\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.29 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#Combined seperating and throttling calorimeter\n", + "Ms = 5.; #in kg\n", + "Mw = 0.5; #in kg\n", + "Cps = 2.1; #in kJ/kg K\n", + "Man = 166.8; #in mm of Hg\n", + "Bar = 733.6; #in mm of Hg\n", + "\n", + "# Calculations\n", + "x1 = Ms/(Ms+Mw);\n", + "P = Man+Bar;\n", + "P_bar = (1.01325*P)/760; #Pressure in bar\n", + "\n", + "#From steam table\n", + "Hf1 = 742.8; #in kJ/kg\n", + "Hfg1 = 2031.1; #in kJ/kg\n", + "Tsat = 104.8+273; #in K\n", + "Tsup = 110.3+273; #in K\n", + "Hg = 2683.5; #in kJ/kg\n", + "\n", + "H2 = Hg+(Cps*(Tsup-Tsat));\n", + "x2 = (H2-Hf1)/Hfg1;\n", + "x = x1*x2;\n", + "\n", + "# Results\n", + "print 'The dryness fraction of steam: %2.3f'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The dryness fraction of steam: 0.874\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.30 pg : 48" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Combined seperating and throttling calorimeter\n", + "\n", + "# Variables\n", + "Mw = 8.; #in kg\n", + "M = 63.; #in kg\n", + "Ms = M-Mw; #in kg\n", + "P1 = 81.5; #Pressure after throttling in mm\n", + "P2 = 754.; #Barometer reading in mm\n", + "SD = 13.6; #Specific Density of Hg\n", + "\n", + "# Calculations\n", + "x1 = Ms/(Ms+Mw); #Dryness Fraction\n", + "P = (P1/SD)+P2; #Pressure in mm\n", + "P = 1.01325; #Pressure in bar\n", + "\n", + "#Now at 7.5 bar pressure\n", + "Hf1 = 709.2; #in kJ/kg\n", + "Hfg1 = 2057.0; #in kJ/kg\n", + "\n", + "#Now at 1.01325 bar\n", + "Hg2 = 2676.0; #in kJ/kg\n", + "Tsat = 100+273; #in K\n", + "Cps = 2.1; #in kJ/kg K\n", + "Tsup = 110+273; #in K\n", + "\n", + "#For throttling H1 = H2\n", + "H2 = Hg2+(Cps*(Tsup-Tsat));\n", + "x2 = (H2-Hf1)/Hfg1;\n", + "\n", + "x = x1*x2;\n", + "\n", + "# Results\n", + "print 'The dryness fraction of steam: %2.3f'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The dryness fraction of steam: 0.844\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.31 pg : 49" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 9.2 bar pressure\n", + "x1 = 0.96; #Dryness Fraction\n", + "Sf1 = 2.1038; #in kJ/kg K\n", + "Sg1 = 6.6151; #in kJ/kg K\n", + "\n", + "#At 3.55 bar pressure\n", + "Sf2 = 1.7327; #in kJ/kg K\n", + "Sg2 = 6.9358; #in kJ/kg K\n", + "Vg2 = 0.5173; #in m**3/kg\n", + "\n", + "#Now at 0.36 bar pressure\n", + "Vg3 = 4.408; #in m**3/kg\n", + "\n", + "# Calculations\n", + "S1 = Sf1+(x1*(Sg1-Sf1));\n", + "\n", + "#As process is adiabatic\n", + "S2 = S1;\n", + "\n", + "#From steam table, Sg = 6.9358 > S2\n", + "\n", + "x2 = (S2-Sf2)/(Sg2-Sf2);\n", + "V2 = x2*Vg2;\n", + "\n", + "#As volume remains consmath.tant\n", + "V3 = V2;\n", + "x3 = V3/Vg3;\n", + "\n", + "# Results\n", + "print 'The dryness fraction of steam: %2.3f'%(x3);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The dryness fraction of steam: 0.106\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.32 pg : 50" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 10 bar pressure\n", + "m = 1./(0.9*0.194);\n", + "\n", + "Hf1 = 762.6; #in kJ/kg\n", + "x1 = 0.9; #Dryness Fraction\n", + "Hfg1 = 2013.6; #in kJ/kg\n", + "H1 = Hf1+(x1*Hfg1);\n", + "\n", + "# Calculations and Results\n", + "Hf2 = 640.1; #in kJ/kg\n", + "Hfg2 = 2107.4; #in kJ/kg\n", + "x2 = (H1-Hf2)/Hfg2;\n", + "Vg2 = 0.375;\n", + "\n", + "Ms = (1./(x2*Vg2));\n", + "Vg3 = 0.462;\n", + "#Now mass of steam blown off\n", + "M = m-Ms;\n", + "\n", + "print 'Mass of steam blown off: %2.3f kg'%(M);\n", + "\n", + "\n", + "V = 1; #Volume in m**3\n", + "x3 = V/(Ms*Vg3);\n", + "print 'Dryness fraction of steam: %2.3f '%(x3);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of steam blown off: 2.823 kg\n", + "Dryness fraction of steam: 0.745 \n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.33 pg : 51" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 25 bar pressure\n", + "P = 25.; #Pressure in bar\n", + "x = 0.8; #Dryness fraction\n", + "Hf = 962.1; #in kJ/kg\n", + "Hfg = 1841; #in kJ/kg\n", + "Vg = 0.0801; #in m**3/kg\n", + "\n", + "# Calculations and Results\n", + "H = Hf+(x*Hfg);\n", + "print 'Enthalpy: %2.1f kJ/kg'%(H);\n", + "\n", + "U = H-(P*100*x*Vg);\n", + "print 'Internal Energy: %2.1f kJ/kg'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy: 2434.9 kJ/kg\n", + "Internal Energy: 2274.7 kJ/kg\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.34 pg : 51" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Ms = 20.; #in kg\n", + "Mw = 2.; #in kg\n", + "Cps = 2.1; #in kJ/kg K\n", + "x1 = Ms/(Ms+Mw); #Dryness fraction\n", + "\n", + "#At 12 bar pressure\n", + "Hf1 = 798.6; #in kJ/kg\n", + "Hfg1 = 1986.2; #in kJ/kg\n", + "\n", + "#At 1 bar pressure\n", + "Hg2 = 2675.5; #in kJ/kg\n", + "Tsup = 110.+273; #in K\n", + "Tsat = 99.+273; #in K\n", + "\n", + "# Calculations\n", + "#For throttling, H1 = H2\n", + "H2 = Hg2+(Cps*(Tsup-Tsat));\n", + "x2 = (H2-Hf1)/Hfg1;\n", + "\n", + "x = x1*x2;\n", + "\n", + "# Results\n", + "print 'Dryness fraction of steam: %2.4f kJ'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Dryness fraction of steam: 0.8696 kJ\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.35 pg : 51" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "V = 0.15; #in m**3\n", + "P = 4.; #in bar\n", + "x = 0.8; #Dryness fraction\n", + "\n", + "#Now at 4 bar pressure\n", + "P = 4.; #in bar\n", + "Vg = 0.463; #in m**3/kg\n", + "\n", + "# Calculations\n", + "SV = x*Vg;\n", + "Mos = V/SV; #Mass of Steam\n", + "\n", + "#Now if Volume is 1 m**3\n", + "\n", + "Ms = 1./SV; #in kg\n", + "#At 4 bar pressure\n", + "Hf = 604.7; #in kJ/kg\n", + "Hfg = 2133.8; #in kJ/kg\n", + "H = Ms*(Hf+(x*Hfg));\n", + "\n", + "# Results\n", + "print 'Enthalpy of 1 m**3 steam: %2.2f kJ'%(H);\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy of 1 m**3 steam: 6241.20 kJ\n" + ] + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.36 pg : 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P1 = 9.; #in bar\n", + "P2 = 1.; #in bar\n", + "T2 = 115.+273; #in K\n", + "m = 1.8; #in kg\n", + "m1 = 0.2; #in kg\n", + "x1 = m/(m+m1); #Dryness fraction\n", + "\n", + "# Calculations\n", + "#Now from steam table\n", + "Hf = 742.8; #in kJ/kg\n", + "Hfg = 2031.1; #in kJ/kg\n", + "Hg = 2675.5; #in kJ/kg\n", + "Tsat = 99+273; #in K\n", + "Tsup = 115+273; #in K\n", + "Cps = 2.1; #in kJ/kg K\n", + "H2 = Hg+(Cps*(Tsup-Tsat));\n", + "x2 = (H2-Hf)/Hfg;\n", + "x = x1*x2;\n", + "\n", + "# Results\n", + "print 'The dryness fraction: %2.4f kJ'%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The dryness fraction: 0.8713 kJ\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.37 pg : 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "m1 = 0.45; #in kg\n", + "m = 7.; #in kg\n", + "P1 = 12.; #in bar\n", + "Bar = 760.; #mm of Hg Barometer reading\n", + "Man = 180.; #mm of Hg Manometer Reading\n", + "Cps = 2.1; #in kJ/kg K\n", + "P = Bar+Man;\n", + "P2 = (P*1.01325)/760; #Pressure in bar\n", + "Tsup = 140.+273; #in K\n", + "x1 = m/(m+m1);\n", + "\n", + "#Now at 12 bar pressure\n", + "Hf = 798.6; #in kJ/kg\n", + "Hfg = 1986.2; #in kJ/kg\n", + "\n", + "# Calculations\n", + "#At 1.25 bar pressure\n", + "Hg = 2685.3; #in kJ/kg\n", + "Tsat = 106+273; #in K\n", + "#For throttling H1 = H2\n", + "H2 = Hg+(Cps*(Tsup-Tsat));\n", + "x2 = (H2-Hf)/Hfg;\n", + "\n", + "x = x1*x2;\n", + "\n", + "# Results\n", + "print 'The dryness fraction: %2.3f '%(x);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The dryness fraction: 0.926 \n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.38 pg : 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "#Case 1\n", + "P = 10.; #in bar\n", + "Cps = 2.1; #in kJ/kg K\n", + "x = 0.85; #Dryness fraction\n", + "Hf = 762.8; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "Vg = 0.194; #in m**3/kg\n", + "Hg = 2778.1; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "H = Hf+(x*Hfg);\n", + "print 'Case 1: When x = 0.85 ';\n", + "print 'Enthalpy of steam: %2.2f kJ'%(H);\n", + "\n", + "\n", + "U = H-(P*100*x*Vg);\n", + "print 'Internal Energy of steam: %2.2f kJ'%(U);\n", + "\n", + "\n", + "#Case 2\n", + "H = Hg; #in kJ/kg\n", + "print ' Case 2: When steam is dry and saturated ';\n", + "print 'Enthalpy of steam: %2.2f kJ'%(H);\n", + "\n", + "\n", + "U = H-(P*100*Vg);\n", + "print 'Internal Energy of steam: %2.2f kJ'%(U);\n", + "\n", + "\n", + "#Case 3\n", + "Tsup = 300.+273; #in K\n", + "Tsat = 179.9+273; #in K\n", + "H = Hg+(Cps*(Tsup-Tsat));\n", + "print ' Case 3: When steam is superheated to 300 C ';\n", + "print 'Enthalpy of steam: %2.2f kJ'%(H);\n", + "\n", + "\n", + "Vsup = (Tsup/Tsat)*Vg;\n", + "U = H-(P*100*Vsup);\n", + "print 'Internal Energy of steam: %2.2f kJ'%(U);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Case 1: When x = 0.85 \n", + "Enthalpy of steam: 2475.80 kJ\n", + "Internal Energy of steam: 2310.90 kJ\n", + " Case 2: When steam is dry and saturated \n", + "Enthalpy of steam: 2778.10 kJ\n", + "Internal Energy of steam: 2584.10 kJ\n", + " Case 3: When steam is superheated to 300 C \n", + "Enthalpy of steam: 3030.31 kJ\n", + "Internal Energy of steam: 2784.87 kJ\n" + ] + } + ], + "prompt_number": 44 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.39 pg : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Ms = 5.; #in kg\n", + "P = 5.; #in bar\n", + "Tsup = 250.+273; #in K\n", + "Cps = 2.1; #in kJ/kg K\n", + "Tf = 30.; #in C\n", + "Cpw = 4.187; #in kJ/kg K\n", + "H1 = Cpw*Tf;\n", + "\n", + "# Calculations\n", + "#At 5 bar pressure\n", + "Tsat = 151.9+273; #in K\n", + "Hg = 2748.7; #in kJ/kg\n", + "H2 = Hg+(Cps*(Tsup-Tsat));\n", + "Q = Ms*(H2-H1);\n", + "\n", + "# Results\n", + "print 'Amount of heat required: %2.2f kJ'%(Q);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of heat required: 14145.50 kJ\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.40 pg : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ms = 3.; #in kg\n", + "Tf = 30.; #in C\n", + "P = 8.; #in bar\n", + "Tsup = 210.+273; #in K\n", + "Cps = 2.1; #in kJ/kg K\n", + "Cpw = 4.186; #in kJ/kg K\n", + "\n", + "\n", + "# Calculations\n", + "H1 = Cpw*Tf;\n", + "\n", + "#At 8 bar pressure\n", + "Tsat = 170.4+273; #in K\n", + "Hg = 2769.1; #in kJ/kg\n", + "H2 = Hg+(Cps*(Tsup-Tsat));\n", + "Q = Ms*(H2-H1);\n", + "\n", + "# Results\n", + "print 'Amount of heat required: %2.2f kJ'%(Q);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of heat required: 8180.04 kJ\n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.41 pg : 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 7 bar pressure\n", + "P1 = 7.; #in bar\n", + "P2 = 1.; #in bar\n", + "n = 1.1;\n", + "#Now according to law of expansion P(V)**1.1 = Consmath.tant\n", + "\n", + "# Calculations and Results\n", + "Vg1 = 0.273; #in m**3/kg\n", + "V1 = Vg1;\n", + "V2 = ((P1/P2)**(1./n))*V1;\n", + "\n", + "W = ((P1*100*V1)-(P2*100*V2))/(n-1);\n", + "print 'Work Done: %3.1f kJ/kg'%(W);\n", + "\n", + "\n", + "Hg = 2763.5; #in kJ/kg\n", + "H1 = Hg;\n", + "Vg = 1.694;\n", + "#At 1 bar, Vg = 1.694 and as V2<Vg steam is wet\n", + "x = V2/Vg;\n", + "\n", + "Hf = 417.5; #in kJ/kg\n", + "Hfg = 2258; #in kJ/kg\n", + "H2 = Hf+(x*Hfg);\n", + "\n", + "U2 = H2-(P2*100*V2);\n", + "U1 = H1-(P1*100*V1);\n", + "U = U2-U1;\n", + "print 'Change in Internal Energy: %3.2f kJ/kg'%(U);\n", + "\n", + "\n", + "Q = U+W;\n", + "print 'Heat transferred during the process: %3.2f kJ/kg'%(Q);\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work Done: 309.8 kJ/kg\n", + "Change in Internal Energy: -180.77 kJ/kg\n", + "Heat transferred during the process: 129.07 kJ/kg\n" + ] + } + ], + "prompt_number": 48 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch5.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch5.ipynb new file mode 100755 index 00000000..87c6cf47 --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch5.ipynb @@ -0,0 +1,985 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7da1949891147ff304647e6b26339aefc0967b49ac6c364d6dfbaaf34a273512" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : Steam Boilers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 pg : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Mf = 1300.; #in kg\n", + "Ma = 13000.; #in kg\n", + "P = 7.; #in bar\n", + "Cpw = 4.187; #in kJ/kg K\n", + "CV = 30000.; #in kJ/kg\n", + "x = 0.95; #Dryness Fraction\n", + "Tfw = 40.; #in C\n", + "\n", + "Hfw = Tfw*Cpw;\n", + "\n", + "#At 7 bar\n", + "Hf = 697.2; #in kJ/kg\n", + "Hfg = 2066.3; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "H = Hf+(x*Hfg);\n", + "Ms = Ma/Mf;\n", + "\n", + "Me = (Ms*(H-Hfw))/(2257);\n", + "print 'Equivalent evaporation: %3.2f kg/kg of coal'%(Me);\n", + "\n", + "\n", + "Eff = 100*(Ma*(H-Hfw))/(Mf*CV);\n", + "print 'Boiler Efficiency: %3.1f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent evaporation: 11.04 kg/kg of coal\n", + "Boiler Efficiency: 83.1 Percent\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 pg : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 5400.; #in kg/hr\n", + "Tfw = 42.; #in C\n", + "P = 7.6; #in bar\n", + "Mf = 670.; #in kg/hr\n", + "x = 0.98; #Dryness Fraction\n", + "CV = 31000.; #kJ/kg\n", + "Ms = Ma/Mf;\n", + "Hf = 175.81; #in kJ/kg\n", + "Hfw = Hf;\n", + "\n", + "#Now at 7.6 bar pressure\n", + "Hf = 711.8; #in kJ/kg\n", + "Hfg = 2055.2; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "H = Hf+(x*Hfg);\n", + "Eff = 100*(Ma*(H-Hfw))/(Mf*CV);\n", + "print 'Boiler Efficiency %3.1f percent'%(Eff);\n", + "\n", + "\n", + "Me = (Ms*(H-Hfw))/(2257);\n", + "print 'Equivalent evaporation: %3.2f kg/kg of coal'%(Me);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Boiler Efficiency 66.3 percent\n", + "Equivalent evaporation: 9.11 kg/kg of coal\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P = 12; #in bar\n", + "CV = 34000; #in kJ/kg\n", + "T = 250; #in C\n", + "Ms = 10; #in kg/kg of coal\n", + "Tfw = 36; #in C\n", + "Hfw = 150.74; #in kJ/kg\n", + "Hg = 2784.8; #in kJ/kg\n", + "Tsup = T;\n", + "Tsat = 188; #in C\n", + "Cps = 2.1; #in kJ/kg K\n", + "H = Hg+(Cps*(Tsup-Tsat));\n", + "\n", + "# Calculations and Results\n", + "Me = (Ms*(H-Hfw))/2257;\n", + "print 'Equivalent evaporation: %3.2f kg/kg of coal'%(Me);\n", + "\n", + "\n", + "Eff = (Me*250)/21.296;\n", + "print 'Boiler Power: %3.2f kW'%(Eff);\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent evaporation: 12.25 kg/kg of coal\n", + "Boiler Power: 143.78 kW\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4 pg : 48" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 35500; #kg of steam\n", + "Mf = 3460;\n", + "CV = 39500;\n", + "Ms = Ma/Mf;\n", + "\n", + "\n", + "Hfw2 = 313.9; #in kJ/kg\n", + "Hfw1 = 71.4; #in kJ/kg\n", + "\n", + "Q = Ma*(Hfw2-Hfw1); #Heat added in economizer\n", + "H = 2915.0; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "Me = (Ms*(H-Hfw2))/2257;\n", + "print 'Equivalent evaporation: %3.2f kg/kg of Oil'%(Me);\n", + "\n", + "\n", + "Eff1 = (Ma*100*(H-Hfw2))/(Mf*CV);\n", + "print 'Thermal Efficiency of boiler: %3.1f Percent'%(Eff1);\n", + "\n", + "\n", + "Eff2 = (Ma*100*(H-Hfw1))/(Mf*CV);\n", + "print 'Thermal Efficiency of Boiler plant: %3.1f Percent'%(Eff2);\n", + "\n", + "\n", + "HU = 860875000/(Mf*CV);\n", + "print 'Heat Utilized by Economizer: %3.1f Percent'%(HU);\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent evaporation: 11.52 kg/kg of Oil\n", + "Thermal Efficiency of boiler: 67.6 Percent\n", + "Thermal Efficiency of Boiler plant: 73.9 Percent\n", + "Heat Utilized by Economizer: 6.0 Percent\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.5 pg : 49" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 10000; #in kg/hr\n", + "P = 7; #in bar\n", + "\n", + "Tfw = 40; #in C\n", + "Hfw = 167.6; #in kJ/kg\n", + "H = 2763.5; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "Q = Ma*(H-Hfw)/60; #Heat per minute\n", + "SA = Q/2720; #Heating surface area required\n", + "print 'Heating surface area required: %3.1f m**2'%(SA);\n", + "\n", + "\n", + "GA = SA/25;\n", + "print 'Grate area required: %3.1f m**2'%(GA);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heating surface area required: 159.1 m**2\n", + "Grate area required: 6.4 m**2\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.6 pg : 50" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 2400; #in kg\n", + "Mf = 240; #in kg\n", + "P = 12; #in bar\n", + "CV = 33500; #in kJ/kg\n", + "Tfw = 120; #in C\n", + "Cpw = 4.187;\n", + "Hfw = Cpw*Tfw;\n", + "H = 2784.8; #in kJ/kg\n", + "Mfa = Mf-(0.1*Mf);\n", + "\n", + "# Calculations and Results\n", + "Eff = (Ma*100*(H-Hfw))/(Mfa*CV);\n", + "print 'Thermal Efficiency: %3.1f percent'%(Eff);\n", + "\n", + "\n", + "Eff1 = (Ma*100*(H-Hfw))/(Mf*CV);\n", + "print 'Thermal Efficiency of boiler and grate: %3.1f percent'%(Eff1);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal Efficiency: 75.7 percent\n", + "Thermal Efficiency of boiler and grate: 68.1 percent\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.7 pg : 50" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Mf = 255; #in kg\n", + "x = 0.94; #Dryness Fraction\n", + "CV = 30100; #in kJ/kg\n", + "P = 11.5; #in bar\n", + "Ma = 2100; #in kg\n", + "Tfw = 25; #in C\n", + "Ms = Ma/Mf;\n", + "\n", + "Hfw = 104.9; #in kJ/kg\n", + "Hf = 790.1; #in kJ/kg\n", + "Hfg = 1993.2; #in kJ/kg\n", + "H = Hf+(x*Hfg);\n", + "\n", + "# Calculations and Results\n", + "Me = (Ms*(H-Hfw))/2257;\n", + "Eff = (Ma*100*(H-Hfw))/(Mf*CV);\n", + "print 'Equivalent Evaporation: %3.2f kg/kg of coal '%(Me)\n", + "print 'Thermal Efficiency: %3.1f percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent Evaporation: 9.07 kg/kg of coal \n", + "Thermal Efficiency: 70.0 percent\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.8 pg : 51" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Hf = 762.8; #in kJ/kg\n", + "Hfg = 2015.3; #in kJ/kg\n", + "x = 0.95; #Dryness Fraction\n", + "Ma = 1000;\n", + "Eff = 0.75;\n", + "CV = 31000;\n", + "\n", + "# Calculations\n", + "H = Hf+(x*Hfg);\n", + "Cpw = 4.187;\n", + "T = 50;\n", + "\n", + "Hfw = Cpw*T;\n", + "Q = Ma*(H-Hfw);\n", + "\n", + "Mf = Q/(Eff*CV);\n", + "y = Mf/0.9;\n", + "\n", + "Eff1 = (Q*100)/(y*CV);\n", + "\n", + "# Results\n", + "print 'Efficiency of Boiler and grate: %3.1f percent'%(Eff1);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of Boiler and grate: 67.5 percent\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.9 pg : 52" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 10 bar\n", + "Hg = 2778.1; #in kJ/kg\n", + "Cp = 2.1; #in kJ/kg K\n", + "T = 50;\n", + "CV = 30000; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "H = Hg+(Cp*T);\n", + "C = 4.187;\n", + "Tf = 30;\n", + "Hfw = C*Tf;\n", + "\n", + "Ms = 800./100;\n", + "\n", + "Me = (Ms*(H-Hfw))/2257;\n", + "print 'Equivalent Evaporation: %3.2f kg/kg of coal'%(Me);\n", + "\n", + "\n", + "Eff = (Ms*100*(H-Hfw))/CV;\n", + "print 'Efficiency of Boiler and grate: %3.1f percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent Evaporation: 9.77 kg/kg of coal\n", + "Efficiency of Boiler and grate: 73.5 percent\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.10 pg : 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "#At 10 bar pressure\n", + "Tsat = 179.9;\n", + "Tsup = 250;\n", + "Cps = 2.1; #in kJ/kg K\n", + "\n", + "Hg = 2778.1; #in kJ/kg\n", + "Ms = 10; #in kg/kg of coal\n", + "Hsup = Hg+(Cps*(Tsup-Tsat));\n", + "\n", + "Hfw = 155;\n", + "Me = (Ms*(Hsup-Hfw))/2257;\n", + "\n", + "# Calculations\n", + "FOE = Me/Ms; #Factor of Evaporation\n", + "BP = (Me*370)/21.296;\n", + "\n", + "# Results\n", + "print 'Equivalent Evaporation: %3.1f kg/kg of coal'%(Me);\n", + "print 'Boiler Power: %3.1f kW'%(BP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent Evaporation: 12.3 kg/kg of coal\n", + "Boiler Power: 213.3 kW\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.11 pg: 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 1100; #in kg/hr\n", + "CV = 33000; #in kJ/kg\n", + "Tfw = 46; #in C\n", + "P = 10; #in bar\n", + "x = 0.9; #Dryness Fraction\n", + "Eff = 0.81; #Efficiency\n", + "\n", + "# Calculations\n", + "Hf = 762.8;\n", + "Hfg = 2015.3;\n", + "H = Hf+(x*Hfg);\n", + "Hfw = 192.6;\n", + "\n", + "Mf = (Ma*(H-Hfw))/(CV*Eff);\n", + "\n", + "# Results\n", + "print 'Amount of Coal Consumed per hour: %3.1f kg'%(Mf);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of Coal Consumed per hour: 98.1 kg\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.12 pg : 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ms = 7.3; #kg/kg of fuel\n", + "Tfw = 46; #in C\n", + "P = 10; #in bar\n", + "FOE = 1.17; #Factor of Evaporation\n", + "Eff = 0.79;\n", + "\n", + "# Calculations and Results\n", + "Me = FOE*Ms;\n", + "print 'Equivalent Evaporation: %3.2f kg/kg of coal'%(Me);\n", + "\n", + "\n", + "Hfw = 192.6; #in kJ/kg\n", + "Hg = 2778.1; #in kJ/kg\n", + "Tsat = 179.9; #in C\n", + "Cps = 2.1; #in kJ/kg K\n", + "H = (2257*FOE)+Hfw;\n", + "Tsup = ((H-Hg)/Cps)+Tsat;\n", + "print 'Temperature of Superheated Steam: %3.1f C'%(Tsup);\n", + "\n", + "\n", + "CV = (Ms*(H-Hfw))/Eff;\n", + "print 'Calorific Value: %3.1f kJ/kg'%(CV);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent Evaporation: 8.54 kg/kg of coal\n", + "Temperature of Superheated Steam: 206.2 C\n", + "Calorific Value: 24401.3 kJ/kg\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.13 pg : 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 18000; #in kg/hr\n", + "P = 10; #in bar\n", + "x = 0.97; #Dryness Fraction\n", + "Tfw = 40; #in C\n", + "Mf = 2050; #in kg/hr\n", + "CV = 28000; #kJ/kg\n", + "\n", + "#At 10 bar\n", + "Hf1 = 762.8;\n", + "Hfg1 = 2015.3;\n", + "H = Hf1+(x*Hfg1);\n", + "Hfw = 167.6;\n", + "\n", + "# Calculations and Results\n", + "Eff = (Ma*100*(H-Hfw))/(Mf*CV);\n", + "print 'Boiler efficiency: %3.2f Percent'%(Eff);\n", + "\n", + "EA = ((Ma/Mf)*(H-Hfw))/2257;\n", + "print 'Equivalent Evaporation: %3.2f kg/kg of coal'%(EA);\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Boiler efficiency: 79.97 Percent\n", + "Equivalent Evaporation: 9.04 kg/kg of coal\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.14 pg : 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 18000; #in kg/hr\n", + "P = 12; #in bar\n", + "x = 0.97; #Dryness Fraction\n", + "CV = 27400; #in kJ/kg\n", + "Mf = 2050; #in kg>hr\n", + "\n", + "# Calculations and Results\n", + "Qs = Mf*CV;\n", + "print 'Heat Supplied per hour: %3.1f kJ/hr'%(Qs);\n", + "\n", + "\n", + "#At 12 bar \n", + "Hf = 798.6; #in kJ/kg\n", + "Hfg = 1986.2; #in kJ/kg\n", + "H1 = Hf+(x*Hfg);\n", + "\n", + "#At 105 C\n", + "Hfw = 438.9; #in kJ/kg\n", + "Eff = (Ma*100*(H1-Hfw))/Qs;\n", + "print 'Thermal Efficiency: %3.2f Percent'%(Eff);\n", + "\n", + "\n", + "Ms = Ma/Mf;\n", + "print 'Factor of Evaporation: %3.2f kg of steam '%(Ms);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat Supplied per hour: 56170000.0 kJ/hr\n", + "Thermal Efficiency: 73.27 Percent\n", + "Factor of Evaporation: 8.00 kg of steam \n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.15 pg : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ms = 7.5; #kg/kg of coal\n", + "P = 11; #in bar\n", + "Tf = 70; #in C\n", + "Eff = 0.75; #Efficiency\n", + "FOE = 1.15; #Factor of Evaporation\n", + "Cps = 2.1; #in kJ/kg K\n", + "Hfw = 293; #in kJ/kg\n", + "H = (FOE*2257)+Hfw;\n", + "\n", + "# Calculations and Results\n", + "#At 11 bar\n", + "Hg = 2781.7; #in kJ/kg\n", + "Tsat = 184.1; #in C\n", + "Tsup = ((H-Hg)/Cps)+Tsat;\n", + "DOS = Tsup-Tsat; #Degree of Superheat\n", + "print 'Degree of Superheat: %3.1f C'%(DOS);\n", + "\n", + "\n", + "Me = (Ms*(H-Hfw))/2257;\n", + "print 'Equivalent evaporation: %3.2f kg/kg of coal'%(Me);\n", + "\n", + "\n", + "CV = (Ms*(H-Hfw))/Eff;\n", + "print 'Calorific value of Boiler: %3.2f kJ/kg '%(CV);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Degree of Superheat: 50.9 C\n", + "Equivalent evaporation: 8.62 kg/kg of coal\n", + "Calorific value of Boiler: 25955.50 kJ/kg \n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.16 pg: 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 17000; #in kg/hr\n", + "P = 14; #in bar\n", + "x = 0.95; #Dryness Fraction\n", + "Tfw = 102; #in C\n", + "Mf = 2050; #in kg/hr\n", + "CV = 27400; #Calorific Value\n", + "\n", + "# Calculations and Results\n", + "HS = Mf*CV;\n", + "print 'Heat Supplied per hour: %3.2f kJ'%(HS);\n", + "\n", + "\n", + "Hf = 830.3; #in kJ/kg\n", + "Hfg = 1959.7; #in kJ/kg\n", + "Hfw = 427.5; #in kJ/kg\n", + "\n", + "H = Hf+(x*Hfg);\n", + "Eff = (Ma*100*(H-Hfw))/(Mf*CV);\n", + "print 'Efficiency of Boiler: %3.2f Percent'%(Eff);\n", + "\n", + "\n", + "Ms = Ma/Mf;\n", + "Me = (Ms*(H-Hfw))/2257;\n", + "print 'Equivalent evaporation: %3.2f kg/kg of coal'%(Me);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat Supplied per hour: 56170000.00 kJ\n", + "Efficiency of Boiler: 68.54 Percent\n", + "Equivalent evaporation: 8.03 kg/kg of coal\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.17 pg: 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 1800; #kg/hr\n", + "P = 12; #in bar\n", + "x = 0.97; #Dryness Fraction\n", + "Tfw = 105; #in C\n", + "Mf = 2050; #in kg/hr\n", + "CV = 27400; #in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "Q = Mf*CV;\n", + "print 'Heat Supplied: %3.2f kJ'%(Q);\n", + "\n", + "#At 12 bar pressure\n", + "Hf = 798.6; #in kJ/kg\n", + "Hfg = 1986.2; #in kJ/kg\n", + "H = Hf+(x*Hfg);\n", + "Hfw = 4.187*Tfw;\n", + "\n", + "Me = (Ma*(H-Hfw))/(2257*Mf);\n", + "print 'Equivalent Evaporation: %3.2f kg/kg of coal'%(Me);\n", + "\n", + "Eff = (Ma*100*(H-Hfw))/(CV*Mf);\n", + "print 'Efficiency of boiler: %3.2f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat Supplied: 56170000.00 kJ\n", + "Equivalent Evaporation: 0.89 kg/kg of coal\n", + "Efficiency of boiler: 7.32 Percent\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.18 pg : 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Me = 10; \t\t #kg/kg\n", + "CV = 34000. #kJ/kg\n", + "\n", + "# Calculations\n", + "x = Me*2257;\n", + "Eff = 100*x/CV;\n", + "\n", + "# Results\n", + "print 'Efficiency of Boiler: %3.2f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of Boiler: 66.38 Percent\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.19 pg : 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ma = 5500; #kg/hr\n", + "P = 1; #bar\n", + "x = 0.94; #Dryness Fraction\n", + "Tfw = 40; #in C\n", + "Mf = 600; #kg/hr\n", + "CV = 32000; #kJ/kg\n", + "Hfw = Tfw*4.187;\n", + "\n", + "#At 1 bar pressure\n", + "Hf = 417.5; #kJ/kg\n", + "Hfg = 2258; #kJ/kg\n", + "H = Hf+(x*Hfg);\n", + "Ms = Ma/Mf;\n", + "\n", + "# Calculations and Results\n", + "Me = (Ms*(H-Hfw))/2257;\n", + "print 'Equivalent Evaporation: %3.3f kg/kg of coal'%(Me);\n", + "\n", + "Eff = (Ms*100*(H-Hfw))/CV;\n", + "print 'Efficiency: %3.2f percent'%(Eff);\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent Evaporation: 9.461 kg/kg of coal\n", + "Efficiency: 66.73 percent\n" + ] + } + ], + "prompt_number": 26 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch6.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch6.ipynb new file mode 100755 index 00000000..3116537b --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch6.ipynb @@ -0,0 +1,1771 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:ea6b758d417b9f2ef812eef289a8c47b5e6d344a1d3c4aa162888434591db094" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 : Heat Engines" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 pg : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "m = 1; #in kg\n", + "R = 0.287; #Universal Gas Consmath.tant\n", + "r = 7; #Compression Ratio\n", + "P1 = 1; #in bar\n", + "T1 = 24+273; #in K\n", + "T3 = 2000; #in K\n", + "G = 1.4; #Gamma\n", + "\n", + "# Calculations and Results\n", + "ASE = (1-(1./(r)**(G-1)))*100;\n", + "print 'Air standand Efficiency is %3.1f Percent'%(ASE);\n", + "\n", + "P2 = P1*(r)**G;\n", + "print 'Pressure at end of Compression is %3.2f Bar'%(P2);\n", + "\n", + "T2 = T1*((r)**(G-1));\n", + "print 'Temperature at end of Compression is %3.2f K'%(T2);\n", + "\n", + "Cv = 0.718;\n", + "Q = Cv*(T3-T2);\n", + "print 'Heat Supplied is %3.2f kJ/kg'%(Q);\n", + "\n", + "W = ASE*Q/100;\n", + "V1 = (m*R*T1)/(P1*100);\n", + "V2 = V1/r;\n", + "V = V1-V2;\n", + "Pm = W/V;\n", + "print 'Mean Effective Pressure is %3.2f kPa'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air standand Efficiency is 54.1 Percent\n", + "Pressure at end of Compression is 15.25 Bar\n", + "Temperature at end of Compression is 646.84 K\n", + "Heat Supplied is 971.57 kJ/kg\n", + "Mean Effective Pressure is 719.21 kPa\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 pg : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 323.; #in K\n", + "T2 = 673.; #in K\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "r_G = T2/T1;\n", + "r = (r_G)**(1./(G-1));\n", + "print 'Compression Ratio is %2.2f '%(r);\n", + "\n", + "\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "print 'Air standand Efficiency is %2.0f Percent '%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Compression Ratio is 6.27 \n", + "Air standand Efficiency is 52 Percent \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 97.; #in kPa\n", + "T1 = 323.; #in K\n", + "r = 5.; #Compression Ratio\n", + "Q = 930.; #in kJ/kg\n", + "G = 1.4;\n", + "Cv = 0.718;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1*(r**(G-1));\n", + "T3 = (Q/Cv)+T2;\n", + "print 'Maximum Temperature Attained is %2.2f K'%(T3);\n", + "\n", + "\n", + "Eff = 100*(1-(1./(r)**(G-1)));\n", + "print 'Thermal Efficiency of cycle is %2.1f Percent'%(Eff);\n", + "\n", + "\n", + "W = Eff*Q/100;\n", + "print 'Work Done is %2.2f kJ/kg'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum Temperature Attained is 1910.14 K\n", + "Thermal Efficiency of cycle is 47.5 Percent\n", + "Work Done is 441.47 kJ/kg\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 57.+273; #in K\n", + "T2 = 603.+273; #in K\n", + "T3 = 1950.+273; #in K\n", + "T4 = 870.+273; #in K\n", + "G = 1.4;\n", + "P1 = 1.; #in bar\n", + "Cp = 1.005;\n", + "Cv = 0.718;\n", + "\n", + "# Calculations and Results\n", + "P2 = P1*((T2/T1)**((G)/(G-1)));\n", + "print 'Maximum Pressure attained is %2.1f bar'%(P2);\n", + "\n", + "\n", + "Qs = Cp*(T3-T2); #Heat Supplied\n", + "Qr = Cv*(T4-T1); #Heat Rejected\n", + "Eff = 100*(1-(Qr/Qs));\n", + "print 'Efficiency is %2.0f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum Pressure attained is 30.5 bar\n", + "Efficiency is 57 Percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "V2 = 0.2; #in cm**3\n", + "V3 = V2;\n", + "Vc = V2;\n", + "\n", + "Vs = 1.2; #in cm**3\n", + "V1 = V2+Vs;\n", + "G = 1.4;\n", + "\n", + "# Calculations\n", + "r = (V1/V2);\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "\n", + "# Results\n", + "print 'Efficiency of Engine is %2.0f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of Engine is 54 Percent\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "rc = 14.; #Adiabatic Compression Ratio\n", + "ra = 8.; #Adiabatic Expansion Ratio\n", + "G = 1.4;\n", + "Z = rc/ra; #Cutoff Ratio\n", + "\n", + "# Calculations\n", + "#It is a diesel Cycle\n", + "Eff = 100*(1-((1./(rc**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));\n", + "\n", + "# Results\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency is 60.6 Percent\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Eff = 0.6; #Efficiency\n", + "T2 = 283; #in K\n", + "\n", + "# Calculations\n", + "T1 = T2/(1-Eff);\n", + "\n", + "# Results\n", + "print 'Initial Temperature is %2.1f K'%(T1);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Initial Temperature is 707.5 K\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.8 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 10; #Diameter in cm\n", + "L = 15; #Length in cm\n", + "Vs = (22./7)*(1./4)*D*D*L; #in cm**3\n", + "Vc = 250; #in cm**3\n", + "V2 = Vc;\n", + "V1 = Vs+Vc;\n", + "r = V1/V2;\n", + "G = 1.4;\n", + "\n", + "# Calculations\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "\n", + "# Results\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency is 50.2 Percent\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9 pg : 27\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T3 = 15+273; #in K\n", + "T4 = T3;\n", + "P3 = 1.1; #in bar\n", + "P4 = 4; #in bar\n", + "P1 = 12; #in bar\n", + "N = 150; #in rpm\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "T1 = T4*((P1/P4)**((G-1)/G));\n", + "Eff = 100*(1-(T4/T1));\n", + "print 'The Efficiency is %3.2f Percent'%(Eff);\n", + "\n", + "r = P4/P3;\n", + "R = 0.287;\n", + "m = 1;\n", + "\n", + "W = m*R*(T1-T3)*(math.log(r));\n", + "P = W*(N/60);\n", + "print 'The Power is %3.1f kW'%(P);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Efficiency is 26.94 Percent\n", + "The Power is 78.7 kW\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.10 pg : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T3 = 1350+273; #in K\n", + "T1 = 30+273; #in K\n", + "Qs = 750; #in kJ/kg\n", + "Cv = 0.718;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "#For Process 2-3\n", + "T2 = T3-(Qs/Cv);\n", + "r = (T2/T1)**(1./(G-1));\n", + "print 'The compression Ratio is %3.2f '%(r);\n", + "\n", + "\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "print 'The Efficiency is %3.1f Percent'%(Eff);\n", + "\n", + "\n", + "W = Eff*Qs/100;\n", + "print 'The Work Output is %3.0f kJ/kg'%(W);\n", + "\n", + "\n", + "P21 = (r**G);\n", + "P32 = T3/T2;\n", + "P31 = P21*P32;\n", + "print 'Ratio of maximum to minimum pressure is %3.2f '%(P31);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The compression Ratio is 5.04 \n", + "The Efficiency is 47.6 Percent\n", + "The Work Output is 357 kJ/kg\n", + "Ratio of maximum to minimum pressure is 26.97 \n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.11 pg : 27\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Vs = 500; #in cm**3\n", + "Vc = 55; #in cm**3\n", + "T1 = 30+273; #in K\n", + "P1 = 1; #in bar\n", + "T3 = 1450+273; #in K\n", + "G = 1.4;\n", + "R = 0.287;\n", + "Cv = 0.718;\n", + "\n", + "# Calculations and Results\n", + "r = (Vs+Vc)/Vc;\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "print 'The standand air Efficiency is %3.2f Percent'%(Eff);\n", + "\n", + "\n", + "T2 = T1*(r**(G-1));\n", + "Qs = Cv*(T3-T2);\n", + "W = Eff*Qs;\n", + "\n", + "V1 = Vc+Vs;\n", + "m = (P1*100*V1*(10**-6))/(R*T1);\n", + "Pm = (W*m)/(100*(Vs*(10**-6)));\n", + "print 'The Mean Effective Pressure is %3.1f kPa'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The standand air Efficiency is 60.19 Percent\n", + "The Mean Effective Pressure is 530.6 kPa\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.12 pg : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 6; #Compression Ratio\n", + "T1 = 20+273; #in K\n", + "G = 1.4;\n", + "Cv = 0.718;\n", + "Qs = 1900;\n", + "\n", + "# Calculations and Results\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "print 'The Efficiency is %3.2f Percent'%(Eff);\n", + "\n", + "\n", + "T2 = T1*(r**(G-1));\n", + "print 'The value of T2 is %3.0f K'%(T2);\n", + "\n", + "\n", + "T3 = (Qs/Cv)+T2;\n", + "print 'The value of T3 is %3.0f K'%(T3);\n", + "\n", + "\n", + "T4 = T3/(r**(G-1));\n", + "print 'The value of T4 is %3.0f K'%(T4);\n", + "\n", + "\n", + "W = Qs*Eff/100;\n", + "print 'The Work Output is %3.0f kJ/kg'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Efficiency is 51.16 Percent\n", + "The value of T2 is 600 K\n", + "The value of T3 is 3246 K\n", + "The value of T4 is 1585 K\n", + "The Work Output is 972 kJ/kg\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.13 pg : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.1; #Diameter\n", + "L = 0.12; #Length\n", + "V = (22./7)*(1./4)*D*D*L;\n", + "T1 = 19+273;\n", + "r = 6.5; #Compression ratio\n", + "P1 = 1; #in bar\n", + "G = 1.4; #Gamma\n", + "Vs = 9.425*(10**-4);\n", + "\n", + "# Calculations and Results\n", + "Vc = Vs/(r-1);\n", + "V1 = Vc+Vs;\n", + "print 'V1 = %3.5f m**3'%(V1);\n", + "\n", + "\n", + "V2 = Vc;\n", + "V3 = Vc;\n", + "P2 = P1*(r**G);\n", + "print 'P2 = %3.1f bar'%(P2);\n", + "\n", + "\n", + "T2 = T1*(r**(G-1));\n", + "print 'T2 = %3.1f K'%(T2);\n", + "\n", + "\n", + "#For process 2-3\n", + "Qs = 1900;\n", + "Cv = 0.718;\n", + "T3 = (Qs/Cv)+T2;\n", + "print 'T3 = %3.1f K'%(T3);\n", + "\n", + "\n", + "P3 = P2*(T3/T2);\n", + "print 'P3 = %3.1f bar'%(P3);\n", + "\n", + "\n", + "#For process 4-1\n", + "V4 = V1;\n", + "P4 = P3*((V3/V4)**G);\n", + "print 'P4 = %3.1f bar'%(P4);\n", + "\n", + "\n", + "T4 = T1*(P4/P1);\n", + "print 'T4 = %3.1f K'%(T4);\n", + "\n", + "\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "print 'Efficiency = %3.1f Percent'%(Eff);\n", + "\n", + "\n", + "R = 0.287;\n", + "m = (P1*100*V1)/(R*T1);\n", + "Pm = (Eff*Qs*m)/(10000*Vs);\n", + "print 'Mean Effective Pressure = %3.1f bar'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "V1 = 0.00111 m**3\n", + "P2 = 13.7 bar\n", + "T2 = 617.4 K\n", + "T3 = 3263.6 K\n", + "P3 = 72.6 bar\n", + "P4 = 5.3 bar\n", + "T4 = 1543.6 K\n", + "Efficiency = 52.7 Percent\n", + "Mean Effective Pressure = 14.1 bar\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.14 pg : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 1.; #in bar\n", + "T1 = 20.+273; #in K\n", + "P2 = 39.; #in bar\n", + "P3 = P2;\n", + "T3 = 1100.+273; #in K\n", + "G = 1.4;\n", + "\n", + "# Calculations\n", + "#For reversible Adiabatic Process 1-2\n", + "T2 = T1*((P2/P1)**((G-1)/G));\n", + "r = (P2/P1)**(1./G);\n", + "\n", + "Z = T3/T2;\n", + "\n", + "Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));\n", + "\n", + "# Results\n", + "print 'Efficiency: %2.2f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency: 60.83 Percent\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.15 pg : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 16.; #Compression Ratio\n", + "D = 0.21; #Diameter\n", + "L = 0.3; #Length\n", + "P1 = 1; #in bar\n", + "G = 1.4;\n", + "T1 = 17+273; #in K\n", + "Z = (0.1*(r-1)+1)\n", + "\n", + "# Calculations and Results\n", + "Vs = (22./7)*(1./4)*D*D*L;\n", + "Vc = Vs/15;\n", + "V2 = Vc;\n", + "print 'Vc = V2 = %2.6f m**3'%(Vc);\n", + "\n", + "V1 = Vc+Vs;\n", + "print 'V1 = %2.4f m**3'%(V1);\n", + "\n", + "V3 = (0.1*(Vs))+(V2);\n", + "print 'V3 = %2.4f m**3'%(V3);\n", + "\n", + "\n", + "#For Process 1-2\n", + "P2 = r**G;\n", + "print 'P2 = %2.1f bar'%(P2);\n", + "\n", + "\n", + "T2 = T1*(r**(G-1));\n", + "print 'T2 = %2.1f K'%(T2);\n", + "\n", + "\n", + "T3 = Z*T2;\n", + "print 'T3 = %2.1f K'%(T3);\n", + "\n", + "\n", + "P3 = P2;\n", + "P4 = P3*((V3/V1)**G);\n", + "print 'P4 = %2.1f bar'%(P4);\n", + "\n", + "\n", + "T4 = T3*((V3/V1)**(G-1));\n", + "print 'T4 = %2.1f K'%(T4);\n", + "\n", + "\n", + "Cv = 0.718;\n", + "Cp = 1.005;\n", + "\n", + "Eff = 100*(1-((Cv*(T4-T1))/(Cp*(T3-T2))));\n", + "print 'Efficiency: %2.1f Percent'%(Eff);\n", + "\n", + "\n", + "R = 0.287;\n", + "m = (P1*100*V1)/(R*T1);\n", + "Pm = (m*((Cp*(T3-T2))-(Cv*(T4-T1))))/(Vs);\n", + "print 'Mean Effective Pressure = %2.1f kPa'%(Pm);\n", + "\n", + "\n", + "N = 300; #Cycles per minute\n", + "W = 10.41;\n", + "EP = W*(N/60);\n", + "print 'Engine Power = %2.2f kW'%(EP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Vc = V2 = 0.000693 m**3\n", + "V1 = 0.0111 m**3\n", + "V3 = 0.0017 m**3\n", + "P2 = 48.5 bar\n", + "T2 = 879.1 K\n", + "T3 = 2197.8 K\n", + "P4 = 3.6 bar\n", + "T4 = 1046.0 K\n", + "Efficiency: 59.0 Percent\n", + "Mean Effective Pressure = 1002.8 kPa\n", + "Engine Power = 52.05 kW\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.16 pg : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 19.; #Compression Ratio\n", + "P1 = 1.; #in bar\n", + "T1 = 17.+273; #in K\n", + "Qs = 730.; #in kJ/cycle\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "#For process 1-2\n", + "m = 1; #in kg\n", + "R = 0.287; #Universal Gas Consmath.tant\n", + "V1 = (m*R*T1)/(P1*100);\n", + "print 'V1 = %2.4f m**3/kg'%(V1);\n", + "\n", + "\n", + "V2 = V1/r;\n", + "print 'V2 = %2.4f m**3/kg'%(V2);\n", + "\n", + "\n", + "P2 = P1*(r**G);\n", + "print 'P2 = %2.1f bar'%(P2);\n", + "\n", + "\n", + "T2 = T1*(r**(G-1));\n", + "print 'T2 = %2.1f K'%(T2);\n", + "\n", + "\n", + "#For Process 2-3\n", + "Cv = 0.718;\n", + "T3 = (Qs/(Cv*m))+T2;\n", + "print 'T3 = %2.1f K'%(T3);\n", + "\n", + "\n", + "P3 = P2;\n", + "print 'P3 = %2.1f bar'%(P3);\n", + "\n", + "\n", + "#As pressure is consmath.tant\n", + "V3 = (T3/T2)*V2;\n", + "print 'V3 = %2.4f m**3/kg'%(V3);\n", + "\n", + "\n", + "#For process 3-4\n", + "V4 = V1;\n", + "T4 = T3*((V3/V4)**(G-1));\n", + "print 'T4 = %2.1f K'%(T4);\n", + "\n", + "\n", + "P4 = P3*((V3/V4)**G);\n", + "print 'P4 = %2.2f bar'%(P4);\n", + "\n", + "\n", + "Cp = 1.005;\n", + "\n", + "W = ((Cp)*(T3-T2))-((Cv*(T4-T1)));\n", + "print 'Work Done = %2.1f kJ/kg'%(W);\n", + "\n", + "\n", + "Eff = 100*(W/(Cp*(T3-T2)));\n", + "print 'Efficiency = %2.2f Percent'%(Eff);\n", + "\n", + "\n", + "Pm = W/(V1-V2);\n", + "print 'Mean Effective Pressure = %2.2f kPa'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "V1 = 0.8323 m**3/kg\n", + "V2 = 0.0438 m**3/kg\n", + "P2 = 61.7 bar\n", + "T2 = 941.7 K\n", + "T3 = 1958.4 K\n", + "P3 = 61.7 bar\n", + "V3 = 0.0911 m**3/kg\n", + "T4 = 808.3 K\n", + "P4 = 2.79 bar\n", + "Work Done = 649.6 kJ/kg\n", + "Efficiency = 63.58 Percent\n", + "Mean Effective Pressure = 823.88 kPa\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.17 pg : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 19.; #Compression Ratio\n", + "Re = 9.1; #Expansion Ratio\n", + "Z = r/Re;\n", + "G = 1.4;\n", + "\n", + "# Calculations\n", + "Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));\n", + "\n", + "# Results\n", + "print 'Efficiency: %2.2f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency: 63.55 Percent\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.18 pg : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "D = 16.; #in cm\n", + "L = 24.; #in cm\n", + "Vc = 340.;\n", + "V2 = Vc;\n", + "G = 1.4;\n", + "\n", + "# Calculations\n", + "Vs = (22./7)*(1./4)*D*D*L;\n", + "V1 = Vs+Vc;\n", + "r = V1/V2;\n", + "\n", + "#Cut-off is 6% of the stroke\n", + "Co1 = 0.06;\n", + "\n", + "V3 = (Co1*(V1-V2))+V2;\n", + "Z = V3/V2;\n", + "x = (Z**G)-1;\n", + "y = (r**(G-1))*(G)*(Z-1);\n", + "Eff1 = 100*(1-((x)/(y)));\n", + "\n", + "\n", + "\n", + "#Cut-off is 10% of the stroke\n", + "Co2 = 0.10;\n", + "\n", + "V3 = (Co2*(V1-V2))+V2;\n", + "Z = V3/V2;\n", + "x = (Z**G)-1;\n", + "y = (r**(G-1))*(G)*(Z-1);\n", + "Eff2 = 100*(1-((x)/(y)));\n", + "\n", + "Loss = ((Eff1-Eff2)*100)/Eff1;\n", + "\n", + "# Results\n", + "print 'Loss: %2.2f Percent'%(r);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Loss: 15.20 Percent\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.20 pg : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T3 = 1000.+273; #in K\n", + "T1 = 27.+273; #in K\n", + "G = 1.25;\n", + "\n", + "# Calculations and Results\n", + "r = (T3/T1)**G;\n", + "print 'Compression Ratio: %2.1f '%(r);\n", + "\n", + "\n", + "T2 = math.sqrt(T1*T3);\n", + "T4 = T2;\n", + "print 'T2 = T4 = %2.0f K'%(T2);\n", + "\n", + "\n", + "Cv = 0.718;\n", + "W = Cv*((math.sqrt(T3))-(math.sqrt(T1)))**2;\n", + "print 'Maximum Work Done: %2.0f kJ/kg'%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Compression Ratio: 6.1 \n", + "T2 = T4 = 618 K\n", + "Maximum Work Done: 242 kJ/kg\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.21 pg : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 6; #Compression Ratio\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "print 'Efficiency: %2.2f Percent'%(Eff);\n", + "\n", + "\n", + "m = 1.; #in kg\n", + "R = 0.287; #Universal Gas Consmath.tant\n", + "T1 = 27.+273; #in K\n", + "P1 = 1.; #in bar\n", + "\n", + "V1 = (m*R*T1)/(P1*100);\n", + "V2 = V1/r;\n", + "Vc = V2;\n", + "Vs = V1-Vc;\n", + "\n", + "T2 = T1*(r**(G-1));\n", + "Cv = 0.718;\n", + "Qs = 1046;\n", + "T3 = (Qs/Cv)+T2;\n", + "T4 = T3/(r**(G-1));\n", + "W = Qs-(Cv*(T4-T1));\n", + "Pm = W/Vs;\n", + "print 'Effective Mean Pressure: %2.2f kPa'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency: 51.16 Percent\n", + "Effective Mean Pressure: 745.89 kPa\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.22 pg : 33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 87.+273; #in K\n", + "r = 14.; #Compression Ratio\n", + "T3 = 1795.+273; #in K\n", + "T4 = 677.+273; #in K\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1*(r**(G-1));\n", + "print 'T2 = %2.1f K'%(T2);\n", + "\n", + "\n", + "Cp = 1.005;\n", + "Cv = 0.718;\n", + "W = (Cp*(T3-T2))-(Cv*(T4-T1))\n", + "Qs = Cp*(T3-T2);\n", + "Eff = (W*100)/Qs;\n", + "print 'Efficiency: %2.1f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "T2 = 1034.6 K\n", + "Efficiency: 59.2 Percent\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.23 pg : 33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 16.; #Compression Ratio\n", + "P1 = 1.; #in bar\n", + "T1 = 20.+273; #in K\n", + "T3 = 1431.+273; #in K\n", + "G = 1.4;\n", + "T2 = T1*(r**(G-1))\n", + "m = 1;\n", + "R = 0.287;\n", + "V1 = (m*R*T1)/(P1*100);\n", + "V2 = V1/r;\n", + "\n", + "# Calculations and Results\n", + "#For Constant Pressure Process 2-3\n", + "V3 = V2*(T3/T2);\n", + "Z = V3/V2;\n", + "Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n", + "\n", + "Cp = 1.005;\n", + "Qs = Cp*(T3-T2);\n", + "W = Qs*Eff/100;\n", + "Vs = V1-V2;\n", + "Pm = W/Vs;\n", + "print 'Effective Mean Pressure %2.1f kPa'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency is 61.8 Percent\n", + "Effective Mean Pressure 642.5 kPa\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.24 pg : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 8.;\n", + "T1 = 310.; #in K\n", + "T3 = 1600.; #in K\n", + "G = 1.4;\n", + "Cv = 0.717;\n", + "\n", + "# Calculations and Results\n", + "#For process 1-2\n", + "T2 = T1*(r**(G-1));\n", + "\n", + "#Now Heat Supplied\n", + "Qs = Cv*(T3-T2);\n", + "print 'Heat Supplied = %2.1f kJ/kg'%(Qs);\n", + "\n", + "\n", + "#Efficiency of Cycle\n", + "Eff = 100*(1-(1./(r**(G-1))))\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat Supplied = 636.6 kJ/kg\n", + "Efficiency is 56.5 Percent\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "\n", + "Example 6.25 pg : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 15.; #Compression Ratio\n", + "P1 = 100.; #in kPa\n", + "T1 = 27.+273;\n", + "Cp = 1.006;\n", + "Cv = 0.717;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "#Cut off takes place at 12% of Working Stroke\n", + "T2 = T1*(r**(G-1));\n", + "print 'T2 = %2.1f K'%(T2);\n", + "\n", + "\n", + "P2 = P1*(r**G);\n", + "print 'P2 = %2.1f kPa'%(P2);\n", + "\n", + "\n", + "Z = (0.12*(r-1))+1;\n", + "Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "T2 = 886.3 K\n", + "P2 = 4431.3 kPa\n", + "Efficiency is 57.2 Percent\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.26 pg : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 288.; #in K\n", + "T3 = 1673.; #in K\n", + "Qs = 800.; #in kJ/kg\n", + "G = 1.4;\n", + "Cv = 0.718;\n", + "R = 0.287;\n", + "P1 = 1.;\n", + "\n", + "# Calculations and Results\n", + "Cp = Cv*G;\n", + "T2 = T3-(Qs/Cp);\n", + "\n", + "x = T2/T1;\n", + "r = x**(1./(G-1));\n", + "print 'Compression Ratio %2.1f '%(r);\n", + "\n", + "\n", + "Eff = 100*(1-(1./(r**(G-1))))\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n", + "\n", + "P3 = r*T3*P1/T1;\n", + "print 'P3 = %2.1f bar'%(P3);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Compression Ratio 16.2 \n", + "Efficiency is 67.2 Percent\n", + "P3 = 94.0 bar\n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.27 pg : 35\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T2 = 293; #in K\n", + "Eff = 0.7;\n", + "\n", + "# Calculations\n", + "T1 = T2/(1-Eff);\n", + "\n", + "# Results\n", + "print 'T1 = %2.1f K'%(T1);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "T1 = 976.7 K\n" + ] + } + ], + "prompt_number": 40 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.28 pg : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 330.; #in K\n", + "T2 = 876.; #in K\n", + "T3 = 2223.; #in K\n", + "T4 = 1143.; #in K\n", + "P1 = 1.; #in bar\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "Cv = 0.718;\n", + "Cp = 1.005;\n", + "Eff = 100*(1-((Cv*(T4-T1))/(Cp*(T3-T2))));\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n", + "\n", + "#For Process 1-2\n", + "P2 = P1*((T2/T1)**(G/(G-1)));\n", + "print 'Maximum Pressure %2.2f bar'%(P2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency is 56.9 Percent\n", + "Maximum Pressure 30.48 bar\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.29 pg : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 25.+273; #in K\n", + "T3 = 1500.+273; #in K\n", + "Qa = 900.; #in kJ/kg\n", + "Cv = 0.718;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "T2 = T3-(Qa/Cv);\n", + "r = (T2/T1)**(1./(G-1));\n", + "print 'Compression Ratio is %2.1f '%(r);\n", + "\n", + "\n", + "Eff = 100*(1-(1./(r**(G-1))));\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n", + "\n", + "Px = r**G; #Max Pressure\n", + "Py = T3/T2; #1./Min Pressure\n", + "P = Px*Py;\n", + "print 'Pressure Ratio %2.1f '%(P);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Compression Ratio is 4.0 \n", + "Efficiency is 42.6 Percent\n", + "Pressure Ratio 23.9 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.30 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 1.; #in bar\n", + "T1 = 15.+273; #in K\n", + "P2 = 15.; #in bar\n", + "P3 = 40.; #in bar\n", + "G = 1.4;\n", + "Cv = 0.718;\n", + "\n", + "# Calculations and Results\n", + "r = (P2/P1)**(1./G);\n", + "print 'Compression Ratio is %2.1f '%(r);\n", + "\n", + "\n", + "Eff = 100*(1-(1./r**(G-1)))\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n", + "T2 = T1*(r**(G-1));\n", + "T3 = T2*(P3/P2);\n", + "T4 = T3/(r**(G-1));\n", + "W = Cv*(T3-T2+(T1-T4))\n", + "\n", + "R = 0.287;\n", + "V1 = (R*T1)/P1;\n", + "V2 = V1/r;\n", + "\n", + "Pm = W/(V1-V2);\n", + "print 'Mean Effective Pressure %2.4f bar'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Compression Ratio is 6.9 \n", + "Efficiency is 53.9 Percent\n", + "Mean Effective Pressure 5.6920 bar\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.31 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P2 = 44.; #in bar\n", + "P3 = P2;\n", + "T3 = 1600.+273; #in K\n", + "P1 = 1.; #in bar\n", + "T1 = 27.+273; #in K\n", + "G = 1.4;\n", + "\n", + "# Calculations\n", + "T2 = T1*((P2/P1)**((G-1)/G))\n", + "R = 0.287;\n", + "\n", + "V1 = (R*T1)/(P1*100);\n", + "\n", + "\n", + "r = (P2/P1)**(1./G);\n", + "Z = T3/T2;\n", + "Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));\n", + "\n", + "# Results\n", + "print 'Efficiency is %2.2f Percent'%(Eff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency is 59.70 Percent\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.32 pg : 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 16.; #Compression Ratio\n", + "P1 = 1.; #in bar\n", + "T1 = 20.+273;\n", + "T3 = 1431.+273; #in K\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1*(r**(G-1));\n", + "Z = T3/T2;\n", + "T4 = (Z**G)*T1;\n", + "Eff = 100*(1-((T4-T1)/(G*(T3-T2))))\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n", + "\n", + "Cp = 1.005;\n", + "Qs = Cp*(T3-T2);\n", + "W = Eff*(Qs/100);\n", + "R = 0.287;\n", + "V1 = (R*T1)/(P1*100);\n", + "V2 = V1/r;\n", + "V = V1-V2;\n", + "\n", + "Pm = W/(V);\n", + "print 'Mean Effective Pressure %2.1f kPa'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency is 61.8 Percent\n", + "Mean Effective Pressure 642.5 kPa\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.33 pg : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 1.; #in bar\n", + "T1 = 15.+273; #in K\n", + "P2 = 15.; #in bar\n", + "P3 = 40.; #in bar\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "r = (P2/P1)**(1./G);\n", + "Eff = 100*(1-(1./(r**(G-1))))\n", + "print 'Efficiency is %2.1f Percent'%(Eff);\n", + "\n", + "\n", + "T2 = T1*((P2/P1)**((G-1)/G))\n", + "T3 = T2*(P3/P2);\n", + "Cv = 0.718;\n", + "\n", + "Qs = Cv*(T3-T2);\n", + "W = Eff*Qs;\n", + "R = 0.287;\n", + "\n", + "V1 = (R*T1)/(P1*100);\n", + "V2 = V1/r;\n", + "\n", + "Vs = V1-V2;\n", + "Pm = W/(Vs*100);\n", + "\n", + "print 'Mean Effective Pressure is %2.1f kPa'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency is 53.9 Percent\n", + "Mean Effective Pressure is 569.2 kPa\n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch7.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch7.ipynb new file mode 100755 index 00000000..3bb088fb --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch7.ipynb @@ -0,0 +1,1266 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:56e79f34bf90e560e489807960eafbcc73eb1dfdf7b718c855da9f11ffbf3c60" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 : Internal combution Engines" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 pg : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Vs = 0.01; #in m**3\n", + "Pm = 600.; #in kPa\n", + "N = 300.; #in rpm\n", + "\n", + "# Calculations\n", + "n = N/2;\n", + "IP = (Vs*Pm*n)/60;\n", + "\n", + "# Results\n", + "print 'Indicated Power = %2.0f kW'%(IP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 15 kW\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 pg : 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#from sympy import Symbol,solve\n", + "#import math\n", + "# Variables\n", + "n = 6.; #Number of Cylinders\n", + "IP = 90.; #Indicated Power in kW\n", + "Eff = 0.85; #Mechanical Efficiency\n", + "Pmb = 5.; #in bar\n", + "LD = 1.5;\n", + "Pm = Pmb/Eff;\n", + "N = 800.;\n", + "nx = N/2;\n", + "\n", + "# Calculations and Results\n", + "#Length = 1.5*D\n", + "#D = Symbol(\"D\")\n", + "#eq = 588*math.pi/4*D**2*LD*D*nx*n/60 - 90\n", + "#ans = solve(eq,D)\n", + "#print ans\n", + "D = ((IP*60*4)/(Pm*100*(22./7)*LD*nx*n))**(1./3);\n", + "print 'D = %3.4f mm'%(D*100);\n", + "\n", + "L = D*LD;\n", + "print 'L = %3.4f mm'%(L*100);\n", + "\n", + "# It seems book answer wrong. kindly check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 14.8056 mm\n", + "L = 22.2084 mm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 pg : 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "BP = 22.; #Brake Power\n", + "Eff = 0.85; #Mechanical Efficiency\n", + "IP = BP/Eff;\n", + "mf = 6.5;\n", + "CV = 30000.; #Calorific Value\n", + "\n", + "# Calculations and Results\n", + "Ebth = BP/((mf/3600)*CV);\n", + "print 'Brake Thermal Eff = %3.1f Percent'%(Ebth*100);\n", + "\n", + "\n", + "Eith = IP/((mf/3600)*CV);\n", + "print 'Indicated Thermal Eff = %3.1f Percent'%(Eith*100);\n", + "\n", + "\n", + "BSFC = mf/BP;\n", + "print 'BSFC = %3.1f kg/kWh'%(BSFC);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Brake Thermal Eff = 40.6 Percent\n", + "Indicated Thermal Eff = 47.8 Percent\n", + "BSFC = 0.3 kg/kWh\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 pg : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "BP = 185.; #Brake Power\n", + "Eff = 0.75;\n", + "IP = BP/Eff;\n", + "LD = 1.5;\n", + "N = 35.;\n", + "n = N/2;\n", + "nx = 4.;\n", + "Pm = 830.; #in kPa\n", + "D = ((IP*4)/(Pm*(22./7)*LD*nx*n))**(1./3);\n", + "print 'D = %3.0f mm'%(D*1000);\n", + "\n", + "L = D*LD;\n", + "print 'L = %3.0f mm'%(L*1000);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 153 mm\n", + "L = 230 mm\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 pg : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Vc = 5*(10**-4);\n", + "D = 0.15;\n", + "L = 0.2;\n", + "Vs = (22./7)*D*D*L*(1./4);\n", + "r = (Vc+Vs)/Vc;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "Ea = (1-(1./(r**(G-1))));\n", + "Eith = 0.3;\n", + "Erel = Eith/Ea;\n", + "print 'Erel = %3.2f Percent'%(Erel*100);\n", + "\n", + "\n", + "Pm = 500.; #in kPa\n", + "n = 1000./2;\n", + "IP = (Pm*Vs*n)/60;\n", + "print 'IP = %3.2f kW'%(IP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Erel = 52.98 Percent\n", + "IP = 14.73 kW\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 pg : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Pm = 600.;\n", + "A = (22./7)*(1./4)*0.11*0.11*0.14;\n", + "n = 1000;\n", + "\n", + "# Calculations\n", + "IP = (Pm*A*n)/60;\n", + "Em = 0.8;\n", + "BP = Em*IP;\n", + "\n", + "# Results\n", + "print 'BP = %3.2f kW'%(BP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "BP = 10.65 kW\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 pg : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "r = 6.;\n", + "G = 1.4;\n", + "Ea = 100*(1-(1./(r**(G-1))));\n", + "\n", + "# Calculations\n", + "Ebt = Ea/2;\n", + "CV = 41500;\n", + "BP = 15.;\n", + "Mf = BP/(CV*(Ebt/100));\n", + "\n", + "# Results\n", + "print 'Mf = %3.3f kg/hr'%(Mf*3600);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mf = 5.086 kg/hr\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 pg : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "n = 4.;\n", + "DL = 1.2;\n", + "BP = 32.;\n", + "N = 2500.;\n", + "Pm = 9.;\n", + "Em = 0.86;\n", + "Mf = 9.;\n", + "CV = 43000.;\n", + "\n", + "# Calculations and Resultse\n", + "IP = BP/Em;\n", + "D = ((IP*60*4)/(Pm*100*(22./7)*DL*N*n))**(1./3);\n", + "print 'D = %3.0f mm'%(D*1000);\n", + "\n", + "\n", + "L = DL*D;\n", + "print 'L = %3.0f mm'%(L*1000);\n", + "\n", + "\n", + "Ebth = BP/(Mf*CV/3600);\n", + "print 'Ebth = %3.2f Percent'%(Ebth*100);\n", + "\n", + "\n", + "Eith = Ebth/Em;\n", + "print 'Eith = %3.2f Percent'%(Eith*100);\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 64 mm\n", + "L = 77 mm\n", + "Ebth = 29.77 Percent\n", + "Eith = 34.61 Percent\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.9 pg : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Eith = 0.29;\n", + "Em = 0.77;\n", + "BP = 5.5;\n", + "SG = 0.87;\n", + "CV = 43000;\n", + "\n", + "# Calculations\n", + "Ebth = Em*Eith;\n", + "Mf = (BP*3600)/(Ebth*CV);\n", + "D = SG*1000;\n", + "Mff = (Mf*1000)/D\n", + "\n", + "# Results\n", + "print 'Mf = %3.2f litre/hr'%(Mff);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mf = 2.37 litre/hr\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.10 pg : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 16.;\n", + "L = 19.;\n", + "Vc = 700.;\n", + "Pm = 5.;\n", + "N = 1000.;\n", + "Eith = 0.32;\n", + "\n", + "# Calculations and Results\n", + "Vs = (22./7)*D*D*L*(1./4);\n", + "Vc = 700.;\n", + "G = 1.4;\n", + "r = (Vs+Vc)/Vc;\n", + "Ea = (1-(1./(r**(G-1))));\n", + "Er = Eith/Ea;\n", + "print 'Relative Efficiency = %3.2f Percent'%(Er*100);\n", + "\n", + "\n", + "IP = (Pm*100*Vs*(10**-6)*N)/60;\n", + "print 'IP = %3.2f KW'%(IP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Relative Efficiency = 60.85 Percent\n", + "IP = 31.85 KW\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.11 pg : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T = 50.;\n", + "Vst = 870.;\n", + "N = 300.;\n", + "Pm = 10.;\n", + "n = N/2;\n", + "\n", + "# Calculations\n", + "BP = (2*(22./7)*N*T)/(60*1000);\n", + "IP = (Pm*100*Vst*(10**-6)*N)/(60*2);\n", + "Em = BP/IP;\n", + "\n", + "# Results\n", + "print 'Mechanical Efficiency = %3.2f Percent'%(Em*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mechanical Efficiency = 72.25 Percent\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.12 pg: 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Pm = 7.;\n", + "A = (22./7)*(1./4)*((0.15/1.25)**2);\n", + "n = 900.;\n", + "L = 0.15;\n", + "N = 2\n", + "\n", + "# Calculations\n", + "IP = (Pm*100*A*L*n*N)/(60*2);\n", + "\n", + "# Results\n", + "print 'IP = %3.2f kW'%(IP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "IP = 17.82 kW\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.13 pg : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "N = 900.;\n", + "D = 0.1;\n", + "L = 0.14;\n", + "Mf = 2.1;\n", + "CV = 42000.;\n", + "Pm = 7.5;\n", + "Vc = 0.15;\n", + "G = 1.4;\n", + "A = (22./7)*(1./4)*D*D;\n", + "\n", + "# Calculations and Results\n", + "IP = (Pm*100*A*L*N*2)/(60*2);\n", + "Eith = (IP*3600)/(Mf*CV);\n", + "print 'Eith = %3.1f Percent'%(Eith*100);\n", + "\n", + "\n", + "r = (1+0.15)/(0.15);\n", + "Ea = 1-(1./(r**(G-1)));\n", + "Er = Eith/Ea;\n", + "print 'Relative Efficiency = %3.2f Percent'%(Er*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Eith = 50.5 Percent\n", + "Relative Efficiency = 90.64 Percent\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.14 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "NOC = 6.;\n", + "N = 820.;\n", + "n = N/2;\n", + "IP = 90.;\n", + "LD = 1.4;\n", + "Pbm = 5;\n", + "\n", + "# Calculations and Results\n", + "Em = 0.79;\n", + "BP = IP*Em;\n", + "D = ((IP*60*2)/(Pbm*100*(math.pi)*(1./4)*LD*N*NOC))**(1./3);\n", + "print 'D = %3.0f mm'%(D*1000);\n", + "\n", + "L = LD*D;\n", + "print 'L = %3.0f mm'%(L*1000);\n", + "\n", + "# rouding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 159 mm\n", + "L = 222 mm\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.15 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "NOC = 4;\n", + "N = 2500;\n", + "n = N/2;\n", + "BP = 200;\n", + "LD = 1.2;\n", + "Pm = 10;\n", + "Em = 0.81;\n", + "Mf = 65;\n", + "CV = 42000;\n", + "IP = BP/Em;\n", + "\n", + "# Calculations and Results\n", + "D = ((IP*60*2*4)/(Pm*100*(22./7)*(1.2*(N)*NOC)))**(1./3);\n", + "print 'D = %3.0f mm'%(D*1000);\n", + "\n", + "\n", + "L = LD*D;\n", + "print 'L = %3.0f mm'%(L*1000);\n", + "\n", + "\n", + "Eith = (IP*3600)/(Mf*CV);\n", + "print 'Eith = %3.2f Percent'%(Eith*100);\n", + "\n", + "\n", + "Ebth = Eith*Em;\n", + "print 'Ebth = %3.2f Percent'%(Ebth*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 146 mm\n", + "L = 176 mm\n", + "Eith = 32.56 Percent\n", + "Ebth = 26.37 Percent\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.16 pg : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "IP = 42.;\n", + "FP = 7.;\n", + "ES = 1800.;\n", + "\n", + "BP = IP-FP;\n", + "\n", + "# Calculations and Results\n", + "Em = BP/IP;\n", + "print 'Mechanical Efficiency = %3.0f Percent'%(Em*100);\n", + "\n", + "BSFC = 0.3;\n", + "CV = 43000.;\n", + "\n", + "Ebth = 3600/(BSFC*CV);\n", + "print 'Brake Thermal Efficiency = %3.0f Percent'%(Ebth*100);\n", + "\n", + "\n", + "Eith = Ebth/Em;\n", + "print 'Indicated Thermal Efficiency = %3.2f Percent'%(Eith*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mechanical Efficiency = 83 Percent\n", + "Brake Thermal Efficiency = 28 Percent\n", + "Indicated Thermal Efficiency = 33.49 Percent\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.17 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.3;\n", + "L = 0.45;\n", + "N = 300.;\n", + "Pimep = 6.;\n", + "F = 1.5;\n", + "Reff = (180+4)/2;\n", + "\n", + "# Calculations and Results\n", + "IP = (Pimep*100*L*(22./7)*(1./4)*(D*D)*N)/(2*60);\n", + "print 'Indicated Power = %3.2f kW'%(IP);\n", + "\n", + "\n", + "BP = (2*(22./7)*N*F*Reff)/6000;\n", + "print 'Brake Power = %3.2f kW'%(BP);\n", + "\n", + "\n", + "Em = BP/IP;\n", + "print 'Mechanical Efficiency = %3.2f Percent'%(Em*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 47.73 kW\n", + "Brake Power = 43.37 kW\n", + "Mechanical Efficiency = 90.86 Percent\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.18 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.27;\n", + "L = 0.38;\n", + "Pmep = 6.;\n", + "N = 250.;\n", + "F = 1000.;\n", + "Reff = 0.75;\n", + "Mf = 10.;\n", + "CV = 44400.;\n", + "\n", + "# Calculations and Results\n", + "BP = (2*(22./7)*N*(F*Reff))/60;\n", + "print 'Brake Power = %3.2f kW'%(BP/1000);\n", + "\n", + "\n", + "A = (22./7)*(1./4)*(D*D);\n", + "IP = (Pmep*100*L*A*N)/(2*60);\n", + "print 'Indicated Power = %3.2f kW'%(IP);\n", + "\n", + "\n", + "Em = BP/(IP*1000);\n", + "print 'Mechanical Efficiency = %3.2f Percent'%(Em*100);\n", + "\n", + "\n", + "Eith = (IP*3600)/(Mf*CV);\n", + "print 'Indicated Thermal Power = %3.2f Percent'%(Eith*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Brake Power = 19.64 kW\n", + "Indicated Power = 27.21 kW\n", + "Mechanical Efficiency = 72.20 Percent\n", + "Indicated Thermal Power = 22.06 Percent\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.19 pg : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "NOC = 6.;\n", + "IP = 89.5;\n", + "N = 800.;\n", + "LD = 1.25;\n", + "Em = 0.8;\n", + "Pbemp = 5.;\n", + "Em = 0.8;\n", + "Pimep = Pbemp/0.8;\n", + "\n", + "# Calculations\n", + "D3 = (IP*2*60*4)/(Pimep*100*LD*(22./7)*N*NOC);\n", + "D = D3**(1./3);\n", + "L = LD*D;\n", + "\n", + "# Results\n", + "print 'L = %3.1f mm'%(L*1000);\n", + "print 'D = %3.0f mm'%(D*1000);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "L = 192.4 mm\n", + "D = 154 mm\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.20 pg: 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.25;\n", + "L = 0.4;\n", + "Pm = 6.5;\n", + "N = 250;\n", + "W = 1080;\n", + "Ddrum = 1.5;\n", + "Mf = 10;\n", + "CV = 44300;\n", + "\n", + "# Calculations and Results\n", + "A = (22./7)*(1./4)*D*D;\n", + "IP = (Pm*100*A*L*N)/(60*2);\n", + "print 'Indicated Power = %3.2f kW'%(IP);\n", + "\n", + "\n", + "Reff = Ddrum/2;\n", + "W = 1.08;\n", + "\n", + "BP = (2*(22./7)*N*W*Reff)/60;\n", + "print 'Brake Power = %3.2f kW'%(BP);\n", + "\n", + "\n", + "Em = BP/IP;\n", + "Eith = (IP*3600)/(Mf*CV);\n", + "print 'Em = %3.2f Percent'%(Em*100);\n", + "\n", + "print 'Eith = %3.2f Percent'%(Eith*100);\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 26.60 kW\n", + "Brake Power = 21.21 kW\n", + "Em = 79.75 Percent\n", + "Eith = 21.62 Percent\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.21 pg : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "W = 50;\n", + "S = 7;\n", + "D = 1.25;\n", + "N = 450;\n", + "Mf = 4;\n", + "CV = 43000;\n", + "Em = 0.7;\n", + "Reff = 9.81*(D/2);\n", + "\n", + "# Calculations and Results\n", + "BP = (2*(22./7)*N*(W-S)*Reff)/(60*1000);\n", + "Ebth = (BP*3600)/(Mf*CV);\n", + "print 'Ebth = %3.2f Percent'%(Ebth*100);\n", + "\n", + "\n", + "Eith = Ebth/Em;\n", + "print 'Eith = %3.2f Percent'%(Eith*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Ebth = 26.01 Percent\n", + "Eith = 37.16 Percent\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.22 pg : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T = 640;\n", + "D = 0.21;\n", + "N = 350;\n", + "L = 0.28;\n", + "Pm = 5.6;\n", + "Mf = 8.16;\n", + "CV = 42705;\n", + "\n", + "# Calculations and Results\n", + "BP = (2*(22./7)*N*T)/60000;\n", + "print 'Brake Power = %3.2f kW'%(BP/1000);\n", + "\n", + "\n", + "A = (22./7)*(1./4)*D*D;\n", + "IP = (Pm*100*A*L*N)/60;\n", + "\n", + "Em = BP/IP;\n", + "print 'Em = %3.2f Percent'%(Em*100);\n", + "\n", + "\n", + "Eith = (IP*3600)/(Mf*CV);\n", + "print 'Eith = %3.2f Percent'%(Eith*100);\n", + "\n", + "\n", + "Ebth = (BP*3600)/(Mf*CV);\n", + "print 'Ebth = %3.2f Percent'%(Ebth*100);\n", + "\n", + "\n", + "BSFC = Mf/BP;\n", + "print 'BSFC = %3.2f kg/kWh'%(BSFC);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Brake Power = 0.02 kW\n", + "Em = 74.04 Percent\n", + "Eith = 32.74 Percent\n", + "Ebth = 24.24 Percent\n", + "BSFC = 0.35 kg/kWh\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.23 pg : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "IP = 37.;\n", + "FP = 6.;\n", + "BSFC = 0.28;\n", + "CV = 44300.;\n", + "\n", + "# Calculations and Results\n", + "BP = IP-FP;\n", + "Em = (IP-FP)/IP;\n", + "print 'Em = %3.2f Percent'%(Em*100);\n", + "\n", + "\n", + "Mf = BSFC*BP;\n", + "Ebth = (BP*3600)/(Mf*CV);\n", + "print 'Ebth = %3.2f Percent'%(Ebth*100);\n", + "\n", + "\n", + "Eith = Ebth/Em;\n", + "print 'Eith = %3.2f Percent'%(Eith*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Em = 83.78 Percent\n", + "Ebth = 29.02 Percent\n", + "Eith = 34.64 Percent\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.24 pg : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.1;\n", + "L = 0.125;\n", + "Pm = 2.6;\n", + "W = 60;\n", + "S = 19;\n", + "Reff = 0.4;\n", + "r = 6;\n", + "Mf = 1;\n", + "CV = 42000;\n", + "N = 2000;\n", + "\n", + "\n", + "# Calculations and Results\n", + "A = (22./7)*(1./4)*D*D;\n", + "IP = (Pm*100*A*L*N)/(60*2);\n", + "print 'indicated Power = %3.2f kW'%(IP);\n", + "\n", + "\n", + "BP = (2*(22./7)*N*(W-S)*Reff)/60000;\n", + "print 'Brake Power = %3.2f kW'%(BP);\n", + "\n", + "\n", + "Em = BP/IP;\n", + "print 'Em = %3.2f Percent'%(Em*100);\n", + "\n", + "\n", + "Ebth = (BP*3600)/(Mf*CV);\n", + "print 'Ebth = %3.2f Percent'%(Ebth*100);\n", + "\n", + "\n", + "Eith = Ebth/Em;\n", + "print 'Eith = %3.2f Percent'%(Eith*100);\n", + "\n", + "\n", + "G = 1.4;\n", + "Ea = 1-(1./(r**(G-1)));\n", + "print 'Ea = %3.2f Percent'%(Ea*100);\n", + "\n", + "\n", + "Er = Ebth/Ea;\n", + "print 'Er = %3.2f Percent'%(Er*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "indicated Power = 4.26 kW\n", + "Brake Power = 3.44 kW\n", + "Em = 80.74 Percent\n", + "Ebth = 29.45 Percent\n", + "Eith = 36.48 Percent\n", + "Ea = 51.16 Percent\n", + "Er = 57.57 Percent\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.25 pg : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "IP = 30.;\n", + "N = 2500;\n", + "Pm = 800;\n", + "Em = 0.8;\n", + "LD = 1.5;\n", + "Ebth = 0.28;\n", + "CV = 44000;\n", + "\n", + "# Calculations and Results\n", + "BP = IP*Em;\n", + "print 'Brake Power = %3.2f kW'%(BP);\n", + "\n", + "\n", + "Mf = (BP/(Ebth*CV));\n", + "print 'Mass Flow Rate = %3.2f kg/hr'%(Mf*3600);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Brake Power = 24.00 kW\n", + "Mass Flow Rate = 7.01 kg/hr\n" + ] + } + ], + "prompt_number": 35 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch8.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch8.ipynb new file mode 100755 index 00000000..e57ba98f --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch8.ipynb @@ -0,0 +1,1680 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:211206a262b62c2debc3feb25be2afbc621e4825b9e890da1c402d32830cf7cd" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 : Air compressors" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 pg : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 100.;\n", + "T1 = 300.;\n", + "P2 = 650.;\n", + "n = 1.25;\n", + "r = 0.05;\n", + "\n", + "# Calculations\n", + "Ev = 1-(r*(((P2/P1)**(1./n))-1));\n", + "\n", + "# Results\n", + "print 'Volumetric Efficiency = %2.2f Percent'%(Ev*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Volumetric Efficiency = 82.65 Percent\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 pg : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.24;\n", + "LN = 5./6;\n", + "P1 = 100.;\n", + "P2 = 1000.;\n", + "n = 1.35;\n", + "\n", + "# Calculations\n", + "A = (22./7)*(1./4)*D*D;\n", + "IP = (n/(n-1))*(P1*A*LN)*(((P2/P1)**((n-1)/n))-1);\n", + "\n", + "# Results\n", + "print 'Indicated Power = %2.2f kW'%(IP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 11.88 kW\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 pg : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "N = 300.;\n", + "D = 0.2;\n", + "L = 0.24;\n", + "P1 = 1.01325;\n", + "P2 = 8*1.01325;\n", + "n = 1.35;\n", + "Et = 0.96;\n", + "Em = 0.85;\n", + "Vs = (22./7)*(1./4)*D*D*L;\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(P1*Vs)*(N/60)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Indicated Power = %2.1f kW'%(IP*100);\n", + "\n", + "\n", + "BP = IP/(Et*Em);\n", + "print 'Brake Power = %2.2f kW'%(BP*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 10.5 kW\n", + "Brake Power = 12.91 kW\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 pg : 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "n = 1.35;\n", + "P1 = 1.013;\n", + "V1 = 1./60;\n", + "P2 = 7;\n", + "Et = 0.85;\n", + "Em = 0.9;\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(P1*100*V1)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Indicated Power = %2.1f kW'%(IP);\n", + "\n", + "\n", + "BP = IP/(Et*Em);\n", + "print 'Brake Power = %2.2f kW'%(BP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 4.2 kW\n", + "Brake Power = 5.54 kW\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5 pg : 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "n = 1.2;\n", + "P1 = 1;\n", + "P2 = 6;\n", + "Vs = 1.5/60;\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(P1*100*Vs)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Indicated Power = %2.1f kW'%(IP);\n", + "\n", + "MP = 6.55;\n", + "Em = IP/MP;\n", + "print 'Mechanical Efficiency = %2.1f Percent'%(Em*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 5.2 kW\n", + "Mechanical Efficiency = 79.7 Percent\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6 pg : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "N = 300.;\n", + "V14 = 14/(2*N);\n", + "Vs = 0.023/(1.05-0.22);\n", + "n = 1.3;\n", + "P1 = 1.013;\n", + "P2 = 7.;\n", + "IP = (n/(n-1))*(P1*100*V14)*(((P2/P1)**((n-1)/n))-1)*(2*N/60);\n", + "print 'Indicated Power = %2.1f kW'%(IP);\n", + "\n", + "\n", + "T1 = 288;\n", + "T2 = T1*((P2/P1)**((n-1)/n));\n", + "print 'Delivery Temperature = %2.0f K'%(T2);\n", + "\n", + "\n", + "print 'Swept Volume = %2.4f m**3'%(Vs);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 57.6 kW\n", + "Delivery Temperature = 450 K\n", + "Swept Volume = 0.0277 m**3\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7 pg : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 1.;\n", + "P2 = 10.;\n", + "Vs = 0.015;\n", + "FAD = 3.;\n", + "Vc = Vs*0.06;\n", + "n = 1.3;\n", + "T1 = 20.+273;\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(P1*100*3)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Indicated Power = %2.1f kW'%(IP/60);\n", + "\n", + "\n", + "V4 = Vc*((P2/P1)**(1./n));\n", + "V1 = Vs+Vc;\n", + "V14 = 0.0107;\n", + "RS = 3/V14;\n", + "print 'Rotation Speed = %2.0f RPM'%(RS);\n", + "\n", + "Tf = 288;\n", + "Pf = 101.325;\n", + "Vf = (P1*100*(FAD)*Tf)/(T1*Pf);\n", + "print 'Vf = %2.4f m**3/min'%(Vf);\n", + "\n", + "\n", + "Mcd = V1/(V14);\n", + "print 'Mcd = %2.1f '%(Mcd);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Indicated Power = 15.2 kW\n", + "Rotation Speed = 280 RPM\n", + "Vf = 2.9102 m**3/min\n", + "Mcd = 1.5 \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.8 pg : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 1.;\n", + "P2 = 10.;\n", + "Vs = 0.014;\n", + "n = 1.3;\n", + "V1 = 3.;\n", + "FAD = 3.;\n", + "\n", + "# Calculations and Results\n", + "W = (n/(n-1))*(P1*100*V1/60)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Power required = %2.1f kW'%(W);\n", + "\n", + "\n", + "RPM = FAD/Vs;\n", + "print 'Rotational Speed = %2.0f rpm'%(RPM);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power required = 15.2 kW\n", + "Rotational Speed = 214 rpm\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.9 pg : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Vs = 5.665/600;\n", + "Vc = 0.04*Vs;\n", + "V3 = Vc;\n", + "n = 1.3;\n", + "P3 = 5.6;\n", + "P2 = 0.97;\n", + "V4 = V3*((P3/P2)**(1./n));\n", + "V1 = Vs+Vc;\n", + "Vd = V1-V4;\n", + "T1 = 300;\n", + "Tf = 288;\n", + "P1 = 0.96;\n", + "Pf = 1.01325;\n", + "\n", + "# Calculations and Results\n", + "Vf = (Tf*P1*Vd)/(Pf*T1);\n", + "Mcd = V1/(Vd);\n", + "print 'Vf = %.1e m**3/cycle'%(Vf);\n", + "\n", + "print 'Mc/Md = %2.2f '%(Mcd);\n", + "\n", + "\n", + "N = 600;\n", + "W = (n/(n-1))*(P1*100*Vd)*(((P3/P1)**((n-1)/n))-1);\n", + "IP = W*N/60;\n", + "print 'Indicated Power = %2.2f kW'%(IP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Vf = 7.6e-03 m**3/cycle\n", + "Mc/Md = 1.17 \n", + "Indicated Power = 17.48 kW\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.10 pg: 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "IP = 15.;\n", + "n = 1.2;\n", + "P1 = 100.;\n", + "P2 = 700.;\n", + "\n", + "# Calculations\n", + "x = ((P2/P1)**((n-1)/n))-1;\n", + "V1N = (IP*(n-1)*60)/(n*P1*x*2);\n", + "LN = 150/2;\n", + "D2 = V1N*4/((22./7)*LN);\n", + "D = D2**0.5;\n", + "L = D*1.5;\n", + "\n", + "# Results\n", + "print 'D = %2.0f mm'%(D*1000);\n", + "print 'L = %2.0f mm'%(L*1000);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 182 mm\n", + "L = 273 mm\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.11 pg : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 1.;\n", + "P2 = 16.;\n", + "n = 1.3;\n", + "LN = 100.;\n", + "N = 350.;\n", + "IP = 30.;\n", + "Ev = 0.95;\n", + "\n", + "# Calculations\n", + "L = LN/N;\n", + "x = (((P2/P1)**((n-1)/n))-1);\n", + "V14 = (IP*(n-1)*60)/(n*P1*100*x*N);\n", + "Vs = V14/Ev;\n", + "D2 = Vs*4/((22./7)*L);\n", + "D = D2**0.5;\n", + "\n", + "# Results\n", + "print 'D = %2.0f mm'%(D*1000);\n", + "print 'L = %2.0f mm'%(L*1000);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 249 mm\n", + "L = 286 mm\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.12 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "D = 0.2;\n", + "L = 0.3;\n", + "Vs = (22./7)*(1./4)*D*D*L;\n", + "Vc = 0.04*Vs;\n", + "\n", + "V3 = Vc;\n", + "P2 = 9;\n", + "P1 = 1;\n", + "n = 1.3;\n", + "V4 = V3*((P2/P1)**(1./n));\n", + "\n", + "# Calculations and Results\n", + "V1 = Vs+Vc;\n", + "W = (n/(n-1))*(P1*100)*(V1-V4)*(((P2/P1)**((n-1)/n))-1);\n", + "R = 0.287;\n", + "T1 = 15+273;\n", + "Md = (P1*(V1-V4)*100)/(R*T1);\n", + "Wpkg = W/Md;\n", + "print 'Word done per kg: %3.2f kJ/kg of air'%(Wpkg);\n", + "\n", + "\n", + "T2 = T1*((P2/P1)**((n-1)/n));\n", + "G = 1.4;\n", + "Q = ((G-n)/(G-1))*((R*(T1-T2))/(n-1));\n", + "print 'Heat Transfereed: %3.2f kJ/kg'%(Q);\n", + "\n", + "\n", + "Pm = W/Vs;\n", + "print 'Mean Effective Pressure: %3.2f kPa'%(Pm);\n", + "\n", + "\n", + "Mac = V1/(V1-V4);\n", + "print 'Mass of air compressed to delivered: %3.2f '%(Mac);\n", + "\n", + "\n", + "Tf = T1;\n", + "Pf = 101.325;\n", + "Vf = (P1*100*(V1-V4)*Tf)/(Pf*T1);\n", + "RPM = 500;\n", + "Vf = Vf*RPM;\n", + "print 'FAD at standand condition: %3.2f m**3/min'%(Vf);\n", + "\n", + "\n", + "IP = (W*RPM)/60;\n", + "Etrans = 0.92;\n", + "Emech = 0.85;\n", + "Emotor = 0.75;\n", + "MP = IP/(Etrans*Emech*Emotor);\n", + "print 'Motor Power: %3.2f kW'%(MP);\n", + "\n", + "\n", + "MAC = Md*RPM;\n", + "print 'Mass of air compressed: %3.2f kg/min'%(MAC);\n", + "\n", + "\n", + "ACC = MAC*Mac;\n", + "print 'Air compressed in cylinder: %3.2f kg/min'%(ACC);\n", + "\n", + "\n", + "print 'End Temperature: %3.2f K'%(T2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word done per kg: 236.54 kJ/kg of air\n", + "Heat Transfereed: -45.49 kJ/kg\n", + "Mean Effective Pressure: 235.57 kPa\n", + "Mass of air compressed to delivered: 1.26 \n", + "FAD at standand condition: 3.83 m**3/min\n", + "Motor Power: 31.56 kW\n", + "Mass of air compressed: 4.70 kg/min\n", + "Air compressed in cylinder: 5.93 kg/min\n", + "End Temperature: 478.19 K\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.13 pg : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Vs = 0.015;\n", + "Vc = 0.06*Vs;\n", + "V3 = Vc;\n", + "n = 1.3;\n", + "P2 = 10.;\n", + "P1 = 1.;\n", + "N = 280.;\n", + "\n", + "# Calculations and Results\n", + "V4 = V3*((P2/P1)**(1./n));\n", + "print 'V4: %3.4f m**3/cycle'%(V4);\n", + "\n", + "print 'V3: %3.4f m**3/cycle'%(V3);\n", + "\n", + "\n", + "V1 = Vs+Vc;\n", + "print 'V1: %3.4f m**3/cycle'%(V1);\n", + "\n", + "\n", + "V14 = V1-V4; #Suction Volume\n", + "V2 = V1*((P1/P2)**(1./n));\n", + "IP = (n/(n-1))*(P1*100*(V14))*(((P2/P1)**((n-1)/n))-1)*(N/60);\n", + "print 'IP: %3.0f kW'%(IP);\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "V4: 0.0053 m**3/cycle\n", + "V3: 0.0009 m**3/cycle\n", + "V1: 0.0159 m**3/cycle\n", + "IP: 15 kW\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.14 pg : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P2 = 6;\n", + "P1 = 0.96;\n", + "n = 1.3;\n", + "CV = 0.04;\n", + "\n", + "# Calculations and Results\n", + "Ev = (1-(CV*(((P2/P1)**(1./n))-1)))*100;\n", + "print 'Clearance Volumetric Efficiency: %3.1f Percent'%(Ev);\n", + "\n", + "\n", + "D = 0.09;\n", + "L = 0.1;\n", + "Vs = (22./7)*(1./4)*(D*D*L);\n", + "Vc = 0.04*Vs;\n", + "V4 = Vc*((P2/P1)**(1./n));\n", + "V1 = Vc+Vs;\n", + "EDV = V1-V4;\n", + "print 'Effective Displacement Volume: %.3e m**3'%(EDV);\n", + "\n", + "\n", + "T1 = 313;\n", + "Tf = 293;\n", + "Pf = 1;\n", + "Vf = ((P1*(EDV)*Tf))/(T1*Pf);\n", + "N = 410;\n", + "FAD = Vf*N*2*60;\n", + "print 'Free air delivered: %3.2f m**3'%(FAD);\n", + "\n", + "\n", + "W = (n/(n-1))*(P1*100*(V1-V4))*(((P2/P1)**((n-1)/n))-1);\n", + "IP = W*2*N/60;\n", + "print 'Indicated Power: %3.2f kW'%(IP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Clearance Volumetric Efficiency: 87.6 Percent\n", + "Effective Displacement Volume: 5.576e-04 m**3\n", + "Free air delivered: 24.66 m**3\n", + "Indicated Power: 1.67 kW\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.15 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P1 = 1.;\n", + "P2 = 5.;\n", + "T1 = 27.+273;\n", + "m = 1.;\n", + "R = 0.287;\n", + "\n", + "# Calculations and Results\n", + "W1 = m*R*T1*(math.log(P2/P1));\n", + "print 'Work in isothermal process: %3.1f kJ'%(W1);\n", + "\n", + "\n", + "G = 1.4;\n", + "W2 = (G/(G-1))*(m*R*T1)*(((P2/P1)**((G-1)/G))-1);\n", + "print 'Work in isentropic process: %3.0f kJ'%(W2);\n", + "\n", + "\n", + "n = 1.25;\n", + "W3 = (n/(n-1))*(m*R*T1)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Work in polytropic process: %3.1f kJ'%(W3);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work in isothermal process: 138.6 kJ\n", + "Work in isentropic process: 176 kJ\n", + "Work in polytropic process: 163.5 kJ\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.16 pg : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "IP = 41.;\n", + "P1 = 1.;\n", + "T1 = 17.+273;\n", + "P2 = 7.;\n", + "N = 100.;\n", + "n = 1.2;\n", + "\n", + "# Calculations\n", + "L = 150/(2*N);\n", + "V1 = (22./7)*(1./4)*(L); #Along with D**2\n", + "W = (n/(n-1))*(P1*100*V1)*(((P2/P1)**((n-1)/n))-1);\n", + "D2 = (IP*60)/(W*2*N);\n", + "D = math.sqrt(D2);\n", + "\n", + "# Results\n", + "print 'D: %3.3f m'%(D);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D: 0.301 m\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.17 pg : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.15;\n", + "L = 0.2;\n", + "P1 = 1.;\n", + "T1 = 17.+273;\n", + "P2 = 7.;\n", + "N = 100.;\n", + "R = 0.287;\n", + "V1 = (22./7)*(1./4)*D*D*L;\n", + "m = (P1*100*V1)/(R*T1);\n", + "Mpm = m*N;\n", + "n = 1.25;\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(P1*100*V1)*(((P2/P1)**((n-1)/n))-1)*(N/60);\n", + "print 'Mass/min: %3.1f Mpm'%(Mpm);\n", + "\n", + "\n", + "print 'Indicated Power: %3.1f kW'%(IP);\n", + "\n", + "\n", + "T2 = T1*((P2/P1)**((n-1)/n));\n", + "print 'T2: %3.1f K'%(T2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass/min: 0.4 Mpm\n", + "Indicated Power: 1.4 kW\n", + "T2: 428.0 K\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.18 pg : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.15;\n", + "N = 100.;\n", + "L = 0.2;\n", + "P1 = 1.;\n", + "T1 = 27.+273;\n", + "P2 = 6.;\n", + "n = 1.25;\n", + "\n", + "Vs = (22./7)*(1./4)*D*D*L;\n", + "Vc = 0.05*Vs;\n", + "V1 = Vs+Vc;\n", + "V4 = Vc*((P2/P1)**(1./n));\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(P1*100*(V1-V4))*(((P2/P1)**((n-1)/n))-1);\n", + "IPf = IP**(N/60)\n", + "print 'IP: %3.2f kJ'%(IPf);\n", + "\n", + "\n", + "Pm = IP/Vs;\n", + "print 'Mean Effective Pressure: %3.2f kN/m**2'%(Pm);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "IP: 0.48 kJ\n", + "Mean Effective Pressure: 181.08 kN/m**2\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.19 pg : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "n = 1.2;\n", + "m = 5.;\n", + "R = 0.287;\n", + "T2 = 107.+273;\n", + "T1 = 27.+273;\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(m/60)*(R*(T2-T1));\n", + "print 'Air Power: %3.2f kW'%(IP);\n", + "\n", + "\n", + "BP = 14;\n", + "Em = IP*100/BP;\n", + "print 'Mechanical Efficiency: %3.0f Percent'%(Em);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air Power: 11.48 kW\n", + "Mechanical Efficiency: 82 Percent\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.20 pg : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "V1 = 50.;\n", + "P1 = 1.;\n", + "P2 = 5.5;\n", + "n = 1.3;\n", + "Em = 0.82;\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(P1*100*V1)*(((P2/P1)**((n-1)/n))-1)*(1./60);\n", + "BP = IP/Em;\n", + "\n", + "print 'IP: %3.1f kW'%(IP);\n", + "print 'BP: %3.1f kW'%(BP);\n", + "\n", + "\n", + "IsoP = P1*100*V1*(math.log(P2/P1))*(100./60);\n", + "Eo = IsoP/BP;\n", + "print 'Isothermal Efficiecy: %3.1f Percent'%(Eo);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "IP: 174.1 kW\n", + "BP: 212.3 kW\n", + "Isothermal Efficiecy: 66.9 Percent\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.21 pg : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 1.;\n", + "P2 = 5.5;\n", + "T1 = 27.+273;\n", + "Pa = 1.01325;\n", + "Ta = 17.+273;\n", + "C = 0.06;\n", + "n = 1.3;\n", + "\n", + "# Calculations\n", + "Ev = ((P1*Ta)/(Pa*T1))*(1+C-(C*((P2/P1)**(1./n))));\n", + "\n", + "# Results\n", + "print 'Volumetric Efficiency: %3.0f Percent'%(Ev*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Volumetric Efficiency: 80 Percent\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.22 pg : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "V14 = 7.5;\n", + "P1 = 1.;\n", + "T1 = 27.+273;\n", + "P2 = 5.5;\n", + "n = 1.3;\n", + "C = 0.06;\n", + "\n", + "# Calculations and Results\n", + "T2 = T1*((P2/P1)**((n-1)/n));\n", + "print 'T2: %3.1f K'%(T2);\n", + "\n", + "\n", + "Ev = 1+C-(C*((P2/P1)**((1./n))));\n", + "print 'Vol Eff: %3.1f Percent'%(Ev*100);\n", + "\n", + "\n", + "AP = (n/(n-1))*(P1*100*V14/60)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Air Power: %3.1f kW'%(AP);\n", + "\n", + "\n", + "Em = 0.9;\n", + "BP = AP/Em;\n", + "print 'BP: %3.1f kW'%(BP);\n", + "\n", + "\n", + "Emot = 0.96;\n", + "EMC = BP/Emot;\n", + "print 'Electric Motor Capacity: %3.1f kW'%(EMC);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "T2: 444.6 K\n", + "Vol Eff: 83.7 Percent\n", + "Air Power: 26.1 kW\n", + "BP: 29.0 kW\n", + "Electric Motor Capacity: 30.2 kW\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.23 pg : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "V1 = 5.;\n", + "P1 = 1.;\n", + "P2 = 5.;\n", + "n = 1.25;\n", + "Em = 0.9;\n", + "\n", + "# Calculations and Results\n", + "IP = (n/(n-1))*(P1*100*V1/60)*(((P2/P1)**((n-1)/n))-1);\n", + "SP = IP/Em;\n", + "print 'Shaft Power: %3.1f kW'%(SP);\n", + "\n", + "\n", + "IsoP = P1*100*V1*(math.log(P2/P1))*(1./60);\n", + "Eo = IsoP/SP;\n", + "print 'Overall Efficiency: %3.0f Percent'%(Eo*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Shaft Power: 17.6 kW\n", + "Overall Efficiency: 76 Percent\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.24 pg : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "V1 = 25.;\n", + "P1 = 1.;\n", + "P2 = 7.;\n", + "N = 460.;\n", + "Em = 0.8;\n", + "Ev = 0.76;\n", + "Ei = 0.81;\n", + "\n", + "# Calculations\n", + "IsoP = P1*100*V1*(math.log(P2/P1));\n", + "IndP = IsoP/Ei;\n", + "Vs = V1/Ev;\n", + "Pm = IndP/Vs;\n", + "BP = IndP/(3600*Em);\n", + "\n", + "# Results\n", + "print 'Mean Effective Pressure: %3.2f bar'%(Pm/100);\n", + "print 'BP: %3.2f kW'%(BP);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mean Effective Pressure: 1.83 bar\n", + "BP: 2.09 kW\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.25 pg : 33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Va = 3.;\n", + "Pa = 1.;\n", + "Ta = 17.+273;\n", + "P2 = 8.2;\n", + "N = 300.;\n", + "n = 1.35\n", + "LD = 1.2;\n", + "Em = 0.9;\n", + "C = 0.05;\n", + "\n", + "# Calculations and Results\n", + "P1 = Pa-0.05;\n", + "T1 = Ta+10;\n", + "V14 = (Pa*Va*T1)/(P1*Ta);\n", + "\n", + "IP = (n/(n-1))*(P1*100*V14/60)*(((P2/P1)**((n-1)/n))-1);\n", + "BP = IP/Em;\n", + "print 'BP: %3.1f kW'%(BP);\n", + "\n", + "\n", + "Ev = 1+C-(C*((P2/P1)**(1./n)));\n", + "print 'Volumetric Efficiency: %3.1f Percent'%(Ev*100);\n", + "\n", + "\n", + "Vs = (22./7)*(1./4)*LD;\n", + "VsMin = Vs*2*N;\n", + "D3 = V14/(VsMin*Ev);\n", + "D = D3**(1./3);\n", + "print 'Cylinder Diameter: %3.0f mm'%(D*1000);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "BP: 16.6 kW\n", + "Volumetric Efficiency: 80.3 Percent\n", + "Cylinder Diameter: 193 mm\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.26 pg : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "V1 = 1.;\n", + "P1 = 1.013;\n", + "T1 = 15.+273;\n", + "P2 = 7.;\n", + "R = 0.287;\n", + "n = 1.35;\n", + "\n", + "# Calculations and Results\n", + "m = (P1*100*V1)/(R*T1);\n", + "print 'Mass of air per minute: %3.1f kg'%(m);\n", + "\n", + "\n", + "T2 = T1*(((P2/P1)**((n-1)/n)));\n", + "print 'T2: %3.1f K'%(T2);\n", + "\n", + "\n", + "IP = (n/(n-1))*(P1*100*V1/60)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'IP: %3.1f kW'%(IP);\n", + "\n", + "\n", + "IsoP = P1*100*V1*(1./60)*math.log(P2/P1);\n", + "Ei = IsoP/IP;\n", + "print 'Isothermal Efficiency: %3.0f Percent'%(Ei*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of air per minute: 1.2 kg\n", + "T2: 475.4 K\n", + "IP: 4.2 kW\n", + "Isothermal Efficiency: 77 Percent\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.27 pg : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P1 = 1.013;\n", + "T1 = 15.+273;\n", + "P2 = 7.;\n", + "FAD = 0.3;\n", + "G = 1.4;\n", + "\n", + "# Calculations and Results\n", + "IP = (G/(G-1))*(P1*100*FAD/60)*(((P2/P1)**((G-1)/G))-1);\n", + "print 'For Isentropic process ';\n", + "print 'IP: %3.1f kW'%(IP);\n", + "\n", + "\n", + "T2 = T1*((P2/P1)**((G-1)/G));\n", + "print 'T2: %3.0f K'%(T2);\n", + "\n", + "\n", + "print 'For Reversible Isothermal process ';\n", + "IP = P1*100*FAD*(1./60)*(math.log(P2/P1));\n", + "print 'IP: %3.3f kW'%(IP);\n", + "\n", + "\n", + "T2 = T1;\n", + "print 'T2: %3.0f K'%(T2);\n", + "\n", + "\n", + "print 'For Polytropic process ';\n", + "n = 1.25\n", + "IP = (n/(n-1))*(P1*100*FAD/60)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'IP: %3.3f kW'%(IP);\n", + "\n", + "\n", + "T2 = T1*((P2/P1)**((n-1)/n));\n", + "print 'T2: %3.2f K'%(T2);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For Isentropic process \n", + "IP: 1.3 kW\n", + "T2: 500 K\n", + "For Reversible Isothermal process \n", + "IP: 0.979 kW\n", + "T2: 288 K\n", + "For Polytropic process \n", + "IP: 1.195 kW\n", + "T2: 423.93 K\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.28 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "V1 = 94.;\n", + "P1 = 1.;\n", + "T1 = 25.+273;\n", + "P2 = 9.;\n", + "\n", + "# Calculations and Results\n", + "print 'For isothermal process ';\n", + "T2 = T1;\n", + "print 'T2: %3.0f K'%(T2);\n", + "\n", + "\n", + "P = P1*100*V1*math.log(P2/P1);\n", + "print 'Power required: %3.0f kW'%(P/60);\n", + "\n", + "\n", + "Q = P;\n", + "print 'Heat Rejected: %3.0f KW'%(Q/60);\n", + "\n", + "\n", + "print ' For adiabatic process ';\n", + "G = 1.4;\n", + "T2 = T1*((P2/P1)**((G-1)/G));\n", + "print 'T2: %3.0f K'%(T2);\n", + "\n", + "\n", + "P = (G/(G-1))*(P1*100*V1/60)*(((P2/P1)**((G-1)/G))-1);\n", + "print 'Power required: %3.0f kW'%(P);\n", + "\n", + "\n", + "Q = 0;\n", + "print 'Heat Rejected: %3.0f kW'%(Q);\n", + "\n", + "\n", + "print ' For adiabatic process ';\n", + "n = 1.25;\n", + "T2 = T1*((P2/P1)**((n-1)/n));\n", + "print 'T2: %3.0f K'%(T2);\n", + "\n", + "\n", + "P = (n/(n-1))*(P1*100*V1/60)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Power required: %3.0f kW'%(P);\n", + "\n", + "\n", + "R = 0.287;\n", + "Cp = 1.005;\n", + "\n", + "m = (P1*100*V1)/(R*T1);\n", + "H = m*(1./60)*Cp*(T2-T1);\n", + "Q = H-P;\n", + "print 'Heat Rejected: %3.0f kW'%(Q);\n", + "\n", + "# note: rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For isothermal process \n", + "T2: 298 K\n", + "Power required: 344 kW\n", + "Heat Rejected: 344 KW\n", + " For adiabatic process \n", + "T2: 558 K\n", + "Power required: 479 kW\n", + "Heat Rejected: 0 kW\n", + " For adiabatic process \n", + "T2: 462 K\n", + "Power required: 432 kW\n", + "Heat Rejected: -130 kW\n" + ] + } + ], + "prompt_number": 40 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.29 pg : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P1 = 1.;\n", + "P2 = 12.;\n", + "n = 1.3;\n", + "N = 350.;\n", + "L = 180./(2*N);\n", + "IP = 30.;\n", + "Ev = 0.92;\n", + "\n", + "# Calculations\n", + "W = (n/(n-1))*(P1*100)*(((P2/P1)**((n-1)/n))-1); #with (V1-V4)\n", + "V14 = (IP*60)/(N*W);\n", + "Vs = V14/Ev;\n", + "D2 = Vs*4/((22./7)*L);\n", + "D = math.sqrt(D2);\n", + "\n", + "# Results\n", + "print 'D: %3.3f m'%(D);\n", + "print 'L: %3.3f m'%(L);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D: 0.287 m\n", + "L: 0.257 m\n" + ] + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.30 pg : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "m = 1.;\n", + "P1 = 1.;\n", + "P2 = 5.;\n", + "T1 = 27.+273;\n", + "n = 1.25;\n", + "R = 0.287;\n", + "\n", + "# Calculations and Results\n", + "W = m*R*T1*math.log(P2/P1);\n", + "print 'Work Done for Isothermal Process: %3.2f kJ/kg '%(W);\n", + "\n", + "\n", + "G = 1.4;\n", + "W = (G/(G-1))*(m*R*T1)*(((P2/P1)**((G-1)/G))-1);\n", + "print 'Work Done for Isentropic Process: %3.2f kJ/kg '%(W);\n", + "\n", + "\n", + "W = (n/(n-1))*(m*R*T1)*(((P2/P1)**((n-1)/n))-1);\n", + "print 'Work Done for Polytropic Process: %3.2f kJ/kg '%(W);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work Done for Isothermal Process: 138.57 kJ/kg \n", + "Work Done for Isentropic Process: 175.93 kJ/kg \n", + "Work Done for Polytropic Process: 163.47 kJ/kg \n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.31 pg : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.15;\n", + "L = 0.3;\n", + "P1 = 1.;\n", + "T1 = 27.+273;\n", + "P2 = 8.;\n", + "N = 120.;\n", + "G = 1.4;\n", + "R = 0.287;\n", + "Vs = (22./7)*(1./4)*D*D*L;\n", + "\n", + "# Calculations and Results\n", + "m = (P1*100*Vs)/(R*T1);\n", + "print 'Mass of air compressed per cycle: %3.4f kJ/cycle '%(m);\n", + "\n", + "\n", + "W = (G/(G-1))*(P1*100*Vs)*(((P2/P1)**((G-1)/G))-1);\n", + "print 'Work required per cycle: %3.3f kJ/cycle '%(W);\n", + "\n", + "\n", + "P = (W*N)/60;\n", + "print 'Power required to drive compressor: %3.2f kJ/cycle '%(P);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of air compressed per cycle: 0.0062 kJ/cycle \n", + "Work required per cycle: 1.506 kJ/cycle \n", + "Power required to drive compressor: 3.01 kJ/cycle \n" + ] + } + ], + "prompt_number": 43 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch9.ipynb b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch9.ipynb new file mode 100755 index 00000000..69be255b --- /dev/null +++ b/Elements_of_Mechanical_Engineering_by_N._M._Bhatt_and_J._R._Mehta/ch9.ipynb @@ -0,0 +1,216 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3d8f673c1a27c909cdf0ff65e7ff4b366a924234852efa0c7c4f35cbe5388149" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Pumps" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 pg : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "D = 0.3;\n", + "L = 0.6;\n", + "N = 60.;\n", + "Hs = 5.;\n", + "Hd = 10.;\n", + "Ep = 0.8;\n", + "Qa = 0.075;\n", + "\n", + "# Calculations and Results\n", + "A = (22./7)*(1./4)*D*D;\n", + "Rho = 1000;\n", + "g = 9.81;\n", + "\n", + "F1 = Rho*g*Hs*A;\n", + "F2 = Rho*g*Hd*A;\n", + "\n", + "TF = F1+F2;\n", + "print 'Total Force Required: %2.2f kN'%(TF/1000);\n", + "\n", + "\n", + "Q = (2*L*A*N)/60;\n", + "Qa = 0.075;\n", + "Slip = (Q-Qa)/Q;\n", + "print 'Percentage Slip: %2.2f Percent'%(Slip*100);\n", + "\n", + "\n", + "Cd = Qa/Q;\n", + "\n", + "P = (Rho*g*Qa*(Hs+Hd))/Ep;\n", + "print 'Power input: %2.2f kW'%(P/1000);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total Force Required: 10.41 kN\n", + "Percentage Slip: 11.62 Percent\n", + "Power input: 13.80 kW\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 pg : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Qa = 0.025;\n", + "Hm = 20;\n", + "L = 0.4;\n", + "D = 0.3;\n", + "\n", + "# Calculations\n", + "A = (22./7)*(1./4)*D*D;\n", + "Slip = 0.02;\n", + "Q = 25/(1000*(1-Slip));\n", + "\n", + "N = (Q*60)/(L*A);\n", + "\n", + "# Results\n", + "print 'Speed of Pump: %2.2f RPM'%(N);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of Pump: 54.11 RPM\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 pg : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Hs = 32.;\n", + "N = 1450.;\n", + "Eff = 0.85;\n", + "Q = 0.05;\n", + "Hfs = 1.;\n", + "Hfd = 6.;\n", + "Hm = Hs+Hfd+Hfs;\n", + "Rho = 1000.;\n", + "g = 9.81;\n", + "\n", + "# Calculations\n", + "P = (Rho*g*Q*Hm)/Eff;\n", + "\n", + "# Results\n", + "print 'Power Consumed: %2.2f kW'%(P/1000);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power Consumed: 22.51 kW\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 pg : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Pm = 25.;\n", + "Em = 0.9;\n", + "Q = 0.063;\n", + "Hs = 4.;\n", + "Hd = 25.;\n", + "Rho = 1000.;\n", + "Hm = Hs+Hd;\n", + "g = 9.81;\n", + "\n", + "# Calculations\n", + "Ph = Rho*g*Q*Hm/1000;\n", + "Ps = Em*Pm;\n", + "Ep = Ph/Ps;\n", + "\n", + "# Results\n", + "print 'Efficiency of Pump: %2.2f Percent'%(Ep*100);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of Pump: 79.66 Percent\n" + ] + } + ], + "prompt_number": 5 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/screenshots/1_converted.png b/Engineering_Physics/screenshots/1_converted.png Binary files differnew file mode 100755 index 00000000..6f902c6e --- /dev/null +++ b/Engineering_Physics/screenshots/1_converted.png diff --git a/Engineering_Physics/screenshots/2_converted.png b/Engineering_Physics/screenshots/2_converted.png Binary files differnew file mode 100755 index 00000000..5b3697bc --- /dev/null +++ b/Engineering_Physics/screenshots/2_converted.png diff --git a/Engineering_Physics/screenshots/3_converted.png b/Engineering_Physics/screenshots/3_converted.png Binary files differnew file mode 100755 index 00000000..47f7a27c --- /dev/null +++ b/Engineering_Physics/screenshots/3_converted.png diff --git a/Engineering_Physics_by_P.K.Palanisamy/Chapter1.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter1.ipynb new file mode 100755 index 00000000..3dd56e56 --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter1.ipynb @@ -0,0 +1,209 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#1: Bonding in Solids"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.1, Page number 1.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "net change in energy per mole is -296 kJ/mol\n",
+ "answer varies due to rounding off errors\n",
+ "since the net change in energy is negative, the A+B- molecule will be stable\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.602*10**-19; #charge of electron(c)\n",
+ "epsilon0=8.85*10**-12; #permittivity(C/Nm)\n",
+ "r=3*10**-10; #seperation(m)\n",
+ "N=6.022*10**20;\n",
+ "Ea=502; #ionisation energy of A(kJ/mol)\n",
+ "Eb=-335; #electron affinity for B(kJ/mol)\n",
+ "\n",
+ "#Calculation\n",
+ "E=-e**2*N/(4*math.pi*epsilon0*r); #electrostatic attraction(kJ/mol)\n",
+ "nE=Ea+Eb+E; #net change in energy per mole(kJ/mol)\n",
+ "\n",
+ "#Result\n",
+ "print \"net change in energy per mole is\",int(nE),\"kJ/mol\"\n",
+ "print \"answer varies due to rounding off errors\"\n",
+ "print \"since the net change in energy is negative, the A+B- molecule will be stable\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.2, Page number 1.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy required is 0.5 eV\n",
+ "seperation is 2.88 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "IPk=4.1; #IP of K(eV)\n",
+ "EACl=3.6; #EA of Cl(eV)\n",
+ "e=1.602*10**-19; #charge of electron(c)\n",
+ "onebyepsilon0=9*10**9;\n",
+ "\n",
+ "#Calculation\n",
+ "deltaE=IPk-EACl;\n",
+ "Ec=deltaE; #energy required(eV)\n",
+ "R=e*onebyepsilon0/deltaE; #seperation(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"energy required is\",Ec,\"eV\"\n",
+ "print \"seperation is\",round(R*10**9,2),\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.3, Page number 1.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "bond energy is 4.61 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.602*10**-19; #charge of electron(c)\n",
+ "epsilon0=8.85*10**-12; #permittivity(C/Nm)\n",
+ "r0=236*10**-12; #seperation(m)\n",
+ "N=6.022*10**20;\n",
+ "IP=5.14; #ionisation energy of A(kJ/mol)\n",
+ "EA=3.65; #electron affinity for B(kJ/mol)\n",
+ "\n",
+ "#Calculation\n",
+ "Ue=-e**2/(4*math.pi*epsilon0*r0*e); #potential energy(eV)\n",
+ "BE=-Ue-IP+EA; #bond energy(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"bond energy is\",round(BE,2),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.4, Page number 1.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "cohesive energy is 7.965 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "A=1.748; #madelung constant\n",
+ "n=9; #born repulsive exponent\n",
+ "e=1.602*10**-19; #charge of electron(c)\n",
+ "epsilon0=8.85*10**-12; #permittivity(C/Nm)\n",
+ "r0=0.281*10**-9; #seperation(m)\n",
+ "IE=5.14; #ionisation energy of A(kJ/mol)\n",
+ "EA=3.61; #electron affinity for B(kJ/mol)\n",
+ "\n",
+ "#Calculation\n",
+ "CE=A*e**2*(1-(1/n))/(4*math.pi*epsilon0*r0*e); #cohesive energy(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"cohesive energy is\",round(CE,3),\"eV\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter10.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter10.ipynb new file mode 100755 index 00000000..e1e3146e --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter10.ipynb @@ -0,0 +1,410 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#10: Dielectric properties"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.1, Page number 10.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy stored in the condenser is 1.0 J\n",
+ "energy stored in the dielectric is 0.99 J\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "C=2*10**-6; #capacitance(F)\n",
+ "V=1000; #voltage(V)\n",
+ "epsilon_r=100;\n",
+ "\n",
+ "#Calculation\n",
+ "W=C*V**2/2; #energy stored in the condenser(J)\n",
+ "C0=C/epsilon_r;\n",
+ "W0=C0*V**2/2;\n",
+ "E=1-W0; #energy stored in the dielectric(J)\n",
+ "\n",
+ "#Result\n",
+ "print \"energy stored in the condenser is\",W,\"J\"\n",
+ "print \"energy stored in the dielectric is\",E,\"J\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.2, Page number 10.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio betwen electronic and ionic polarizability is 1.738\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "epsilon_r=4.94;\n",
+ "n2=2.69;\n",
+ "\n",
+ "#Calculation\n",
+ "x=(epsilon_r-1)/(epsilon_r+2);\n",
+ "y=(n2-1)/(n2+2);\n",
+ "r=(x/y)-1; #ratio betwen electronic and ionic polarizability\n",
+ "\n",
+ "#Result\n",
+ "print \"ratio betwen electronic and ionic polarizability is\",round(1/r,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.3, Page number 10.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "parallel loss resistance is 10.0 ohm\n",
+ "answer varies due to rounding off errors\n",
+ "parallel loss capacitance is 226.56 *10**-12 Farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "epsilon_r=2.56;\n",
+ "epsilon_R=2.65*0.7*10**-4;\n",
+ "tan_delta=0.7*10**-4; \n",
+ "A=8*10**-4; #area(m**2)\n",
+ "d=0.08*10**-3; #diameter(m)\n",
+ "f=1*10**6; #frequency(Hz)\n",
+ "epsilon0=8.85*10**-12;\n",
+ "\n",
+ "#Calculation\n",
+ "Rp=d/(2*math.pi*f*epsilon0*epsilon_R*A); #parallel loss resistance(ohm)\n",
+ "Cp=A*epsilon0*epsilon_r/d; #parallel loss capacitance(Farad)\n",
+ "\n",
+ "#Result\n",
+ "print \"parallel loss resistance is\",round(Rp/10**6),\"ohm\"\n",
+ "print \"answer varies due to rounding off errors\"\n",
+ "print \"parallel loss capacitance is\",round(Cp*10**12,2),\"*10**-12 Farad\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.4, Page number 10.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "dielectric constant of material is 1.339\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "N=3*10**28; #number of atoms(per m**3)\n",
+ "alphae=10**-40; \n",
+ "epsilon0=8.854*10**-12;\n",
+ "\n",
+ "#Calculation\n",
+ "epsilon_r=1+(N*alphae/epsilon0); #dielectric constant of material\n",
+ "\n",
+ "#Result\n",
+ "print \"dielectric constant of material is\",round(epsilon_r,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.5, Page number 10.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "electronic polarizability is 2.243 *10**-41 Fm**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "N=2.7*10**25; #number of atoms(per m**3)\n",
+ "epsilon0=8.854*10**-12;\n",
+ "epsilon_r=1.0000684;\n",
+ "\n",
+ "#Calculation\n",
+ "alphae=epsilon0*(epsilon_r-1)/N; #electronic polarizability(Fm**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"electronic polarizability is\",round(alphae*10**41,3),\"*10**-41 Fm**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.6, Page number 10.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance is 8.85e-12 F\n",
+ "charge on plates is 8.85e-10 coulomb\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "epsilon0=8.85*10**-12;\n",
+ "A=100*10**-4; #area(m**2)\n",
+ "d=10**-2; #diameter(m)\n",
+ "V=100; #potential(V)\n",
+ "\n",
+ "#Calculation\n",
+ "C=epsilon0*A/d; #capacitance(F)\n",
+ "Q=C*V; #charge on plates(coulomb)\n",
+ "\n",
+ "#Result\n",
+ "print \"capacitance is\",C,\"F\"\n",
+ "print \"charge on plates is\",Q,\"coulomb\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.7, Page number 10.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "electronic polarizability is 3.181 *10**-40 Fm**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=6.02*10**26; #avagadro number\n",
+ "d=2050; #density(kg/m**3)\n",
+ "w=32; #atomic weight\n",
+ "gama=1/3; #internal field constant\n",
+ "epsilon0=8.55*10**-12;\n",
+ "epsilon_r=3.75;\n",
+ "\n",
+ "#Calculation\n",
+ "N=n*d/w; #number of atoms(per m**3)\n",
+ "alphae=3*epsilon0*((epsilon_r-1)/(epsilon_r+2))/N; #electronic polarizability(Fm**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"electronic polarizability is\",round(alphae*10**40,3),\"*10**-40 Fm**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.8, Page number 10.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resultant voltage is 39.73 Volts\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Q=2*10**-10; #charge(C)\n",
+ "d=4*10**-3; #seperation(m)\n",
+ "epsilon_r=3.5;\n",
+ "A=650*10**-6; #area(m**2)\n",
+ "epsilon0=8.85*10**-12;\n",
+ "\n",
+ "#Calculation\n",
+ "V=Q*d/(epsilon0*epsilon_r*A); #resultant voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print \"resultant voltage is\",round(V,2),\"Volts\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.9, Page number 10.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "dielectric displacement is 265.5 *10**-9 C m**-2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=2*10**-3; #seperation(m)\n",
+ "epsilon_r=6;\n",
+ "V=10; #voltage(V)\n",
+ "epsilon0=8.85*10**-12;\n",
+ "\n",
+ "#Calculation\n",
+ "E=V/d;\n",
+ "D=epsilon0*epsilon_r*E; #dielectric displacement(C m**-2)\n",
+ "\n",
+ "#Result\n",
+ "print \"dielectric displacement is\",round(D*10**9,1),\"*10**-9 C m**-2\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter11.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter11.ipynb new file mode 100755 index 00000000..43338be1 --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter11.ipynb @@ -0,0 +1,529 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#11: Magnetic properties"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.1, Page number 11.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "relative permeability of iron is 2154\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",
+ "M=1.4; #magnetic field(T)\n",
+ "H=6.5*10**-4; #magnetic field(T)\n",
+ "\n",
+ "#Calculation\n",
+ "chi=M/H;\n",
+ "mew_r=1+chi; #relative permeability of iron\n",
+ "\n",
+ "#Result\n",
+ "print \"relative permeability of iron is\",int(mew_r)\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.2, Page number 11.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "relative permeability is 16\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "M=3300; #magnetic field(amp/m)\n",
+ "H=220; #magnetic field(amp/m)\n",
+ "\n",
+ "#Calculation\n",
+ "chi=M/H;\n",
+ "mew_r=1+chi; #relative permeability\n",
+ "\n",
+ "#Result\n",
+ "print \"relative permeability is\",int(mew_r)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.3, Page number 11.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnetisation of material is 1.5 *10**3 A/m\n",
+ "flux density is 1.2585 T\n",
+ "answer given in the book varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H=10**6; #magnetic field(amp/m)\n",
+ "chi=1.5*10**-3;\n",
+ "mew0=4*math.pi*10**-7;\n",
+ "\n",
+ "#Calculation\n",
+ "M=chi*H; #magnetisation of material(A/m)\n",
+ "B=mew0*(M+H); #flux density(T)\n",
+ "\n",
+ "#Result\n",
+ "print \"magnetisation of material is\",M/10**3,\"*10**3 A/m\"\n",
+ "print \"flux density is\",round(B,4),\"T\"\n",
+ "print \"answer given in the book varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.4, Page number 11.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnetisation of material is 37.0 A/m\n",
+ "flux density is 0.0126 wb/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H=10**4; #magnetic field(amp/m)\n",
+ "chi=3.7*10**-3;\n",
+ "mew0=4*math.pi*10**-7;\n",
+ "\n",
+ "#Calculation\n",
+ "M=chi*H; #magnetisation of material(A/m)\n",
+ "B=mew0*(M+H); #flux density(T)\n",
+ "\n",
+ "#Result\n",
+ "print \"magnetisation of material is\",M,\"A/m\"\n",
+ "print \"flux density is\",round(B,4),\"wb/m**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.5, Page number 11.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnetic moment is 7.854 *10**-3 Am**2\n",
+ "answer given in the book varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=5*10**-2 #radius(m)\n",
+ "I=500*10**-3; #current(A)\n",
+ "\n",
+ "#Calculation\n",
+ "A=2*math.pi*r**2;\n",
+ "mew_m=I*A; #magnetic moment(Am**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"magnetic moment is\",round(mew_m*10**3,3),\"*10**-3 Am**2\"\n",
+ "print \"answer given in the book varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.6, Page number 11.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "change in magnetic moment is 3.943 *10**-29 Am**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=5.29*10**-11; #radius(m)\n",
+ "B=2; #magnetic field(T)\n",
+ "e=1.602*10**-19; #charge(c)\n",
+ "m=9.108*10**-31; #mass(kg)\n",
+ "\n",
+ "#Calculation\n",
+ "mew_ind=e**2*r**2*B/(4*m); #change in magnetic moment(Am**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"change in magnetic moment is\",round(mew_ind*10**29,3),\"*10**-29 Am**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.7, Page number 11.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "susceptibility is 3.267 *10**-4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "chi1=2.8*10**-4; #susceptibility\n",
+ "T1=350; #temperature(K)\n",
+ "T2=300; #temperature(K)\n",
+ "\n",
+ "#Calculation\n",
+ "chi2=chi1*T1/T2; #susceptibility\n",
+ "\n",
+ "#Result\n",
+ "print \"susceptibility is\",round(chi2*10**4,3),\"*10**-4\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.8, Page number 11.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnetic moment is 0.61 mewB\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Bs=0.65; #magnetic induction(wb/m**2)\n",
+ "d=8906; #density(kg/m**3)\n",
+ "n=6.025*10**26; #avagadro number\n",
+ "mew0=4*math.pi*10**-7;\n",
+ "w=58.7; #atomic weight(kg)\n",
+ "\n",
+ "#Calculation\n",
+ "N=d*n/w; #number of nickel atoms(per m**3)\n",
+ "mew_m=Bs/(N*mew0*9.27*10**-24); #magnetic moment(mewB)\n",
+ "\n",
+ "#Result\n",
+ "print \"magnetic moment is\",round(mew_m,2),\"mewB\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.9, Page number 11.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "temperature is 3.9 K\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mew=9.4*10**-24; \n",
+ "H=2; #magnetic field(weber/m**2)\n",
+ "k=1.38*10**-23; #boltzmann constant\n",
+ "\n",
+ "#Calculation\n",
+ "T=2*mew*H/(math.log(2)*k); #temperature(K)\n",
+ "\n",
+ "#Result\n",
+ "print \"temperature is\",round(T,1),\"K\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.10, Page number 11.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnetic moment per gram 1966.851 Am**2\n",
+ "magnetic moment per gram is 2.4716 Wb/m**2\n",
+ "answer given in the book varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=7.8*10**3; #density(kg/m**3)\n",
+ "n=6.025*10**26; #number of atoms\n",
+ "w=157.26; #atomic weight(kg)\n",
+ "mewm=9.27*10**-24;\n",
+ "mew=7.1*mewm;\n",
+ "mew0=4*math.pi*10**-7;\n",
+ "\n",
+ "#Calculation\n",
+ "N=d*n/w; #number of atoms\n",
+ "mew_B=N*mew/10**3; #magnetic moment per gram(Am**2)\n",
+ "Bs=N*mew0*mew;\n",
+ "\n",
+ "#Result\n",
+ "print \"magnetic moment per gram\",round(mew_B,3),\"Am**2\"\n",
+ "print \"magnetic moment per gram is\",round(Bs,4),\"Wb/m**2\"\n",
+ "print \"answer given in the book varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.11, Page number 11.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 41,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical field is 0.02166 Tesla\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tc=3.7; #temperature(K)\n",
+ "Hc0=0.0306; #critical field(T)\n",
+ "T=2; #temperature(K)\n",
+ "\n",
+ "#Calculation\n",
+ "Hc2=Hc0*(1-(T/Tc)**2); #critical field(T)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical field is\",round(Hc2,5),\"Tesla\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.12, Page number 11.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical current is 134.33 A\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",
+ "Tc=7.18; #temperature(K)\n",
+ "H0=6.5*10**4; #critical field(T)\n",
+ "T=4.2; #temperature(K)\n",
+ "d=1*10**-3; #diameter(m)\n",
+ "\n",
+ "#Calculation\n",
+ "Hc=H0*(1-(T/Tc)**2); #critical field(T)\n",
+ "ic=math.pi*d*Hc; #critical current(A)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical current is\",round(ic,2),\"A\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter12.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter12.ipynb new file mode 100755 index 00000000..93ea352e --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter12.ipynb @@ -0,0 +1,159 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#12: Lasers"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.1, Page number 12.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "relative population is 1.0764 *10**-30\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",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "h=6.6*10**-34; #planck's constant(J sec)\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "lamda=6943*10**-10; #wavelength(m)\n",
+ "k=8.61*10**-5;\n",
+ "T=300; #temperature(K)\n",
+ "\n",
+ "#Calculation\n",
+ "dE=h*c/(e*lamda);\n",
+ "N2byN1=math.exp(-dE/(k*T)); #relative population\n",
+ "\n",
+ "#Result\n",
+ "print \"relative population is\",round(N2byN1*10**30,4),\"*10**-30\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.2, Page number 12.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "divergence is 1.0 milli radian\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a1=4*10**-3; #diameter(m)\n",
+ "a2=6*10**-3; #diameter(m)\n",
+ "d1=1; #distance(m)\n",
+ "d2=2; #distance(m)\n",
+ "\n",
+ "#Calculation\n",
+ "theta=(a2-a1)/(2*(d2-d1)); #divergence(radian)\n",
+ "\n",
+ "#Result\n",
+ "print \"divergence is\",theta*10**3,\"milli radian\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.3, Page number 12.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "spot size is 0.867 micro m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s=1*10**-3; #size(m)\n",
+ "l=1*10**-3; #length(m)\n",
+ "lamda=650*10**-9; #wavelength(m)\n",
+ "\n",
+ "#Calculation\n",
+ "tantheta=(l/2)/s; \n",
+ "theta=math.atan(tantheta); #angle(radian)\n",
+ "sintheta=round(math.sin(theta),2);\n",
+ "ss=0.6*lamda/sintheta; #spot size(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"spot size is\",round(ss*10**6,3),\"micro 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/Engineering_Physics_by_P.K.Palanisamy/Chapter13.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter13.ipynb new file mode 100755 index 00000000..fa599112 --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter13.ipynb @@ -0,0 +1,274 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#13: Fiber Optics "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 13.1, Page number 13.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "numerical aperture is 0.391\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=1.55; #refractive index of core\n",
+ "n2=1.50; #refractive index of cladding\n",
+ "\n",
+ "#Calculation\n",
+ "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n",
+ "\n",
+ "#Result\n",
+ "print \"numerical aperture is\",round(NA,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 13.2, Page number 13.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "angle of acceptance is 26 degrees 29.5 minutes\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=1.563; #refractive index of core\n",
+ "n2=1.498; #refractive index of cladding\n",
+ "\n",
+ "#Calculation\n",
+ "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n",
+ "alpha_i=math.asin(NA); #angle of acceptance(radian)\n",
+ "alpha_i=(alpha_i*180/math.pi); #angle(degrees)\n",
+ "alpha_id=int(alpha_i);\n",
+ "alpha_im=60*(alpha_i-alpha_id);\n",
+ "\n",
+ "#Result\n",
+ "print \"angle of acceptance is\",alpha_id,\"degrees\",round(alpha_im,1),\"minutes\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 13.3, Page number 13.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "refractive index of core is 1.2333\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "NA=0.39; #numerical aperture\n",
+ "delta=0.05; #difference of indices\n",
+ "\n",
+ "#Calculation\n",
+ "n1=NA/math.sqrt(2*delta); #refractive index of core\n",
+ "\n",
+ "#Result\n",
+ "print \"refractive index of core is\",round(n1,4)\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 13.4, Page number 13.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fractional index change is 0.0416\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=1.563; #refractive index of core\n",
+ "n2=1.498; #refractive index of cladding\n",
+ "\n",
+ "#Calculation\n",
+ "delta=(n1-n2)/n1; #fractional index change\n",
+ "\n",
+ "#Result\n",
+ "print \"fractional index change is\",round(delta,4)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 13.5, Page number 13.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "numerical aperture is 0.2965\n",
+ "angle of acceptance is 17 degrees 15.0 minutes\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=1.48; #refractive index of core\n",
+ "n2=1.45; #refractive index of cladding\n",
+ "\n",
+ "#Calculation\n",
+ "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n",
+ "alpha_i=math.asin(NA); #angle of acceptance(radian)\n",
+ "alpha_i=(alpha_i*180/math.pi); #angle(degrees)\n",
+ "alpha_id=int(alpha_i);\n",
+ "alpha_im=60*(alpha_i-alpha_id);\n",
+ "\n",
+ "#Result\n",
+ "print \"numerical aperture is\",round(NA,4)\n",
+ "print \"angle of acceptance is\",alpha_id,\"degrees\",round(alpha_im),\"minutes\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 13.6, Page number 13.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "attenuation loss is 3.98 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pout=40; #power(mW)\n",
+ "Pin=100; #power(mW)\n",
+ "\n",
+ "#Calculation\n",
+ "al=-10*math.log10(Pout/Pin); #attenuation loss(dB)\n",
+ "\n",
+ "#Result\n",
+ "print \"attenuation loss is\",round(al,2),\"dB\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter14.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter14.ipynb new file mode 100755 index 00000000..ef73934a --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter14.ipynb @@ -0,0 +1,281 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#14: Acoustics of buildings and acoustic quieting"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 14.1, Page number 14.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "reverberation time of hall is 1.264 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=475; #volume(m**3)\n",
+ "aw=200; #area of wall(m**2)\n",
+ "ac=100; #area of ceiling(m**2)\n",
+ "ac_w=0.025; #absorption coefficient of wall\n",
+ "ac_c=0.02; #absorption coefficient of ceiling\n",
+ "ac_f=0.55; #absorption coefficient of floor\n",
+ "\n",
+ "#Calculation\n",
+ "sigma_as=(aw*ac_w)+(ac*ac_c)+(ac*ac_f); \n",
+ "T=0.165*V/sigma_as; #reverberation time of hall(s)\n",
+ "\n",
+ "#Result\n",
+ "print \"reverberation time of hall is\",round(T,3),\"s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 14.2, Page number 14.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "new reverberation time is 1.31 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=12500; #volume(m**3)\n",
+ "T1=1.5; #reverberation time(sec)\n",
+ "n=200; #number of cushioned chairs\n",
+ "\n",
+ "#Calculation\n",
+ "sigma_as=0.165*V/T1; \n",
+ "T2=0.165*V/(sigma_as+n); #new reverberation time(s)\n",
+ "\n",
+ "#Result\n",
+ "print \"new reverberation time is\",round(T2,2),\"s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 14.3, Page number 14.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total absorption in the hall is 660.0 OWU\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=5000; #volume(m**3)\n",
+ "T=1.25; #time(s)\n",
+ "\n",
+ "#Calculation\n",
+ "sigma_as=0.165*V/T; #total absorption in the hall(OWU)\n",
+ "\n",
+ "#Result\n",
+ "print \"total absorption in the hall is\",sigma_as,\"OWU\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 14.4, Page number 14.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total absorption in the hall is 1045.0 OWU\n",
+ "new period of reverberation is 1.369 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=9500; #volume(m**3)\n",
+ "T=1.5; #time(s)\n",
+ "x=100; #absorption(sabines)\n",
+ "\n",
+ "#Calculation\n",
+ "sigma_as=0.165*V/T; #total absorption in the hall(OWU)\n",
+ "T=0.165*V/(sigma_as+x); #new period of reverberation(s)\n",
+ "\n",
+ "#Result\n",
+ "print \"total absorption in the hall is\",sigma_as,\"OWU\"\n",
+ "print \"new period of reverberation is\",round(T,3),\"s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 14.5, Page number 14.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total absorption in the hall is 70.714 OWU\n",
+ "average absorption coefficient is 0.074 sabine/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=20*15*5; #volume(m**3)\n",
+ "T=3.5; #time(s)\n",
+ "A=950; #surface area(m**2)\n",
+ "\n",
+ "#Calculation\n",
+ "sigma_as=0.165*V/T; #total absorption in the hall(OWU)\n",
+ "ac=sigma_as/A; #average absorption coefficient\n",
+ "\n",
+ "#Result\n",
+ "print \"total absorption in the hall is\",round(sigma_as,3),\"OWU\"\n",
+ "print \"average absorption coefficient is\",round(ac,3),\"sabine/m**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 14.6, Page number 14.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "reverberation time of hall is 4.023 s\n",
+ "number of persons to be seated is 5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=2265; #volume(m**3)\n",
+ "sigma_as=92.9; #absorption(m**2)\n",
+ "a=18.6; #area(m**2)\n",
+ "\n",
+ "#Calculation\n",
+ "T=0.165*V/sigma_as; #reverberation time of hall(s)\n",
+ "T1=0.165*V/2; \n",
+ "inc=T1-sigma_as; #increase in absorption(OWU)\n",
+ "n=inc/a; #number of persons to be seated\n",
+ "\n",
+ "#Result\n",
+ "print \"reverberation time of hall is\",round(T,3),\"s\"\n",
+ "print \"number of persons to be seated is\",int(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/Engineering_Physics_by_P.K.Palanisamy/Chapter2.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter2.ipynb new file mode 100755 index 00000000..5f7356c7 --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter2.ipynb @@ -0,0 +1,559 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#2: Crystallography and Crystal Structures"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.3, Page number 2.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of atoms in (100) is a**(-2) atoms/mm**2\n",
+ "number of atoms in (110) is 0.707106781186547/a**2 atoms/mm**2\n",
+ "number of atoms in (111) is 0.577350269189626/a**2 atoms/mm**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from sympy import *\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=Symbol('a'); #lattice constant(mm)\n",
+ "x1=4;\n",
+ "x2=math.sqrt(2);\n",
+ "b=a*math.sqrt(2);\n",
+ "theta=30; #angle(degrees)\n",
+ "\n",
+ "#Calculation\n",
+ "theta=theta*math.pi/180; #angle(radian)\n",
+ "na1=x1*1/(x1*a**2); #number of atoms in (100)(per mm**2)\n",
+ "na2=1/(x2*a**2); #number of atoms in (110)(per mm**2)\n",
+ "A3=(1/2)*b*b*math.cos(theta); \n",
+ "t=60/360*3;\n",
+ "na3=t/A3; #number of atoms in (111)(per mm**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"number of atoms in (100) is\",na1,\"atoms/mm**2\"\n",
+ "print \"number of atoms in (110) is\",na2,\"atoms/mm**2\"\n",
+ "print \"number of atoms in (111) is\",na3,\"atoms/mm**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.4, Page number 2.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "interplanar spacing for (110) is 0.2556 nm\n",
+ "interplanar spacing for (212) is 0.1205 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=0.1278; #atomic radius(m)\n",
+ "h1=1;\n",
+ "k1=1;\n",
+ "l1=0;\n",
+ "h2=2;\n",
+ "k2=1;\n",
+ "l2=2;\n",
+ "\n",
+ "#Calculation\n",
+ "a=round(4*r/math.sqrt(2),4);\n",
+ "d110=a/math.sqrt(h1**2+k1**2+l1**2); #interplanar spacing for (110)(nm)\n",
+ "d212=a/math.sqrt(h2**2+k2**2+l2**2); #interplanar spacing for (212)(nm)\n",
+ "\n",
+ "#Result\n",
+ "print \"interplanar spacing for (110) is\",round(d110,4),\"nm\"\n",
+ "print \"interplanar spacing for (212) is\",d212,\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.5, Page number 2.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "seperation between successive lattice planes is 1 : 0.71 : 0.58\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1=1;\n",
+ "k1=0;\n",
+ "l1=0;\n",
+ "h2=1;\n",
+ "k2=1;\n",
+ "l2=0;\n",
+ "h3=1;\n",
+ "k3=1;\n",
+ "l3=1;\n",
+ "\n",
+ "#Calculation\n",
+ "d100=1/math.sqrt(h1**2+k1**2+l1**2); #interplanar spacing for (110)\n",
+ "d110=1/math.sqrt(h2**2+k2**2+l2**2); #interplanar spacing for (110)\n",
+ "d111=1/math.sqrt(h3**2+k3**2+l3**2); #interplanar spacing for (111)\n",
+ "\n",
+ "#Result\n",
+ "print \"seperation between successive lattice planes is\",int(d100),\":\",round(d110,2),\":\",round(d111,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.6, Page number 2.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "miller indices of plane is ( 3.0 6.0 1.0 )\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=1;\n",
+ "b=1/2;\n",
+ "c=3;\n",
+ "\n",
+ "#Calculation\n",
+ "A=1/a;\n",
+ "B=1/b;\n",
+ "C=1/c;\n",
+ "h=A*c;\n",
+ "k=B*c;\n",
+ "l=C*c; #miller indices of plane\n",
+ "\n",
+ "#Result\n",
+ "print \"miller indices of plane is (\",h,k,l,\")\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.7, Page number 2.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "radius of interstitial sphere is 0.155 r\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=1; #assume\n",
+ "\n",
+ "#Calculation\n",
+ "a=4/math.sqrt(3);\n",
+ "R=(a-(2*r))/2; #radius of interstitial sphere(r)\n",
+ "\n",
+ "#Result\n",
+ "print \"radius of interstitial sphere is\",round(R,3),\"r\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.8, Page number 2.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "decrease of volume is 0.5 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r1=1.258; #atomic radius(angstrom)\n",
+ "r2=1.292; #atomic radius(angstrom)\n",
+ "\n",
+ "#Calculation\n",
+ "a1=4*r1/math.sqrt(3); #spacing(angstrom)\n",
+ "n1=((1/8)*8)+1; #number of atoms per unit cell\n",
+ "v1=a1**3/n1; #volume occupied by 1 atom(m**3)\n",
+ "n2=(1/2*6)+(1/8*8); #number of atoms per unit cell\n",
+ "a2=2*math.sqrt(2)*r2; #spacing(angstrom)\n",
+ "v2=a2**3/n2; #volume occupied by 1 atom(m**3)\n",
+ "dc=(v1-v2)*100/v1; #change in volume(%)\n",
+ "\n",
+ "#Result\n",
+ "print \"decrease of volume is\",round(dc,1),\"%\" "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.9, Page number 2.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "volume of unit cell is 9.356 *10**-29 m**3\n",
+ "density of zinc is 6960 kg/m**3\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=0.27*10**-9; #spacing(m)\n",
+ "c=0.494*10**-9;\n",
+ "n=6; #number of atoms\n",
+ "M=65.37; #atomic weight\n",
+ "N=6.023*10**26; #avagadro number\n",
+ "\n",
+ "#Calculation\n",
+ "V=3*math.sqrt(3)*a**2*c/2; #volume of unit cell(m**3)\n",
+ "rho=n*M/(N*V); #density of zinc(kg/m**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"volume of unit cell is\",round(V*10**29,3),\"*10**-29 m**3\"\n",
+ "print \"density of zinc is\",int(rho),\"kg/m**3\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.10, Page number 2.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "radius of interstitial sphere is 0.414 r\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=1; #assume\n",
+ "\n",
+ "#Calculation\n",
+ "a=4*r/math.sqrt(2);\n",
+ "R=(a/2)-r; #radius of interstitial sphere(r)\n",
+ "\n",
+ "#Result\n",
+ "print \"radius of interstitial sphere is\",round(R,3),\"r\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.11, Page number 2.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of atoms per m**3 is 1.77 *10**29\n",
+ "density of diamond is 3535.7 kg/m**3\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=0.356*10**-9; #cube edge(m)\n",
+ "m=12.01; #atomic weight of carbon\n",
+ "N=6.023*10**26; #avagadro number\n",
+ "\n",
+ "#Calculation\n",
+ "n=8/a**3; #number of atoms per m**3\n",
+ "M=m/N;\n",
+ "d=M*n; #density of diamond(kg/m**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"number of atoms per m**3 is\",round(n/10**29,2),\"*10**29\"\n",
+ "print \"density of diamond is\",round(d,1),\"kg/m**3\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.12, Page number 2.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "distance between 2 adjacent atoms is 2.81 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mw=23+35.5; #molecular weight of NaCl(gm/mol)\n",
+ "N=6.023*10**23; #avagadro number(per mol)\n",
+ "d=2.18; #mass of unit volume\n",
+ "\n",
+ "#Calculation\n",
+ "M=mw/N; #mass of NaCl molecule(gm)\n",
+ "n=2*d/M; #number of atoms per unit volume(atoms/cm**3)\n",
+ "a=(1/n)**(1/3); #distance between 2 adjacent atoms(cm)\n",
+ "\n",
+ "#Result\n",
+ "print \"distance between 2 adjacent atoms is\",round(a*10**8,2),\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.13, Page number 2.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density of copper crystal is 8.929 gm/cm**3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "M=63.5; #atomic weight\n",
+ "N=6.023*10**23; #avagadro number\n",
+ "r=1.278*10**-8; #radius(m)\n",
+ "n=4;\n",
+ "\n",
+ "#Calculation\n",
+ "m=M/N; #mass of copper atom(gm)\n",
+ "a=4*r/math.sqrt(2);\n",
+ "Mu=n*m; #mass of unit cell\n",
+ "d=Mu/a**3; #density of copper crystal(gm/cm**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"density of copper crystal is\",round(d,3),\"gm/cm**3\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.14, Page number 2.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "free volume per unit cell is 7.6795 *10**-30 m**3\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=0.1249*10**-9; #radius(m)\n",
+ "pf=0.68; #packing factor\n",
+ "\n",
+ "#Calculation\n",
+ "a=4*r/math.sqrt(3); #lattice constant(m)\n",
+ "v=a**3; #volume of unit cell(m**3)\n",
+ "Fv=(1-pf)*v; #free volume per unit cell(m**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"free volume per unit cell is\",round(Fv*10**30,4),\"*10**-30 m**3\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter3.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter3.ipynb new file mode 100755 index 00000000..5c886a5b --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter3.ipynb @@ -0,0 +1,249 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#3: X-ray Diffraction"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 3.1, Page number 3.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "wavelength of X-rays is 0.08496 nm\n",
+ "answer varies due to rounding off errors\n",
+ "when theta=90, maximum order of diffraction possible is 7\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=0.313; #lattice spacing(m)\n",
+ "theta=7+(48/60); #angle(degrees)\n",
+ "n=1;\n",
+ "\n",
+ "#Calculation\n",
+ "theta=theta*math.pi/180; #angle(radian)\n",
+ "lamda=2*d*math.sin(theta)/n; #wavelength of X-rays(nm)\n",
+ "#when theta=90\n",
+ "n=2*d/lamda; #maximum order of diffraction possible\n",
+ "\n",
+ "#Result\n",
+ "print \"wavelength of X-rays is\",round(lamda,5),\"nm\"\n",
+ "print \"answer varies due to rounding off errors\"\n",
+ "print \"when theta=90, maximum order of diffraction possible is\",int(n)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 3.2, Page number 3.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "interatomic spacing is 2.67 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda=1.5418; #wavelength(angstrom)\n",
+ "theta=30; #angle(degrees)\n",
+ "n=1; #first order\n",
+ "h=1;\n",
+ "k=1;\n",
+ "l=1;\n",
+ "\n",
+ "#Calculation\n",
+ "theta=theta*math.pi/180; #angle(radian)\n",
+ "d=n*lamda/(2*math.sin(theta)); \n",
+ "a=d*math.sqrt(h**2+k**2+l**2); #interatomic spacing(angstrom)\n",
+ "\n",
+ "#Result\n",
+ "print \"interatomic spacing is\",round(a,2),\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 3.3, Page number 3.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "glancing angle is 21 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d100=0.28; #spacing(nm)\n",
+ "lamda=0.071; #wavelength of X rays(nm)\n",
+ "n=2; #second order\n",
+ "\n",
+ "#Calculation\n",
+ "d110=round(d100/math.sqrt(2),3); #spacing(nm)\n",
+ "x=n*lamda/(2*d110);\n",
+ "theta=math.asin(x); #glancing angle(radian)\n",
+ "theta=theta*180/math.pi; #glancing angle(degrees)\n",
+ "\n",
+ "#Result\n",
+ "print \"glancing angle is\",int(theta),\"degrees\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 3.4, Page number 3.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "distance between planes is 0.27 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=0.38; #lattice constant(nm)\n",
+ "h=1;\n",
+ "k=1;\n",
+ "l=0;\n",
+ "\n",
+ "#Calculation\n",
+ "d=a/math.sqrt(h**2+k**2+l**2); #distance between planes(nm)\n",
+ "\n",
+ "#Result\n",
+ "print \"distance between planes is\",round(d,2),\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 3.5, Page number 3.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "glancing angle is 32.0 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=0.19; #lattice constant(nm)\n",
+ "h=1;\n",
+ "k=1;\n",
+ "l=1;\n",
+ "lamda=0.058; #wavelength of X rays(nm)\n",
+ "n=2; #second order\n",
+ "\n",
+ "#Calculation\n",
+ "d=a/math.sqrt(h**2+k**2+l**2); #distance between planes(nm)\n",
+ "x=n*lamda/(2*d);\n",
+ "theta=math.asin(x); #glancing angle(radian)\n",
+ "theta=theta*180/math.pi; #glancing angle(degrees)\n",
+ "\n",
+ "#Result\n",
+ "print \"glancing angle is\",round(theta),\"degrees\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter4.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter4.ipynb new file mode 100755 index 00000000..2b7c926e --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter4.ipynb @@ -0,0 +1,203 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#4: Defects in Crystals"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.1, Page number 4.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio of vacancies is 1.082 *10**5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ev=1;\n",
+ "k=1.38*10**-23; #boltzmann constant(J/K)\n",
+ "e=1.6*10**-19; #charge(eV)\n",
+ "\n",
+ "#Calculation\n",
+ "r=Ev/(2.303*1000*k/e); \n",
+ "n=10**r; #ratio of n1000/n500\n",
+ "\n",
+ "#Result\n",
+ "print \"ratio of vacancies is\",round(n/10**5,3),\"*10**5\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.2, Page number 4.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of vacancies per atom at 350K is 0.5486 *10**-17\n",
+ "number of vacancies per atom at 500K is 0.827 *10**-12\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ev=1.2;\n",
+ "k=1.38*10**-23; #boltzmann constant(J/K)\n",
+ "e=1.6*10**-19; #charge(eV)\n",
+ "T1=350; #temperature(K)\n",
+ "T2=500; #temperature(K)\n",
+ "\n",
+ "#Calculation\n",
+ "x1=Ev/(2.303*k*T1/e);\n",
+ "n1=1/(10**x1); #number of vacancies per atom at 350K\n",
+ "x2=Ev/(2.303*k*T2/e);\n",
+ "n2=1/(10**x2); #number of vacancies per atom at 500K\n",
+ "\n",
+ "#Result\n",
+ "print \"number of vacancies per atom at 350K is\",round(n1*10**17,4),\"*10**-17\"\n",
+ "print \"number of vacancies per atom at 500K is\",round(n2*10**12,3),\"*10**-12\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.3, Page number 4.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "average energy required is 1.971 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=2.82*10**-10; #distance(m)\n",
+ "k=1.38*10**-23; #boltzmann constant(J/K)\n",
+ "e=1.6*10**-19; #charge(eV)\n",
+ "T=273+25; #temperature(K)\n",
+ "sd=5*10**11; #schotky defects(per m**3)\n",
+ "\n",
+ "#Calculation\n",
+ "V=(2*d)**3; #volume of unit cell(m**3)\n",
+ "N=4/V; #density of ion pairs\n",
+ "x=round(math.log10(N/sd),2);\n",
+ "Es=2*(k/e)*T*2.303*x; #average energy required(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"average energy required is\",round(Es,3),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.4, Page number 4.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio of Frenkel defects is 1.125 *10**-6\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T1=273+25; #temperature(K)\n",
+ "T2=273+350; #temperature(K)\n",
+ "Ef=1.35; #energy(eV)\n",
+ "k=8.625*10**-5;\n",
+ "\n",
+ "#Calculation\n",
+ "x=(Ef/k)*((1/(2*T1))-(1/(2*T2)))/2.303;\n",
+ "r=1/(10**round(x,3)); #ratio of Frenkel defects\n",
+ "\n",
+ "#Result\n",
+ "print \"ratio of Frenkel defects is\",round(r*10**6,3),\"*10**-6\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter5.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter5.ipynb new file mode 100755 index 00000000..f1b18946 --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter5.ipynb @@ -0,0 +1,238 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#5: Elements of statistical mechanics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 5.1, Page number 5.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "average thermal energy is 0.039 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k=1.38*10**-23; #boltzmann constant(J)\n",
+ "T=300; #temperature(K)\n",
+ "e=1.6*10**-19; #charge(c)\n",
+ "\n",
+ "#Calculation\n",
+ "E=3*k*T/(2*e); #average thermal energy(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"average thermal energy is\",round(E,3),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 5.3, Page number 5.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fermi function is 0.269\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "kT=1; #assume\n",
+ "E_Ef=kT;\n",
+ "\n",
+ "#Calculation\n",
+ "FE=1/(1+math.exp(1)); #fermi function\n",
+ "\n",
+ "#Result\n",
+ "print \"fermi function is\",round(FE,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 5.4, Page number 5.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " temperature is 290.2 K\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "FE=10/100; #fermi function\n",
+ "EF=5.5; #energy function(eV)\n",
+ "e=1.6*10**-19; #charge(c)\n",
+ "k=1.38*10**-23; #boltzmann constant(J)\n",
+ "\n",
+ "#Calculation\n",
+ "E=EF+(EF/100); #energy(eV)\n",
+ "x=math.log((1/FE)-1);\n",
+ "T=(E-EF)*e/(k*x); #temperature(K)\n",
+ "\n",
+ "#Result\n",
+ "print \"temperature is\",round(T,1),\"K\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 5.5, Page number 5.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fermi velocity is 0.86 *10**6 m s-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k=1.38*10**-23; #boltzmann constant(J)\n",
+ "T=24600; #temperature(K)\n",
+ "m=9.108*10**-31; #mass(kg)\n",
+ "\n",
+ "#Calculation\n",
+ "vF=math.sqrt(2*k*T/m); #fermi velocity(m s-1)\n",
+ "\n",
+ "#Result\n",
+ "print \"fermi velocity is\",round(vF/10**6,2),\"*10**6 m s-1\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 5.6, Page number 5.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of states is 1.1877 *10**26\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from scipy.integrate import quad\n",
+ "\n",
+ "#Variable declaration\n",
+ "EF=3.0; #fermi energy(eV)\n",
+ "e=1.6*10**-19; #charge(c)\n",
+ "m=9.14*10**-31; #mass(kg)\n",
+ "h=6.62*10**-34; #planck's constant\n",
+ "\n",
+ "#Calculation\n",
+ "E1=EF*e; #energy(J)\n",
+ "E2=(EF+0.01)*e; #energy(J)\n",
+ "def zintg(E):\n",
+ "\treturn (4*math.pi*(2*m)**(3/2)*math.sqrt(E))/h**3;\n",
+ "\n",
+ "n=quad(zintg,E1,E2)[0]; #number of states\n",
+ "\n",
+ "#Result\n",
+ "print \"number of states is\",round(n/10**26,4),\"*10**26\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter6.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter6.ipynb new file mode 100755 index 00000000..9746dc5d --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter6.ipynb @@ -0,0 +1,603 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# 6: Principles of quantum mechanics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.1, Page number 6.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "de broglie wavelength is 1.323 *10**-14 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/s)\n",
+ "m=1.67*10**-27; #mass of proton(kg)\n",
+ "h=6.626*10**-34; #planck's constant\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=h*10/(m*c); #de broglie wavelength(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"de broglie wavelength is\",round(lamda*10**14,3),\"*10**-14 m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.2, Page number 6.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "de broglie wavelength is 0.613 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=400; #voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=12.26/math.sqrt(V); #de broglie wavelength(angstrom)\n",
+ "\n",
+ "#Result\n",
+ "print \"de broglie wavelength is\",lamda,\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.3, Page number 6.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "de broglie wavelength is 0.181 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=1.674*10**-27; #mass of proton(kg)\n",
+ "h=6.626*10**-34; #planck's constant\n",
+ "E=0.025*1.6*10**-19; #energy(J)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=h/math.sqrt(2*m*E); #de broglie wavelength(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"de broglie wavelength is\",round(lamda*10**9,3),\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.4, Page number 6.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "de broglie wavelength is 0.3065 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=1600; #voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=12.26/math.sqrt(V); #de broglie wavelength(angstrom)\n",
+ "\n",
+ "#Result\n",
+ "print \"de broglie wavelength is\",lamda,\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.5, Page number 6.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "uncertainity in momentum is 5.27 *10**-24 kg m/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "deltax=0.2*10**-10; #distance(m)\n",
+ "h=6.626*10**-34; #planck's constant\n",
+ "\n",
+ "#Calculation\n",
+ "deltap=h/(2*math.pi*deltax); #uncertainity in momentum(kg m/s)\n",
+ "\n",
+ "#Result\n",
+ "print \"uncertainity in momentum is\",round(deltap*10**24,2),\"*10**-24 kg m/s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.6, Page number 6.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "lowest energy of electron is 112.9 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=n2=n3=1;\n",
+ "h=6.62*10**-34; #planck's constant\n",
+ "m=9.1*10**-31; #mass(kg)\n",
+ "L=0.1*10**-9; #side(m) \n",
+ "\n",
+ "#Calculation\n",
+ "E1=h**2*(n1**2+n2**2+n3**2)/(8*m*1.6*10**-19*L**2); #lowest energy of electron(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"lowest energy of electron is\",round(E1,1),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.7, Page number 6.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "lowest energy of electron is 1.208 *10**4 eV\n",
+ "value of E112, E121, E211 is 2.4168 *10**4 eV\n",
+ "value of E122, E212, E221 is 3.625 *10**4 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=n2=n3=1;\n",
+ "h=6.62*10**-34; #planck's constant\n",
+ "m=8.5*10**-31; #mass(kg)\n",
+ "L=10**-11; #side(m) \n",
+ "\n",
+ "#Calculation\n",
+ "E111=h**2*(n1**2+n2**2+n3**2)/(8*m*1.6*10**-19*L**2); #lowest energy of electron(eV)\n",
+ "E112=6*h**2/(8*m*1.6*10**-19*L**2); #value of E112(eV)\n",
+ "E121=E112; #value of E121(eV)\n",
+ "E211=E112; #value of E211(eV)\n",
+ "E122=9*h**2/(8*m*1.6*10**-19*L**2); #value of E122(eV)\n",
+ "E212=E122; #value of E212(eV)\n",
+ "E221=E122; #value of E221(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"lowest energy of electron is\",round(E111/10**4,3),\"*10**4 eV\"\n",
+ "print \"value of E112, E121, E211 is\",round(E121/10**4,4),\"*10**4 eV\"\n",
+ "print \"value of E122, E212, E221 is\",round(E122/10**4,3),\"*10**4 eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.8, Page number 6.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "de broglie wavelength is 0.0275 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=9.1*10**-31; #mass of electron(kg)\n",
+ "h=6.626*10**-34; #planck's constant\n",
+ "E=2000*1.6*10**-19; #energy(J)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=h/math.sqrt(2*m*E); #de broglie wavelength(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"de broglie wavelength is\",round(lamda*10**9,4),\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.9, Page number 6.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "lowest energy of electron is 0.377 *10**-18 joule\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=9.1*10**-31; #mass of electron(kg)\n",
+ "h=6.626*10**-34; #planck's constant\n",
+ "n=1;\n",
+ "L=4*10**-10; #side(m) \n",
+ "\n",
+ "#Calculation\n",
+ "E1=n**2*h**2/(8*m*L**2); #lowest energy of electron(joule)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"lowest energy of electron is\",round(E1*10**18,3),\"*10**-18 joule\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.10, Page number 6.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "lowest energy of electron is 0.6031 *10**-17 joule\n",
+ "energy of electron in 1st state is 2.412 *10**-17 joule\n",
+ "energy of electron in 2nd state is 5.428 *10**-17 joule\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=9.1*10**-31; #mass of electron(kg)\n",
+ "h=6.626*10**-34; #planck's constant\n",
+ "n1=1;\n",
+ "n2=2;\n",
+ "n3=3;\n",
+ "L=1*10**-10; #side(m) \n",
+ "\n",
+ "#Calculation\n",
+ "E1=n1**2*h**2/(8*m*L**2); #lowest energy of electron(joule)\n",
+ "E2=n2**2*h**2/(8*m*L**2); #energy of electron in 1st state(joule)\n",
+ "E3=n3**2*h**2/(8*m*L**2); #energy of electron in 2nd state(joule)\n",
+ "\n",
+ "#Result\n",
+ "print \"lowest energy of electron is\",round(E1*10**17,4),\"*10**-17 joule\"\n",
+ "print \"energy of electron in 1st state is\",round(E2*10**17,3),\"*10**-17 joule\"\n",
+ "print \"energy of electron in 2nd state is\",round(E3*10**17,3),\"*10**-17 joule\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.11, Page number 6.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "velocity is 4386 km/s\n",
+ "kinetic energy is 54.71 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=9.1*10**-31; #mass of electron(kg)\n",
+ "h=6.626*10**-34; #planck's constant\n",
+ "lamda=1.66*10**-10; #wavelength(m)\n",
+ "\n",
+ "#Calculation\n",
+ "v=h/(m*lamda); #velocity(m/s)\n",
+ "KE=(1/2)*m*v**2; #kinetic energy(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"velocity is\",int(v/10**3),\"km/s\"\n",
+ "print \"kinetic energy is\",round(KE/(1.6*10**-19),2),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.12, Page number 6.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "de broglie wavelength is 0.1 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=15000; #voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=12.26/math.sqrt(V); #de broglie wavelength(angstrom)\n",
+ "\n",
+ "#Result\n",
+ "print \"de broglie wavelength is\",round(lamda,1),\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.13, Page number 6.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "spacing of crystal is 0.3816 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=344; #voltage(V)\n",
+ "n=1;\n",
+ "theta=60*math.pi/180; #angle(radian)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=round(12.26/math.sqrt(V),3); #de broglie wavelength(angstrom)\n",
+ "d=n*lamda/(2*math.sin(theta)); #spacing of crystal(angstrom)\n",
+ "\n",
+ "#Result\n",
+ "print \"spacing of crystal is\",round(d,4),\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 6.14, Page number 6.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "wavelength is 9.787 *10**-6 m\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "E=1.5*9.1*10**-31; #energy(joule)\n",
+ "m=1.676*10**-27; #mass(kg)\n",
+ "h=6.62*10**-34; #planck's constant\n",
+ "\n",
+ "#Calculation\n",
+ "v=math.sqrt(2*E/m); \n",
+ "lamda=h/(m*v); #wavelength(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"wavelength is\",round(lamda*10**6,3),\"*10**-6 m\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter7.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter7.ipynb new file mode 100755 index 00000000..8fddb7ff --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter7.ipynb @@ -0,0 +1,212 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#7: Band Theory of Solids"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 7.1, Page number 7.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density of electrons is 5.86 *10**28\n",
+ "mobility of electrons is 0.725 *10**-2 m**2 V-1 s-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "rho_s=10.5*10**3; #density(kg/m**3)\n",
+ "NA=6.02*10**26; #avagadro number(per k mol)\n",
+ "MA=107.9; #atomic mass\n",
+ "sigma=6.8*10**7; #conductance(ohm-1 m-1)\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "\n",
+ "#Calculation\n",
+ "n=rho_s*NA/MA; #density of electrons\n",
+ "mew=sigma/(n*e); #mobility of electrons(m**2/Vs)\n",
+ "\n",
+ "#Result\n",
+ "print \"density of electrons is\",round(n/10**28,2),\"*10**28\"\n",
+ "print \"mobility of electrons is\",round(mew*10**2,3),\"*10**-2 m**2 V-1 s-1\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 7.2, Page number 7.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mobility of electrons is 0.427 *10**-2 m V-1 s-1\n",
+ "average time of collision is 2.43 *10**-14 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=8.92*10**3; #density(kg/m**3)\n",
+ "rho=1.73*10**-8; #resistivity of copper(ohm m)\n",
+ "NA=6.02*10**26; #avagadro number(per k mol)\n",
+ "Aw=63.5; #atomic weight\n",
+ "m=9.1*10**-31; #mass(kg)\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "\n",
+ "#Calculation\n",
+ "n=d*NA/Aw; #density of electrons\n",
+ "mew=1/(rho*n*e); #mobility of electrons(m**2/Vs)\n",
+ "t=m/(n*e**2*rho); #average time of collision(s)\n",
+ "\n",
+ "#Result\n",
+ "print \"mobility of electrons is\",round(mew*10**2,3),\"*10**-2 m V-1 s-1\"\n",
+ "print \"average time of collision is\",round(t*10**14,2),\"*10**-14 s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 7.3, Page number 7.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "relaxation time of conduction electrons is 3.97 *10**-14 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P=1.54*10**-8; #resistance(ohm m)\n",
+ "n=5.8*10**28; #number of electrons(per m**3)\n",
+ "m=9.108*10**-31; #mass(kg)\n",
+ "e=1.602*10**-19; #charge(coulomb)\n",
+ "\n",
+ "#Calculation\n",
+ "t=m/(n*e**2*P); #relaxation time of conduction electrons(s) \n",
+ "\n",
+ "#Result\n",
+ "print \"relaxation time of conduction electrons is\",round(t*10**14,2),\"*10**-14 s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 7.4, Page number 7.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "free electron concentration is 1.8088 *10**29 electrons/m**2\n",
+ "mobility is 1.278 *10**-3 m s-1 V-1\n",
+ "drift velocity of electrons is 0.23 *10**-3 m s-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=0.06; #resistance(ohm)\n",
+ "I=15; #current(A)\n",
+ "D=5; #length(m)\n",
+ "MA=26.98; #atomic mass\n",
+ "rho_s=2.7*10**3; #density(kg/m**3)\n",
+ "NA=6.025*10**26; #avagadro number(per k mol)\n",
+ "e=1.602*10**-19; #charge(coulomb)\n",
+ "\n",
+ "#Calculation\n",
+ "n=3*rho_s*NA/MA; #free electron concentration(electrons/m**2)\n",
+ "mew=1/(n*e*rho_s*10**-11); #mobility(m s-1 V-1)\n",
+ "E=I*R/D; #electric field(V/m)\n",
+ "vd=mew*E; #drift velocity of electrons(m/s)\n",
+ "\n",
+ "#Result\n",
+ "print \"free electron concentration is\",round(n/10**29,4),\"*10**29 electrons/m**2\"\n",
+ "print \"mobility is\",round(mew*10**3,3),\"*10**-3 m s-1 V-1\"\n",
+ "print \"drift velocity of electrons is\",round(vd*10**3,2),\"*10**-3 m s-1\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter8.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter8.ipynb new file mode 100755 index 00000000..e6d0049e --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter8.ipynb @@ -0,0 +1,873 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#8: Semiconductors"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.1, Page number 8.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistivity is 0.471 ohm m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ni=2.37*10**19; #carrier density(per m**3)\n",
+ "mew_e=0.38; #electron mobility(m**2/Vs)\n",
+ "mew_h=0.18; #hole mobility(m**2/Vs)\n",
+ "e=1.6*10**-19; \n",
+ "\n",
+ "#Calculation\n",
+ "sigma_i=ni*e*(mew_e+mew_h); \n",
+ "rho=1/sigma_i; #resistivity(ohm m)\n",
+ "\n",
+ "#Result\n",
+ "print \"resistivity is\",round(rho,3),\"ohm m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.2, Page number 8.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "position of fermi level is 0.576 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Eg=1.12; #band gap(eV)\n",
+ "T=300; #temperature(K)\n",
+ "m0=1; #assume\n",
+ "me=0.12*m0;\n",
+ "mh=0.28*m0;\n",
+ "k=1.38*10**-23; #boltzmann constant\n",
+ "e=1.6*10**-19; \n",
+ "\n",
+ "#Calculation\n",
+ "EF=(Eg/2)+(3*k*T*math.log(mh/me)/(4*e)); #position of fermi level(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"position of fermi level is\",round(EF,3),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.3, Page number 8.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "concentration of intrinsic charge carriers is 33.48 *10**18 per m**3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T=300; #temperature(K)\n",
+ "k=1.38*10**-23; #boltzmann constant\n",
+ "m=9.109*10**-31; #mass(kg)\n",
+ "h=6.626*10**-34; #plancks constant\n",
+ "Eg=0.7; #energy(eV)\n",
+ "e=1.6*10**-19; \n",
+ "\n",
+ "#Calculation\n",
+ "x=(2*math.pi*m*k/h**2)**(3/2);\n",
+ "y=math.exp(-Eg*e/(2*k*T));\n",
+ "ni=2*x*(T**(3/2))*y; #concentration of intrinsic charge carriers(per m**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"concentration of intrinsic charge carriers is\",round(ni/10**18,2),\"*10**18 per m**3\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.4, Page number 8.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistivity is 0.449 ohm m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ni=2.4*10**19; #carrier density(per m**3)\n",
+ "mew_e=0.39; #electron mobility(m**2/Vs)\n",
+ "mew_h=0.19; #hole mobility(m**2/Vs)\n",
+ "e=1.6*10**-19; \n",
+ "\n",
+ "#Calculation\n",
+ "sigma_i=ni*e*(mew_e+mew_h); \n",
+ "rhoi=1/sigma_i; #resistivity(ohm m)\n",
+ "\n",
+ "#Result\n",
+ "print \"resistivity is\",round(rhoi,3),\"ohm m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.5, Page number 8.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is 4.31 *10**3 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ni=2.5*10**19; #carrier density(per m**3)\n",
+ "mew_e=0.39; #electron mobility(m**2/Vs)\n",
+ "mew_p=0.19; #hole mobility(m**2/Vs)\n",
+ "e=1.6*10**-19; \n",
+ "l=1*10**-2; #length(m)\n",
+ "A=10**-3*10**-3; #area(m**2)\n",
+ "\n",
+ "#Calculation\n",
+ "R=l/(ni*e*A*(mew_p+mew_e)); #resistance(ohm)\n",
+ "\n",
+ "#Result\n",
+ "print \"resistance is\",round(R/10**3,2),\"*10**3 ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.6, Page number 8.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "conductivity is 1.578 *10**-3 ohm-1 m-1\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",
+ "T=300; #temperature(K)\n",
+ "k=1.38*10**-23; #boltzmann constant\n",
+ "m=9.109*10**-31; #mass(kg)\n",
+ "h=6.626*10**-34; #plancks constant\n",
+ "Eg=1.1; #energy(eV)\n",
+ "e=1.6*10**-19; \n",
+ "mew_e=0.48; #electron mobility(m**2/Vs)\n",
+ "mew_p=0.013; #hole mobility(m**2/Vs)\n",
+ "\n",
+ "#Calculation\n",
+ "C=2*((2*math.pi*m*k/h**2)**(3/2));\n",
+ "y=math.exp(-Eg*e/(2*k*T));\n",
+ "ni=C*(T**(3/2))*y; #concentration of intrinsic charge carriers(per m**3)\n",
+ "sigma_i=ni*e*(mew_e+mew_h); #conductivity(ohm-1 m-1)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"conductivity is\",round(sigma_i*10**3,3),\"*10**-3 ohm-1 m-1\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.7, Page number 8.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "concentration of intrinsic charge carriers is 3.35 *10**19 per m**3\n",
+ "conductivity is 3.589 ohm-1 m-1\n",
+ "answer in the book varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T=300; #temperature(K)\n",
+ "k=1.38*10**-23; #boltzmann constant\n",
+ "m=9.109*10**-31; #mass(kg)\n",
+ "h=6.626*10**-34; #plancks constant\n",
+ "Eg=0.7; #energy(eV)\n",
+ "e=1.6*10**-19; \n",
+ "mew_e=0.48; #electron mobility(m**2/Vs)\n",
+ "mew_p=0.013; #hole mobility(m**2/Vs)\n",
+ "\n",
+ "#Calculation\n",
+ "C=2*((2*math.pi*m*k/h**2)**(3/2));\n",
+ "y=math.exp(-Eg*e/(2*k*T));\n",
+ "ni=C*(T**(3/2))*y; #concentration of intrinsic charge carriers(per m**3)\n",
+ "sigma_i=ni*e*(mew_e+mew_h); #conductivity(ohm-1 m-1)\n",
+ "\n",
+ "#Result\n",
+ "print \"concentration of intrinsic charge carriers is\",round(ni/10**19,2),\"*10**19 per m**3\"\n",
+ "print \"conductivity is\",round(sigma_i,3),\"ohm-1 m-1\"\n",
+ "print \"answer in the book varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.8, Page number 8.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "forbidden energy gap is 0.793 eV\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; \n",
+ "mew_e=0.36; #electron mobility(m**2/Vs)\n",
+ "mew_h=0.17; #hole mobility(m**2/Vs)\n",
+ "rho=2.12; #resistivity(ohm m)\n",
+ "T=300; #temperature(K)\n",
+ "k=1.38*10**-23; #boltzmann constant\n",
+ "m=9.109*10**-31; #mass(kg)\n",
+ "h=6.626*10**-34; #plancks constant\n",
+ "\n",
+ "#Calculation\n",
+ "sigma=1/rho;\n",
+ "ni=sigma/(e*(mew_e+mew_h));\n",
+ "C=2*((2*math.pi*m*k/h**2)**(3/2));\n",
+ "y=C*T**(3/2)/ni;\n",
+ "z=math.log(y);\n",
+ "Eg=2*k*T*z/(1.6*10**-19); #forbidden energy gap(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"forbidden energy gap is\",round(Eg,3),\"eV\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.9, Page number 8.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy band gap is 0.452 eV\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "x=0.6532;\n",
+ "y=0.3010;\n",
+ "T1=273+20; #temperature(K)\n",
+ "T2=273+32; #temperature(K)\n",
+ "k=8.616*10**-5;\n",
+ "\n",
+ "#Calculation\n",
+ "dy=x-y;\n",
+ "dx=(1/T1)-(1/T2);\n",
+ "Eg=2*k*dy/dx; #energy band gap(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"energy band gap is\",round(Eg,3),\"eV\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.10, Page number 8.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "temperature is 1729.0 K\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k=1.38*10**-23; #boltzmann constant\n",
+ "EF=0.18; #fermi shift(eV)\n",
+ "E=1.2; #energy gap(eV)\n",
+ "e=1.6*10**-19; \n",
+ "r=5; \n",
+ "\n",
+ "#Calculation\n",
+ "T=EF*e*4/(3*k*math.log(r)); #temperature(K)\n",
+ "\n",
+ "#Result\n",
+ "print \"temperature is\",round(T),\"K\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.11, Page number 8.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "electron concentration is 2.0 *10**9 per m**3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Na=5*10**23; #number of atoms(atoms)\n",
+ "Nd=3*10**23; #number of atoms(atoms)\n",
+ "ni=2*10**16; #intrinsic charge carriers(per m**3)\n",
+ "\n",
+ "#Calculation\n",
+ "p=2*(Na-Nd)/2; #hole concentration(per m**3)\n",
+ "n=ni**2/p; #electron concentration(per m**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"electron concentration is\",n/10**9,\"*10**9 per m**3\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.12, Page number 8.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "conductivity is 0.432 *10**-3 ohm-1 m-1\n",
+ "conductivity is 10.38 ohm-1 m-1\n",
+ "conductivity is 3.99 ohm-1 m-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ni=1.5*10**16; #carrier density(per m**3)\n",
+ "mew_e=0.13; #electron mobility(m**2/Vs)\n",
+ "mew_h=0.05; #hole mobility(m**2/Vs)\n",
+ "e=1.6*10**-19; \n",
+ "d=2.33*10**3; #density(kg/m**3)\n",
+ "n=28.1;\n",
+ "na=6.02*10**26; #number of atoms\n",
+ "\n",
+ "#Calculation\n",
+ "sigma=ni*e*(mew_e+mew_h); #conductivity(ohm-1 m-1)\n",
+ "Nd=d*na/(n*10**8);\n",
+ "p=ni**2/Nd; \n",
+ "sigma_ex1=Nd*e*mew_e; #conductivity(ohm-1 m-1)\n",
+ "n=p;\n",
+ "Na=Nd;\n",
+ "sigma_ex2=Na*e*mew_h; #conductivity(ohm-1 m-1)\n",
+ "\n",
+ "#Result\n",
+ "print \"conductivity is\",sigma*10**3,\"*10**-3 ohm-1 m-1\"\n",
+ "print \"conductivity is\",round(sigma_ex1,2),\"ohm-1 m-1\"\n",
+ "print \"conductivity is\",round(sigma_ex2,2),\"ohm-1 m-1\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.13, Page number 8.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "conductivity is 0.4392 *10**-3 ohm-1 m-1\n",
+ "hole concentration is 2250000000.0 per m**3\n",
+ "conductivity is 2.16 *10**3 ohm-1 m-1\n",
+ "position of fermi level is 0.02 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ni=1.5*10**16; #carrier density(per m**3)\n",
+ "mew_e=0.135; #electron mobility(m**2/Vs)\n",
+ "mew_h=0.048; #hole mobility(m**2/Vs)\n",
+ "e=1.6*10**-19; \n",
+ "Nd=10**23; \n",
+ "T=300; #temperature(K)\n",
+ "k=1.38*10**-23;\n",
+ "\n",
+ "#Calculation\n",
+ "sigma=ni*e*(mew_e+mew_h); #conductivity(ohm-1 m-1)\n",
+ "p=ni**2/Nd; #hole concentration(per m**3)\n",
+ "sigma_ex=Nd*e*mew_e; #conductivity(ohm-1 m-1)\n",
+ "x=3*k*T*math.log(mew_e/mew_h)/4;\n",
+ "\n",
+ "#Result\n",
+ "print \"conductivity is\",sigma*10**3,\"*10**-3 ohm-1 m-1\"\n",
+ "print \"hole concentration is\",p,\"per m**3\"\n",
+ "print \"conductivity is\",sigma_ex/10**3,\"*10**3 ohm-1 m-1\"\n",
+ "print \"position of fermi level is\",round(x/(1.6*10**-19),2),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.14, Page number 8.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "diffusion coefficient is 49.162 *10**-4 m**2 s-1\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mew_e=0.19; #electron mobility(m**2/Vs)\n",
+ "e=1.6*10**-19; \n",
+ "T=300; #temperature(K)\n",
+ "k=1.38*10**-23;\n",
+ "\n",
+ "#Calculation\n",
+ "Dn=mew_e*k*T/e; #diffusion coefficient(m**2 s-1)\n",
+ "\n",
+ "#Result\n",
+ "print \"diffusion coefficient is\",round(Dn*10**4,3),\"*10**-4 m**2 s-1\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.15, Page number 8.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "hall voltage is 1.83 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "RH=3.66*10**-4; #hall coefficient(m**3/coulomb)\n",
+ "I=10**-2; #current(amp)\n",
+ "B=0.5; #magnetic field(wb/m**2)\n",
+ "t=1*10**-3; #thickness(m)\n",
+ "\n",
+ "#Calculation\n",
+ "VH=RH*I*B*10**3/t; #hall voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print \"hall voltage is\",VH,\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.16, Page number 8.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "hall coefficient is 3.7e-06 C-1 m**3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vy=37*10**-6; #voltage(V)\n",
+ "t=10**-3; #thickness(m)\n",
+ "Bz=0.5; #magnetic field(wb/m**2)\n",
+ "Ix=20*10**-3; #current(A)\n",
+ "\n",
+ "#Calculation\n",
+ "RH=Vy*t/(Ix*Bz); #hall coefficient(m**3/coulomb)\n",
+ "\n",
+ "#Result\n",
+ "print \"hall coefficient is\",RH,\"C-1 m**3\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.17, Page number 8.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density of charge carriers is 9.124 *10**22 m**3\n",
+ "mobility of charge carriers is 17.125 *10**-3 m**2 V-1 s-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "RH=6.85*10**-5; #hall coefficient(m**3/coulomb)\n",
+ "e=1.6*10**-19; \n",
+ "sigma=250; #conductivity(m-1 ohm-1)\n",
+ "\n",
+ "#Calculation\n",
+ "n=1/(RH*e); #density of charge carriers(m**3)\n",
+ "mew=sigma/(n*e); #mobility of charge carriers(m**2/Vs)\n",
+ "\n",
+ "#Result\n",
+ "print \"density of charge carriers is\",round(n/10**22,3),\"*10**22 m**3\"\n",
+ "print \"mobility of charge carriers is\",mew*10**3,\"*10**-3 m**2 V-1 s-1\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.18, Page number 8.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "hall voltage is 1.431 micro V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "I=30; #current(A)\n",
+ "B=1.75; #magnetic field(T)\n",
+ "n=6.55*10**28; #electron concentration(/m**3)\n",
+ "t=0.35*10**-2; #thickness(m)\n",
+ "e=1.6*10**-19; \n",
+ "\n",
+ "#Calculation\n",
+ "VH=I*B*10**6/(n*e*t); #hall voltage(micro V)\n",
+ "\n",
+ "#Result\n",
+ "print \"hall voltage is\",round(VH,3),\"micro V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 8.19, Page number 8.47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density of charge carriers is 1.708 *10**22 per m**3\n",
+ "mobility of charge carriers is 0.041 m**2 V-1 s-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "RH=3.66*10**-4; #hall coefficient(m**3/coulomb)\n",
+ "e=1.6*10**-19;\n",
+ "Pn=8.93*10**-3; #resistivity(ohm m)\n",
+ "\n",
+ "#Calculation\n",
+ "n=1/(RH*e); #density of charge carriers(per m**3)\n",
+ "mew_e=RH/Pn; #mobility of charge carriers(m**2/Vs)\n",
+ "\n",
+ "#Result\n",
+ "print \"density of charge carriers is\",round(n/10**22,3),\"*10**22 per m**3\"\n",
+ "print \"mobility of charge carriers is\",round(mew_e,3),\"m**2 V-1 s-1\""
+ ]
+ }
+ ],
+ "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/Engineering_Physics_by_P.K.Palanisamy/Chapter9.ipynb b/Engineering_Physics_by_P.K.Palanisamy/Chapter9.ipynb new file mode 100755 index 00000000..bd885ca7 --- /dev/null +++ b/Engineering_Physics_by_P.K.Palanisamy/Chapter9.ipynb @@ -0,0 +1,195 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#9: Physics of Semiconductor Devices"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 9.1, Page number 9.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "wavelength of radiation is 0.868 micro m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.62*10**-34; #planck's constant(J sec)\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "Eg=1.43*1.6*10**-19; #energy gap(J)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=h*c*10**6/Eg; #wavelength of radiation(micro m)\n",
+ "\n",
+ "#Result\n",
+ "print \"wavelength of radiation is\",round(lamda,3),\"micro m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 9.2, Page number 9.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "time taken is 3.7 *10**-9 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=5*10**-6; #thickness(m)\n",
+ "Dc=3.4*10**-3; #diffusion coefficient(m**2 S-1)\n",
+ "\n",
+ "#Calculation\n",
+ "tow_diff=d**2/(2*Dc); #time taken(s)\n",
+ "\n",
+ "#Result\n",
+ "print \"time taken is\",round(tow_diff*10**9,1),\"*10**-9 s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 9.3, Page number 9.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "transit time is 5e-11 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "w=5*10**-6; #thickness(m)\n",
+ "vsat=10**5; #velocity(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "tow_drift=w/vsat; #transit time(s)\n",
+ "\n",
+ "#Result\n",
+ "print \"transit time is\",tow_drift,\"s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 9.4, Page number 9.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "diode capacitance is 28.8 pF\n",
+ "frequency bandwidth is 110 MHz\n",
+ "answer varies due to rounding off errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "A=10**-6; #area(m**2)\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "Nd=10**21; #electron concentration(m**-3)\n",
+ "epsilonr=11.7;\n",
+ "epsilon0=8.85*10**-12;\n",
+ "V=10; #potential(V)\n",
+ "RL=50; #resistance(ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Cj=(A/2)*math.sqrt(2*e*epsilonr*epsilon0*Nd/V); #diode capacitance(F)\n",
+ "delta_fel=1/(2*math.pi*RL*Cj); #frequency bandwidth(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print \"diode capacitance is\",round(Cj*10**12,1),\"pF\"\n",
+ "print \"frequency bandwidth is\",int(delta_fel*10**-6),\"MHz\"\n",
+ "print \"answer varies due to rounding off errors\""
+ ]
+ }
+ ],
+ "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/Gas_Dynamics_and_Jet_Propulsion/screenshots/ch8.png b/Gas_Dynamics_and_Jet_Propulsion/screenshots/ch8.png Binary files differnew file mode 100755 index 00000000..1f16e0a1 --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion/screenshots/ch8.png diff --git a/Gas_Dynamics_and_Jet_Propulsion/screenshots/pvdiagram1.png b/Gas_Dynamics_and_Jet_Propulsion/screenshots/pvdiagram1.png Binary files differnew file mode 100755 index 00000000..0fc4368a --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion/screenshots/pvdiagram1.png diff --git a/Gas_Dynamics_and_Jet_Propulsion/screenshots/pvdiagram2.png b/Gas_Dynamics_and_Jet_Propulsion/screenshots/pvdiagram2.png Binary files differnew file mode 100755 index 00000000..d9912f2a --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion/screenshots/pvdiagram2.png diff --git a/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch1.ipynb b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch1.ipynb new file mode 100755 index 00000000..736b003b --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch1.ipynb @@ -0,0 +1,2063 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:061d7e4b577b807ec47d62ccaff69c19b6ddf8c7eb248995f153a6b3c9a73f96" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Compressible Flow-Fundamentals" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1 page : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%matplotlib inline\n", + "\n", + "import math \n", + "from numpy import linspace\n", + "from matplotlib.pyplot import plot,legend,suptitle,xlabel,ylabel\n", + "\t\t\t\t\n", + "#Input data\n", + "m = 0.75 \t\t\t\t#Mass of air in kg \n", + "T1 = 800. \t\t\t\t#Intial Temperature in K\n", + "P1 = 400. \t\t\t\t#Initial Pressure in kPa\n", + "P2 = 150. \t\t\t\t#Final Pressure in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 0.287 \t\t\t\t#Specific Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = P2/P1 \t\t\t\t#pressure ratio of process\n", + "T2 = T1*p1**((k-1)/k) \t\t\t\t#Final temperature in K\n", + "W = ((m*R*(T1-T2))/(k-1)) \t\t\t\t#Workdone in kJ\n", + "\n", + "\t\t\t\t\n", + "#P-V Diagram\n", + "\n", + "V1 = (((m*R*T1)/P1)**(1/k))*10**3 \t\t\t\t#Inlet volume in cc\n", + "V2 = (((m*R*T2)/P2)**(1/k))*10**3 \t\t\t\t#Final volume in cc\n", + "V = linspace(V1,V2,101) \t\t\t\t#Representing volume on graph, adiabatic expansion\n", + "P = P1*V1**k/V**k \t\t\t\t#Representing pressure on graph\n", + "plot(V, P) \t\t\t\t\t\t\t#Plotting \n", + "legend('P*V**k = C') \t\t\t\t#Defining curve\n", + "suptitle(\"PV Diagram\")\n", + "xlabel(\"V (cc)\")\n", + "ylabel(\"P (kPa)\") \t\t\t\t#Titles of axes\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Workdone is %3.2f kJ'%(W)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Workdone is 105.21 kJ\n" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEhCAYAAACOZ4wDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X2cjXX+x/HXMG5zN6p1tzRiZVEroZKY5LaHqHYrupfS\n3U+qbQubNdX+IqFt26gk6YZSKBRCJtVPUshdNt0ooyhSoSRmfn98rtMc48ycubvO9zrnvJ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wX4Lxf88XVYHq3vFRwDvYKP0YbMAI\n7C/V/ANHfi/kKyiuumHPcbHAcBnQzDvOxK6T62uVP6b7cX+dAJ7HBkZDXF+nSDG5XLD6J6wro4r3\n3lOxFrTr61RQXK5/p37n3TfCZv6FJpe4vFb5Y6pBAi+Cboz9A9ZgvyDDvPO1sX7KSFPSYrGQr6C4\nXC8w/BOKpS/XAAABxElEQVT2V/yH2F9cNXF/rfLHVAv31+koYCd5CR/cX6dIMbm+TneQN0V1KjZT\nxvV1ihRXRdxfq2VeTGuAs7xzrq9VpJhcXycRERERERERERERERERERERERERERERSQxvcGTZ5luw\n8gn5VcIKtxV3UVMd4LXihyYSe0Es9yESBNOxIn/hLiZvBWy4S4F5FL/ezw6sVESbYkcnIiKBUBv7\nMk/1fk4HvijguYvIK3ECVvJhLbaSdpR3rim2uncNVg+qsXf+YuCBsgpaRERiby62RwFYrZ8xEZ5T\nnrwik2DFAd/BNqGBvJIPK7A9BMDKVVTxjht7j4mISJy6hLxup9VYifr86mC1gELGAgPzPac6trlR\nJJXJ2wNBJLA0ZiFSsDnA2ViSqIoljEjyD2wXZ6A7Bf/2yxApM0oWIgXbCyzFdv6LNLANVjm2WtjP\ni4AB5HUzpQF7sH0+Qt1QlcIer0fBYyEiIhIn+mI7jjUr5DmLgBPCfr4TKxW9Gvind64psAQrFf0+\nNmAONuNKA9wiIkngKvI2vSmu54g8FiIiIgmmIrbxTHEX5f0OeLXswxERERERERERERERERERERER\nERERERGREvp/sG5+0yvB71cAAAAASUVORK5CYII=\n", + "text": [ + "<matplotlib.figure.Figure at 0x105fc1750>" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2 page : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%matplotlib inline\n", + "\n", + "import math \n", + "from numpy import linspace\n", + "from matplotlib.pyplot import plot,legend,suptitle,xlabel,ylabel\n", + "\n", + "\n", + "#Input data\n", + "V1 = 0.35 \t\t\t\t#Volume of gas in m**3\n", + "P1 = 110. \t\t\t\t#Initial Pressure in kPa\n", + "T1 = 300. \t\t\t\t#Intial Temperature in K\n", + "P2 = 600. \t\t\t\t#Final Pressure in kPa,mismath.sing data\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "Cv = 718. \t\t\t\t#Specific heat at consmath.tant volume in J/kg-K\n", + "R = 287. \t\t\t\t#Specific Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "dQ = 0 \t\t\t\t#Heat transfer in J, Since Adiabatic process\n", + "m = (P1*10**3*V1)/(R*T1) \t\t\t\t#Mass of air in kg \n", + "p1 = P2/P1 \t\t\t\t#Pressure ratio\n", + "T2 = T1*p1**((k-1)/k) \t\t\t\t#Final temperature in K\n", + "dU = (m*Cv*(T2-T1))*10**-3 \t\t\t\t#Change in internal energy in kJ\n", + "dW = -dU \t\t\t\t#Workdone in kJ, Since dQ = 0\n", + "\n", + "\t\t\t\t\n", + "#P-V Diagram\n", + "\n", + "V1cc = V1*10**3 \t\t\t\t#Inlet volume in cc\n", + "V2cc = V1cc*(T2/T1)**(1/(k-1)) \t\t\t\t#Final volume in cc\n", + "V = linspace(V1cc,V2cc,101) \t\t\t\t#Representing volume on graph, adiabatic expansion\n", + "P = P2*V1cc**k/V**k \t\t\t\t#Representing pressure on graph\n", + "plot(V, P) \t\t\t\t#Plotting \n", + "legend('P*V**k = C') \t\t\t\t#Defining curve\n", + "suptitle(\"PV Diagram\")\n", + "xlabel(\"V (cc)\")\n", + "ylabel(\"P (kPa)\") \t\t\t\t#Titles of axes\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Heat transfer is %3i J \\nB)Change in internal energy is %3.3f kJ \\nC)Workdone is %3.3f kJ'%(dQ,dU,dW)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Heat transfer is 0 J \n", + "B)Change in internal energy is 60.072 kJ \n", + "C)Workdone is -60.072 kJ\n" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEhCAYAAACDefxEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4VPXZ//F32EHWIAJBIYgggqAQFq2AI1WLCqKogIiy\naC1Fi9VWEWuF59dWkUd/Lm2pVlGpCmpREbBsAlFwYd8DsgtBiUrFggsCyfPHfaYZQ1Yyc75nZj6v\n6zrXnHPmzJmbJMw93x1EREREREREREREREREREREREREREREJAkcA1YD64HXgOrAIuDSAtf9GphY\nzOs3AGuAu4AU77kM4InohywiIq4cjNh/CbgT+DnwXIHrPgS6lfD6BsB8YFwU4wurEIN7iohIGUV+\n6I8A/grUA3KASt75dOCTUrweoDnwpbcfAmZ6+12AD4BVwPtAK+98DayEsxF4A/gI6Og9dwh4BCvB\nXAD8HliGlYqejnjPTOD/A8uBTUBn4E1gC/CHIuIWEZETEP7QrwS8BfzCO54JXOnt3wtMKOH1kb7C\nSh0h8pNGLaCit38xMM3b/y3wN2+/LXCE/KSRC1wbcd96Efv/AHp7+4uAh7z9UcCnQEOgCrCnwOtE\nnFBRWRJFdaxNYjmwC5jknZ8KDPT2B3jH5VEXSxTrsVJBG+/8BcAr3v5GYF3Ea44Br0cc98RKIuu8\n/TYRz83wHjd4Ww7wA7ADaFrO2EXKrVLJl4jEhe+ADoWcnwE85j1XA0sspXE69mH/RYHzfwAWAFdj\n1V2LIp5LoXDfA3nefjWs6iwD2AuM9c6FHfYecyP2w8cVEXFMJQ1JdIewD/bngSmlfE0D4Cngz4U8\nVxurNgIYGnH+faC/t98GaFfEvcMJYj9QE7iulDGJBIKShiSKvGKem4p9iBdXNRWu3tqA9ZyaA/xP\nxL3D95+AtTuswr75h89PxJLNRqw0shH4upDYDgDPeO8zB1hazL+nuH+TiIjEsQpAVW+/BdYGoepf\nSTj6oxaJjpOAh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5qh1WF74G60p6t3c+KAMCLyS/95TrmJpjP6c12AfQmIDEdQ5W0ojs8uc6ppOAL8lPsgQgpnvI\n73I7GevV4jqm97yY1pBfLewipmgNCg53Jd0GPBnlmIZjM3TvAb7DSomzAxDTVuAT8ruYT/Q5JhER\nERERERERERERERERERERERERERGRwizk+Om+f82P+72HVQXepeyD2xqSPzeQSFwI8jQiIi5NxSY4\njDSAwufyuQGYRdnnQ8rBpusouBaDiIjEmVTsQ72Sd5yOjbQtzHzyp04Bm+5iHTayOryQ2BnYiOY1\n2BxYzb3zA7CFc0REJM7NxCarBJvvaEIh11Qkf+JIsIkR38cWM4L86S6WAn29/SrYvFNgyWNplOIV\nERGHBpFfHbUam4a+oIbYfEhhjwA3F7imFjY3UGGqkb9OhEjgqU1DpGgzsFmWO2CzCq8u4rqCDeBl\naRBPQWtDSBxR0hAp2iFs2uvnKXoxmy+xRZTC5mOzsoarn+oBB7G1C8LVU1Ujnm9M0W0lIiISZ/pi\nK9i1Kuaa+cCZEcejsSnGVwN/9M6dASzApoxfgTWsg/XQUkO4iEgSGUr+AkFl9TKFt5WIiEiCqoIt\nYFTWwX2nYEsai4iIiIiIiIiIiIiIiIiIiIiIiIiIiEhi+D+m6ixUxfDpowAAAABJRU5ErkJggg==\n", + "text": [ + "<matplotlib.figure.Figure at 0x105f799d0>" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3 page : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "P1 = 3.2 \t\t\t\t#Initial Pressure in bar\n", + "P2 = 1. \t\t\t\t#Final Pressure in bar\n", + "T1 = 475. \t\t\t\t#Initial temperature in K\n", + "Mol = 44. \t\t\t\t#Molecular weight of carbondioxide in kg/mol\n", + "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = (k*R)/(k-1) \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "Cv = Cp/k \t\t\t\t#Specific heat capacity at consmath.tant volume in J/kg-K\n", + "p1 = P2/P1 \t\t\t\t#Pressure ratio\n", + "T2 = T1*p1**((k-1)/k) \t\t\t\t#Final Temperature\n", + "dh = Cp*(T1-T2)*10**-3 \t\t\t\t#Enthalpy drop in kJ/kg\n", + "dU = Cv*(T2-T1)*10**-3 \t\t\t\t#Change in internal energy in kJ/kg, -ve sign indicates loss\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Temperature is %3.3f K \\nB)Enthalpy drop is %3.3f kJ/kg \\\n", + "\\nC)Change in internal energy is %3.2f kJ/kg i.e. %3.2f kJ/kgloss'%(T2,dh,dU,abs(dU))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Temperature is 363.179 K \n", + "B)Enthalpy drop is 91.560 kJ/kg \n", + "C)Change in internal energy is -70.43 kJ/kg i.e. 70.43 kJ/kgloss\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4 page : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P1 = 0.5 \t\t\t\t#Initial Pressure in bar\n", + "T1 = 50.+273 \t\t\t\t#Intial Temperature in K\n", + "C1 = 240. \t\t\t\t#Inlet velocity in m/s\n", + "C2 = 120. \t\t\t\t#Outlet velocity in m/s, mismath.sing data\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "T2 = T1+((C1**2-C2**2)/(2*Cp)) \t\t\t\t#Final Temperature in K\n", + "t1 = T2/T1 \t\t\t\t#Temperature ratio\n", + "P2 = P1*t1**(k/(k-1)) \t\t\t\t#Final Pressure in bar\n", + "ar = (P1*T2*C1)/(P2*T1*C2) \t\t\t\t#Ratio of outlet to inlet area\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At outlet: Temperature is %3.2f K \\\n", + "\\nPressure is %3.4f bar \\\n", + "\\nB)Ratio of outlet to inlet area is %3.4f'%(T2,P2,ar)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At outlet: Temperature is 344.49 K \n", + "Pressure is 0.6265 bar \n", + "B)Ratio of outlet to inlet area is 1.7025\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.5 page : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "m = 25. \t\t\t\t#Mass flow rate of air in kg/s\n", + "C2 = 115. \t\t\t\t#Outlet velocity in m/s\n", + "P1 = 100. \t\t\t\t#\t\t\t\t#Initial Pressure in kPa\n", + "T1 = 300. \t\t\t\t#Intial Temperature in K\n", + "C1 = 40. \t\t\t\t#Inlet velocity in m/s\n", + "R = 0.287 \t\t\t\t#Specific gas consmath.tant in kJ/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "T2 = T1+((C1**2-C2**2)/(2*Cp)) \t\t\t\t#Final Temperature in K\n", + "t1 = T2/T1 \t\t\t\t#Temperature ratio\n", + "P2 = P1*t1**(k/(k-1)) \t\t\t\t#Final Pressure in bar\n", + "A1 = (m*R*T1)/(P1*C1) \t\t\t\t#Area at inlet in m**2\n", + "A2 = (m*R*T2)/(P2*C2) \t\t\t\t#Area at outlet in m**2\n", + "F = ((P1*A1)-(P2*A2))+(m*(C1-C2))*10**-3 \t\t\t\t#Axial force on mouthpiece resulting from acceleration of air in kN\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Static pressure at intake face is %3.3f kPa \\\n", + "\\nB)Magnitude of axial force on mouthpiece resulting from acceleration of air is %3.3f kN'%(P2,F)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Static pressure at intake face is 93.414 kPa \n", + "B)Magnitude of axial force on mouthpiece resulting from acceleration of air is 33.581 kN\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.6 page : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "P = 200. \t\t\t\t#Pressure in kPa\n", + "C = 50. \t\t\t\t#Velocity of air in m/s\n", + "d = 2.9 \t\t\t\t#Density in kg/m**3\n", + "Mol = 32. \t\t\t\t#Molecular weight of oxygen in kg/mol\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "Ri = 8314 \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "\n", + "#Calculation\n", + "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "T = P*10**3/(R*d) \t\t\t\t#Temperature in K\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound in m/s \n", + "M = C/a \t\t\t\t#Mach number \n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Mach number is %3.2f'%(M)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mach number is 0.16\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.7 page : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Pa = 1.3 \t\t\t\t#Pressure at section-A in bar\n", + "Ta = 50.+273 \t\t\t\t#Temperature at section-A in K\n", + "Pb = 1. \t\t\t\t#Pressure at section-B in bar\n", + "Tb = 13.+273 \t\t\t\t#Temperature at section-B in K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ds = ((Cp*math.log(Tb/Ta))-(R*math.log(Pb/Pa)))*10**-3 \t\t\t\t#The change in the entropy is kJ/kg\n", + "#+ve sign indicates A to B\n", + "#-ve sign indicates B to A\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'The change in the entropy is %3.4f kJ/kg Since value is -ve, process must takes place from B to A'%(ds)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The change in the entropy is -0.0470 kJ/kg Since value is -ve, process must takes place from B to A\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.8 page : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "V1 = 8. \t\t\t\t#Intial volume in litre\n", + "V2 = 7.8 \t\t\t\t#Final volume in litre\n", + "P1 = 0.7 \t\t\t\t#Intial Pressure in MPa\n", + "P2 = 2.7 \t\t\t\t#Final Pressure in MPa\n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "K = (P2-P1)/(math.log(V1/V2)) \t\t\t\t#Bulk modulus of liquid in kPa\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Bulk modulus of liquid is %3.3f kPa'%(K)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Bulk modulus of liquid is 78.996 kPa\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.9 page : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "V1 = 0.5 \t\t\t\t#Voume of Water required to fill pressure vessel in m**3\n", + "P = 3000. \t\t\t\t#Test pressure in bar\n", + "dv = 0.6 \t\t\t\t#Change of empty volume of container due to pressurisation in percentage \n", + "K = 20000. \t\t\t\t#Bulk modulus of water in MPa\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "m1 = V1*10**3 \t\t\t\t#Mass of water required to fill pressure vessel in kg\n", + "Vr = (P*V1)/K \t\t\t\t#Reduced volume of water due to compression in m**3\n", + "Vi = dv*V1/100 \t\t\t\t#Increased volume of container in m**3\n", + "V = Vr+Vi \t\t\t\t#Volume of additional water required in m**3\n", + "m = V*10**3 \t\t\t\t#Mass of additional water required in kg\n", + "mt = m1+m \t\t\t\t#Total mass of water required in litre, Since 1kg = 1Lit\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Mass of water to be pumped into the vesel to obtain the desired pressure is %3i lit'%(mt)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of water to be pumped into the vesel to obtain the desired pressure is 578 lit\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.10 page : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "SG_oil = 0.8 \t\t\t\t#Specific gravity of crude oil \n", + "K_oil = 153036.*10**4 \t\t\t\t#Bulk modulus of Oil in N/m**2\n", + "K_hg = 2648700.*10**4 \t\t\t\t#Bulk modulus of Mercury in N/m**2\n", + "d_steel = 7860. \t\t\t\t#Density of steel in kg/m**3\n", + "E_steel = 200.*10**9 \t\t\t\t#Modulus of elasticity in Pa\n", + "d_hg = 13600. \t\t\t\t#Density of mercury in kg/m**3\n", + "d_water = 1000. \t\t\t\t#Density of water in kg/m**3\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "d_oil = SG_oil*d_water \t\t\t\t#Density of oil in kg/m**3\n", + "a_oil = math.sqrt(K_oil/d_oil) \t\t\t\t#Sonic velocity of crude oil in m/s\n", + "a_hg = math.sqrt(K_hg/d_hg) \t\t\t\t#Sonic velocity of mercury in m/s\n", + "a_steel = math.sqrt(E_steel/d_steel) \t\t\t\t#Sonic velocity of steel in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Sonic velocity of crude oil is %3.2f m/s \\\n", + "\\nB)Sonic velocity of mercury is %3.2f m/s \\\n", + "\\nA)Sonic velocity of steel is %3.1f m/s'%(a_oil,a_hg,a_steel)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Sonic velocity of crude oil is 1383.09 m/s \n", + "B)Sonic velocity of mercury is 1395.55 m/s \n", + "A)Sonic velocity of steel is 5044.3 m/s\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.11 page : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T = 20.+273 \t\t\t\t#Temperarture of medium in K\n", + "Cp_fr = 678. \t\t\t\t#Specific heat capacity at consmath.tant pressure of freon in J/kg-K\n", + "Cv_fr = 543. \t\t\t\t#Specific heat capacity at consmath.tant volime of freon in J/kg-K\n", + "T_air = 0.+273 \t\t\t\t#Temperature of air in K\n", + "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "mol_h = 2. \t\t\t\t#Molecular weight of Hydrogen in kg/mol\n", + "mol_water = 18. \t\t\t\t#Molecular weight of water in kg/mol\n", + "R_air = 287. \t\t\t\t#Specific gas consmath.tant of air in J/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant of hydrogen\n", + "k_water = 1.3 \t\t\t\t#Adiabatic consmath.tant of water\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R_h = Ri/mol_h \t\t\t\t#Specific gas consmath.tant of hydrogen in J/kg-K\n", + "a_h = math.sqrt(k*R_h*T) \t\t\t\t#Velocity of sound in hydrogen in m/s\n", + "R_water = Ri/mol_water \t\t\t\t#Specific gas consmath.tant of water in J/kg-K\n", + "a_water = math.sqrt(k_water*R_water*T) \t\t\t\t#Velocity of sound in water vapour in m/s\n", + "k_fr = Cp_fr/Cv_fr \t\t\t\t#Adiabatic consmath.tant of feoan\n", + "R_fr = Cp_fr-Cv_fr \t\t\t\t#Specific gas consmath.tant of freon in J/kg-K\n", + "a_fr = math.sqrt(k_fr*R_fr*T) \t\t\t\t#Velocity of sound in freon in m/s\n", + "a_air = math.sqrt(k*R_air*T_air) \t\t\t\t#Sonic Velocity of air at in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Velocity of sound in hydrogen is %3.2f m/s \\\n", + "\\nB)Velocity of sound in water vapour is %3.2f m/s \\\n", + "\\nC)Velocity of sound in freon is %3.2f m/s \\\n", + "\\nD)Sonic Velocity of air at %3i K is %3.4f m/s'%(a_h,a_water,a_fr,T_air,a_air)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Velocity of sound in hydrogen is 1305.83 m/s \n", + "B)Velocity of sound in water vapour is 419.44 m/s \n", + "C)Velocity of sound in freon is 222.24 m/s \n", + "D)Sonic Velocity of air at 273 K is 331.1969 m/s\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.12 page : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 0.85 \t\t\t\t#Mach number\n", + "P = 80. \t\t\t\t#Pressure in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Po = P*(1+(((k-1)/2)*M**2))**(k/(k-1)) \t\t\t\t#Pressure acting on the surface of the body in kPa\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'The highest pressure acting on the surface of the body is %3.1f kPa'%(Po)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The highest pressure acting on the surface of the body is 128.3 kPa\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.13 page : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "P = 96. \t\t\t\t#Pressure in kPa\n", + "T = 27.+273 \t\t\t\t#Temperature in K\n", + "dP = 32. \t\t\t\t#Difference between pivot and static pressure\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "d = (P*10**3)/(R*T) \t\t\t\t#Density in kg/m**3\n", + "Ci = math.sqrt((2*(dP*10**3))/d) \t\t\t\t#Velocity of incompressible flow in m/s\n", + "pr = (dP)/P \t\t\t\t#Pressure ratio\n", + "p1 = pr+1 \t\t\t\t#Stagnation to static pressure ratio\n", + "M = math.sqrt(((p1**((k-1)/k)-1)*2)/(k-1)) \t\t\t\t#Mach number\n", + "Cc = M*math.sqrt(k*R*T) \t\t\t\t#Velocity of compressible flow in m/s\n", + "\n", + "#Output\n", + "print 'A)Air velocity in incompressible flow is %3.1f m/s \\\n", + "\\nB)Air velocity if flow is compressible is %3.3f m/s'%(Ci,Cc)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Air velocity in incompressible flow is 239.6 m/s \n", + "B)Air velocity if flow is compressible is 227.226 m/s\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.14 page : 42" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T1 = 200.+273 \t\t\t\t#Intial Temperature in K\n", + "P1 = 1.7 \t\t\t\t#Initial Pressure in bar\n", + "P2 = 1. \t\t\t\t#Final Pressure in bar\n", + "C1 = 30. \t\t\t\t#Inlet velocity in m/s\n", + "m = 1. \t\t\t\t#Mass flow rate in kg/s\n", + "D = 0.025 \t\t\t\t#Nozzle diameter in m\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific Gas consmath.tant in J/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = P2/P1 \t\t\t\t#Pressure ratio\n", + "T2 = T1*p1**((k-1)/k) \t\t\t\t#Final temperature in K\n", + "E1 = T1+(C1**2/(2*Cp)) \t\t\t\t#LHS of Steady flow energy equation\n", + "C2 = math.sqrt((E1-T2)*2*Cp) \t\t\t\t#Exit velocity of the air in m/s\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at outlet in kg/m**3\n", + "A2 = math.pi*D**2/4 \t\t\t\t#Area at outlet in m**2\n", + "n = ceil(m/(d2*A2*C2)) \t\t\t\t#Number of nozzles to be used\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Exit velocity of the air is %3.2f m/s \\\n", + "\\nB)Number of nozzles to be used are %1.0f'%(C2,n)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Exit velocity of the air is 366.94 m/s \n", + "B)Number of nozzles to be used are 7\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.15 page : 44" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 300. \t\t\t\t#Pressure in the vessel in kPa\n", + "To = 50.+273 \t\t\t\t#Temperature in vessel in K\n", + "M = 1. \t\t\t\t#Mach number \n", + "k = 1.667 \t\t\t\t#Adiabatic consmath.tant\n", + "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "Mol = 4. \t\t\t\t#Molecular weight of helium in kg/mol\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = (k*R)/(k-1) \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "p1 = (2/(k+1))**(k/(k-1)) \t\t\t\t#Pressure ratio\n", + "Pt = Po*p1 \t\t\t\t#Pressure at test condition in kPa\n", + "t1 = (2/(k+1)) \t\t\t\t#Temperature ratio \n", + "Tt = To*t1 \t\t\t\t#Temperature at test condition in K\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound in m/s\n", + "Ct = at \t\t\t\t#Velocity of gas at test condition in m/s\n", + "Cmax = math.sqrt(2*Cp*To) \t\t\t\t#Maximum velocity due to expanding of gases through nozzle system in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At test point: \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nVelocity is %3.1f m/s \\\n", + "\\nB)Maximum velocity due to expanding of gases through nozzle system is %3.2f m/s'%(Pt,Tt,Ct,Cmax)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At test point: \n", + "Pressure is 146.13 kPa \n", + "Temperature is 242.22 K \n", + "Velocity is 916.1 m/s \n", + "B)Maximum velocity due to expanding of gases through nozzle system is 1831.88 m/s\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.16 page :43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T = 40+273 \t\t\t\t#Temperature in K\n", + "p1 = 0.5 \t\t\t\t#Static to Stagnation pressure ratio\n", + "k = 1.67 \t\t\t\t#Adiabatic consmath.tant\n", + "Ri = 8314 \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "Mol = 39.94 \t\t\t\t#Molecular weight of argon in kg/mol\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "p2 = 1/p1 \t\t\t\t#Pressure ratio\n", + "M = math.sqrt(((p2**((k-1)/k)-1)*2)/(k-1)) \t\t\t\t#Mach number \n", + "C = M*math.sqrt(k*R*T) \t\t\t\t#Velocity in the flow in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)Mach number is %3.3f \\\n", + "\\nB)Velocity in the flow is %3.1f m/s'%(M,C)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number is 0.978 \n", + "B)Velocity in the flow is 322.7 m/s\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.17 page : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 2.5 \t\t\t\t#Mach number \n", + "h = 10 \t\t\t\t#Height in km\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "alp = math.asin((1/M)) \t\t\t\t#Mach cone angle in degree\n", + "d = 10/math.tan((alp)) \t\t\t\t#Distance the jet would cover before a sonic boom is heard on ground in km\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Distance the jet would cover before a sonic boom is heard on ground is %3.2f km'%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Distance the jet would cover before a sonic boom is heard on ground is 22.91 km\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.18 page : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "h = 1100 \t\t\t\t#Height in m\n", + "M1 = 2.5 \t\t\t\t#Mach number of aircraft @h\n", + "T = 280 \t\t\t\t#Temperature @h\n", + "M2 = 0.5 \t\t\t\t#Mach number of observer\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "alp = math.sin((1/M1)) \t\t\t\t#Mach cone angle in degree\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound in m/s\n", + "C1 = M1*a \t\t\t\t#Velocity of aircraft when the observer is stationary in m/s\n", + "t1 = h/(C1*(math.tan(alp))) \t\t\t\t#Time elapsed when the observer is stationary in sec\n", + "C2 = (M1-M2)*a \t\t\t\t#Velocity of aircraft when the observer is moving in the direction of aircraft in m/s\n", + "t2 = h/(C2*(math.tan(alp))) \t\t\t\t#Time elapsed when the observer is moving in the direction of aircraft in sec\n", + "C3 = (M1+M2)*a \t\t\t\t#Velocity of aircraft when the observer is moving in the opposite direction in m/s\n", + "t3 = h/(C3*(math.tan(alp))) \t\t\t\t#Time elapsed when the observer is moving in the opposite direction in sec\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Time elapsed when the observer is stationary is %3.3f sec \\\n", + "\\nB)Time elapsed when the observer is moving in the direction of aircraft with M = %3.1f is %3.2f sec \\\n", + "\\nC)Time elapsed when the observer is moving in the opposite direction is %3.2f sec'%(t1,M2,t2,t3)\n", + "\n", + "# note : rounding off error ." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Time elapsed when the observer is stationary is 3.197 sec \n", + "B)Time elapsed when the observer is moving in the direction of aircraft with M = 0.5 is 4.00 sec \n", + "C)Time elapsed when the observer is moving in the opposite direction is 2.66 sec\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.19 page : 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P = 200. \t\t\t\t#Pressure in kPa\n", + "d = 2.9 \t\t\t\t#Density in kg/m**3\n", + "C = 50. \t\t\t\t#Velocity in m/s\n", + "mol = 32. \t\t\t\t#Molecular weight of oxygen in kg/mol\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R = Ri/mol \t\t\t\t#Specific gas Consmath.tant in J/kg-k\n", + "T = (P*10**3)/(R*d) \t\t\t\t#Temperature in K\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound in m/s \n", + "M = C/a \t\t\t\t#Mach number\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Mach number is %3.4f'%(M)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mach number is 0.1609\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.20 page : 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C = 200 \t\t\t\t#Velocity of object in m/s\n", + "mol = 4 \t\t\t\t#Molecular weight of helium in kg/mol\n", + "k = 1.67 \t\t\t\t#Adiabatic consmath.tant\n", + "Ri = 8314 \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "T = 288 \t\t\t\t#Temperature in K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R = Ri/mol \t\t\t\t#Specific gas Consmath.tant in J/kg-k\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound in m/s\n", + "M = C/a \t\t\t\t#Mach number \n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Mach number is %3.1f'%(M)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mach number is 0.2\n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.21 page : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Z1 = 0. \t\t\t\t#Height from sea level in m\n", + "Z2 = 11. \t\t\t\t#Height from sea level in m\n", + "T1 = 288. \t\t\t\t#Temperature @Z1 in K, from gas tables\n", + "T2 = 216.5 \t\t\t\t#Temperature @Z2 in K, from gas tables\n", + "C = 1000.*(5./18) \t\t\t\t#Velocity in m/s\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity @Z1 in m/s\n", + "M1 = C/a1 \t\t\t\t#Mach number @Z1\n", + "a2 = math.sqrt(k*R*T2) \t\t\t\t#Sound velocity @Z2 in m/s\n", + "M2 = C/a2 \t\t\t\t#Mach number @Z2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Speed of sound at: \\\n", + "\\nsea level is %3.2f and altitude of %3i km is %3.2f m/s \\\n", + "\\nB)Mach numbeer at: sea level is %3.2f an altitude of %3i km is %3.2f'%(a1,Z2,a2,M1,Z2,M2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Speed of sound at: \n", + "sea level is 340.17 and altitude of 11 km is 294.94 m/s \n", + "B)Mach numbeer at: sea level is 0.82 an altitude of 11 km is 0.94\n" + ] + } + ], + "prompt_number": 50 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.22 page : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T = 300+273 \t\t\t\t#Static Temperature in K\n", + "C = 200 \t\t\t\t#Velocity in m/s\n", + "Cp = 1005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation Temperature in K\n", + "C_max = math.sqrt(2*Cp*To) \t\t\t\t#Maximum possible velocity obtained by air in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Maximum possible velocity obtained by air is %3.f m/s'%(C_max)\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum possible velocity obtained by air is 1091 m/s\n" + ] + } + ], + "prompt_number": 52 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.23 page : 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "dT = 37 \t\t\t\t#Temperature difference between air inside the tyre and nozzle exit\n", + "Cp = 1005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "C = math.sqrt(2*Cp*dT) \t\t\t\t#Exit velocity of air in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Exit velocity of air is %3.1f m/s'%(C)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Exit velocity of air is 272.7 m/s\n" + ] + } + ], + "prompt_number": 53 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.24 page : 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C = 800*(5./18) \t\t\t\t#Velocity in m/s\n", + "Po = 105. \t\t\t\t#Stagnation pressure in kPa\n", + "To = 35.+273 \t\t\t\t#Stagnation temperature in K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "T = To-(C**2/(2*Cp)) \t\t\t\t#Static temperature in K\n", + "P = Po*(T/To)**(k/(k-1)) \t\t\t\t#Static pressure in kPa\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Sound Velocity in m/s \n", + "M = C/a \t\t\t\t#Mach number\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Static conditions: \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nSound Velocity is %3.2f m/s \\\n", + "\\nB)Mach number is %3.2f'%(P,T,a,M)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Static conditions: \n", + "Pressure is 78.49 kPa \n", + "Temperature is 283.43 K \n", + "Sound Velocity is 337.47 m/s \n", + "B)Mach number is 0.66\n" + ] + } + ], + "prompt_number": 54 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.25 page : 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C = 215 \t\t\t\t#Velocity in m/s\n", + "T = 30+273 \t\t\t\t#Static temperature in K\n", + "P = 5 \t\t\t\t#Static pressure in bar\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Sound Velocity in m/s \n", + "M = C/a \t\t\t\t#Mach number\n", + "To = T*(1+(((k-1)/2)*M**2)) \t\t\t\t#Stagnation temperature in K\n", + "Po = P*(To/T)**(k/(k-1)) \t\t\t\t#Stagnation pressure in kPa\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Stagnation Pressure is %3.4f bar \\\n", + "\\nB)Mach number is %3.3f'%(Po,M)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Stagnation Pressure is 6.4599 bar \n", + "B)Mach number is 0.616\n" + ] + } + ], + "prompt_number": 55 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.26 page : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T = 400. \t\t\t\t#Static temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Sound velocity in m/s\n", + "C = a \t\t\t\t#Velocity of jet in m/s, Since jet has sonic velocity\n", + "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation temperature in K\n", + "ao = math.sqrt(k*R*To) \t\t\t\t#Sound velocity at Stagnation condition in m/s \n", + "ho = (Cp*To)*10**-3 \t\t\t\t#Stagnation enthalpy in kJ/kg\n", + "C_max = math.sqrt(2*Cp*To) \t\t\t\t#Maximum velocity of jet in m/s\n", + "cr = C/C_max \t\t\t\t#Crocco number\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Velocity of sound at %3i K is %3.3f m/s \\\n", + "\\nB)Velocity of sound at stagnation condition is %3.3f m/s \\\n", + "\\nC)Maximum velocity of jet is %3.3f m/s \\\n", + "\\nD)Stagnation enthalpy is %3.3f kJ/kg \\\n", + "\\nE)Crocco number is %3.4f'%(T,C,ao,C_max,ho,cr)\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Velocity of sound at 400 K is 400.899 m/s \n", + "B)Velocity of sound at stagnation condition is 439.145 m/s \n", + "C)Maximum velocity of jet is 982.202 m/s \n", + "D)Stagnation enthalpy is 482.360 kJ/kg \n", + "E)Crocco number is 0.4082\n" + ] + } + ], + "prompt_number": 57 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.27 page : 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C = 250. \t\t\t\t#Velocity of air in m/s \n", + "D = 10. \t\t\t\t#Diameter in duct in cm\n", + "T = 5.+273 \t\t\t\t#Static temperature in K\n", + "P = 40. \t\t\t\t#Static pressure in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation temperature in K\n", + "Po = P*(To/T)**(k/(k-1)) \t\t\t\t#Stagnation pressure in kPa\n", + "d = (P*10**3)/(R*T) \t\t\t\t#Density in kg/m**3\n", + "A = (math.pi*D**2/4)*10**-4 \t\t\t\t#Area in m**2\n", + "m = d*A*C \t\t\t\t#Mass flow rate in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Stagnation pressure is %3.2f kPa \\\n", + "\\nB)Stagnation temperature is %3.2f K \\\n", + "\\nC)Mass flow rate is %3.4f kg/s'%(Po,To,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Stagnation pressure is 57.97 kPa \n", + "B)Stagnation temperature is 309.09 K \n", + "C)Mass flow rate is 0.9844 kg/s\n" + ] + } + ], + "prompt_number": 58 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.28 page : 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C = 300. \t\t\t\t#Velocity of air in m/s \n", + "P = 1. \t\t\t\t#Static pressure in kPa\n", + "T = 290. \t\t\t\t#Static temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation temperature in K\n", + "Po = P*(To/T)**(k/(k-1)) \t\t\t\t#Stagnation pressure in kPa\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Sound velocity in m/s\n", + "Co = math.sqrt(k*R*To) \t\t\t\t#Sound velocity at Stagnation condition in m/s \n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Stagnation pressure and temperature are %3.4f bar and %3.2f K \\\n", + "\\nB)Velocity of sound in the dynamic and stagnation conditions are %3.2f m/s and %3.2f m/s'%(Po,To,a,Co)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Stagnation pressure and temperature are 1.6529 bar and 334.78 K \n", + "B)Velocity of sound in the dynamic and stagnation conditions are 341.35 m/s and 366.76 m/s\n" + ] + } + ], + "prompt_number": 59 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.29 page : 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data \n", + "dP = 490*(1.01325/760) \t\t\t\t#Pressure in pivot tube in bar\n", + "P = 0.3546+1.01325 \t\t\t\t#Static pressure(absolute) in bar \n", + "To = 25.+273 \t\t\t\t#Stagnation temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabaatic consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Po = dP+P \t\t\t\t#Stagnation pressure in bar\n", + "T = To*(P/Po)**((k-1)/k) \t\t\t\t#Static temperature\n", + "C1 = math.sqrt(2*Cp*(To-T)) \t\t\t\t#Flow velocity for Compressible flow in m/s\n", + "di = Po/(R*To) \t\t\t\t#Density in kg/m**3\n", + "C2 = math.sqrt((2*dP)/di) \t\t\t\t#Flow velocity for incompressible flow in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Flow velocity for: A)Compressible flow is %3.2f m/s \\\n", + "\\nB)Incompressible flow is %3.2f m/s'%(C1,C2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Flow velocity for: A)Compressible flow is 251.44 m/s \n", + "B)Incompressible flow is 235.13 m/s\n" + ] + } + ], + "prompt_number": 60 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.30 page : 61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "To = 27.+273 \t\t\t\t#Stagnation temperature in K\n", + "Po = 8. \t\t\t\t#Stagnation Pressure in bar\n", + "P = 5.6 \t\t\t\t#Static pressure in bar, taken from diagram given\n", + "m = 2. \t\t\t\t#Mass flow rate in kg/s\n", + "k = 1.4 \t\t\t\t#Adiabaatic consmath.tant\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "T = To*(P/Po)**((k-1)/k) \t\t\t\t#Static temperature in K\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Sound velocity in m/s\n", + "C = math.sqrt(2*Cp*(To-T)) \t\t\t\t#Velocity in m/s\n", + "M = C/a \t\t\t\t#Mach number\n", + "A = ((m*R*T)/(P*10**5*C))*10**4 \t\t\t\t#Area at a point in the channal in cm**2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number is %3.4f \\\n", + "\\nB)Velocity is %3.1f m/s \\\n", + "\\nC)Area at a point in the channal is %3.3f cm**2'%(M,C,A)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number is 0.7326 \n", + "B)Velocity is 241.7 m/s \n", + "C)Area at a point in the channal is 11.489 cm**2\n" + ] + } + ], + "prompt_number": 61 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.31 page : 61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 1.8 \t\t\t\t#Stagnation pressure in atm\n", + "To = 20+273 \t\t\t\t#Stagnation temperature in K\n", + "P = 1 \t\t\t\t#Surrounding pressure in atm\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 0.528 \t\t\t\t#Static to Stagnation pressure ratio @Mach number = 1, from gas tables\n", + "Pt = p1*Po \t\t\t\t#Critical pressure in atm, Since Pt<P the flow is not chocked \n", + "di = (Po*10**5)/(R*To) \t\t\t\t#Density in kg/m**3 \n", + "ao = math.sqrt(k*R*To) \t\t\t\t#Sound velocity at Stagnation condition in m/s\n", + "Cp = (k*R)/(k-1) \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "C = math.sqrt(2*Cp*To*(1-(P/Po)**((k-1)/k))) \t\t\t\t#Velocity of air flow which will take place from chamber to the outside through a unit area hole in m/s\n", + "G = di*ao*math.sqrt(2/(k-1))*(P/Po)**(1/k)*math.sqrt((1-(P/Po)**((k-1)/k))) \t\t\t\t#Mass flow rate per unit area in kg/s-m**2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Velocity of air flow which will take place from chamber to the outside through a unit area hole is %3.3f m/s \\\n", + "\\nB)Mass flow rate per unit area is %3.3f kg/s-m**2'%(C,G)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Velocity of air flow which will take place from chamber to the outside through a unit area hole is 301.662 m/s \n", + "B)Mass flow rate per unit area is 424.333 kg/s-m**2\n" + ] + } + ], + "prompt_number": 63 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.32 page: 62" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "A1 = 465.125 \t\t\t\t#Cross sectional area at entry in cm**2\n", + "T1 = 26.66+273 \t\t\t\t#Static temperature at section-1 in K\n", + "P1 = 3.4473 \t\t\t\t#Static Pressure at section-1 in bar\n", + "C1 = 152.5 \t\t\t\t#Velocity at section-1 in m/s\n", + "P2 = 2.06838 \t\t\t\t#Static Pressure at section-2 in bar\n", + "T2 = 277.44 \t\t\t\t#Static temperature at section-2 in K\n", + "C2 = 260.775 \t\t\t\t#Velocity at section-2 in m/s\n", + "Cp = 1005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "To1 = T1+(C1**2/(2*Cp)) \t\t\t\t#Stagnation temperature at entry in K\n", + "To2 = T2+(C2**2/(2*Cp)) \t\t\t\t#Stagnation temperature at exit in K\n", + "#here To1 = To2 from answers\n", + "d1 = (P1*10**5)/(R*T1) \t\t\t\t#Density at section-1\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at section-2\n", + "ar = (d2*C2)/(d1*C1) \t\t\t\t#Ratio of inlet to outlet area\n", + "A2 = A1/ar \t\t\t\t#Cross sectional area at exit in cm**2\n", + "C_max = math.sqrt(2*Cp*To1) \t\t\t\t#Maximum velocity at exit in m/s\n", + "m = d1*A1*C1*10**-4 \t\t\t\t#Mass flow rate in kg/s \n", + "F = ((P1*10**5*A1*10**-4)-(P2*10**5*A2*10**-4))+(m*(C1-C2)) \t\t\t\t#Force acting on the duct wall between two sections in N\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Maximum velocity and stagnation temperature at exit are %3.2f m/s and %3.2f K \\\n", + "\\nB)Since Stagnation temperature %3i K at entry and %3i K at exit are equal, the flow is adiabatic \\\n", + "\\nC)Cross sectional area at exit is %3.2f cm**2 \\\n", + "\\nD)Force acting on the duct wall between two sections is %3.2f N'%(C_max,To2,To1,To2,A2,F)\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Maximum velocity and stagnation temperature at exit are 790.93 m/s and 311.27 K \n", + "B)Since Stagnation temperature 311 K at entry and 311 K at exit are equal, the flow is adiabatic \n", + "C)Cross sectional area at exit is 419.72 cm**2 \n", + "D)Force acting on the duct wall between two sections is 4274.31 N\n" + ] + } + ], + "prompt_number": 65 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.33 page : 63" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P1 = 250. \t\t\t\t#Static Pressure at section-1 in kPa\n", + "T1 = 26.+273 \t\t\t\t#Static temperature at section-1 in K\n", + "M1 = 1.4 \t\t\t\t#Mach number at entry\n", + "M2 = 2.5 \t\t\t\t#Mach number at exit\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "C1 = math.sqrt(k*R*T1)*M1 \t\t\t\t#Air velocity at entry in m/s \n", + "To = T1*(1+(((k-1)/2)*M1**2)) \t\t\t\t#Stagnation temperature in K\n", + "t1 = (1+(((k-1)/2)*M2**2)) \t\t\t\t#Stagnation to exit Temperature ratio\n", + "T2 = To/t1 \t\t\t\t#Exit temperature in K\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Air velocity at exit in m/s \n", + "P2 = P1*(T2/T1)**(k/(k-1)) \t\t\t\t#Exit static pressure in kPa\n", + "d2 = (P2*10**3)/(R*T2) \t\t\t\t#Density at section-2 in kg/m**3\n", + "G = d2*C2 \t\t\t\t#)Mass flow rate through the duct per square metre in kg/s-m**2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At second section: \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nVelocity is %3.4f m/s \\\n", + "\\nB)Mass flow rate through the duct per square metre is %3.1f kg/s-m**2'%(T2,P2,C2,G)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At second section: \n", + "Temperature is 184.98 K \n", + "Pressure is 46.56 kPa \n", + "Velocity is 681.5676 m/s \n", + "B)Mass flow rate through the duct per square metre is 597.8 kg/s-m**2\n" + ] + } + ], + "prompt_number": 67 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.34 page : 64" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 2. \t\t\t\t#Mach number\n", + "h = 20. \t\t\t\t#Altitude in km\n", + "Tc = -56. \t\t\t\t#Ambient temperature in degree Centigrade\n", + "Ta = -56.+273 \t\t\t\t#Ambient temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a = math.sqrt(k*R*Ta) \t\t\t\t#Sound velocity in m/s\n", + "C = M*a \t\t\t\t#Velocity of flight in m/s\n", + "To = Tc+(C**2/(2*Cp)) \t\t\t\t#The maximum temperature encountered is %3.1f degree Centigrade\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'The maximum temperature encountered is %3.1f degree Centigrade'%(To)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum temperature encountered is 117.5 degree Centigrade\n" + ] + } + ], + "prompt_number": 68 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.35 page : 65" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Input data\n", + "W = 20000. \t\t\t\t#Power developed in kW\n", + "m = 12. \t\t\t\t#Mass flow rate in kg/s\n", + "C1 = 50. \t\t\t\t#Velocity of air entering in m/s\n", + "T1 = 700.+273 \t\t\t\t#Temperature of air entering in K\n", + "T2 = 298. \t\t\t\t#Temperature of air leaving in K\n", + "C2 = 125. \t\t\t\t#Velocity of air leaving in m/s\n", + "Cp = 1.005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "dh = Cp*(T2-T1) \t\t\t\t#Change in enthalpy in kJ/kg\n", + "Q = ((m*dh)+W-(m*(1./2000)*(C2**2-C1**2))) \t\t\t\t#The rate of heat transfer in kJ/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'The rate of heat transfer is %3.2f kJ/s'%(Q)\n", + "\n", + "# rounding off error. kindly check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The rate of heat transfer is 11780.75 kJ/s\n" + ] + } + ], + "prompt_number": 71 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.36 page : 65" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "mol = 39.9 \t\t\t\t#Molecular weight of gas in kg/mol\n", + "k = 1.67 \t\t\t\t#Adiabatic consmath.tant\n", + "Po = 500. \t\t\t\t#Pressure in chamber in kPa\n", + "To = 30.+273 \t\t\t\t#Temperature in chamber in K\n", + "P1 = 80. \t\t\t\t#Pressure of nozzle at given section in kPa\n", + "D = 0.012 \t\t\t\t#Cross section diameter of nozzle in m\n", + "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R = Ri/mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "p1 = Po/P1 \t\t\t\t#Stagnation to static pressure ratio\n", + "M1 = math.sqrt((((p1**((k-1)/k))-1)*2)/(k-1)) \t\t\t\t#Mach number at section\n", + "T1 = To*((1+(((k-1)/2)*M1**2))**(-1)) \t\t\t\t#Temperature at section in K\n", + "a = math.sqrt(k*R*T1) \t\t\t\t#Sound Velocity in m/s\n", + "C1 = M1*a \t\t\t\t#Gas Velocity at section in m/s\n", + "d = (P1*10**3)/(R*T1) \t\t\t\t#Density in kg/m**3\n", + "A1 = math.pi*D**2/4 \t\t\t\t#Cross-sectional Area \n", + "m = d*A1*C1 \t\t\t\t#Mass flow rate through nozzle in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At section: \\\n", + "\\nMach number is %3.1f \\\n", + "\\nTemperature is %3.1f K \\\n", + "\\nVelocity is %3.3f m/s \\\n", + "\\nB)Mass flow rate through nozzle is %3.3f kg/s'%(M1,T1,C1,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At section: \n", + "Mach number is 1.8 \n", + "Temperature is 145.3 K \n", + "Velocity is 404.790 m/s \n", + "B)Mass flow rate through nozzle is 0.121 kg/s\n" + ] + } + ], + "prompt_number": 73 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.37 page : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "mol = 4. \t\t\t\t#Molecular weight of gas in kg/mol\n", + "k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n", + "C1 = 150. \t\t\t\t#Gas Velocity at section-1 in m/s\n", + "P1 = 100. \t\t\t\t#Pressure of duct at section-1 in kPa\n", + "T1 = 15.+273 \t\t\t\t#Temperature at section-1 in K\n", + "T2 = -10.+273 \t\t\t\t#Temperature at section-2 in K\n", + "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R = Ri/mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity at section-1 in m/s\n", + "M1 = C1/a1 \t\t\t\t#Mach number at section-1 \n", + "t1 = 0.9955 \t\t\t\t#Static to Stagnation temperature ratio at entry from gas tables @M1,k = 1.3 \n", + "To = T1/t1 \t\t\t\t#Stagantion temperature in K\n", + "p1 = 0.9815 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables @M1,k = 1.3 \n", + "Po = P1/p1 \t\t\t\t#Stagnation pressure in kPa\n", + "t2 = T2/To \t\t\t\t#Static to Stagnation temperature ratio at exit\n", + "M2 = 0.82 \t\t\t\t#Amch number at section-2 from gas tables @t2,k = 1.3\n", + "p2 = 0.659 \t\t\t\t#Static to Stagnation pressure ratio at exit from gas tables @M2,k = 1.3 \n", + "P2 = Po*p2 \t\t\t\t#Pressure at section-2 in kPa\n", + "a2 = math.sqrt(k*R*T2) \t\t\t\t#Sound velocity at section-2 in m/s\n", + "C2 = M2*a2 \t\t\t\t#Gas Velocity at section-2 in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'At the second point: \\\n", + "\\nMach number is %3.2f \\\n", + "\\nPressure is %3.3f kPa \\\n", + "\\nVelocity is %3.2f m/s'%(M2,P2,C2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "At the second point: \n", + "Mach number is 0.82 \n", + "Pressure is 67.142 kPa \n", + "Velocity is 691.26 m/s\n" + ] + } + ], + "prompt_number": 75 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.38 page : 67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Input data\n", + "A1 = 10. \t\t\t\t#Inlet area in cm**2\n", + "C1 = 80. \t\t\t\t#Inlet Air velocity in m/s\n", + "T1 = 28.+273 \t\t\t\t#Inlet temperature in K\n", + "P1 = 700. \t\t\t\t#Inlet Pressure in kPa\n", + "P2 = 250. \t\t\t\t#Exit pressure in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity at inlet in m/s\n", + "M1 = C1/a1 \t\t\t\t#Mach number at inlet\n", + "t1 = 0.989 \t\t\t\t#Static to Stagnation temperature ratio at entry from gas tables @M1,k = 1.4\n", + "To = T1/t1 \t\t\t\t#Stagantion temperature in K\n", + "p1 = 0.964 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables @M1,k = 1.4 \n", + "Po = P1/p1 \t\t\t\t#Stagnation pressure in kPa\n", + "p2 = P2/Po \t\t\t\t#Static to Stagnation pressure ratio \n", + "M2 = 1.335 \t\t\t\t#Mach number at exit \n", + "t2 = 0.737 \t\t\t\t#Static to Stagnation temperature ratio at exit from gas tables @M2,k = 1.4\n", + "T2 = To*t2 \t\t\t\t#Stagnation temperatur in K\n", + "a2 = math.sqrt(k*R*T2) \t\t\t\t#Sound velocity at exit in m/s\n", + "C2 = M2*a2 \t\t\t\t#Exit Air velocity in m/s\n", + "d1 = (P1*10**3)/(R*T1) \t\t\t\t#Density at inlet in kg/m**3\n", + "m = d1*A1*C1*10**-4 \t\t\t\t#Mass flow rate in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mass flow rate is %3.3f kg/s \\\n", + "\\nB)Velocity at the exit is %3.2f m/s'%(m,C2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mass flow rate is 0.648 kg/s \n", + "B)Velocity at the exit is 400.78 m/s\n" + ] + } + ], + "prompt_number": 76 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.39 page : 68" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Input data\n", + "V = 5. \t\t\t\t#Volume of air in m**3\n", + "Ae = 10.*10**-4 \t\t\t\t#Exit area in cm**2\n", + "To = 60.+273 \t\t\t\t#Temperature inside in the math.tank in K\n", + "Po1 = 40. \t\t\t\t#Intial total pressure in bar \n", + "Po2 = 2. \t\t\t\t#Final total pressure in bar\n", + "P = 1. \t\t\t\t#Discharge pressure in bar\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\n", + "#Calculation\n", + "#Here pressure ratios P/Po1 and P/Po2 are always less than critical pressure ratio therefore flow is choked i.e. M = 1 at exit\n", + "Gp = (0.0404184*Ae)/math.sqrt(To) \t\t\t\t#Mass flow rate by Stagnation pressure i.e. m/Po\n", + "#Differentiating m = (P*V)/(R*To) w.r.t. time and intrgrating resulting equation we get following expression.\n", + "t = -(V/(R*To*Gp))*math.log(Po2/Po1) \t\t\t\t#The time required for math.tank pressure to decrease from Po1 to Po2 in sec\n", + "\n", + "\n", + "#Output\n", + "print 'The time required for tank pressure to decrease from %i bar to %i bar is %3.2f sec'%(Po1,Po2,t)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The time required for tank pressure to decrease from 40 bar to 2 bar is 70.76 sec\n" + ] + } + ], + "prompt_number": 78 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch2.ipynb b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch2.ipynb new file mode 100755 index 00000000..12361fe9 --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch2.ipynb @@ -0,0 +1,1509 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:6875085981d30c40f21af9abe827ee04ccc837d7faa969a757e96f393b389713" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : Flow Through Variable Area Ducts" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1 page : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "do1 = 1.12 \t\t\t\t#Density of air i reservoir in kg/m**3\n", + "ao1 = 500 \t\t\t\t#Velocity of sound in reservoir in m/s\n", + "d = 0.01 \t\t\t\t#Throat diameter in m \n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant \n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "To1 = ao1**2/(k*R) \t\t\t\t#Stagnation temperature in K\n", + "Po1 = do1*R*To1 \t\t\t\t#Stagnation pressure in Pa\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from gas tables @M = 1\n", + "Pt = (Po1*p1)*10**-5 \t\t\t\t#Throat pressure in bar\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from gas tables @M = 1\n", + "Tt = To1*t1 \t\t\t\t#critical temperature in K\n", + "d_t = (Pt*10**5)/(R*Tt) \t\t\t\t#Density of air at throat in kg/m**3\n", + "a_t = math.sqrt(k*R*Tt) \t\t\t\t#Sound velocity at throat in m/s \n", + "Ct = a_t \t\t\t\t#Air velocity t throat in m/s, Since M = 1\n", + "A_t = math.pi*d**2/4 \t\t\t\t#Throat area in m**2 \n", + "m = d_t*A_t*Ct \t\t\t\t#Maximum mass flow rate in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Maximum mass flow rate is %3.5f kg/s \\\n", + "\\nB)Pressure and temperarature at the throat are %3.3f bar and %3.4f K'%(m,Pt,Tt)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Maximum mass flow rate is 0.02543 kg/s \n", + "B)Pressure and temperarature at the throat are 1.056 bar and 518.9149 K\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.2 page : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P1 = 2. \t\t\t\t#Intial pressure in bar\n", + "C1 = 170. \t\t\t\t#Initial velocity of air in m/s\n", + "T1 = 473. \t\t\t\t#Intial temperature in K\n", + "A1 = 1000. \t\t\t\t#Inlet area in mm**2\n", + "P2 = 0.95 \t\t\t\t#Exit pressure in bar\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a_1 = math.sqrt(k*R*T1) \t\t\t\t#Velocity of sound at inlet in m/s\n", + "M1 = C1/a_1 \t\t\t\t#Inlet mach number\n", + "t1 = 0.970 \t\t\t\t#Ratio of inlet temperature to Stagnation temperature from gas tables @M = 1\n", + "To1 = T1/t1 \t\t\t\t#Stagnation temperature in K\n", + "p1 = 0.900 \t\t\t\t#Ratio of inlet pressure to Stagnation pressure from gas tables @M = 1\n", + "Po1 = P1/p1 \t\t\t\t#Stagnation pressure in bar\n", + "a1 = 1.623 \t\t\t\t#Ratio of inlet area to critical area from isentropic gas tables @M = 1\n", + "At = A1/a1 \t\t\t\t#critical area in mm**2\n", + "p2 = 0.528 \t\t\t\t#Pressure ratio at critical state from isentropic gas tables @M = 1\n", + "Pt = Po1*p2 \t\t\t\t#Throat pressure in bar\n", + "t2 = 0.834 \t\t\t\t#Temperature ratio at critical state from isentropic gas tables @M = 1\n", + "Tt = To1*t2 \t\t\t\t#Throat temperature in K\n", + "a_t = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound at throat in m/s\n", + "C_t = a_t \t\t\t\t#Critical velocity of air in m/s\n", + "p3 = P2/Po1 \t\t\t\t#Pressure ratio at exit \n", + "M2 = 1.17 \t\t\t\t#Mach number at exit from isentropic gas tables @p3\n", + "t3 = 0.785 \t\t\t\t#Temperature ratio at exit from isentropic gas tables @M2\n", + "T2 = To1*t3 \t\t\t\t#Exit temperature in K\n", + "a3 = 1.022 \t\t\t\t#Area ratio at exit from isentropic gas tables @M2\n", + "A2 = At*a3 \t\t\t\t#Exit area in mm**2, wrong answer in textbook\n", + "C2 = M2*math.sqrt(k*R*T2) \t\t\t\t#Exit velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Stagnation temperature and pressure are %3.2f K and %3.3f bar \\\n", + "\\nB)Sonic velocity and mach number at entry are %3.2f m/s and %3.2f \\\n", + "\\nC)Velocity, Mach number and flow area at outlet section are %3.2f m/s, %3.2f and %3.2f mm**2 \\\n", + "\\nD)Pressure, area at throat of the nozzle are %3.5f bar and %3.3f mm**2'%(To1,Po1,a_1,M1,C2,M2,A2,Pt,At)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Stagnation temperature and pressure are 487.63 K and 2.222 bar \n", + "B)Sonic velocity and mach number at entry are 435.95 m/s and 0.39 \n", + "C)Velocity, Mach number and flow area at outlet section are 458.85 m/s, 1.17 and 629.70 mm**2 \n", + "D)Pressure, area at throat of the nozzle are 1.17333 bar and 616.143 mm**2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3 page: 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po1 = 10. \t\t\t\t#Stagnation pressure in bar\n", + "To1 = 798. \t\t\t\t#Stagnation temperature in K\n", + "Pt = 7.6 \t\t\t\t#Throat pressure in bar \n", + "m = 1.5 \t\t\t\t#Mass flow rate in kg/s\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + " \n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from isentropic gas tables @M = 1,k = 1.4\n", + "Pc = p1*Po1 \t\t\t\t#Critical pressure in bar\n", + "P2 = Pt \t\t\t\t#Exit pressure in bar, Since Pc<P2\n", + "p2 = P2/Po1 \t\t\t\t#Pressure ratio\n", + "M2 = 0.64 \t\t\t\t#Exit mach number from isentropic gas tables @p2\n", + "t1 = 0.924 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2\n", + "T2 = t1*To1 \t\t\t\t#exit temperature in K\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit velocity in m/s\n", + "C_max = math.sqrt(2*Cp*To1) \t\t\t\t#Maximum possible velocity in m/s\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/m**3\n", + "At = (m/(d2*C2))*10**6 \t\t\t\t#Throat area in mm**2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At the nozzle throat/exit: \\\n", + "\\nPressure is %3.2f bar \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nB)Maximum possible velocity is %3.2f m/s \\\n", + "\\nC)Type of the nozzle is a convergent nozzle and its throat area is %3.3f mm**2'%(P2,T2,C2,C_max,At)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At the nozzle throat/exit: \n", + "Pressure is 7.60 bar \n", + "Temperature is 737.35 K \n", + "Velocity is 348.36 m/s \n", + "B)Maximum possible velocity is 1266.48 m/s \n", + "C)Type of the nozzle is a convergent nozzle and its throat area is 1198.980 mm**2\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 page : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po1 = 3.344 \t\t\t\t#Stagnation pressure in bar\n", + "To1 = 900. \t\t\t\t#Stagnation temperature in K\n", + "P2 = 1.05 \t\t\t\t#Exit pressure in bar\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = P2/Po1 \t\t\t\t#Pressure ratio\n", + "M2 = 1.40 \t\t\t\t#Exit mach number from gas tables @p1,k = 1.4\n", + "t1 = 0.718 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.4\n", + "T2 = To1*t1 \t\t\t\t#exit temperature in K\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit velocity in m/s\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/m**3\n", + "a1 = 1.115 \t\t\t\t#Ratio of exit area to critical area from isentropic gas tables @M2\n", + "M_2 = 0.6733 \t\t\t\t#Exit mach number when it acts as diffuser \n", + "t2 = 0.91633 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2\n", + "T_2 = t2*To1 \t\t\t\t#exit temperature in K\n", + "C_2 = math.sqrt(k*R*T_2)*M_2 \t\t\t\t#Exit velocity in m/s\n", + "p2 = 0.738 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2\n", + "P_2 = Po1*p2 \t\t\t\t#exit pressure in bar\n", + "d_2 = (P_2*10**5)/(R*T_2) \t\t\t\t#Density at exit in kg/m**3\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At exit: \\nTemperaure is %3i K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nDensity is %3.3f kg/m**3 \\\n", + "\\nB)At diffuser: Temperaure is %3.3f K \\\n", + "\\nVelocity is %3.3f m/s \\\n", + "\\nDensity is %3.4f kg/m**3 \\\n", + "\\nPressure is %3.4f bar'%(T2,C2,d2,T_2,C_2,d_2,P_2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At exit: \n", + "Temperaure is 646 K \n", + "Velocity is 713.37 m/s \n", + "Density is 0.566 kg/m**3 \n", + "B)At diffuser: Temperaure is 824.697 K \n", + "Velocity is 387.579 m/s \n", + "Density is 1.0427 kg/m**3 \n", + "Pressure is 2.4679 bar\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5 page : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po1 = 8 \t\t\t\t#Stagnation pressure in bar\n", + "To1 = 273+15 \t\t\t\t#Stagnation temperature in K\n", + "At = 25 \t\t\t\t#Throat area in cm**2\n", + "A2 = 100 \t\t\t\t#Exit area in cm**2\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = A2/At \t\t\t\t#Area ratio\n", + "M2 = 2.94 \t\t\t\t#Exit mach number from gas tables @a1,k = 1.4\n", + "p1 = 0.0298 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "P2 = Po1*p1 \t\t\t\t#exit pressure in bar\n", + "M_2 = 0.146 \t\t\t\t#Exit mach number when it acts as diffuser\n", + "p2 = 0.9847 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2\n", + "P_2 = Po1*p2 \t\t\t\t#exit pressure in bar\n", + "p3 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from isentropic gas tables @M = 1,k = 1.4 \n", + "Pc = (Po1*p3) \t\t\t\t#Critical pressure in bar\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from isentropic gas tables @M = 1,k = 1.4 \n", + "Tt = To1*t1 \t\t\t\t#critical temperature in K\n", + "d_t = (Pc*10**5)/(R*Tt) \t\t\t\t#Density at critical state in kg/m**3\n", + "a_t = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound at critical state in m/s\n", + "Ct = a_t \t\t\t\t#Velocity of air at critical state in m/s\n", + "m = d_t*At*Ct*10**-4 \t\t\t\t#Mass flow rate in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Maximum mass flow rate is %3.3f kg/s \\\n", + "\\n\\\n", + "\\nB)As nozzle: \\\n", + "\\nPressure is %3.4f bar \\\n", + "\\nMach number is %3.2f \\\n", + "\\nAs diffuser: \\\n", + "\\nPressure is %3.4f bar \\\n", + "\\nMach number is %3.3f'%(m,P2,M2,P_2,M_2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Maximum mass flow rate is 4.759 kg/s \n", + "\n", + "B)As nozzle: \n", + "Pressure is 0.2384 bar \n", + "Mach number is 2.94 \n", + "As diffuser: \n", + "Pressure is 7.8776 bar \n", + "Mach number is 0.146\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.6 page : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D1 = 15 \t\t\t\t#Entry diameter in cm\n", + "D2 = 30 \t\t\t\t#Exit diamater in cm \n", + "P1 = 0.96 \t\t\t\t#Inlet pressure in bar\n", + "T1 = 340 \t\t\t\t#Inlet temperature in K\n", + "C1 = 185 \t\t\t\t#INlet velocity in m/s\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "A1 = math.pi*D1**2/4 \t\t\t\t#Entry area in cm**2\n", + "A2 = math.pi*D2**2/4 \t\t\t\t#Exit area in cm**2\n", + "a_1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "M1 = C1/a_1 \t\t\t\t#Inlet mach number \n", + "p1 = 0.843 \t\t\t\t#Ratio of inlet pressure to Stagnation pressure from gas tables @M1,k = 1.4\n", + "Po1 = P1/p1 \t\t\t\t#Stagnation pressure in bar\n", + "t1 = 0.952 \t\t\t\t#Ratio of inlet temperature to Stagnation temperature from gas tables @M1,k = 1.4\n", + "To1 = T1/t1 \t\t\t\t#Stagnation temperature in K\n", + "a1 = 1.34 \t\t\t\t#Ratio of inlet area to critical area from isentropic gas tables @M1,k = 1.4\n", + "At = A1/a1 \t\t\t\t#critical area in cm**2\n", + "a2 = A2/At \t\t\t\t#Area ratio\n", + "M2 = 0.1088 \t\t\t\t#Exit mach number from gas tables @a2,k = 1.4\n", + "p2 = 0.992 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "P2 = Po1*p2 \t\t\t\t#exit pressure in bar\n", + "t2 = 0.9976 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.4\n", + "T2 = To1*t2 \t\t\t\t#exit temperature in K\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit velocity in m/s\n", + "F1 = P1*10**5*A1*10**-4*(1+(k*(M1**2))) \t\t\t\t#Force exerted at entry in kN\n", + "F2 = P2*10**5*A2*10**-4*(1+(k*(M2**2))) \t\t\t\t#Force exerted at exit in kN\n", + "F = (F2-F1)*10**-3 \t\t\t\t#Force exerted on the diffuser walls in kN, wrong answer in textbook \n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Exit pressure is %3.3f bar \\\n", + "\\n\\\n", + "\\nB)Exit velocity is %3.2f m/s \\\n", + "\\n\\\n", + "\\nC)Force exerted on the diffuser walls is %3.3f kN'%(P2,C2,F)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Exit pressure is 1.130 bar \n", + "\n", + "B)Exit velocity is 41.17 m/s \n", + "\n", + "C)Force exerted on the diffuser walls is 5.826 kN\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.7 page : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 3.6 \t\t\t\t#Inlet mach number \n", + "M2 = 2 \t\t\t\t#Exit mach number\n", + "m = 15 \t\t\t\t#Mass flow rate in kg/s\n", + "P1 = 1.05 \t\t\t\t#Inlet pressure in bar\n", + "T1 = 313 \t\t\t\t#Inlet temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 11.38*10**-3 \t\t\t\t#Ratio of inlet pressure to Stagnation pressure from gas tables @M1,k = 1.4\n", + "Po = P1/p1 \t\t\t\t#Stagnation pressure in bar\n", + "t1 = 0.278 \t\t\t\t#Ratio of inlet temperature to Stagnation temperature from gas tables @M1,k = 1.4\n", + "To = T1/t1 \t\t\t\t#Stagnation temperature in K\n", + "C1 = math.sqrt(k*R*T1)*M1 \t\t\t\t#Inlet velocity in m/s\n", + "d1 = (P1*10**5)/(R*T1) \t\t\t\t#Density at inlet in kg/s, P1 in Pa\n", + "A1 = (m/(d1*C1))*10**4 \t\t\t\t#Inlet area in cm**2\n", + "p2 = 0.128 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "P2 = Po*p2 \t\t\t\t#exit pressure in bar\n", + "t2 = 0.555 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.4\n", + "T2 = To*t2 \t\t\t\t#exit temperature in K\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit velocity in m/s\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/s\n", + "A2 = (m/(d2*C2))*10**4 \t\t\t\t#Exit area in cm**2\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)At Inlet: \\\n", + "\\nArea is %3.1f cm**2 \\\n", + "\\nTotal pressure %3.2f bar \\\n", + "\\nTotal temperature is %3.1f K \\\n", + "\\nB)At Exit: \\\n", + "\\nArea is %3.1f cm**2 \\\n", + "\\nTotal pressure %3.2f bar \\\n", + "\\nTotal temperature is %3.2f K \\\n", + "\\nStatic temperature is %3.2f K \\\n", + "\\nStatic pressure is %3.2f bar'%(A1,Po,To,A2,Po,To,T2,P2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At Inlet: \n", + "Area is 100.5 cm**2 \n", + "Total pressure 92.27 bar \n", + "Total temperature is 1125.9 K \n", + "B)At Exit: \n", + "Area is 22.7 cm**2 \n", + "Total pressure 92.27 bar \n", + "Total temperature is 1125.90 K \n", + "Static temperature is 624.87 K \n", + "Static pressure is 11.81 bar\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.8 page :26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 6.91 \t\t\t\t#Stagnation pressure in bar\n", + "To = 325+273 \t\t\t\t#Stagnation temperature in K\n", + "P2 = 0.98 \t\t\t\t#exit pressure in bar\n", + "m = 3600/3600 \t\t\t\t#Mass flow rate in kg/s\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from gas tables @M = 1\n", + "Pt = Po*p1 \t\t\t\t#critical pressure in bar\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from gas tables @M = 1\n", + "Tt = To*t1 \t\t\t\t#critical temperature in K\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Sound velocity at throat in m/s \n", + "Ct = at \t\t\t\t#Air velocity t throat in m/s, Since M = 1\n", + "dt = (Pt*10**5)/(R*Tt) \t\t\t\t#Density of air at throat in kg/m**3, Pt in Pa\n", + "At = (m/(dt*Ct))*10**4 \t\t\t\t#Throat area in m**2 x10**-4 \n", + "p2 = P2/Po \t\t\t\t#Pressure ratio \n", + "M2 = 1.93 \t\t\t\t#Exit mach number from gas tables @p2,k = 1.4\n", + "t2 = 0.573 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.4\n", + "T2 = To*t2 \t\t\t\t#exit temperature in K\n", + "a2 = 1.593 \t\t\t\t#Ratio of exit area to critical area from isentropic gas tables @M2,k = 1.4\n", + "A2 = a2*At \t\t\t\t#Exit area in m**2, At in m**2 x10**-4\n", + "C_max = math.sqrt(2*Cp*To) \t\t\t\t#Maximum possible velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At throat: \\\n", + "\\nArea is %3.2fx10**-4 m**2 \\\n", + "\\nPressure is %3.2f bar \\\n", + "\\nVelocity is %3.1f m/s \\\n", + "\\nB)At Exit: \\\n", + "\\nArea is %3.3fx10**-4 m**2 \\\n", + "\\nMach number is %3.2f \\\n", + "\\nC)Maximum possible velocity is %3.2f m/s'%(At,Pt,Ct,A2,M2,C_max)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At throat: \n", + "Area is 8.76x10**-4 m**2 \n", + "Pressure is 3.65 bar \n", + "Velocity is 447.6 m/s \n", + "B)At Exit: \n", + "Area is 13.961x10**-4 m**2 \n", + "Mach number is 1.93 \n", + "C)Maximum possible velocity is 1096.35 m/s\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.9 page : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P1 = 2.45 \t\t\t\t#Inlet pressure in bar\n", + "T1 = 26.5+273 \t\t\t\t#Inlet temperature in K\n", + "M1 = 1.4 \t\t\t\t#Inlet mach number \n", + "M2 = 2.5 \t\t\t\t#Exit mach number\n", + "k = 1.3 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 469 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.773 \t\t\t\t#Ratio of inlet temperature to Stagnation temperature from gas tables @M1,k = 1.3\n", + "To = T1/t1 \t\t\t\t#Stagnation temperature in K\n", + "t2 = 0.516 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.3\n", + "T2 = To*t2 \t\t\t\t#exit temperature in K\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit velocity in m/s\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity at inlet in m/s\n", + "G = (P1*10**5*a1*M1)/(R*T1) \t\t\t\t#)Flow rate per square meter of the inlet cross section in kg/s-m**2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Stagnation temperature is %3.2f K \\\n", + "\\nB)At Exit: \\\n", + "\\nTemperature is %3.3f K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nC)Flow rate per square meter of the inlet cross section is %3.2f kg/s-m**2'%(To,T2,C2,G)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Stagnation temperature is 387.45 K \n", + "B)At Exit: \n", + "Temperature is 199.925 K \n", + "Velocity is 872.83 m/s \n", + "C)Flow rate per square meter of the inlet cross section is 1043.47 kg/s-m**2\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.10 page : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 1000 \t\t\t\t#Stagnation pressure in kPa\n", + "To = 800 \t\t\t\t#Stagnation temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant \n", + "M2 = 2 \t\t\t\t#Exit mach number\n", + "At = 20 \t\t\t\t#Throat area in cm**2 \n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from isentropic gas tables @M = 1,k = 1.4 \n", + "Tt = To*t1 \t\t\t\t#critical temperature in K\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound at critical state in m/s\n", + "Ct = at \t\t\t\t#Velocity of air at critical state in m/s, Since M = 1\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from isentropic gas tables @M = 1,k = 1.4 \n", + "Pt = Po*p1 \t\t\t\t#Critical pressure in bar\n", + "dt = (Pt*10**3)/(R*Tt) \t\t\t\t#Density at critical state in kg/m**3, Pt in Pa\n", + "m = dt*At*10**-4*Ct \t\t\t\t#Mass flow rate in kg/s, At in m**2\n", + "p2 = 0.128 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "P2 = Po*p2 \t\t\t\t#exit pressure in kPa\n", + "t2 = 0.555 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.4\n", + "T2 = To*t2 \t\t\t\t#exit temperature in K\n", + "a2 = 1.687 \t\t\t\t#Ratio of exit area to critical area from isentropic gas tables @M2,k = 1.4\n", + "A2 = At*a2 \t\t\t\t#Exit area in cm**2\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit velocity in m/s\n", + "d2 = P2*10**3/(R*T2) \t\t\t\t#Density at exit in kg/m**3, P2 in Pa\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At throat: \\\n", + "\\nTemperature is %3.1f K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nPressure is %3i kPa \\\n", + "\\nB)At Exit: \\\n", + "\\nTemperature is %3i K \\\n", + "\\nPressure is %3i kPa \\\n", + "\\nArea is %3.2f m**2 \\\n", + "\\nMass flow rate is %3.4f kg/s'%(Tt,Ct,Pt,T2,P2,A2,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At throat: \n", + "Temperature is 667.2 K \n", + "Velocity is 517.77 m/s \n", + "Pressure is 528 kPa \n", + "B)At Exit: \n", + "Temperature is 444 K \n", + "Pressure is 128 kPa \n", + "Area is 33.74 m**2 \n", + "Mass flow rate is 2.8553 kg/s\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.11 page : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M2 = 2 \t\t\t\t#Exit mach number\n", + "At = 1000 \t\t\t\t#Throat area in cm**2 \n", + "Po = 0.69 \t\t\t\t#Stagnation pressure in bar \n", + "To = 310 \t\t\t\t#Stagnation temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant \n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1.005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in kJ/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from isentropic gas tables @M = 1,k = 1.4\n", + "Tt = To*t1 \t\t\t\t#critical temperature in K\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound at critical state in m/s\n", + "Ct = at \t\t\t\t#Velocity of air at critical state in m/s, Since M = 1\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from isentropic gas tables @M = 1,k = 1.4 \n", + "Pt = Po*p1 \t\t\t\t#Critical pressure in bar\n", + "dt = (Pt*10**5)/(R*Tt) \t\t\t\t#Density at critical state in kg/m**3, Pt in Pa\n", + "m = dt*At*10**-4*Ct \t\t\t\t#Mass flow rate in kg/s, At in m**2\n", + "p2 = 0.128 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "P2 = Po*p2 \t\t\t\t#exit pressure in bar\n", + "t2 = 0.555 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.4\n", + "T2 = To*t2 \t\t\t\t#exit temperature in K\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit velocity in m/s\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/m**3, P2 in Pa\n", + "A2 = (m/(d2*C2))*10**4 \t\t\t\t#Exit area in cm**2\n", + "P = m*Cp*(To-T2) \t\t\t\t#Power required to drive the compressor in kW\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At throat: \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nPressure is %3.3f bar \\\n", + "\\nAt Test section: Temperature is %3.2f K \\\n", + "\\nVelocity is %3.3f m/s \\\n", + "\\nPressure is %3.3f bar \\\n", + "\\nB)Area of cross section at test section is %3i cm**2 \\\n", + "\\nC)Mass flow rate is %3.3f kg/s \\\n", + "\\nD)Power required to drive the compressor is %3.2f kW'%(Tt,Ct,Pt,T2,C2,P2,A2,m,P)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At throat: \n", + "Temperature is 258.54 K \n", + "Velocity is 322.31 m/s \n", + "Pressure is 0.364 bar \n", + "At Test section: Temperature is 172.05 K \n", + "Velocity is 525.851 m/s \n", + "Pressure is 0.088 bar \n", + "B)Area of cross section at test section is 1682 cm**2 \n", + "C)Mass flow rate is 15.825 kg/s \n", + "D)Power required to drive the compressor is 2193.97 kW\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.12 page : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\n", + "#Input data\n", + "Po = 10. \t\t\t\t#Stagnation pressure in bar \n", + "To = 100.+273 \t\t\t\t#Stagnation temperature in K\n", + "m = 15. \t\t\t\t#mass flow rate in kg/s\n", + "P2s = 1. \t\t\t\t#Back pressure in isentropic state in bar\n", + "eff = 0.95 \t\t\t\t#efficiency of diverging nozzle\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\n", + "#Calculation\n", + "#case I: isentropic\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from isentropic gas tables @M = 1,k = 1.4\n", + "Tt = To*t1 \t\t\t\t#critical temperature in K\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound at critical state in m/s\n", + "Ct = at \t\t\t\t#Velocity of air at critical state in m/s, Since M = 1\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from isentropic gas tables @M = 1,k = 1.4 \n", + "Pt = Po*p1 \t\t\t\t#Critical pressure in bar\n", + "dt = (Pt*10**5)/(R*Tt) \t\t\t\t#Density at critical state in kg/m**3, Pt in Pa\n", + "At = (m/(dt*Ct))*10**4 \t\t\t\t#Throat area in cm**2 \n", + "p2 = P2s/Po \t\t\t\t#Pressure ratio\n", + "M2s = 2.15 \t\t\t\t#Exit mach number from gas tables (isentropic state) @p2,k = 1.4\n", + "t2 = 0.519 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2s,k = 1.4\n", + "T2s = t2*To \t\t\t\t#exit temperature in K\n", + "a2s = math.sqrt(k*R*T2s) \t\t\t\t#Velocity of sound at exit in m/s\n", + "C2s = M2s*a2s \t\t\t\t#Exit air velocity in m/s\n", + "d2s = (P2s*10**5)/(R*T2s) \t\t\t\t#Density at exit in kg/m**3, P2 in Pa\n", + "A2s = (m/(d2s*C2s))*10**4 \t\t\t\t#Exit area in cm**2\n", + "#case II: isentropic upto throat\n", + "T2 = To-(eff*(To-T2s)) \t\t\t\t#Exit tempareture in K\n", + "C2 = math.sqrt(2*Cp*(To-T2)) \t\t\t\t#Exit air velocity in m/s\n", + "P2 = P2s \t\t\t\t#Exit pressure in bar, Since it is diffuser\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/m**3, P2 in Pa\n", + "A2 = (m/(d2*C2))*10**4 \t\t\t\t#Exit area in cm**2\n", + "\n", + "\n", + "#Output\n", + "print 'A)The nozzle cross section at throat in both cases is %3.2f cm**2 \\\n", + "\\nB)The nozzle cross section at exit in case I is %3.3f cm**2 and in case II is %3.2f cm**2'%(At,A2s,A2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)The nozzle cross section at throat in both cases is 71.74 cm**2 \n", + "B)The nozzle cross section at exit in case I is 138.985 cm**2 and in case II is 148.98 cm**2\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.13 page : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 600. \t\t\t\t#Stagnation pressure in kPa\n", + "To = 40.+273 \t\t\t\t#Stagnation temperature in K\n", + "P2 = 100. \t\t\t\t#exit pressure in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = P2/Po \t\t\t\t#pressure ratio \n", + "M2 = 1.82 \t\t\t\t#Exit mach number from gas tables @p2,k = 1.4\n", + "ar = 1.461 \t\t\t\t#Ratio of nozzle exit area to nozzle throat area from gas tables @M2\n", + "t1 = 0.602 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.4\n", + "T2 = To*t1 \t\t\t\t#exit temperature in K\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit air velocity in m/s\n", + "p2 = 3.698 \t\t\t\t#Ratio of static pressures after shock to before shock from normal shock gas tables @M2 \n", + "Py = p2*P2 \t\t\t\t#The back pressure at which normal shock acts at the exit plane of the nozzle in kPa\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Ratio of nozzle exit area to nozzle throat area is %3.3f \\\n", + "\\nB)The discharge velocity from nozzle is %3.2f m/s \\\n", + "\\nC)The back pressure at which normal shock acts at the exit plane of the nozzle is %3.1f kPa'%(ar,C2,Py)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Ratio of nozzle exit area to nozzle throat area is 1.461 \n", + "B)The discharge velocity from nozzle is 500.78 m/s \n", + "C)The back pressure at which normal shock acts at the exit plane of the nozzle is 369.8 kPa\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.14 page : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "ar = 2. \t\t\t\t#Ratio of nozzle exit area to nozzle throat area\n", + "Po = 700. \t\t\t\t#Stagnation pressure in kPa\n", + "P2 = 400. \t\t\t\t#exit pressure in kPa\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from gas tables @M = 1\n", + "Pt = Po*p1 \t\t\t\t#critical pressure in bar\n", + "p2 = P2/Po \t\t\t\t#Pressure ratio\n", + "M2 = 0.93 \t\t\t\t#Exit mach number from gas tables @p2,k = 1.4\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Since pressure decreases from %3i kPa to %3.1f kPa from inlet to throat, \\\n", + "\\nit acts as nozzle Since exit pressure %3i kPa is above critical pressure %3.1f kPa, \\\n", + "\\nit acts as diffuser with M = %3.2f Hence the duct acts as Venturi'%(Po,Pt,P2,Pt,M2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since pressure decreases from 700 kPa to 369.6 kPa from inlet to throat, \n", + "it acts as nozzle Since exit pressure 400 kPa is above critical pressure 369.6 kPa, \n", + "it acts as diffuser with M = 0.93 Hence the duct acts as Venturi\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.15 page : 33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "A1 = 0.15 \t\t\t\t#Inlet area in m**2\n", + "C1 = 240 \t\t\t\t#Inlet velocity in m/s \n", + "T1 = 300 \t\t\t\t#Inlet temperature in K\n", + "P1 = 0.7 \t\t\t\t#Inlet pressure in bar\n", + "C2 = 120 \t\t\t\t#Exit velocity in m/s\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Velocity of sound at inlet in m/s\n", + "M1 = C1/a1 \t\t\t\t#Inlet mach number \n", + "d1 = (P1*10**5)/(R*T1) \t\t\t\t#Density at inlet in kg/s, P1 in Pa\n", + "m = d1*A1*C1 \t\t\t\t#Mass flow rate in kg/s\n", + "t1 = 0.913 \t\t\t\t#Ratio of inlet temperature to Stagnation temperature from gas tables @M1,k = 1.4\n", + "To = T1/t1 \t\t\t\t#Stagnation temperature in K\n", + "p1 = 0.727 \t\t\t\t#Ratio of inlet pressure to Stagnation pressure from gas tables @M1,k = 1.4\n", + "Po = P1/p1 \t\t\t\t#Stagnation pressure in bar\n", + "T2 = To-(C2**2/(2*Cp)) \t\t\t\t#Exit temperature in K\n", + "t2 = T2/To \t\t\t\t#Temperature ratio \n", + "M2 = 0.33 \t\t\t\t#Exit mach number from gas tables @t2,k = 1.4\n", + "p2 = 0.927 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "P2 = Po*p2 \t\t\t\t#exit pressure in bar\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/s, P2 in Pa\n", + "A2 = (m/(d2*C2)) \t\t\t\t#Exit area in m**2\n", + "ds = 0 \t\t\t\t#Entropy change in kJ/kg-K, math.since process is isentropic\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mass flow rate is %3.3f kg/s \\\n", + "\\nB)Stagnation pressure at exit is %3.4f bar \\\n", + "\\nC)Stagnation Temperature at exit is %3.3f K \\\n", + "\\nD)Static exit pressure is %3.3f bar \\\n", + "\\nE)Entropy change is %3i kJ/kg-K \\\n", + "\\nF)Exit area is %3.3f m**2'%(m,Po,To,P2,ds,A2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mass flow rate is 29.268 kg/s \n", + "B)Stagnation pressure at exit is 0.9629 bar \n", + "C)Stagnation Temperature at exit is 328.587 K \n", + "D)Static exit pressure is 0.893 bar \n", + "E)Entropy change is 0 kJ/kg-K \n", + "F)Exit area is 0.252 m**2\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.16 page : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "A2 = 645. \t\t\t\t#Exit area in mm**2\n", + "M2 = 2. \t\t\t\t#Exit mach number\n", + "P2 = 1. \t\t\t\t#exit pressure in bar\n", + "T2 = 185. \t\t\t\t#Exit temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.555 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from gas tables @M2,k = 1.4\n", + "To = T2/t1 \t\t\t\t#Stagnation temperature in K\n", + "p1 = 0.128 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "Po = P2/p1 \t\t\t\t#Stagnation pressure in bar\n", + "a1 = 1.687 \t\t\t\t#Ratio of exit area to critical area from isentropic gas tables @M2,k = 1.4\n", + "At = A2/a1 \t\t\t\t#Critical area in mm**2\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/s, P2 in Pa\n", + "C2 = math.sqrt(k*R*T2)*M2 \t\t\t\t#Exit air velocity in m/s\n", + "m = d2*A2*C2*10**-6 \t\t\t\t#Mass flow rate in kg/s, A2 in m**2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Throat area is %3.2f mm**2 \\\n", + "\\nB)Reservoir pressure is %3.4f bar \\\n", + "\\nC)Reservoir temperature is %3.2f K \\\n", + "\\nD)Mass flow rate is %3.4f kg/s'%(At,Po,To,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Throat area is 382.34 mm**2 \n", + "B)Reservoir pressure is 7.8125 bar \n", + "C)Reservoir temperature is 333.33 K \n", + "D)Mass flow rate is 0.6624 kg/s\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.17 page : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 20. \t\t\t\t#Stagnation pressure in kPa\n", + "To = 1000. \t\t\t\t#Stagnation temperature in K\n", + "P2 = 3. \t\t\t\t#exit pressure in bar\n", + "A2 = 100. \t\t\t\t#Exit area in cm**2\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "p1 = P2/Po \t\t\t\t#Pressure ratio\n", + "M2 = 1.9 \t\t\t\t#Exit mach number from gas tables @p1,k = 1.4\n", + "t1 = 0.581 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k = 1.4 \n", + "T2 = To*t1 \t\t\t\t#exit temperature in K\n", + "C2 = M2*math.sqrt(k*R*T2) \t\t\t\t#Exit velocity in m/s\n", + "a1 = 1.555 \t\t\t\t#Ratio of exit area to critical area from isentropic gas tables @M2,k = 1.4\n", + "At = A2/a1 \t\t\t\t#critical area in cm**2\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from gas tables @M = 1\n", + "Pt = Po*p1 \t\t\t\t#critical pressure in bar\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from gas tables @M = 1\n", + "Tt = To*t1 \t\t\t\t#critical temperature in K\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Sound velocity at throat in m/s \n", + "Ct = at \t\t\t\t#Air velocity t throat in m/s, Since M = 1\n", + "dt = (Pt*10**5)/(R*Tt) \t\t\t\t#Density of air at throat in kg/m**3, Pt in Pa\n", + "m = dt*At*10**-4*Ct \t\t\t\t#Mass flow rate in kg/s, At in m**2\n", + "C_max = math.sqrt(2*Cp*To) \t\t\t\t#Maximum possible velocity in m/s\n", + "cr = C2/C_max \t\t\t\t#Ratio of velocities\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At Throat: \\\n", + "\\nArea is %3.2f cm**2 \\\n", + "\\nPressure is %3.2f bar \\\n", + "\\nTemperature is %3i K \\\n", + "\\nB)Exit velocity is %3.4f times C_max in m/s \\\n", + "\\nC)Mass flow rate is %3.2f kg/s'%(At,Pt,Tt,cr,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At Throat: \n", + "Area is 64.31 cm**2 \n", + "Pressure is 10.56 bar \n", + "Temperature is 834 K \n", + "B)Exit velocity is 0.6475 times C_max in m/s \n", + "C)Mass flow rate is 16.42 kg/s\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.18 page : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 7. \t\t\t\t#Stagnation pressure in bar\n", + "To = 100.+273 \t\t\t\t#Stagnation temperature in K\n", + "At = 12. \t\t\t\t#Critical area in cm**2\n", + "A2 = 25.166 \t\t\t\t#Exit area in cm**2\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = A2/At \t\t\t\t#Ratio of areas\n", + "\t\t\t\t#subsonic\n", + "M2 = 0.29 \t\t\t\t#Exit mach number from gas tables @a1,k = 1.4\n", + "p1 = 0.943 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "P2 = Po*p1 \t\t\t\t#exit pressure in bar\n", + "t1 = 0.983 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from gas tables @M2,k = 1.4\n", + "T2 = To*t1 \t\t\t\t#Exit temperature in K\n", + "C2 = M2*math.sqrt(k*R*T2) \t\t\t\t#Exit air velocity in m/s\n", + "\t\t\t\t#supersonic\n", + "M_2 = 2.25 \t\t\t\t#Exit mach number from gas tables @a1,k = 1.4\n", + "p2 = 0.0865 \t\t\t\t#Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k = 1.4\n", + "P_2 = Po*p2 \t\t\t\t#exit pressure in bar\n", + "t2 = 0.497 \t\t\t\t#Ratio of exit temperature to Stagnation temperature from gas tables @M2,k = 1.4\n", + "T_2 = To*t2 \t\t\t\t#Exit temperature in K\n", + "C_2 = M_2*math.sqrt(k*R*T_2) \t\t\t\t#Exit air velocity in m/s\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/s, P2 in Pa\n", + "m = d2*A2*10**-4*C2 \t\t\t\t#Mass flow rate in kg/s, A2 in m**2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Maximum mass flow rate is %3.3f kg/s \\\n", + "\\nB)Subsonic exit condition: \\\n", + "\\nTemperature is %3.3f K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nPressure is %3.3f bar \\\n", + "\\nMach number is %3.2f \\\n", + "\\nSupersonic exit condition: \\\n", + "\\nTemperature is %3.3f K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nPressure is %3.4f bar \\\n", + "\\nMach number is %3.2f'%(m,T2,C2,P2,M2,T_2,C_2,P_2,M_2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Maximum mass flow rate is 1.757 kg/s \n", + "B)Subsonic exit condition: \n", + "Temperature is 366.659 K \n", + "Velocity is 111.31 m/s \n", + "Pressure is 6.601 bar \n", + "Mach number is 0.29 \n", + "Supersonic exit condition: \n", + "Temperature is 185.381 K \n", + "Velocity is 614.07 m/s \n", + "Pressure is 0.6055 bar \n", + "Mach number is 2.25\n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.19 page : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T1 = 335. \t\t\t\t#Inlet temperature in K\n", + "P1 = 655. \t\t\t\t#Inlet pressure in kPa\n", + "C1 = 150. \t\t\t\t#Inlet velocity in m/s\n", + "P2 = 138. \t\t\t\t#Exit pressure in kPa\n", + "T2 = 222. \t\t\t\t#Exit temperature in K\n", + "m = 9. \t\t\t\t#Mass flow rate in kg/s\n", + "Mol = 32. \t\t\t\t#Molar mass of oxygen in kg/mol\n", + "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/kg-k\n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "Cp = 915. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity at inlet in m/s \n", + "M1 = C1/a1 \t\t\t\t#Inlet mach number\n", + "t1 = 0.964 \t\t\t\t#Ratio of inlet temperature to Stagnation temperature from gas tables @M1,k = 1.4\n", + "To1 = T1/t1 \t\t\t\t#Stagnation temperature at inlet in K\n", + "p1 = 0.881 \t\t\t\t#Ratio of inlet pressure to Stagnation pressure at entry from gas tables @M1,k = 1.4 \n", + "Po1 = P1/p1 \t\t\t\t#Stagnation pressure at entry in kPa\n", + "t2 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from gas tables @M = 1\n", + "Tt = To1*t2 \t\t\t\t#critical temperature in K\n", + "C2 = math.sqrt(C1**2+(2*Cp*(T1-T2))) \t\t\t\t#Exit velocity in m/s, \n", + "a2 = math.sqrt(k*R*T2) \t\t\t\t#Sound velocity at exit in m/s \n", + "M2 = C2/a2 \t\t\t\t#Exit mach number \n", + "p2 = 0.208 \t\t\t\t#Ratio of exit pressure to Stagnation pressure at exit from isentropic gas tables @M2,k = 1.4\n", + "Po2 = P2/p2 \t\t\t\t#Stagnation pressure at exit in kPa\n", + "SPC = (Po1-Po2) \t\t\t\t#Change in the stagnation pressure between inlet and exit in kPa\n", + "ds = R*math.log(Po1/Po2) \t\t\t\t#Change in entropy in J/kg-K\n", + "T2s = T1*((P2/P1)**((k-1)/k)) \t\t\t\t#Exit temperature at isentropic state in K\n", + "eff = ((T1-T2)/(T1-T2s))*100 \t\t\t\t#Nozzle efficiency in percent\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Exit mach number is %3.2f \\\n", + "\\nB)Change in the stagnation pressure between inlet and exit is %3.2f kPa \\\n", + "\\nC)Change in entropy is %3.3f J/kg-K \\\n", + "\\nD)Static temperature at throat is %3.1f K \\\n", + "\\nE)Nozzle efficiency is %3.2f percent'%(M2,SPC,ds,Tt,eff)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Exit mach number is 1.69 \n", + "B)Change in the stagnation pressure between inlet and exit is 80.01 kPa \n", + "C)Change in entropy is 29.583 J/kg-K \n", + "D)Static temperature at throat is 289.8 K \n", + "E)Nozzle efficiency is 93.92 percent\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.20 page : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C1 = 200. \t\t\t\t#Inlet velocity in m/s\n", + "Po1 = 400. \t\t\t\t#Stagnation pressure at entry in kPa\n", + "To1 = 500. \t\t\t\t#Stagnation temperature at inlet in K\n", + "C2 = 100. \t\t\t\t#Exit velocity in m/s\n", + "eff = 0.9 \t\t\t\t#Nozzle efficiency \n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "T1 = To1-(C1**2/(2*Cp)) \t\t\t\t#Inlet temperature in K\n", + "t1 = T1/To1 \t\t\t\t#Temperature ratio \n", + "P1 = Po1*t1**(k/(k-1)) \t\t\t\t#Inlet pressure in kPa\n", + "To2s = (eff*(To1-T1))+T1 \t\t\t\t#Exit Stagnation temperature at isentropic state in K\n", + "To2 = To2s \t\t\t\t#Exit Stagnation temperature in K, Since adiabatic \n", + "T2 = To2-(C2**2/(2*Cp)) \t\t\t\t#Exit temperature in K\n", + "t2 = To2s/T1 \t\t\t\t#Temperature ratio \n", + "Po2 = P1*t2**(k/(k-1)) \t\t\t\t#Stagnation pressure at exit in kPa\n", + "t3 = T2/To2 \t\t\t\t#Temperature ratio \n", + "P2 = Po2*t3**(k/(k-1)) \t\t\t\t#Exit pressure in kPa\n", + "Cpr = (P2-P1)/(Po1-P1) \t\t\t\t#Pressure raise coefficient\n", + "ar = (P1*T2*C1)/(P2*T1*C2) \t\t\t\t#Ratio of exit to inlet area\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Pressure raise coefficient is %3.3f \\\n", + "\\nB)Ratio of exit to inlet area is %3.3f'%(Cpr,ar)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Pressure raise coefficient is 0.638 \n", + "B)Ratio of exit to inlet area is 1.871\n" + ] + } + ], + "prompt_number": 44 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.21 page : 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po1 = 4.9 \t\t\t\t#Stagnation pressure at entry in bar\n", + "P2 = 1.4 \t\t\t\t#Exit pressure in bar\n", + "To = 810 \t\t\t\t#Stagnation temperature in K\n", + "m = 1 \t\t\t\t#Mass flow rate in kg/s\n", + "eff = 0.9 \t\t\t\t#Nozzle efficiency \n", + "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to Stagnation temperature from gas tables @M = 1\n", + "Tt = To*t1 \t\t\t\t#critical temperature in K\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Sound velocity at critical state in m/s \n", + "Ct = at \t\t\t\t#Air velocity t throat in m/s, Since M = 1\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure to Stagnation pressure from gas tables @M = 1\n", + "Pt = Po1*p1 \t\t\t\t#critical pressure in bar\n", + "dt = (Pt*10**5)/(R*Tt) \t\t\t\t#Density of air at throat in kg/m**3, Pt in Pa\n", + "At = (m/(dt*Ct))*10**4 \t\t\t\t#Throat area in cm**2 \n", + "p2 = P2/Po1 \t\t\t\t#Pressure ratio\n", + "T2s = To*p2**((k-1)/k) \t\t\t\t#Exit temperature in K (at isentropic state)\n", + "T2 = To-(eff*(To-T2s)) \t\t\t\t#Exit temperature in K\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/m**3, P2 in Pa\n", + "C2 = math.sqrt(2*Cp*(To-T2)) \t\t\t\t#Exit air velocity in m/s\n", + "A2 = (m/(d2*C2))*10**4 \t\t\t\t#Exit area in cm**2\n", + "a2 = math.sqrt(k*R*T2) \t\t\t\t#Sound velocity at exit in m/s \n", + "M2 = C2/a2 \t\t\t\t#Exit mach number\n", + "p3 = 0.332 \t\t\t\t#Static to stagnation pressure ratio at exit from isentropic gas tables @M2,k = 1.4 \n", + "Po2 = P2/p3 \t\t\t\t#stagnation pressure in bar\n", + "TPL = Po1-Po2 \t\t\t\t#Loss in total pressure is %3.3f bar\n", + "ds = R*math.log(Po1/Po2) \t\t\t\t#Increase in entropy in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Throat and exit area are %3.2f cm**2 and %3.3f cm**2 \\\n", + "\\nB)Exit mach number is %3.2f \\\n", + "\\nC)Loss in total pressure is %3.3f bar \\\n", + "\\nD)Increase in entropy is %3.2f kJ/kg-K'%(At,A2,M2,TPL,ds)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Throat and exit area are 14.38 cm**2 and 18.236 cm**2 \n", + "B)Exit mach number is 1.36 \n", + "C)Loss in total pressure is 0.683 bar \n", + "D)Increase in entropy is 43.09 kJ/kg-K\n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.22 page : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 3.5 \t\t\t\t#Stagnation pressure in bar\n", + "To = 425.+273 \t\t\t\t#Stagnation temperature in K\n", + "P2 = 0.97 \t\t\t\t#Exit pressure in bar\n", + "m = 18. \t\t\t\t#Mass flow rate in kg/s\n", + "Kd = 0.99 \t\t\t\t#Coefficient of discharge\n", + "eff = 0.94 \t\t\t\t#Nozzle efficiency \n", + "k = 1.33 \t\t\t\t#Adiabatic Consmath.tant\n", + "Cp = 1110. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K \n", + "\n", + "\t\t\t\t\n", + "#Calculations \n", + "Pt = Po*(2/(k+1))**(k/(k-1)) \t\t\t\t#critical pressure in bar\n", + "Tt = To*(2/(k+1)) \t\t\t\t#critical temperature in K\n", + "R = Cp/(k/(k-1)) \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "m_s = m/Kd \t\t\t\t#Isentropic mass\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Sound velocity at throat in m/s\n", + "Ct = at \t\t\t\t#Air velocity t throat in m/s, Since M = 1\n", + "dt = (Pt*10**5)/(R*Tt) \t\t\t\t#Density of air at throat in kg/m**3, Pt in Pa\n", + "At = (m_s/(dt*Ct))*10**4 \t\t\t\t#Throat area in cm**2 \n", + "p2 = P2/Po \t\t\t\t#Pressure ratio\n", + "T2s = To*p2**(1/(k/(k-1))) \t\t\t\t#Exit temperature in K (at isentropic state)\n", + "T2 = To-(eff*(To-T2s)) \t\t\t\t#Exit temperature in K\n", + "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at exit in kg/m**3, P2 in Pa\n", + "C2 = math.sqrt(2*Cp*(To-T2)) \t\t\t\t#Exit air velocity in m/s\n", + "A2 = (m_s/(d2*C2))*10**4 \t\t\t\t#Exit area in cm**2\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Throat area and Exit area of nozzle are %3.1f cm**2 and %3.1f cm**2'%(At,A2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Throat area and Exit area of nozzle are 338.6 cm**2 and 425.2 cm**2\n" + ] + } + ], + "prompt_number": 49 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch3.ipynb b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch3.ipynb new file mode 100755 index 00000000..8633bde3 --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch3.ipynb @@ -0,0 +1,1421 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:e125bf54ea1a9a80b48556c3a0d9bfe5a0daef9c6dd0d17606321588bbf0db06" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Flow through constant area duct adiabatic flow" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 page : 11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 0.25 \t\t\t\t#Mach number at entrance\n", + "M2 = 1 \t\t\t\t#Mach number at exit\n", + "D = 0.04 \t\t\t\t#inner tude diameter in m\n", + "f = 0.002 \t\t\t\t#frictional factor\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "X1 = 8.537 \t\t\t\t#frictional consmath.tant fanno parameter at entry from gas tables @M1 = 0.25\n", + "X2 = 0 \t\t\t\t#frictional consmath.tant fanno parameter at exit from gas tables @M2 = 1\n", + "X = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter i.e. (4*f*L)/D\n", + "L = (X*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the pipe is %3.3f m'%(L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the pipe is 42.685 m\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 page : 11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 0.1 \t\t\t\t#Mach number at entrance\n", + "M2 = 0.5 \t\t\t\t#Mach number at a section\n", + "M3 = 1 \t\t\t\t#Mach number at critical condition\n", + "D = 0.02 \t\t\t\t#Diameter of duct in m\n", + "f = 0.004 \t\t\t\t#Frictional factor\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "X1 = 66.922 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables @M1 = 0.1\n", + "X2 = 1.069 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables @M2 = 0.5\n", + "X3 = 0 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables @M3 = 1\n", + "X4 = X1-X3 \t\t\t\t#\t\t\t\t#frictional consmath.tant fanno parameter from M2 = 0.1 to M3 = 1\n", + "L1 = (X4*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "X5 = X2-X3 \t\t\t\t#frictional consmath.tant fanno parameter from M2 = 0.5 to M3 = 1\n", + "L2 = (X5*D)/(4*f) \t\t\t\t#Addition length of the pipe required to accelerate into critical condition in m\n", + "L = L1-L2 \t\t\t\t#Length of the pipe required to accelerate the flow from M1 = 0.1 to M2 = 0.5 in m\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)Length of the pipe required to accelerate the flow from M1 = %3.1f to M2 = %3.1f is %3.3f m \\\n", + "\\nB)Additional length required to accelerate into critical condition is %3.5f m'%(M1,M2,L,L2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the pipe required to accelerate the flow from M1 = 0.1 to M2 = 0.5 is 82.316 m \n", + "B)Additional length required to accelerate into critical condition is 1.33625 m\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 page : 12" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D = 0.05 \t\t\t\t#inner pipe diameter in m\n", + "Po = 10 \t\t\t\t#Stagnation Pressure at reservoir in bar\n", + "To = 400 \t\t\t\t#Stagnation temperature at reservoir in K\n", + "f = 0.002 \t\t\t\t#frictional factor \n", + "M1 = 3 \t\t\t\t#Mach number at entrance\n", + "M2 = 1 \t\t\t\t#Mach number at end of pipe\n", + "R = 287 \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "X1 = 0.522 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables @M1 = 3\n", + "X2 = 0 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables @M2 = 1\n", + "X = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L = (X*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "p1 = 0.0272 \t\t\t\t#Pressure ratio from gas tables (M = 3,k = 1.4,isentropiC)\n", + "P1 = p1*Po \t\t\t\t#Static pressure at entrance in bar\n", + "t1 = 0.3571 \t\t\t\t#Temperature ratio from gas tables (M = 3,k = 1.4,isentropic)\n", + "T1 = t1*To \t\t\t\t#Static temperature at entrance in K\n", + "d1 = (P1*10**5)/(R*T1) \t\t\t\t#Density of air in kg/m**3, P1 in Pa\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "C1 = a1*M1 \t\t\t\t#air velocity in m/s\n", + "A1 = (math.pi*D**2)/4 \t\t\t\t#Cross sectional area of pipe in m**2\n", + "m = d1*A1*C1 \t\t\t\t#Mass flow rate in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the pipe is %3.2f m \\\n", + "\\nB)Mass flow rate is %3.4f kg/s'%(L,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the pipe is 3.26 m \n", + "B)Mass flow rate is 0.9363 kg/s\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 page : 13" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C1 = 235. \t\t\t\t#Velocity at entrance in m/s\n", + "P1 = 13. \t\t\t\t#Static Pressure at entry in bar\n", + "P2 = 10. \t\t\t\t#Static Pressure at a point in duct in bar\n", + "T1 = 543. \t\t\t\t#Static temperature at entry in Kelvin\n", + "D = 0.15 \t\t\t\t#inner duct diameter in m\n", + "f = 0.005 \t\t\t\t#frictional factor\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "M1 = C1/a1 \t\t\t\t#Mach number at entry\n", + "p1 = 2.138 \t\t\t\t#Static Pressure ratio from gas tables (fanno flow tables,k = 1.4,M = 0.5)\n", + "Pt = P1/p1 \t\t\t\t#Static critical pressure in bar\n", + "t1 = 1.143 \t\t\t\t#Static temperature ratio from gas tables (fanno flow tables,k = 1.4,M = 0.5) \n", + "Tt = T1/t1 \t\t\t\t#Static critical temperature in K\n", + "c1 = 0.534 \t\t\t\t#Velocity ratio from gas tables (fanno flow tables,k = 1.4,M = 0.5)\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "p2 = 1.644 \t\t\t\t#Pressure ratio from gas tables (fanno flow tables,k = 1.4)\n", + "M2 = 0.64 \t\t\t\t#Mach number from gas tables (fanno flow tables,k = 1.4,p2)\n", + "c2 = 0.674 \t\t\t\t#Velocity ratio from gas tables (fanno flow tables,k = 1.4,p2)\n", + "C2 = Ct*c2 \t\t\t\t#Air velocity at P2 in m/s\n", + "t2 = 1.109 \t\t\t\t#Temperature ratio from gas tables (fanno flow tables,k = 1.4,p2)\n", + "T2 = t2*Tt \t\t\t\t#Satic temperature at P2 is K\n", + "X1 = 1.06922 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables @M1\n", + "X2 = 0.353 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables @M2\n", + "X = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L = (X*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Temperature and velocity at section of the duct where the pressure has dropped to %3i bar \\\n", + "\\ndue to friction are %3.1f K and %3.2f m/s \\\n", + "\\nB)The Distance between two section is %3.3f m'%(P2,T2,C2,L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Temperature and velocity at section of the duct where the pressure has dropped to 10 bar \n", + "due to friction are 526.8 K and 296.61 m/s \n", + "B)The Distance between two section is 5.372 m\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 page : 14" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P1 = 120. \t\t\t\t#Static pressure at entrance in bar\n", + "T1 = 313. \t\t\t\t#Static temperature at entry in Kelvin\n", + "M1 = 2.5 \t\t\t\t#Mach number at entrance\n", + "M2 = 1.8 \t\t\t\t#Mach number at exit\n", + "D = 0.2 \t\t\t\t#inner pipe diameter in m\n", + "f = 0.01/4 \t\t\t\t#frictional factor\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "C1 = a1*M1 \t\t\t\t#air velocity in m/s\n", + "p1 = 0.292 \t\t\t\t#Static Pressure ratio from gas tables (fanno flow tables,k = 1.4,M = 2.5)\n", + "Pt = P1/p1 \t\t\t\t#Static critical pressure in kPa\n", + "t1 = 0.533 \t\t\t\t#Static temperature ratio from gas tables (fanno flow tables,k = 1.4,M = 2.5)\n", + "Tt = T1/t1 \t\t\t\t#Static critical temperature in K\n", + "c1 = 1.826 \t\t\t\t#Velocity ratio from gas tables (fanno flow tables,k = 1.4,M = 2.5)\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "X1 = 0.432 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1 = 3\n", + "X2 = 0 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables @M2 = 1\n", + "X3 = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L1 = (X3*D)/(4*f) \t\t\t\t#Maximum length of the pipe in m\n", + "p2 = 0.474 \t\t\t\t#Static Pressure ratio from gas tables (fanno flow tables,k = 1.4,M = 1.8)\n", + "P2 = Pt*p2 \t\t\t\t#Static pressure in kPa\n", + "t2 = 0.728 \t\t\t\t#static temperature ratio from gas tables (fanno flow tables,k = 1.4,M = 1.8)\n", + "T2 = Tt*t2 \t\t\t\t#Static temperature in K\n", + "c2 = 1.536 \t\t\t\t#Velocity ratio from gas tables (fanno flow tables,k = 1.4,M = 1.8)\n", + "C2 = c2*Ct \t\t\t\t#Critical velocity in m/s\n", + "X4 = 0.242 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M = 1.8\n", + "X5 = X4-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L2 = (X5*D)/(4*f) \t\t\t\t#Length between sonic and oulet section\n", + "L = L1-L2 \t\t\t\t#Length of the pipe in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Maximum length of the pipe is %3.2f m \\\n", + "\\nB)Properties of air at sonic condition: \\\n", + "\\nPressure is %3i kPa \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nVelocity is %3.1f m/s \\\n", + "\\nC)Length of the pipe is %3.1f m \\\n", + "\\nD)Properties of air at M2 = %3.1f: \\\n", + "\\nPressure is %3i kPa \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nVelocity is %3.2f m/s'%(L1,Pt,Tt,Ct,L,M2,P2,T2,C2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Maximum length of the pipe is 8.64 m \n", + "B)Properties of air at sonic condition: \n", + "Pressure is 410 kPa \n", + "Temperature is 587.24 K \n", + "Velocity is 485.5 m/s \n", + "C)Length of the pipe is 3.8 m \n", + "D)Properties of air at M2 = 1.8: \n", + "Pressure is 194 kPa \n", + "Temperature is 427.51 K \n", + "Velocity is 745.77 m/s\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.6 page : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 0.25 \t\t\t\t#Mach number at entrance\n", + "ds = 0.124 \t\t\t\t#Change in entropy in kJ/kg-K\n", + "P1 = 700. \t\t\t\t#Static pressure at entrance in bar\n", + "T1 = 333. \t\t\t\t#Static temperature at entry in Kelvin\n", + "D = 0.05 \t\t\t\t#inner pipe diameter in m\n", + "f = 0.006 \t\t\t\t#frictional factor\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 0.287 \t\t\t\t#Gas consmath.tant in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = math.exp(ds/R) \t\t\t\t#Ratio of Stagnation pressure at inlet to outlet \n", + "t1 = 0.987 \t\t\t\t#Ratio of Static Temperature to Stagnation temperature at entry from gas tables @M1\n", + "To1 = T1/t1 \t\t\t\t#Stagnation temperature at entry in K\n", + "p2 = 0.957 \t\t\t\t#Ratio of Static pressure to Stagnation pressure at entry from gas tables @M1\n", + "Po1 = P1/p2 \t\t\t\t#Stagnation pressure at entry in kPa\n", + "Po2 = Po1/p1 \t\t\t\t#Stagnation pressure at exit in kPa\n", + "a1 = math.sqrt(k*R*10**3*T1) \t\t\t\t#Sound velocity in m/s, R in J/kg\n", + "C1 = a1*M1 \t\t\t\t#air velocity in m/s\n", + "p3 = 4.3615 \t\t\t\t#Static Pressure ratio from gas tables (fanno flow tables,k = 1.4,M = 0.25)\n", + "Pt = P1/p3 \t\t\t\t#Static critical pressure in kPa\n", + "t1 = 1.185 \t\t\t\t#Static temperature ratio from gas tables (fanno flow tables,k = 1.4,M = 0.25)\n", + "Tt = T1/t1 \t\t\t\t#Static critical temperature in K\n", + "c1 = 0.272 \t\t\t\t#Velocity ratio from gas tables (fanno flow tables,k = 1.4,M = 0.25)\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "p4 = 2.4065 \t\t\t\t#Pressure ratio at entry from gas tables @M1,k\n", + "Pot = Po1/p4 \t\t\t\t#Stagnation pressure at critical state in kPa\n", + "X1 = 8.537 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k\n", + "p5 = Po2/Pot \t\t\t\t#Pressure ratio \n", + "M2 = 0.41 \t\t\t\t#Mach number at exit from gas tables @p5\n", + "p6 = 2.629 \t\t\t\t#Pressure ratio at exit from gas tables @p5\n", + "P2 = Pt*p6 \t\t\t\t#Exit pressure in kPa\n", + "t2 = 1.161 \t\t\t\t#Temperature ratio at exit from gas tables @p5\n", + "T2 = Tt*t2 \t\t\t\t#Exit temperature in K\n", + "c2 = 0.4415 \t\t\t\t#Velocity ratio at exit from gas tables @p5\n", + "C2 = Ct*c2 \t\t\t\t#Exit velocity in m/s\n", + "X2 = 2.141 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k\n", + "X3 = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L = (X3*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number at exitsection 2) is %3.2f \\\n", + "\\nB)Properties at exitsection 2): \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nTemperature is %3i K \\\n", + "\\nVelocity is %3.3f m/s \\\n", + "\\nC)Length of the duct is %3.3f m'%(M2,P2,T2,C2,L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number at exitsection 2) is 0.41 \n", + "B)Properties at exitsection 2): \n", + "Pressure is 421.94 kPa \n", + "Temperature is 326 K \n", + "Velocity is 148.432 m/s \n", + "C)Length of the duct is 13.325 m\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.7 page : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 0.25 \t\t\t\t#Initial Mach number \n", + "M2 = 0.75 \t\t\t\t#Final mach number \n", + "P1 = 1.5 \t\t\t\t#Inlet pressure in bar\n", + "T1 = 300. \t\t\t\t#Inlet temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 0.287 \t\t\t\t#Gas consmath.tant in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*10**3*T1) \t\t\t\t#Sound velocity in m/s, R in J/kg\n", + "C1 = a1*M1 \t\t\t\t#air velocity in m/s\n", + "p1 = 4.3615 \t\t\t\t#Pressure ratio at entry from gas tables @M1,k\n", + "Pt = P1/p1 \t\t\t\t#Static critical pressure in kPa\n", + "c1 = 0.272 \t\t\t\t#Velocity ratio from gas tables (fanno flow tables,k = 1.4,M1)\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "p2 = 1.385 \t\t\t\t#Pressure ratio at exit from gas tables @M2,k\n", + "P2 = Pt*p2 \t\t\t\t#Exit pressure in bar\n", + "c2 = 0.779 \t\t\t\t#Velocity ratio at exit from gas tables @M2,k\n", + "C2 = Ct*c2 \t\t\t\t#Exit velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Final pressure and velocity are %3.4f bar and %3.2f m/s'%(P2,C2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure and velocity are 0.4763 bar and 248.58 m/s\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.8 page : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T1 = 333. \t\t\t\t#Inlet temperature in K\n", + "D = 0.05 \t\t\t\t#inner duct diameter in m\n", + "f = 0.005/4 \t\t\t\t#frictional factor\n", + "L = 5. \t\t\t\t#Length of the pipe in m\n", + "Pt = 101. \t\t\t\t#Exit pressure in kPa, Pt = P2 Since flow is choked \n", + "M2 = 1. \t\t\t\t#Mach number at exit math.since pipe is choked \n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 0.287 \t\t\t\t#Gas consmath.tant in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "X = (4*f*L)/D \t\t\t\t#frictional consmath.tant fanno parameter \n", + "M1 = 0.6 \t\t\t\t#Inlet mach number \n", + "t1 = 1.119 \t\t\t\t#Temperature ratio at entry from fanno flow gas tables @M1,k\n", + "Tt = T1/t1 \t\t\t\t#Static critical temperature in K\n", + "at = math.sqrt(k*R*10**3*Tt) \t\t\t\t#Sound velocity in m/s, R in J/kg\n", + "Ct = at \t\t\t\t#air velocity in m/s\n", + "d_t = Pt/(R*Tt) \t\t\t\t#Density at exit in kg/m**3\n", + "At = math.pi*D**2/4 \t\t\t\t#Critical area in m**2\n", + "m = d_t*At*Ct \t\t\t\t#Mass flow rate in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number at inlet is %3.1f \\\n", + "\\nB)Mass flow rate is %3.5f kg/s \\\n", + "\\nC)Exit temperature is %3.3f K'%(M1,m,Tt)\n", + "\n", + "# note : rouding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number at inlet is 0.6 \n", + "B)Mass flow rate is 0.80291 kg/s \n", + "C)Exit temperature is 297.587 K\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.9 page : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "m = 8.25 \t\t\t\t#Mass flow rate in kg/s\n", + "M1 = 0.15 \t\t\t\t#Mach number at entrance\n", + "M2 = 0.5 \t\t\t\t#Mach number at exit\n", + "P1 = 345. \t\t\t\t#Static pressure at entrance in kPa\n", + "T1 = 38.+273 \t\t\t\t#Static temperature at entry in Kelvin\n", + "f = 0.005 \t\t\t\t#frictional factor\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 0.287 \t\t\t\t#Gas consmath.tant in kJ/kg-K\n", + "\n", + "#calculation\n", + "d1 = (P1*10**3)/(R*10**3*T1) \t\t\t\t#Density of air in kg/m**3, P1 in Pa\n", + "a1 = math.sqrt(k*R*10**3*T1) \t\t\t\t#Sound velocity in m/s, R in J/kg\n", + "C1 = a1*M1 \t\t\t\t#air velocity in m/s\n", + "A1 = m/(d1*C1) \t\t\t\t#Inlet area in m**2\n", + "D = (math.sqrt((4*A1)/(math.pi)))*10**3 \t\t\t\t#inner duct diameter in mm\n", + "p1 = 7.3195 \t\t\t\t#Static Pressure ratio from gas tables (fanno flow tables,k = 1.4,M = 0.15)\n", + "Pt = P1/p1 \t\t\t\t#Static critical pressure in kPa\n", + "t1 = 1.1945 \t\t\t\t#Static temperature ratio from gas tables (fanno flow tables,k = 1.4,M = 0.15)\n", + "Tt = T1/t1 \t\t\t\t#Static critical temperature in K\n", + "c1 = 0.164 \t\t\t\t#Velocity ratio from gas tables (fanno flow tables,k = 1.4,M = 0.15)\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "p2 = 0.984 \t\t\t\t#Pressure ratio at entry from gas tables (fanno flow tables,k = 1.4,M = 0.15)\n", + "Po1 = P1/p2 \t\t\t\t#Stagnation pressure at entry in kPa\n", + "p3 = 3.928 \t\t\t\t#Stagnation pressure ratio at entry from gas tables (fanno flow tables,k = 1.4,M = 0.15)\n", + "Pot = Po1/p3 \t\t\t\t#Stagnation pressure at critical state in kPa\n", + "X1 = 28.354 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k\n", + "p5 = 2.138 \t\t\t\t#Pressure ratio at exit from gas tables (fanno flow tables,k = 1.4,M2)\n", + "P2 = Pt*p5 \t\t\t\t#Exit pressure in kPa\n", + "t2 = 1.143 \t\t\t\t#Temperature ratio at exit from gas tables (fanno flow tables,k = 1.4,M2)\n", + "T2 = Tt*t2 \t\t\t\t#Exit temperature in K\n", + "c2 = 0.534 \t\t\t\t#Velocity ratio at exit from gas tables (fanno flow tables,k = 1.4,M2) \n", + "C2 = Ct*c2 \t\t\t\t#Exit velocity in m/s\n", + "p6 = 1.34 \t\t\t\t#Stagnation pressure ratio at exit from gas tables (fanno flow tables,k = 1.4,M2)\n", + "Po2 = Pot*p6 \t\t\t\t#Stagnation pressure at exit in kPa\n", + "SPL = Po1-Po2 \t\t\t\t#Stagnation Pressure lose in kPa\n", + "X2 = 1.069 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k\n", + "X3 = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L = (X3*D*10**-3)/(4*f) \t\t\t\t#Length of the duct in m\n", + "\n", + "\t\t\t\t#verification\n", + "a2 = math.sqrt(k*R*10**3*T2) \t\t\t\t#Sound velocity in m/s, R in J/kg\n", + "M2_v = C2/a2 \t\t\t\t#air velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the duct is %3.2f m \\\n", + "\\nB)Diameter of the duct is %3i mm \\\n", + "\\nC)Pressure and diameter at exit are %3.2f kPa, and %3i mm respectively \\\n", + "\\nD)Stagnation Pressure lose is %3i kPa \\\n", + "\\nE)using exit velocity %3.2f m/s, \\\n", + "\\ntemperature %3.2f K \\\n", + "\\nMach number is found to be %3.2f'%(L,D,P2,D,SPL,C2,T2,M2_v)\n", + "\n", + "# note : rouding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the duct is 308.85 m \n", + "B)Diameter of the duct is 226 mm \n", + "C)Pressure and diameter at exit are 100.77 kPa, and 226 mm respectively \n", + "D)Stagnation Pressure lose is 231 kPa \n", + "E)using exit velocity 172.65 m/s, \n", + "temperature 297.59 K \n", + "Mach number is found to be 0.50\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.10 page : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 0.25 \t\t\t\t#Mach number at entrance\n", + "f = 0.01/4 \t\t\t\t#frictional factor\n", + "D = 0.15 \t\t\t\t#inner pipe diameter in m\n", + "p1 = 0.8 \t\t\t\t#Stagnation pressure ratio at exit to entry when loss in stagnation pressure is 20%\n", + "M3 = 0.8 \t\t\t\t#Mach number at a section\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p2 = 2.4065 \t\t\t\t#Ratio of Stagnation pressure at entry from gas tables @M1,k = 1.4\n", + "X1 = 8.537 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1\n", + "p3 = p1*p2 \t\t\t\t#Ratio of Stagnation pressure at exit\n", + "M2 = 0.32 \t\t\t\t#Exit mach number at p1 = 0.8\n", + "X2 = 4.447 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2\n", + "L1 = (X1*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "L2 = (X2*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "L = L1-L2 \t\t\t\t#Overall length of the duct in m\n", + "p4 = 1.038 \t\t\t\t#Stagnation pressure ratio from M = 1 to M3\n", + "PL = (1-(p4/p2))*100 \t\t\t\t#Percentage of stagnation pressure from inlet to section at which M3 in percent\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the pipe is %3.2f m \\\n", + "\\nB)Mach number at this exit is %3.2f \\\n", + "\\nC)Percentage of stagnation pressure from inlet to section at which M = %3.1f is %3.2f percent \\\n", + "\\nD)Maximum length to reach choking condition is %3.3f m'%(L,M2,M3,PL,L1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the pipe is 61.35 m \n", + "B)Mach number at this exit is 0.32 \n", + "C)Percentage of stagnation pressure from inlet to section at which M = 0.8 is 56.87 percent \n", + "D)Maximum length to reach choking condition is 128.055 m\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.11 page : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D = 0.3 \t\t\t\t#inner duct diameter in m\n", + "P1 = 10. \t\t\t\t#Static pressure at entrance in bar\n", + "T1 = 400. \t\t\t\t#Static temperature at entry in Kelvin\n", + "M1 = 3. \t\t\t\t#Mach number at entrance\n", + "M2 = 1. \t\t\t\t#Mach number at exit\n", + "k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Specific Gas consmath.tant in J/kg-K, wrong printing in question\n", + "f = 0.002 \t\t\t\t#frictional factor\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 0.233 \t\t\t\t#Pressure ratio from gas tables (M = 3,k = 1.4,isentropic)\n", + "Pt = P1/p1 \t\t\t\t#Static pressure at entrance in bar\n", + "t1 = 0.489 \t\t\t\t#Temperature ratio from gas tables (M = 3,k = 1.4,isentropic)\n", + "Tt = T1/t1 \t\t\t\t#Static temperature at entrance in K\n", + "X1 = 0.628 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.3\n", + "L1 = (X1*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "d_t = (Pt*10**5)/(R*Tt) \t\t\t\t#Density at critical state in kg/m**3, Pt in Pa\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Sound velocity in m/s, R in J/kg \n", + "Ct = at \t\t\t\t#air velocity in m/s\n", + "At = (math.pi*D**2)/4 \t\t\t\t#Critical area in m**2\n", + "m = d_t*At*Ct \t\t\t\t#Mass flow rate in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the pipe is %3.2f m \\\n", + "\\nB)Mass flow rate is %3.3f kg/s'%(L1,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the pipe is 23.55 m \n", + "B)Mass flow rate is 713.891 kg/s\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.12 page : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 0.25 \t\t\t\t#Mach number at entrance\n", + "f = 0.04/4 \t\t\t\t#frictional factor\n", + "D = 0.15 \t\t\t\t#inner duct diameter in m\n", + "p1 = 0.9 \t\t\t\t#Stagnation pressure ratio at exit to entry when loss in stagnation pressure is 10%\n", + "ds = 190 \t\t\t\t#/Change in entropy in J/kg-K\n", + "k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287 \t\t\t\t#Specific Gas consmath.tant in J/kg-K, wrong printing in question\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p2 = 2.4064 \t\t\t\t#Ratio of stagnation pressures at inlet to critical state from gas tables fanno flow tables @M1,k = 1.3\n", + "X1 = 8.537 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.3\n", + "p3 = p1*p2 \t\t\t\t#Ratio of stagnation pressures at exit to critical state from gas tables fanno flow tables @M1,k = 1.3\n", + "M2 = 0.28 \t\t\t\t#Mach number at p1 = 0.9 from gas tables @p3\n", + "X2 = 6.357 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k = 1.3\n", + "X3 = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L1 = (X3*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "p4 = math.exp(ds/R) \t\t\t\t#Ratio of Stagnation pressure at entry to Stagnation pressure where ds = 190 \n", + "p5 = p1/p4 \t\t\t\t#Ratio of Stagnation pressures where ds = 190 to critical state\n", + "M3 = 0.56 \t\t\t\t#Mach number where ds = 190\n", + "X4 = 0.674 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M3,k = 1.3\n", + "X5 = X1-X4 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L2 = (X5*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the pipe is %3.3f m \\\n", + "\\nB)Length of the pipe would require to rise entropy by %3i J/kg-K is %3.5f m \\\n", + "\\nC)Mach number is %3.2f'%(L1,ds,L2,M3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the pipe is 8.175 m \n", + "B)Length of the pipe would require to rise entropy by 190 J/kg-K is 29.48625 m \n", + "C)Mach number is 0.56\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.13 page : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po1 = 200. \t\t\t\t#Stagantion pressure at inlet in kPa\n", + "To1 = 303. \t\t\t\t#Stagnation temperature at inlet in K\n", + "M1 = 0.2 \t\t\t\t#Inlet Mach number from diagram\n", + "D = 0.025 \t\t\t\t#inner tude diameter in m(mismath.sing data)\n", + "M2 = 0.8 \t\t\t\t#Outlet Mach number \n", + "f = 0.005/4 \t\t\t\t#frictional factor\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.992 \t\t\t\t#Static to Stagnation temperature ratio at entry from gas tables (M1,k = 1.4,isentropic)\n", + "T1 = To1*t1 \t\t\t\t#Static temperature in K\n", + "p1 = 0.973 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables (M1,k = 1.4,isentropic)\n", + "P1 = Po1*p1 \t\t\t\t#Static pressure in kPa\n", + "p2 = 2.964 \t\t\t\t#Stagnation pressure ratio at inlet to critical state from gas tables (M1,k = 1.4,fanno flow)\n", + "Pot = Po1/p2 \t\t\t\t#Stagnation pressure at critical state in kPa\n", + "X1 = 14.533 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "p3 = 1.038 \t\t\t\t#Stagnation pressure ratio at outlet to critical state from gas tables (M1,k = 1.4,fanno flow)\n", + "Po2 = Pot*p3 \t\t\t\t#Stagnation pressure at exit in kPa\n", + "X2 = 0.073 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k = 1.4\n", + "X3 = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L1 = (X3*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "SPL = (1-(p3/p2))*100 \t\t\t\t#Percentage decrease in stagnation pressure in percent\n", + "ds = R*math.log(Po1/Po2) \t\t\t\t#Change of entropy in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the pipe is %3.1f m \\\n", + "\\nB)Percentage decrease in stagnation pressure is %3.2f percent \\\n", + "\\nC)Change of entropy is %3.3f kJ/kg-K'%(L1,SPL,ds)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the pipe is 72.3 m \n", + "B)Percentage decrease in stagnation pressure is 64.98 percent \n", + "C)Change of entropy is 301.133 kJ/kg-K\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.14 page : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D1 = 0.03 \t\t\t\t#Inlet duct diameter in m\n", + "D2 = 0.015 \t\t\t\t#Throat diameter of duct in m \n", + "Po1 = 750. \t\t\t\t#Stagantion pressure at inlet in kPa\n", + "To1 = 450. \t\t\t\t#Stagnation temperature at inlet in K\n", + "f = 0.02/4 \t\t\t\t#frictional factor\n", + "L = 0.25 \t\t\t\t#Length of the duct in m\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ar = (D1/D2)**2 \t\t\t\t#Ratio of areas\n", + "M1 = 2.94 \t\t\t\t#Mach number at inlet from gas tables (ar,k = 1.4,isentropic)\n", + "p1 = 0.0298 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables (M1,k = 1.4,isentropic)\n", + "P1 = Po1*p1 \t\t\t\t#Static pressure at inlet in kPa\n", + "t1 = 0.367 \t\t\t\t#Static to Stagnation temperature ratio at entry from gas tables (M1,k = 1.4,isentropic)\n", + "T1 = To1*t1 \t\t\t\t#Static temperature at inlet in K\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "C1 = a1*M1 \t\t\t\t#Air velocity at inlet in m/s\n", + "X1 = 0.513 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "p2 = 0.226 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Pt = P1/p2 \t\t\t\t#Critical pressure in kPa\n", + "c1 = 1.949 \t\t\t\t#Static to Critical velocity ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "t2 = 0.439 \t\t\t\t#Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Tt = T1/t2 \t\t\t\t#Critical temperature in K\n", + "L1 = (X1*D1)/(4*f) \t\t\t\t#Length of the pipe from inlet to critical state in m\n", + "L2 = L1-L \t\t\t\t#Length of the pipe from required point to critical state in m\n", + "X2 = (4*f*L2)/D2 \t\t\t\t#frictional consmath.tant fanno parameter\n", + "M2 = 2.14 \t\t\t\t#Mach number at inlet from gas tables (X2,k = 1.4,fanno flow)\n", + "p3 = 0.369 \t\t\t\t#Static to Critical pressure ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "P2 = Pt*p3 \t\t\t\t#Exit pressure in kPa\n", + "c2 = 1.694 \t\t\t\t#Static to Critical velocity ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "C2 = Ct*c2 \t\t\t\t#Exit velocity in m/s\n", + "t3 = 0.623 \t\t\t\t#Static to Critical temperature ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "T2 = t3*Tt \t\t\t\t#Exit temperature in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Maximum length of the pipe is %3.4f m \\\n", + "\\nB)Condition of air at exit: \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nTemperature is %3.2f K'%(L1,P2,C2,T2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Maximum length of the pipe is 0.7695 m \n", + "B)Condition of air at exit: \n", + "Pressure is 36.49 kPa \n", + "Velocity is 658.25 m/s \n", + "Temperature is 234.37 K\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.15 page : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "f = 0.002 \t\t\t\t#frictional factor\n", + "C1 = 130. \t\t\t\t#Air velocity at inlet in m/s\n", + "T1 = 400. \t\t\t\t#Inlet temperature at inlet in K\n", + "P1 = 250. \t\t\t\t#Inlet pressure at inlet in kPa\n", + "D = 0.16 \t\t\t\t#Inlet duct diameter in m\n", + "p1 = 0.8 \t\t\t\t#Stagnation pressure ratio at exit to entry when loss in stagnation pressure is 20%\n", + "L1 = 35. \t\t\t\t#Length of duct from inlet to required section\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "M1 = C1/a1 \t\t\t\t#Mach number at inlet\n", + "p2 = 0.9295 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables (M1,k = 1.4,isentropic)\n", + "Po1 = P1/p2 \t\t\t\t#Stagantion pressure at inlet in kPa\n", + "Po2 = 0.8*Po1 \t\t\t\t#Stagantion pressure at outlet in kPa\n", + "p3 = 1.89725 \t\t\t\t#Stagnation pressure ratio at inlet to critical state from gas tables (M1,k = 1.4,fanno flow)\n", + "Pot = Po1/p3 \t\t\t\t#Stagnation pressure at critical state in kPa\n", + "X1 = 4.273 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "p4 = 3.33725 \t\t\t\t#Static Pressure ratio from gas tables (fanno flow tables,k = 1.4,M = 0.5)\n", + "Pt = P1/p4 \t\t\t\t#Static critical pressure in kPa\n", + "t1 = 1.175 \t\t\t\t#Static temperature ratio from gas tables (fanno flow tables,k = 1.4,M = 0.5) \n", + "Tt = T1/t1 \t\t\t\t#Static critical temperature in K\n", + "c1 = 0.347 \t\t\t\t#Velocity ratio from gas tables (fanno flow tables,k = 1.4,M = 0.5)\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "p5 = Po2/Pot \t\t\t\t#Pressure ratio\n", + "M2 = 0.43 \t\t\t\t#Mach number at p1 = 0.8\n", + "X2 = 1.833 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k = 1.4\n", + "X3 = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L2 = (X3*D)/(4*f) \t\t\t\t#Length of the pipe in m, (from required section to critical state) \n", + "L3 = (X1*D)/(4*f) \t\t\t\t#Length of the pipe in m, (from required inlet to critical state) \n", + "L4 = L3-L1 \t\t\t\t#Length of the pipe in m\n", + "X4 = (4*f*L3)/D \t\t\t\t#frictional consmath.tant fanno parameter\n", + "M3 = 0.39 \t\t\t\t#Mach number at L1 = 35m\n", + "p6 = 2.767 \t\t\t\t#Static to Critical pressure ratio at outlet from gas tables,fanno flow tables @M3,k = 1.4\n", + "P2 = Pt*p6 \t\t\t\t#Exit pressure in kPa\n", + "t2 = 1.1645 \t\t\t\t#Static to Critical temperature ratio at outlet from gas tables,fanno flow tables @M3,k = 1.4\n", + "T2 = Tt*t2 \t\t\t\t#Exit temperature in K\n", + "c2 = 0.42087 \t\t\t\t#Static to Critical velocity ratio at outlet from gas tables,fanno flow tables @M3,k = 1.4\n", + "C2 = Ct*c2 \t\t\t\t#Exit velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of pipe required for p = %3.1f m is %3.3f m \\\n", + "\\nB)Properties of air at section %3i from inlet: \\\n", + "\\nTemperature is %3.3f K \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nVelocity is %3.1f m/s \\\n", + "\\nC)Maximum length of the pipe is %3.2f m'%(p1,L2,L1,T2,P2,C2,L3)\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of pipe required for p = 0.8 m is 48.800 m \n", + "B)Properties of air at section 35 from inlet: \n", + "Temperature is 396.426 K \n", + "Pressure is 207.28 kPa \n", + "Velocity is 157.7 m/s \n", + "C)Maximum length of the pipe is 85.46 m\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.16 page : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D = 0.3 \t\t\t\t#inner pipe diameter in m\n", + "Q = 1000. \t\t\t\t#Discharge in m**3/min\n", + "P2 = 150. \t\t\t\t#Exit pressure in kPa\n", + "T2 = 293. \t\t\t\t#Exit temperature in K\n", + "L1 = 50. \t\t\t\t#Length of the pipe in m\n", + "f = 0.005 \t\t\t\t#frictional factor\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "A = math.pi*D**2/4 \t\t\t\t#Area of duct in m**2 \n", + "C2 = Q/(A*60) \t\t\t\t#Exit air velocity in m/s\n", + "a2 = math.sqrt(k*R*T2) \t\t\t\t#Sound velocity in m/s\n", + "M2 = C2/a2 \t\t\t\t#Exit mach number \n", + "p1 = 1.54 \t\t\t\t#\t\t\t\t#Static to Critical pressure ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "Pt = P2/p1 \t\t\t\t#Critical pressure in kPa\n", + "t1 = 1.10 \t\t\t\t#Static to Critical temperature ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "Tt = T2/t1 \t\t\t\t#Critical temperature in K\n", + "X1 = 0.228 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k = 1.4\n", + "L2 = (X1*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "L2 = L1+L2 \t\t\t\t#Overall length of pipe from inlet to critical state in m\n", + "X2 = (4*f*L2)/D \t\t\t\t#frictional consmath.tant fanno parameter for M1\n", + "M1 = 0.345 \t\t\t\t#Inlet Mach number from gas tables fanno flow tables @X2,k = 1.4\n", + "p2 = 3.14 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "P1 = Pt*p2 \t\t\t\t#Static pressure at inlet in kPa\n", + "t2 = 1.17 \t\t\t\t#Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "T1 = Tt*t2 \t\t\t\t#Static temperature at inlet in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number at the exit is %3.3f \\\n", + "\\nB)Inlet pressure and temperature are %3.3f kPa and %3.2f K'%(M2,P1,T1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number at the exit is 0.687 \n", + "B)Inlet pressure and temperature are 305.844 kPa and 311.65 K\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.17 page : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D = 0.0254 \t\t\t\t#inner pipe diameter in m\n", + "f = 0.003 \t\t\t\t#frictional factor\n", + "M1 = 2.5 \t\t\t\t#Inlet Mach number \n", + "To1 = 310. \t\t\t\t#Stagnation temperature at inlet in K\n", + "P1 = 0.507 \t\t\t\t#Static pressure at inlet in kPa\n", + "M2 = 1.2 \t\t\t\t#Exit mach number \n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.4444 \t\t\t\t#Static to Stagnation temperature ratio at entry from gas tables (M1,k = 1.4,isentropic)\n", + "T1 = To1*t1 \t\t\t\t#Static temperature at inlet in K\n", + "p1 = 0.05853 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables (M1,k = 1.4,isentropic)\n", + "Po1 = P1/p1 \t\t\t\t#Stagantion pressure at inlet in kPa\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity at inlet in m/s, R in J/kg\n", + "C1 = a1*M1 \t\t\t\t#air velocity at inlet in m/s\n", + "c1 = 2.95804 \t\t\t\t#Static to Critical velocity ratio at inlet from gas tables,isothermal tables @M1,k = 1.4\n", + "Ctt = C1/c1 \t\t\t\t#Critical velocity at isothermal state in m/s\n", + "p2 = 0.33806 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,isothermal @M1,k = 1.4\n", + "Ptt = P1/p2 \t\t\t\t#Critical pressure at isothermal state in bar\n", + "p3 = 3.61691 \t\t\t\t#Stagnation pressure ratio at inlet to isothermal state from gas tables,isothermal tables @M1,k = 1.4\n", + "Pott = Po1/p3 \t\t\t\t#Critical pressure at isothermal state in K\n", + "t2 = 1.968748 \t\t\t\t#Stagnation temperature ratio at inlet to isothermal state from gas tables,isothermal tables @M1,k = 1.4\n", + "Tott = To1/t2 \t\t\t\t#Critical temperature at isothermal state in K\n", + "X1 = 1.28334 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "c2 = 1.4186 \t\t\t\t#Static to Critical velocity ratio at exit from gas tables,isothermal tables @M2,k = 1.4\n", + "C2 = Ctt*c2 \t\t\t\t#Exit velocity in m/s\n", + "p4 = 0.7043 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,isothermal @M2,k = 1.4\n", + "P2 = Ptt*p4 \t\t\t\t#Exit pressure in bar\n", + "p5 = 1.07026 \t\t\t\t#Stagnation pressure ratio at inlet to isothermal state from gas tables,isothermal tables @M2,k = 1.4\n", + "Po2 = Pott*p5 \t\t\t\t#Stagnation pressure at exit in bar \n", + "t3 = 1.127 \t\t\t\t#Stagnation temperature ratio at inlet to isothermal state from gas tables,isothermal tables @M2,k = 1.4\n", + "To2 = Tott*t3 \t\t\t\t#Stagnation temperature at exit in bar\n", + "T2 = T1 \t\t\t\t#Exit temperature in K, Since isothermal flow\n", + "X2 = 0.19715 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k = 1.4\n", + "X3 = X1-X2 \t\t\t\t#Overall frictional consmath.tant fanno parameter\n", + "L1 = (X3*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "d1 = (P1*10**5)/(R*T1) \t\t\t\t#Density of air in kg/m**3, P1 in Pa\n", + "A1 = (math.pi*D**2)/4 \t\t\t\t#Cross sectional area of pipe in m**2\n", + "m = d1*A1*C1 \t\t\t\t#Mass flow rate in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'At M = %3.1f : A)Static pressure and static temperature are %3.5f bar and %3.3f K respectively \\\n", + "\\nB)Stagnation pressure and temperature are %3.4f bar and %3.3f K respectively \\\n", + "\\nC)Velocity of air is %3.3f m/s \\\n", + "\\nD)Distance of the section from innlet is %3.3f m \\\n", + "\\nE)Mass flow rate is %3.5f kg/s'%(M2,P2,T2,Po2,To2,C2,L1,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "At M = 1.2 : A)Static pressure and static temperature are 1.05626 bar and 137.764 K respectively \n", + "B)Stagnation pressure and temperature are 2.5632 bar and 177.458 K respectively \n", + "C)Velocity of air is 282.078 m/s \n", + "D)Distance of the section from innlet is 2.299 m \n", + "E)Mass flow rate is 0.38217 kg/s\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.18 page : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D = 0.12 \t\t\t\t#inner duct diameter in m\n", + "f = 0.004 \t\t\t\t#frictional factor\n", + "M1 = 0.4 \t\t\t\t#Inlet Mach number \n", + "P1 = 300. \t\t\t\t#Static pressure at inlet in kPa\n", + "T1 = 310. \t\t\t\t#Static temperature at inlet in K\n", + "M2 = 0.6 \t\t\t\t#Exit mach number\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 2.118 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Pt = P1/p1 \t\t\t\t#Critical pressure in kPa\n", + "X1 = 1.968 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "p2 = 1.408 \t\t\t\t#Static to Critical pressure ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "P2 = Pt*p2 \t\t\t\t#Exit pressure in kPa\n", + "X2 = 0.299 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k = 1.4\n", + "X3 = X1-X2 \t\t\t\t#Overall frictional consmath.tant fanno parameter\n", + "L1 = (X3*D)/(4*f) \t\t\t\t#Length of the pipe in m\n", + "T2 = T1 \t\t\t\t#Exit temperature in K, Since isothermal flow\n", + "Ttt = T1 \t\t\t\t#Critical temperature at critical state, Since isothermal flow \n", + "Mtt = 1/math.sqrt(k) \t\t\t\t#Limiting Mach number\n", + "L2 = (X1*D)/(4*f) \t\t\t\t#Length of the duct required to attain limiting mach number in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the duct required to chnage the mach number to %3.1f is %3.4f m \\\n", + "\\nB)Pressure and temperature at M = %3.1f is %.f kPa and %3i K respectively \\\n", + "\\nC)Length of the duct required to attain limiting mach number is %3.3f m \\\n", + "\\nD)State of air at limiting mach number %3.3f is subsonic'%(M2,L1,M2,P2,T2,L2,Mtt)\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the duct required to chnage the mach number to 0.6 is 12.5175 m \n", + "B)Pressure and temperature at M = 0.6 is 199 kPa and 310 K respectively \n", + "C)Length of the duct required to attain limiting mach number is 14.760 m \n", + "D)State of air at limiting mach number 0.845 is subsonic\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.19 page : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import roots\n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "m = 0.32 \t\t\t\t#Mass flow rate in kg/s\n", + "L = 140. \t\t\t\t#Length of the pipe in m\n", + "P1 = 800. \t\t\t\t#Inlet pressure in N/m**2, wrong units in textbook\n", + "T1 = 288. \t\t\t\t#Inlet temperature in K\n", + "P2 = 600. \t\t\t\t#Outlet pressure in N/m**2, wrong units in textbook\n", + "f = 0.006 \t\t\t\t#frictional factor\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "\t\t\t\t#Umath.sing Adiabatic Equation d = 1/((((((math.pi*(d/2)**2)**2)/(2*m**2*R*T))*(P1**2-P2**2))-(math.log(P1/P2)))/(2*f*L)) and converting into 5th degree polynomial of d\n", + "a = (math.pi**2*(P1**2-P2**2))/(32*m**2*R*T1) \t\t\t\t#Coefficient of power 5\n", + "b = math.log(P1/P2) \t\t\t\t#Coefficient of power 1\n", + "c = 2*f*L \t\t\t\t#Coefficient of consmath.tant\n", + "#p5 = poly([-c -b 0 0 0 a],'d','coeff') \t\t\t\t#Solving polynomial of degree 5\n", + "d = roots([a,0,0,0,-b, -c]) \t\t\t\t#Command to find roots\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print (\"Possible values for diameter of pipe are:\") \t\t\t\t#Displays whatever within paranthesis \n", + "print (d) \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#To print lay roots\n", + "print 'Therefore Diameter of the pipe is : %.1f m'%d[0].real\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Possible values for diameter of pipe are:\n", + "[ 0.71338855+0.j 0.20228465+0.67301992j 0.20228465-0.67301992j\n", + " -0.55897893+0.39355091j -0.55897893-0.39355091j]\n", + "Therefore Diameter of the pipe is : 0.7 m\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.20 page: 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Q = 225./60 \t\t\t\t#Discharge in m**3/s\n", + "T2 = 293. \t\t\t\t#Exit temperature in K\n", + "P2 = 1.25 \t\t\t\t#Exit pressure in bar\n", + "L1 = 30. \t\t\t\t#Length of the pipe in m\n", + "D = 0.15 \t\t\t\t#Duct diameter in m\n", + "f = 0.02/4 \t\t\t\t#frictional factor\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "A = math.pi*D**2/4 \t\t\t\t#area in m**2\n", + "C2 = Q/A \t\t\t\t#Exit air velocity in m/s\n", + "a2 = math.sqrt(k*R*T2) \t\t\t\t#Exit sound velocity in m/s \n", + "M2 = C2/a2 \t\t\t\t#Exit mach number \n", + "p1 = 1.703 \t\t\t\t#Static to Critical pressure ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "Pt = P2/p1 \t\t\t\t#Critical pressure in bar\n", + "c1 = 0.654 \t\t\t\t#Static to Critical velocity ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "Ct = C2/c1 \t\t\t\t#Critical velocity in m/s\n", + "t1 = 1.114 \t\t\t\t#Static to Critical temperature ratio at outlet from gas tables,fanno flow tables @M2,k = 1.4\n", + "Tt = T2/t1 \t\t\t\t#Critical temperature in K\n", + "X1 = 0.417 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "X2 = (4*f*L1)/D \t\t\t\t#frictional consmath.tant fanno parameter\n", + "X3 = X1+X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "M1 = 0.32 \t\t\t\t#Mach number at entrance\n", + "p2 = 3.385 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "P1 = Pt*p2 \t\t\t\t#Static pressure at inlet in bar\n", + "c2 = 0.347 \t\t\t\t#Static to Critical velocity ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "C1 = Ct*c2 \t\t\t\t#Air velocity at inlet in m/s\n", + "t2 = 1.176 \t\t\t\t#Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "T1 = Tt*t2 \t\t\t\t#Static temperature at inlet in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Required Inlet Condition: \\\n", + "\\nPressure is %3.4f bar \\\n", + "\\nVelocity is %3.3f m/s \\\n", + "\\nTemperature is %3.1f K'%(P1,C1,T1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required Inlet Condition: \n", + "Pressure is 2.4846 bar \n", + "Velocity is 112.593 m/s \n", + "Temperature is 309.3 K\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.21 page : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D1 = 0.134 \t\t\t\t#Inlet duct diameter in m\n", + "Po1 = 7 \t\t\t\t#Stagnation pressure at inlet in bar\n", + "P1 = 0.245 \t\t\t\t#Static pressure at 5*D1 i.e. L1 in bar\n", + "P2 = 0.5 \t\t\t\t#Static pressure at 33*D1 i.e. L2 in bar\n", + "D2 = 0.0646 \t\t\t\t#throat diameter in m \n", + "L1 = 5*D1 \t\t\t\t#Length of nozzle till section-1 in m\n", + "L2 = 33*D1 \t\t\t\t#Length of nozzle till section-2 in m \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ar = (D1/D2)**2 \t\t\t\t#Ratio of areas\n", + "p1 = P1/Po1 \t\t\t\t#Pressure ratio\n", + "APR1 = p1*ar \t\t\t\t#Area Pressure ratio i.e. (A1*P1)/(At*Po1)\n", + "M1 = 2.54 \t\t\t\t#Mach number at inlet from isentropic gas tables @APR1 \n", + "X1 = 0.44 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "APR2 = 0.3073 \t\t\t\t#Area Pressure ratio i.e. (A2*P2)/(At*Po1)\n", + "M2 = 1.54 \t\t\t\t#Exit mach number\n", + "X2 = 0.151 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k = 1.4\n", + "X3 = X1-X2 \t\t\t\t#overall frictional consmath.tant fanno parameter\n", + "L3 = L2-L1 \t\t\t\t#Length of the nozzle (Section-1 to Section-2) in m \n", + "f = (X3*D1)/(4*L3) \t\t\t\t#frictional factor\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number at %3.3f m and %3.3f m are %3.2f and %3.2f respectively \\\n", + "\\nB)Mean value of friction between two sections is %3.5f'%(L1,L2,M1,M2,f)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number at 0.670 m and 4.422 m are 2.54 and 1.54 respectively \n", + "B)Mean value of friction between two sections is 0.00258\n" + ] + } + ], + "prompt_number": 44 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch4.ipynb b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch4.ipynb new file mode 100755 index 00000000..ec750ed0 --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch4.ipynb @@ -0,0 +1,912 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3dc843b6fccc3bd8da777a50fc56121df05dd48df905590c5824b3d32e8ee94a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : Flow through constant area ducts rayleigh flow" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 page : 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Pa = 1*10**5 \t\t\t\t#Pressure of dry air in Pa\n", + "To1 = 288 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "M1 = 1 \t\t\t\t#Mach number at inlet of pipe\n", + "M2 = 0.8 \t\t\t\t#Mach number at exit o pipe\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K \n", + " \n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.834 \t\t\t\t#Temperature ratio at entry, i.e.entry static temperature to total temperature from gas tables at isentropic,M1 = 1 & adiabatic consmath.tant = 1.4\n", + "T1 = t1*To1 \t\t\t\t#Static temperature at entry in Kelvin\n", + "t2 = 0.964 \t\t\t\t#Temperature ratio at critical state, i.e. exit stagnation temperature to critical state temperature from gas tables at Rayleigh, M2 = 0.8 & adiabatic consmath.tant = 1.4\n", + "To2 = t2*To1 \t\t\t\t#Total stagnation temperature at exit in K\n", + "t3 = 1.025 \t\t\t\t#Temperature ratio at exit, i.e. exit static temperature to total temperature from gas tables at isentropic,M1 = 1 & adiabatic consmath.tant = 1.4\n", + "T2 = t3*T1 \t\t\t\t#Static temperature at exit in Kelvin\n", + "q = Cp*(To1-To2) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "dT = To1-T2 \t\t\t\t#Change in temperature in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)The heat transferred per unit mass flow is %3.3f kJ/kg rejected \\\n", + "\\nB)Change in temperature is %3.3f K'%(q,dT)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)The heat transferred per unit mass flow is 10.420 kJ/kg rejected \n", + "B)Change in temperature is 41.803 K\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 page : 10" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 3. \t\t\t\t#Mach number at entry\n", + "P1 = 1. \t\t\t\t#Static Pressure at entry in atm\n", + "T1 = 300. \t\t\t\t#Static Temperature at entry in K\n", + "q = 300. \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 2.8 \t\t\t\t#Temperature ratio at entry from gas tables (M = 3,k = 1.4,isentropinC)\n", + "To1 = t1*T1 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "p1 = 0.0272 \t\t\t\t#Pressure ratio at entry from gas tables (M = 3,k = 1.4,isentropiC)\n", + "Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in atm\n", + "p2 = 0.176 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n", + "Pt = P1/p2 \t\t\t\t#Static critical pressure in atm \n", + "p3 = 3.424 \t\t\t\t#Stagnation Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n", + "Pot = Po1/p3 \t\t\t\t#Stagnation critical pressure in atm\n", + "t2 = 0.281 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3) \n", + "Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n", + "t3 = 0.654 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n", + "Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n", + "To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n", + "t4 = (To2/Tot) \t\t\t\t#Stagnation Temperature ratio at exit\n", + "M2 = 1.6 \t\t\t\t#Mack number at exit from gas tables (Rayleigh,t4)\n", + "p4 = 0.524 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4 = 0.866,M = 1.6)\n", + "P2 = p4*Pt \t\t\t\t#Static Pressure at exit in atm\n", + "p5 = 1.176 \t\t\t\t#Stagnation Pressure ratio at exit from gas tables (Rayleigh,t4 = 0.866,M = 1.6)\n", + "Po2 = p5*Pot \t\t\t\t#Stagnation Pressure at exit in atm\n", + "t5 = 0.702 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4 = 0.866,M = 1.6)\n", + "T2 = t5*Tt \t\t\t\t#Static exit temperature in K\n", + "d2 = P2*101325/(R*T2) \t\t\t\t#density of air at exit in kg/m**3, P2 in N/m**2\n", + "\n", + "\t\t\t\t#outpur\n", + "print 'A)The Mach numer at exit is %3.1f \\\n", + "\\nB)Static Pressure at exit is %3.3f atm \\\n", + "\\nC)Static exit temperature is %3.2f K \\\n", + "\\nD)density of air at exit is %3.4f kg/m**3 \\\n", + "\\nE)Stagnation exit temperation is %3.2f K \\\n", + "\\nF)Stagnation Pressure at exit is %3.2f atm'%(M2,P2,T2,d2,To2,Po2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)The Mach numer at exit is 1.6 \n", + "B)Static Pressure at exit is 2.977 atm \n", + "C)Static exit temperature is 749.47 K \n", + "D)density of air at exit is 1.4025 kg/m**3 \n", + "E)Stagnation exit temperation is 1138.51 K \n", + "F)Stagnation Pressure at exit is 12.63 atm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 page : 11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 2 \t\t\t\t#Mach number at entry\n", + "P1 = 1.4 \t\t\t\t#Static Pressure at entry in bar\n", + "T1 = 323 \t\t\t\t#Static Temperature at entry in K\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287 \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.555 \t\t\t\t#Temperature ratio at entry from gas tables (M = 2,k = 1.4,isentropiC)\n", + "To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "p1 = 0.364 \t\t\t\t#Pressure ratio at entry from gas tables (M = 2,k = 1.4,isentropiC)\n", + "Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in bar\n", + "t2 = 0.529 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2) \n", + "Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n", + "t3 = 0.793 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2)\n", + "Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n", + "To2 = Tot \t\t\t\t#Stagnation exit temperation in K\n", + "q = Cp*(To2-To1) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "C1 = M1*a1 \t\t\t\t#Air velocity in m/s\n", + "d1 = (P1*10**5)/(R*T1) \t\t\t\t#density of air in kg/m**3\n", + "ma = d1*C1 \t\t\t\t#Mass flow rate per unit area in kg/s-m**3\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mass flow rate per unit area is %3.2f kg/s-m**2 \\\n", + "\\nB)Final temperarure is %3.3f K \\\n", + "\\nC)Heat added is %3.2f kJ/kg'%(ma,Tt,q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mass flow rate per unit area is 1088.13 kg/s-m**2 \n", + "B)Final temperarure is 610.586 K \n", + "C)Heat added is 152.68 kJ/kg\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 page : 11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C1 = 100. \t\t\t\t#Air velocity into combustion chamber in m/s\n", + "P1 = 3. \t\t\t\t#Static Pressure at entry in bar\n", + "T1 = 318. \t\t\t\t#Static Temperature at entry in K\n", + "q = 630. \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "M1 = C1/a1 \t\t\t\t#Mach number at entry\n", + "t1 = 0.985 \t\t\t\t#Temperature ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "p1 = 0.947 \t\t\t\t#Pressure ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in bar\n", + "To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n", + "p2 = 2.163 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.28)\n", + "Pt = P1/p2 \t\t\t\t#Static critical pressure in bar \n", + "p3 = 2.206 \t\t\t\t#Stagnation Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.28)\n", + "Pot = Po1/p3 \t\t\t\t#Stagnation critical pressure in bar\n", + "t2 = 0.310 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.28)\n", + "Tot = To1/t2 \t\t\t\t#Stagnation critical temperature in K\n", + "t3 = (To2/Tot) \t\t\t\t#Stagnation Temperature ratio at exit\n", + "M2 = 0.7 \t\t\t\t#Mack number at exit from gas tables (Rayleigh,t3)\n", + "p4 = 1.423 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t3,M2)\n", + "P2 = p4*Pt \t\t\t\t#Static Pressure at exit in bar\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)Pressure after combustion is %3.3f bar \\\n", + "\\nB)Mach number after combustion is %3.1f'%(P2,M2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Pressure after combustion is 1.974 bar \n", + "B)Mach number after combustion is 0.7\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 page : 12" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 3. \t\t\t\t#Mach number at entry\n", + "To1 = 295. \t\t\t\t#Total stagnation temperature at inlet in K\n", + "P1 = 0.5 \t\t\t\t#Static Pressure at entry in bar\n", + "M2 = 1.5 \t\t\t\t#Mack number at exit\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 0.0272 \t\t\t\t#Pressure ratio at entry from gas tables (M = 3,k = 1.4,isentropiC)\n", + "Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in bar\n", + "t1 = 0.357 \t\t\t\t#Temperature ratio at entry from gas tables (M = 3,k = 1.4,isentropiC)\n", + "T1 = t1*To1 \t\t\t\t#Static temperature at entry in Kelvin\n", + "p2 = 0.176 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n", + "Pt = P1/p2 \t\t\t\t#Static critical pressure in bar \n", + "p3 = 3.424 \t\t\t\t#Stagnation Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n", + "Pot = Po1/p3 \t\t\t\t#Stagnation critical pressure in bar\n", + "t2 = 0.654 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n", + "Tot = To1/t2 \t\t\t\t#Stagnation critical temperature in K\n", + "t3 = 0.280 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n", + "Tt = T1/t3 \t\t\t\t#Static critical temperature in K\n", + "p4 = 0.578 \t\t\t\t#\t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,M = 1.5)\n", + "P2 = p4*Pt \t\t\t\t#Static Pressure at exit in bar\n", + "p5 = 1.122 \t\t\t\t#Stagnation Pressure ratio at exit from gas tables (Rayleigh,M = 1.5)\n", + "Po2 = p5*Pot \t\t\t\t#Stagnation Pressure at exit in bar\n", + "t4 = 0.753 \t\t\t\t#\t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,M = 1.5)\n", + "T2 = t4*Tt \t\t\t\t#Static exit temperature in K\n", + "t5 = 0.909 \t\t\t\t#Stagnation temperature ratio at exit from gas tables (Rayleigh,M = 1.5)\n", + "To2 = t5*Tot \t\t\t\t#Total stagnation temperature at exit in K\n", + "q = Cp*(To1-To2) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "SPC = Po1-Po2 \t\t\t\t#Change in stagnation pressure in bar\n", + "n = math.log(Po1/Po2)/(math.log(Po1/Po2)-math.log(To1/To2)) \t\t\t\t#Exponent of polytropic equation\n", + "qmax = Cp*(Tot-To1) \t\t\t\t#Maximum possible heat transfer in kJ/kg\n", + "ds = Cp*math.log(T2/T1)-(R*math.log(P2/P1)) \t\t\t\t#Change in entropy in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Total temperature at exit is %3.2f K \\\n", + "\\nB)Static pressure at exit is %3.3f bar \\\n", + "\\nC)Change in stagnation pressure is %3.2f bar \\\n", + "\\nD)Exponent of polytropic equation is %3.2f'%(To2,P2,SPC,n)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Total temperature at exit is 410.02 K \n", + "B)Static pressure at exit is 1.642 bar \n", + "C)Change in stagnation pressure is 12.36 bar \n", + "D)Exponent of polytropic equation is 0.77\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 page : 14" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M2 = 0.9 \t\t\t\t#Mack number at exit\n", + "P2 = 2.5 \t\t\t\t#Static Pressure at exit in bar\n", + "T2 = 1273. \t\t\t\t#Static exit temperature in K\n", + "t1 = 3.74 \t\t\t\t#ratio of stagnation temperatures at and exit entry\n", + "Cp = 1.218 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t2 = 0.892 \t\t\t\t#Temperauture ratio at exit from gas tables (isentropic,k = 1.3,M = 0.9)\n", + "To2 = T2/t2 \t\t\t\t#Total stagnation temperature at exit in K\n", + "To1 = To2/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "p1 = 1.12 \t\t\t\t#Static pressure ratio at critical state from gas tables (Rayleigh,k = 1.3,M = 1.5)\n", + "Pt = P2/p1 \t\t\t\t#Static critical pressure in bar\n", + "t3 = 1.017 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.3,M = 1.5)\n", + "Tt = T2/t3 \t\t\t\t#Static critical temperature in K\n", + "t4 = 0.991 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.3,M = 1.5)\n", + "Tot = To2/t4 \t\t\t\t#Stagnation critical temperature in K\n", + "t5 = To1/Tot \t\t\t\t#Ratio of stagnation temperature at entry and critical state \n", + "M1 = 0.26 \t\t\t\t#Mach number at entry from gas tables (Rayleigh,t5,k = 1.3)\n", + "p2 = 2.114 \t\t\t\t#Static Pressure ratio at entry from gas tables (Rayleigh,t5,k = 1.3)\n", + "P1 = Pt*p2 \t\t\t\t#Static Pressure at entry in bar\n", + "t6 = 0.302 \t\t\t\t#Static temperature ratio at entry from gas tables (Rayleigh,t5,k = 1.3)\n", + "T1 = Tt*t6 \t\t\t\t#Static temperature at entry in Kelvin\n", + "q = Cp*(To2-To1) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "qmax = Cp*(Tot-To1) \t\t\t\t#Maximum possible heat transfer in kJ/kg \n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number at entry is %3.2f \\\n", + "\\nB)Pressure at entry is %3.3f bar \\\n", + "\\nC)Temperature of gas is %3i K \\\n", + "\\nD)Amount of heat added is %3.2f kJ/kg \\\n", + "\\nE)Maximum heat that can be heated is %3.3f kJ/kg'%(M1,P1,T1,q,qmax)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number at entry is 0.26 \n", + "B)Pressure at entry is 4.719 bar \n", + "C)Temperature of gas is 378 K \n", + "D)Amount of heat added is 1273.47 kJ/kg \n", + "E)Maximum heat that can be heated is 1289.259 kJ/kg\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 page : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#input\n", + "P1 = 0.343 \t\t\t\t#Static Pressure at entry in bar\n", + "T1 = 310. \t\t\t\t#Static temperature at entry in Kelvin\n", + "C1 = 60. \t\t\t\t#Velocity at entrance in m/s\n", + "q = 1172.5 \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "M1 = C1/a1 \t\t\t\t#Mach number at entry\n", + "t1 = 0.9943 \t\t\t\t#Temperature ratio at entry from gas tables (M = 0.17,k = 1.4,isentropic)\n", + "To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "p1 = 2.306 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.17)\n", + "Pt = P1/p1 \t\t\t\t#Static critical pressure in bar\n", + "t2 = 0.154 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.17) \n", + "Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n", + "t3 = 0.129 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.17)\n", + "Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n", + "c1 = 0.0665 \t\t\t\t#Velocity ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.17)\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n", + "t4 = To2/Tot \t\t\t\t#Ratio of stagnation temperature at exit and critical state \n", + "M2 = 0.45 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "p2 = 1.87 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "P2 = p2*Pt \t\t\t\t#Static Pressure at exit in bar \n", + "t5 = 0.7075 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "T2 = t5*Tt \t\t\t\t#Static exit temperature in K\n", + "c2 = 0.378 \t\t\t\t#Velocity ratio at critical state from gas tables (Rayleigh,k = 1.4,t4)\n", + "C2 = Ct*c2 \t\t\t\t#exit velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'At exit conditions : A)Mach number is %3.2f \\\n", + "\\nB)Pressure is %3.3f bar \\\n", + "\\nC)Temperature is %3.2f K \\\n", + "\\nD)Exit velocity is %3.2f m/s'%(M2,P2,T2,C2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "At exit conditions : A)Mach number is 0.45 \n", + "B)Pressure is 0.278 bar \n", + "C)Temperature is 1424.19 K \n", + "D)Exit velocity is 341.05 m/s\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.8 page : 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 2. \t\t\t\t#Mach number at entry\n", + "To1 = 523. \t\t\t\t#Total stagnation temperature at inlet in K\n", + "Po1 = 6. \t\t\t\t#Stagnation Pressure at entry in bar\n", + "To2 = 423. \t\t\t\t#Stagnation exit temperation in K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.555 \t\t\t\t#Temperature ratio at entry from gas tables (M = 2,k = 1.4,isentropiC)\n", + "T1 = t1*To1 \t\t\t\t#Static temperature at entry in Kelvin\n", + "p1 = 0.128 \t\t\t\t#Pressure ratio at entry from gas tables (M = 2,k = 1.4,isentropiC)\n", + "P1 = Po1*p1 \t\t\t\t#Static Pressure at entry in bar\n", + "p2 = 0.364 \t\t\t\t#Static pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2)\n", + "p3 = 1.503 \t\t\t\t#\t\t\t\t#Stagnation pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2), printing mistake in textbook\n", + "t2 = 0.529 \t\t\t\t#Static Temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2)\n", + "t3 = 0.793 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2)\n", + "t4 = (To2/To1)*t3 \t\t\t\t#Ratio of stagnation temperature at exit and critical state \n", + "M2 = 3.15 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "p4 = 0.161 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4), printing mistake in textbook\n", + "t5 = 0.258 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "P2 = (p4/p2)*P1 \t\t\t\t#Static Pressure at exit in bar \n", + "T2 = (t5/t2)*T1 \t\t\t\t#Static exit temperature in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'After Cooling : A)Mach number is %3.2f \\\n", + "\\nB)Pressure is %3.4f bar \\\n", + "\\nC)Temperature is %3.2f K'%(M2,P2,T2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "After Cooling : A)Mach number is 3.15 \n", + "B)Pressure is 0.3397 bar \n", + "C)Temperature is 141.57 K\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.9 page : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M2 = 0.8 \t\t\t\t#Mack number at exit\n", + "t1 = 4. \t\t\t\t#Ratio of stagnation temperature at exit and entry\n", + "T1 = 288. \t\t\t\t#Atmospheric temperature in K\n", + "P1 = 1. \t\t\t\t#Atmospheric Pressure in atm\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t2 = 0.964 \t\t\t\t#Ratio of stagnation temperature at exit and critical state from gas tables\n", + "t3 = t2/t1 \t\t\t\t#Ratio of stagnation temperature at entry and critical state\n", + "M1 = 0.24 \t\t\t\t#\t\t\t\t#Mach number at entry from gas tables (Rayleigh,t3,k = 1.4)\n", + "t5 = 0.988 \t\t\t\t#Temperature ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "To1 = T1/t5 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "To2 = t1*To1 \t\t\t\t#Stagnation exit temperation in K\n", + "Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n", + "q = Cp*(To2-To1) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "qmax = Cp*(Tot-To1) \t\t\t\t#Maximum possible heat transfer in kJ/kg \n", + "t6 = 0.9775 \t\t\t\t#Ratio of stagnation temperature for maximum static temperature (M = 1/math.sqrt(k),Rayleigh)\n", + "To3 = Tot*t6 \t\t\t\t#maximum stagnation temperature in K\n", + "q_req = Cp*(To3-To1) \t\t\t\t#Heat transfer required to get maximum static temperature in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Heat added per kg of air flow is %3.2f kJ/kg \\\n", + "\\nB)Maximum possible heat transfer is %3.2f kJ/kg \\\n", + "\\nC)Heat transfer required to get maximum static temperature is %3.1f kJ/kg'%(q,qmax,q_req)\n", + "\n", + "# note : rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Heat added per kg of air flow is 878.87 kJ/kg \n", + "B)Maximum possible heat transfer is 922.63 kJ/kg \n", + "C)Heat transfer required to get maximum static temperature is 895.3 kJ/kg\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.10 page : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "T1 = 560. \t\t\t\t#Static Temperature at entry in K\n", + "P1 = 0.6 \t\t\t\t#Static Pressure at entry in bar\n", + "C1 = 75. \t\t\t\t#Air velocity into combustion chamber in m/s\n", + "mp = 30. \t\t\t\t#air fuel ratio\n", + "CV = 92000. \t\t\t\t#Calorific value of fuel in kJ/kg\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "M1 = C1/a1 \t\t\t\t#Mach number at entry\n", + "t1 = 0.9949 \t\t\t\t#Temperature ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "p1 = 0.982 \t\t\t\t#Pressure ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in bar\n", + "q = CV/(mp+1) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg of gas, mp+1 = total amount of fuel = mf+ma\n", + "p2 = 2.317 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n", + "Pt = P1/p2 \t\t\t\t#Static critical pressure in bar\n", + "p3 = 1.246 \t\t\t\t#Stagnation Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n", + "Pot = Po1/p3 \t\t\t\t#Stagnation critical pressure in bar\n", + "t2 = 0.137 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M1) \n", + "Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n", + "t3 = 0.115 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n", + "Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n", + "To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n", + "t4 = To2/Tot \t\t\t\t#Ratio of stagnation temperature at exit and critical state \n", + "M2 = 0.33 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "p4 = 2.0825 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "P2 = p4*Pt \t\t\t\t#Static Pressure at exit in bar, miscalculation in textbook\n", + "p5 = 1.186 \t\t\t\t#Stagnation Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "Po2 = Pot*p5 \t\t\t\t#Stagnation Pressure at exit in bar\n", + "t5 = 0.472 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "T2 = t5*Tt \t\t\t\t#Static exit temperature in K\n", + "C2 = M2*math.sqrt(k*R*T2) \t\t\t\t#exit velocity in m/s\n", + "SPL = ((Po1-Po2)/Po1)*100 \t\t\t\t#Percentage of pressure loss in combustion chamber in %\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At exit: \\\n", + "\\nPressure is %3.5f bar \\\n", + "\\nTemperature is %3i K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nMach number is %3.2f \\\n", + "\\nB)Maximum stagnation temperature available is %3.2f K \\\n", + "\\nC)Percentage of pressure loss in combustion chamber is %3.1f percent \\\n", + "\\nD)Intial Mach number is %3.2f '%(P2,T2,C2,M2,Tot,SPL,M1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At exit: \n", + "Pressure is 0.53927 bar \n", + "Temperature is 1929 K \n", + "Velocity is 290.55 m/s \n", + "Mach number is 0.33 \n", + "B)Maximum stagnation temperature available is 4894.53 K \n", + "C)Percentage of pressure loss in combustion chamber is 4.8 percent \n", + "D)Intial Mach number is 0.16 \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.11 page : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "To1 = 473. \t\t\t\t#Total stagnation temperature at inlet in K\n", + "To2 = 673. \t\t\t\t#Stagnation exit temperation in K\n", + "M1 = 0.5 \t\t\t\t#Mach number at entry\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.6914 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n", + "p1 = 1.7778 \t\t\t\t#Static pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n", + "t2 = (To2/To1)*t1 \t\t\t\t#Stagnation temperature ratio at exit \n", + "M2 = 0.867 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t2,k = 1.4)\n", + "p2 = 1.16 \t\t\t\t#Static pressure ratio at exit from gas tables (Rayleigh,k = 1.4,M2)\n", + "p = p2/p1 \t\t\t\t#ratio of static pressures at oulet and inlet\n", + "PL = (1-p)*100 \t\t\t\t#pressure loss in %\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number is %3.3f \\\n", + "\\nB)Percentage drop in pressure is %3.1f percent'%(M2,PL) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number is 0.867 \n", + "B)Percentage drop in pressure is 34.8 percent\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.12 page : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "t1 = 3. \t\t\t\t#Stagnation temperature ratio\n", + "M2 = 0.8 \t\t\t\t#Mach number at exit\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t2 = 0.964 \t\t\t\t#Ratio of stagnation temperature at exit and critical state (Rayleigh,M2,k = 1.4) \n", + "p1 = 1.266 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,M2,k = 1.4)\n", + "t3 = t2/t1 \t\t\t\t#Stagnation temperature ratio at critical state \n", + "M1 = 0.29 \t\t\t\t#Mach number at entry from gas tables (Rayleigh,t3,k = 1.4)\n", + "p2 = 2.147 \t\t\t\t#Static pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n", + "p = p1/p2 \t\t\t\t#ratio of static pressures at exit and entry\n", + "PL = (1-p)*100 \t\t\t\t#Percentage loss in static pressure in %\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number at entry is %3.2f \\\n", + "\\nB)Percentage loss in static pressure is %3i percent'%(M1,PL)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number at entry is 0.29 \n", + "B)Percentage loss in static pressure is 41 percent\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.13 page : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "To1 = 300. \t\t\t\t#Total stagnation temperature at inlet in K\n", + "To2 = 310. \t\t\t\t#Stagnation exit temperation in K\n", + "G = 1300. \t\t\t\t#Mass velocity in kg/m**2-s\n", + "P1 = 105.*10**3 \t\t\t\t#Static Pressure at entry in Pa\n", + "Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "T1 = (((-2*P1**2*Cp)+math.sqrt(((-2*P1**2*Cp)**2)+(8*G**2*R**2*P1**2*Cp*To1)))/(2*G**2*R**2)) \t\t\t\t#Static temperature in K\n", + "t1 = T1/To1 \t\t\t\t#Temperature ratio at entry\n", + "M1 = 1.4 \t\t\t\t#Mach number at entry from gas tables (isentropic,t1,k = 1.4)\n", + "t2 = 0.934 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n", + "Tot = To1/t2 \t\t\t\t#Stagnation critical temperature in K\n", + "t3 = To2/Tot \t\t\t\t#Stagnation temperature ratio at exit from gas tables (Rayleigh,k = 1.4,M1)\n", + "M2 = 1.26 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t3,k = 1.4)\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)The inlet mach number is %3.2f \\\n", + "\\nB)The exit mach number is %3.2f'%(M1,M2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)The inlet mach number is 1.40 \n", + "B)The exit mach number is 1.26\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.14 page : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n", + "R = 466. \t\t\t\t#Gas consmath.tant in J/kg-K\n", + "P1 = 0.345 \t\t\t\t#Static Pressure at entry in Pa\n", + "T1 = 312. \t\t\t\t#Static Temperature at entry in K\n", + "C1 = 65.5 \t\t\t\t#Entry velocity in m/s\n", + "q = 4592. \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n", + "M1 = C1/a1 \t\t\t\t#Mach number at entry\n", + "t1 = 0.9965 \t\t\t\t#Temperature ratio at entry from gas tables (M1,k = 1.3,isentropiC)\n", + "To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n", + "p1 = 2.235 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.3,M1)\n", + "Pt = P1/p1 \t\t\t\t#Static critical pressure in bar \n", + "c1 = 0.051 \t\t\t\t#Velocity ratio at critical state from gas tables (Rayleigh,k = 1.3,M1)\n", + "Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n", + "t2 = 0.112 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.3,M1) \n", + "Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n", + "t3 = 0.098 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.3,M1)\n", + "Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n", + "Cp = (k*R)/(k-1) \t\t\t\t#Specific heat of dry air in kJ/kg-K\n", + "To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n", + "t4 = (To2/Tot) \t\t\t\t#Stagnation Temperature ratio at exit\n", + "M2 = 0.60 \t\t\t\t#Mack number at exit from gas tables (Rayleigh,t4)\n", + "p2 = 1.567 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "P2 = p2*Pt \t\t\t\t#Static Pressure at exit in bar \n", + "t5 = 0.884 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n", + "T2 = t5*Tt \t\t\t\t#Static exit temperature in K\n", + "c2 = 0.564 \t\t\t\t#Velocity ratio at critical state from gas tables (Rayleigh,k = 1.4,t4)\n", + "C2 = Ct*c2 \t\t\t\t#exit velocity in m/s\n", + "qmax = Cp*(Tot-To1)/10**3 \t\t\t\t#Maximum possible heat transfer in kJ/kg \n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Heat required to accelerate the gas from the inlet condition to sonic condition is %3.2f kJ/kg \\\n", + "\\nB)The pressure and temperature at sonic condition are %3.3f bar and %3.2f K respectively \\\n", + "\\nC)The properties at exit are: \\\n", + "\\nPressure is %3.3f bar \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nVelocity is %3i m/s'%(qmax,Pt,Tt,P2,T2,C2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Heat required to accelerate the gas from the inlet condition to sonic condition is 5819.23 kJ/kg \n", + "B)The pressure and temperature at sonic condition are 0.154 bar and 2785.71 K respectively \n", + "C)The properties at exit are: \n", + "Pressure is 0.242 bar \n", + "Temperature is 2462.57 K \n", + "Velocity is 724 m/s\n" + ] + } + ], + "prompt_number": 19 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch5.ipynb b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch5.ipynb new file mode 100755 index 00000000..e48f9ea6 --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch5.ipynb @@ -0,0 +1,2176 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:48c3c13129b0ce3ee083feadd095d84beabf52cb58d3a61a7cd29360c1b4aee6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : Normal and Oblique Shock" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 page : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Input data\n", + "Px = 150. \t\t\t\t#Pressure before the shock in kPa\n", + "Tx = 25.+273 \t\t\t\t#Temperature before the shock in K\n", + "Py = 350. \t\t\t\t#Pressure just after the shock in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "p1 = Py/Px \t\t\t\t#Pressure ratio \n", + "Mx = 1.4638 \t\t\t\t#Mach number before the shock\n", + "My = 0.716 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "t1 = 1.294 \t\t\t\t#Temperature ratio after and before the shock from gas tables @p1\n", + "Ty = t1*Tx \t\t\t\t#Temperature ratio after the shock in K\n", + "ax = math.sqrt(k*R*Tx) \t\t\t\t#Velocity of sound before the shock in m/s\n", + "Cx = ax*Mx \t\t\t\t#Velocity of gas before the shock in m/s\n", + "ay = math.sqrt(k*R*Ty) \t\t\t\t#Velocity of sound after the shock in m/s\n", + "Cy = ay*My \t\t\t\t#Velocity of gas after the shock in m/s\n", + "p2 = 0.942 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @p1\n", + "ds = R*math.log(1/p2) \t\t\t\t#Change in entropy in J/kg-K\n", + "p3 = 3.265 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @p1\n", + "Poy = p3*Px \t\t\t\t#Stagnation pressure after shock in kPa\n", + "Pox = Poy/p2 \t\t\t\t#Stagnation pressure before shock in kPa\n", + "pr_loss = Pox-Poy \t\t\t\t#Loss of stagnation pressure of air in kPa\n", + "dd = (1000/R)*((Py/Ty)-(Px/Tx)) \t\t\t\t#Increase in density of air in kg/m**3\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number before shock is %3.4f \\\n", + "\\nB)After shock: \\\n", + "\\nMach number is %3.3f \\\n", + "\\nStatic temperature is %3.3f K \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nC)Increase in density of air is %3.2f kg/m**3 \\\n", + "\\nD)Loss of stagnation pressure of air is %3.2f kPa \\\n", + "\\nE)Change in entropy is %3.3f J/kg-K'%(Mx,My,Ty,Cy,dd,pr_loss,ds)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number before shock is 1.4638 \n", + "B)After shock: \n", + "Mach number is 0.716 \n", + "Static temperature is 385.612 K \n", + "Velocity is 281.83 m/s \n", + "C)Increase in density of air is 1.41 kg/m**3 \n", + "D)Loss of stagnation pressure of air is 30.15 kPa \n", + "E)Change in entropy is 17.148 J/kg-K\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 page : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "Tx = 350. \t\t\t\t#Temperature before the shock in K\n", + "Px = 137.8 \t\t\t\t#Pressure before the shock in kPa\n", + "Cx = 750. \t\t\t\t#Velocity before the shock in m/s\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ax = math.sqrt(k*R*Tx) \t\t\t\t#Velocity of sound before the shock in m/s\n", + "Mx = Cx/ax \t\t\t\t#Mach number before the shock\n", + "My = 0.577 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "p1 = 4.5 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = Px*p1 \t\t\t\t#Static pressure after shock in kPa\n", + "t1 = 1.687 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t1 \t\t\t\t#Temperature ratio after the shock in K\n", + "p2 = 5.641 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @My\n", + "Poy = Px*p2 \t\t\t\t#Stagnation pressure after shock in kPa\n", + "p3 = 0.721 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @My\n", + "Pox = Poy/p3 \t\t\t\t#Stagnation pressure before shock in kPa\n", + "ds = R*math.log(1/p3) \t\t\t\t#Change in entropy in J/kg-K\n", + "t2 = 0.555 \t\t\t\t#Static to Stagnation temperature ratio before shock from isentropic gas tables @Mx,k = 1.4\n", + "Tox = Tx/t2 \t\t\t\t#Stagnation temperature before shock in K\n", + "p4 = 0.128 \t\t\t\t#Static to Stagnation pressure ratio from isentropic gas tables @Mx,k = 1.4\n", + "Pox = Px/p4 \t\t\t\t#Stagnation pressure in kPa\n", + "t4 = 0.937 \t\t\t\t#Static to Stagnation temperature ratio before shock from normal shock gas tables @Mx,k = 1.4 (Tox = Toy CheckenD)\n", + "Toy = Ty/t4 \t\t\t\t#Stagnation temperature after shock in K\n", + "ay = math.sqrt(k*R*Ty) \t\t\t\t#Velocity of sound after the shock in m/s\n", + "Cy = (My*ay) \t\t\t\t#Velocity of gas after the shock in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)At inlet to shock: \\\n", + "\\nStagnation pressure is %3.1f kPa \\\n", + "\\nStagnation temperature is %3.2f K \\\n", + "\\nMach number is %3.0f \\\n", + "\\nB)After shock: \\\n", + "\\nStagnation pressure is %3.2f kPa \\\n", + "\\nStagnation temperature is %3.2f K \\\n", + "\\nStatic pressure is %3.1f kPa \\\n", + "\\nStatic temperature is %3.2f K \\\n", + "\\nMach number is %3.3f \\\n", + "\\nVelocity is %3.2f m/s \\\n", + "\\nC)Change in entropy across the shock is %3.2f J/kg-K'%(Pox,Tox,Mx,Poy,Toy,Py,Ty,My,Cy,ds)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At inlet to shock: \n", + "Stagnation pressure is 1076.6 kPa \n", + "Stagnation temperature is 630.63 K \n", + "Mach number is 2 \n", + "B)After shock: \n", + "Stagnation pressure is 777.33 kPa \n", + "Stagnation temperature is 630.15 K \n", + "Static pressure is 620.1 kPa \n", + "Static temperature is 590.45 K \n", + "Mach number is 0.577 \n", + "Velocity is 281.04 m/s \n", + "C)Change in entropy across the shock is 93.88 J/kg-K\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 page: 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "Tx = 0+273 \t\t\t\t#Temperature before the shock in K\n", + "Px = 60. \t\t\t\t#Pressure before the shock in kPa\n", + "Cx = 497. \t\t\t\t#Air Velocity before the shock in m/s\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ax = math.sqrt(k*R*Tx) \t\t\t\t#Velocity of sound before the shock in m/s\n", + "Mx = Cx/ax \t\t\t\t#Mach number before the shock\n", + "My = 0.70109 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "p1 = 2.45833 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = p1*Px \t\t\t\t#Static pressure after shock in kPa\n", + "t1 = 1.32022 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t1 \t\t\t\t#Temperature ratio after the shock in K\n", + "p2 = 3.41327 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @My\n", + "Poy = p2*Px \t\t\t\t#Stagnation pressure after shock in kPa\n", + "p3 = 0.92979 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @My\n", + "Pox = Poy/p3 \t\t\t\t#Stagnation pressure before shock in kPa\n", + "ay = math.sqrt(k*R*Ty) \t\t\t\t#Velocity of sound after the shock in m/s\n", + "Cy = ay*My \t\t\t\t#Velocity of air after the shock in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'After shock: A)Mach number is %3.5f \\\n", + "\\nB)Velocity is %3.3f m/s \\\n", + "\\nC)Stagnation pressure is %3.3f kPa'%(My,Cy,Poy)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "After shock: A)Mach number is 0.70109 \n", + "B)Velocity is 266.798 m/s \n", + "C)Stagnation pressure is 204.796 kPa\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4 page : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Px = 30. \t\t\t\t#Pressure before the shock in kPa\n", + "Tx = -30+273 \t\t\t\t#Temperature before the shock in K\n", + "pr = 2.6 \t\t\t\t#Pressure ratio across the shock wave\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Mx = 1.54 \t\t\t\t#Mach number before the shock from gas tables @pr\n", + "My = 0.687 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "t1 = 1.347 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = t1*Tx \t\t\t\t#Temperature ratio after the shock in K\n", + "p1 = 3.567 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @My\n", + "Poy = p1*Px \t\t\t\t#Stagnation pressure after shock in kPa\n", + "p2 = 0.917 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @My\n", + "Pox = Poy/p2 \t\t\t\t#Stagnation pressure before shock in kPa\n", + "dP = Pox-Poy \t\t\t\t#Change in stagnation pressure in kPa\n", + "ax = math.sqrt(k*R*Tx) \t\t\t\t#Velocity of sound before the shock in m/s\n", + "Cx = (Mx*ax) \t\t\t\t#Air Velocity before the shock in m/s\n", + "ay = math.sqrt(k*R*Ty) \t\t\t\t#Velocity of sound after the shock in m/s\n", + "Cy = (My*ay) \t\t\t\t#Velocity of air after the shock in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Velocities upstream and downstream of shock wave are %3.2f m/s and %3.2f m/s respectively \\\n", + "\\nB)Change in stagnation pressure is %3.3f kPa'%(Cx,Cy,dP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Velocities upstream and downstream of shock wave are 481.20 m/s and 249.14 m/s respectively \n", + "B)Change in stagnation pressure is 9.686 kPa\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.5 page : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Mol = 39.9 \t\t\t\t#Molar mass of a gas in kg/mol\n", + "k = 1.67 \t\t\t\t#Specific heat ratio \n", + "Mx = 2.5 \t\t\t\t#Mach number before the shock \n", + "Px = 40 \t\t\t\t#Pressure before the shock in kPa \n", + "Tx = -20+273 \t\t\t\t#Temperature before the shock in K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "My = 0.554 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "p1 = 7.567 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = p1*Px \t\t\t\t#Static pressure after shock in kPa\n", + "t1 = 2.805 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t1 \t\t\t\t#Temperature ratio after the shock in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Downstream the normal shock: \\\n", + "\\nMach number is %3.3f \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nTemperature is %3.3f K'%(My,Py,Ty)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Downstream the normal shock: \n", + "Mach number is 0.554 \n", + "Pressure is 302.68 kPa \n", + "Temperature is 709.665 K\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.6 page : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Mx = 2 \t\t\t\t#Mach number before the shock \n", + "Px = 50 \t\t\t\t#Pressure before the shock in kPa \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 6.335 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @Mx\n", + "Poy = p1*Px \t\t\t\t#Stagnation pressure after shock in kPa\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Pressure acting on the front of the body is %3.2f kPa'%Poy\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure acting on the front of the body is 316.75 kPa\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.7 page : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 800. \t\t\t\t#Pressure in reservoir in kPa\n", + "To = 40.+273 \t\t\t\t#Temperature in reservoir in K\n", + "M2a = 2.5 \t\t\t\t#Mach number at exit from diagram\n", + "At = 25. \t\t\t\t#Throat Area in cm**2 \n", + "Ax = 40. \t\t\t\t#Area just before the shock in cm**2\n", + "Ay = 40. \t\t\t\t#Area just after the shock in cm**2\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature and stagnation temperature from gas tables @M = 1\n", + "Tt = To*t1 \t\t\t\t#Critical temperature in K\n", + "p1 = 0.528 \t\t\t\t#Ratio of critical pressure and stagnation pressure from gas tables @M = 1\n", + "Pt = Po*p1 \t\t\t\t#Critical pressure in kPa\n", + "dt = Pt*10**3/(R*Tt) \t\t\t\t#Density in kg/m**3, Pt in Pa\n", + "at = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound at throat in m/s\n", + "Ct = at \t\t\t\t#Air Velocity of sound at throat in m/s\n", + "m = dt*At*10**-4*Ct \t\t\t\t#Mass flow rate in kg/s\n", + "p2 = 0.0585 \t\t\t\t#Ratio of exit to stagnation pressure from isentropic gas tables @M2 = 2.5\n", + "a1 = 2.637 \t\t\t\t#Ratio of exit to critical area from isentropic gas tables @M2 = 2.5\n", + "A2 = a1*At \t\t\t\t#Exit area in cm**2\n", + "a2 = Ax/At \t\t\t\t#Area ratio\n", + "M = 1.94 \t\t\t\t#Mach number upstream of shock from gas tables @a2\n", + "p3 = 0.140 \t\t\t\t#Ratio of upstram of shock to stagnation pressures from isentropic gas tables @M\n", + "Px = p3*Po \t\t\t\t#Pressure upstram of shock in kPa\n", + "t2 = 0.570 \t\t\t\t#Ratio of upstram of shock to stagnation temperature from isentropic gas tables @M\n", + "Tx = t2*To \t\t\t\t#Temperature upstram of shock in K\n", + "My = 0.588 \t\t\t\t#Mach number downstream of shock from normal shock gas tables @M\n", + "p4 = 4.225 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = Px*p4 \t\t\t\t#Static pressure after shock in kPa\n", + "t3 = 1.639 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t3 \t\t\t\t#Temperature ratio after the shock in K\n", + "p5 = 2.338 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @My\n", + "Poy = p5*Px \t\t\t\t#Stagnation pressure after shock in kPa\n", + "p6 = 0.749 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @My\n", + "Pox = Poy/p6 \t\t\t\t#Stagnation pressure before shock in kPa \n", + "#Here At2 = Aty, Po2 = Poy, Toy = To2 = To1 = To\n", + "p7 = 0.79 \t\t\t\t#Static to stagnation pressure ratio after shock from isentropic gas tables @My\n", + "Po2 = Py/p7 \t\t\t\t#Stagnation pressure at exit in kPa\n", + "t4 = 0.935 \t\t\t\t#Static to stagnation temperature ratio after shock from isentropic gas tables @My\n", + "To2 = Ty/t4 \t\t\t\t#Stagnation temperature in K (checkeD)\n", + "a3 = 1.2 \t\t\t\t#Ratio of areas after shock i.e. (Ay/At2)\n", + "At2 = Ay/a3 \t\t\t\t#Critical area after shock in cm**2\n", + "a4 = A2/At2 \t\t\t\t#Ratio of areas \n", + "M2b = 0.31 \t\t\t\t#Mach number at exit from gas tables @a4(as per sectionB)\n", + "p8 = 0.936 \t\t\t\t#Static to stagnation pressure ratio at exit from isentropic gas tables @M2b\n", + "P2 = Po2*p8 \t\t\t\t#Exit pressure in kPa\n", + "t5 = 0.981 \t\t\t\t#Static to stagnation temperature ratio after shock from isentropic gas tables @M2b\n", + "T2 = To2*t5 \t\t\t\t#Exit temperature in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'CASE-I: A)Mass flow rate is %3.2f kg/s \\\n", + "\\nB)Exit area is %3.1f cm**2 CASE-II: \\\n", + "\\nA)Temperature is %3.3f K \\\n", + "\\nB)Pressure is %3.1f kPa'%(m,A2,T2,P2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "CASE-I: A)Mass flow rate is 4.56 kg/s \n", + "B)Exit area is 65.9 cm**2 CASE-II: \n", + "A)Temperature is 306.800 K \n", + "B)Pressure is 560.7 kPa\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.8 page : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Input data\n", + "Px = 1. \t\t\t\t#Pressure before the shock in bar\n", + "Tx = 17.+273 \t\t\t\t#Temperature before the shock in K\n", + "Cx = 500. \t\t\t\t#Air Velocity before the shock in m/s\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ax = math.sqrt(k*R*Tx) \t\t\t\t#Velocity of sound before the shock in m/s\n", + "Mx = Cx/ax \t\t\t\t#Mach number before the shock \n", + "My = 0.715 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "p1 = 2.335 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = p1*Px \t\t\t\t#Static pressure after shock in bar\n", + "t1 = 1.297 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t1 \t\t\t\t#Temperature ratio after the shock in K\n", + "ay = math.sqrt(k*R*Ty) \t\t\t\t#Velocity of sound after the shock in m/s\n", + "Cy = ay*My \t\t\t\t#Velocity of air after the shock in m/s\n", + "C_y = Cx-Cy \t\t\t\t#Velocity of air in m/s\n", + "M_y = C_y/ay \t\t\t\t#Mach number impared upstream of the wave front\n", + "t2 = 0.939 \t\t\t\t#Static to stagnation temperature ratio after shock from isentropic gas tables @M_y\n", + "T_oy = Ty/t2 \t\t\t\t#Stagnation temperature of air in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Pressure is %3.3f bar \\\n", + "\\nB)Temperature is %3.2f K \\\n", + "\\nC)Velocity of air is %3.2f m/s \\\n", + "\\nD)Stagnation temperature is %3.2f K \\\n", + "\\nE)Mach number is %3.3f'%(Py,Ty,C_y,T_oy,M_y)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Pressure is 2.335 bar \n", + "B)Temperature is 376.13 K \n", + "C)Velocity of air is 222.04 m/s \n", + "D)Stagnation temperature is 400.56 K \n", + "E)Mach number is 0.571\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.9 page : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "Mx = 3. \t\t\t\t#Mach number before the shock \n", + "Tx = 27.+273 \t\t\t\t#Temperature before the shock in K\n", + "Px = 1. \t\t\t\t#Pressure before the shock in bar\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + " \n", + "\t\t\t\t\n", + "#Calculation\n", + "My = 0.475 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "p1 = 10.333 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = p1*Px \t\t\t\t#Static pressure after shock in bar\n", + "t1 = 2.679 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t1 \t\t\t\t#Temperature ratio after the shock in K\n", + "p2 = 12.061 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @My\n", + "Poy = p2*Px \t\t\t\t#Stagnation pressure after shock in bar\n", + "p3 = 0.328 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @My\n", + "Pox = Poy/p3 \t\t\t\t#Stagnation pressure before shock in kPa\n", + "ay = math.sqrt(k*R*Ty) \t\t\t\t#Velocity of sound after the shock in m/s\n", + "Cy = ay*My \t\t\t\t#Velocity of air after the shock in m/s\n", + "ds = R*math.log(1/p3) \t\t\t\t#Change in entropy in J/kg-K\n", + "e = (Py-Px)/Px \t\t\t\t#Strength of shock\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'I)Downstream of the shock: \\\n", + "\\nA)Pressure is %3.3f bar \\\n", + "\\nB)Temperature is %3.1f K \\\n", + "\\nC)Gas velocity is %3.2f m/s \\\n", + "\\nD)Mach number is %3.3f \\nII)Total head pressure ratio is %3.3f \\nIII)Entropy change across the shock is %3.3f J/kg-K \\\n", + "\\nIV)Strength of the shock is %3.3f'%(Py,Ty,Cy,My,p3,ds,e) \n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "I)Downstream of the shock: \n", + "A)Pressure is 10.333 bar \n", + "B)Temperature is 803.7 K \n", + "C)Gas velocity is 269.93 m/s \n", + "D)Mach number is 0.475 \n", + "II)Total head pressure ratio is 0.328 \n", + "III)Entropy change across the shock is 319.931 J/kg-K \n", + "IV)Strength of the shock is 9.333\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.10 page : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "a1 = 0.4 \t\t\t\t#Ratio of throat area to exit area \n", + "p1 = 0.8 \t\t\t\t#Ratio of static pressure to Stagnation pressure at inlet\n", + "At = 1. \t\t\t\t#Throat area in m**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a2 = 1/a1 \t\t\t\t#reciprocal of a1 to find in gas tables\n", + "\t\t\t\t#Pox = Po1 = Po, Poy = Po2\n", + "a2p2 = a2*p1 \t\t\t\t#Area pressure ratio i.e. (A2*P2)/(At2*Po2)\n", + "M2 = 0.28 \t\t\t\t#Exit mach number from gas tables @a2p2\n", + "a3 = 2.166 \t\t\t\t#Ratio of exit area to throat area after shock from gas tables @a2p2 \n", + "p2 = 0.947 \t\t\t\t#Static to stagnation pressure ratio at exit from gas tables @a2p2\n", + "p3 = a2/a3 \t\t\t\t#Stagnation pressure ratio after and before shock \n", + "Mx = 1.675 \t\t\t\t#Mach number before the shock @p3\n", + "My = 0.647 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "a4 = 1.14 \t\t\t\t#Ratio of area after shock to throat area after shock from isentropic gas tables @My\n", + "a5 = 1.315 \t\t\t\t#Ratio of area before shock to throat area before shock from isentropic gas tables @My\n", + "Ax = a5*At \t\t\t\t#Area at shock in m**2\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)Mach number across the shock: Mx = %3.3f My = %3.3f) \\\n", + "\\nB)Area at shock is %3.3f m**2'%(Mx,My,Ax)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number across the shock: Mx = 1.675 My = 0.647) \n", + "B)Area at shock is 1.315 m**2\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.11 page : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "a1 = 1./3 \t\t\t\t#Ratio of throat area to exit area \n", + "p1 = 0.4 \t\t\t\t#Ratio of static pressure to Stagnation pressure at inlet\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a2 = 1/a1 \t\t\t\t#reciprocal of a1 to find in gas tables\n", + "\t\t\t\t#we know Pox = Po1 = Po, Poy = Po2, At = Atx and Aty = At2\n", + "a2p2 = a2*p1 \t\t\t\t#Area pressure ratio i.e. (A2*P2)/(At2*Po2)\n", + "M2 = 0.472 \t\t\t\t#Exit mach number from gas tables @a2p2\n", + "a3 = 1.397 \t\t\t\t#Ratio of exit area to throat area after shock from gas tables @a2p2 \n", + "p2 = 0.858 \t\t\t\t#Static to stagnation pressure ratio at exit from gas tables @a2p2\n", + "p3 = a3/a2 \t\t\t\t#Stagnation pressure ratio after and before shock \n", + "Mx = 2.58 \t\t\t\t#Mach number before the shock @p3\n", + "My = 0.506 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "p4 = 9.145 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @My\n", + "a4 = 2.842 \t\t\t\t#Ratio of area before shock to throat area \n", + "p5 = 0.051 \t\t\t\t#Ratio of Pressure before shock to Stagnation pressure at entry\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'At section where shock occurs: \\\n", + "\\nA)Mach number Mx = %3.2f and My = %3.3f \\\n", + "\\nB)Static Pressure is %3.3f*Po1 units depend on Po1) \\\n", + "\\nC)Area of cross section is %3.3f*At units depend on At)'%(Mx,My,p5,a4)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "At section where shock occurs: \n", + "A)Mach number Mx = 2.58 and My = 0.506 \n", + "B)Static Pressure is 0.051*Po1 units depend on Po1) \n", + "C)Area of cross section is 2.842*At units depend on At)\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.12 page : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 300. \t\t\t\t#Pressure in reservoir in kPa\n", + "To = 500. \t\t\t\t#Temperature in reservoir in K\n", + "At = 1. \t\t\t\t#Throat area in m**2\n", + "Ax = 2. \t\t\t\t#Area just before the shock in m**2\n", + "Ay = 2. \t\t\t\t#Area just after the shock in m**2\n", + "A2 = 3. \t\t\t\t#Exit area in m**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = Ax/At \t\t\t\t#Area ratio \n", + "Mx = 2.2 \t\t\t\t#Mach number upstream of shock\n", + "p1 = 0.0935 \t\t\t\t#Ratio of pressure before shock to stagnation pressure before shock from gas tables @Mx\n", + "Px = p1*Po \t\t\t\t#pressure before shock in kPa\n", + "t1 = 0.50 \t\t\t\t#Ratio of temperature before shock to stagnation pressure before shock from gas tables @Mx\n", + "Tx = t1*To \t\t\t\t#temperature before shock in K\n", + "My = 0.547 \t\t\t\t#Mach number downstream of shock \n", + "p2 = 5.480 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = Px*p2 \t\t\t\t#Static pressure after shock in kPa\n", + "t2 = 1.857 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = t2*Tx \t\t\t\t#Temperature ratio after the shock in K\n", + "p3 = 6.716 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @My\n", + "Poy = Px*p3 \t\t\t\t#Stagnation pressure after shock in kPa\n", + "Po2 = Poy \t\t\t\t#Exit stagnation pressure in kPa, Since total pressure remains same after shock\n", + "t3 = 0.943 \t\t\t\t#Static to stagnation pressure after shock from isentropic gas tables @My\n", + "Toy = Ty/t3 \t\t\t\t#Stagnation pressure after shock in K\n", + "To2 = Toy \t\t\t\t#Exit stagnation temperature in K, Since temperature remains after shock\n", + "a2 = 1.255 \t\t\t\t#Ratio of area after shock to throat area after shock from isentropic gas tables @My\n", + "Aty = Ay/a2 \t\t\t\t#Throat area after shock in m**2\n", + "At2 = Aty \t\t\t\t#Throat area at exit in m**2\n", + "a3 = A2/At2 \t\t\t\t#Areas ratio\n", + "M2 = 0.33 \t\t\t\t#Exit mach number from gas tables @a3\n", + "p4 = 0.927 \t\t\t\t#Static to Stagnation pressure at exit from gas isentropic gas tables @a3\n", + "P2 = Po2*p4 \t\t\t\t#Exit pressure in kPa\n", + "t4 = 0.978 \t\t\t\t#Static to Stagnation temperature at exit from gas isentropic gas tables @a3\n", + "T2 = To2*t4 \t\t\t\t#Exit temperature in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Pressure at section x) Px = %3.2f kPa \\\n", + "\\nB)Pressure at section y) Px = %3.3f kPa \\\n", + "\\nC)Stagnation pressure at section y) Poy = %3.2f kPa \\\n", + "\\nD)Throat area of cross section at section y) Aty = %3.4f m**2 \\\n", + "\\nE)Stagnation pressure at exit Po2 = %3.2f kPa \\\n", + "\\nF)Throat area of cross section at exit At2 = %3.4f m**2 \\\n", + "\\nG)Static Pressure at exit P2 = %3.2f kPa \\\n", + "\\nH)Stagantion temperature at exit To2 = %3i K \\\n", + "\\nI)Temperature at exit T2 = %3i k'%(Px,Py,Poy,Aty,Po2,At2,P2,To2,T2)\n", + "\n", + "# rounding off error. " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Pressure at section x) Px = 28.05 kPa \n", + "B)Pressure at section y) Px = 153.714 kPa \n", + "C)Stagnation pressure at section y) Poy = 188.38 kPa \n", + "D)Throat area of cross section at section y) Aty = 1.5936 m**2 \n", + "E)Stagnation pressure at exit Po2 = 188.38 kPa \n", + "F)Throat area of cross section at exit At2 = 1.5936 m**2 \n", + "G)Static Pressure at exit P2 = 174.63 kPa \n", + "H)Stagantion temperature at exit To2 = 492 K \n", + "I)Temperature at exit T2 = 481 k\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.13 page : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "#Input data\n", + "Po1 = 500. \t\t\t\t#Stagnation pressure in kPa\n", + "To1 = 600. \t\t\t\t#Stagnation temperature in K\n", + "C1 = 100. \t\t\t\t#inlet velocity in m/s\n", + "A1 = 0.01 \t\t\t\t#Inlet Area in m**2\n", + "A2 = 0.01 \t\t\t\t#Exit Area in m**2\n", + "Mx = 1.2 \t\t\t\t#Mach number before the shock\n", + "Ax = 37.6 \t\t\t\t#Area just before the shock in cm**2\n", + "Ay = 37.6 \t\t\t\t#Area just after the shock in cm**2\n", + "Px = 109.9 \t\t\t\t#Pressure before the shock in kPa\n", + "Poy = 350. \t\t\t\t#Stagnation pressure after shock in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant volume in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "T1 = To1+(C1**2/(2*Cp)) \t\t\t\t#Inlet static temperature in K\n", + "ai_1 = math.sqrt(k*R*T1) \t\t\t\t#Velocity of sound at inlet in m/s\n", + "M1 = C1/ai_1 \t\t\t\t#Inlet Mach number \n", + "p1 = 0.973 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables @M1 \n", + "P1 = Po1*p1 \t\t\t\t#Inlet static pressure in kPa\n", + "d1 = P1*10**3/(R*T1) \t\t\t\t#Density at inlet in kg/m**3, P1 in Pa\n", + "m = d1*A1*C1 \t\t\t\t#Mass flow rate at inlet in kg/s\n", + "p2 = 0.528 \t\t\t\t#Ratio of critical pressure to stagnation pressure from gas tables @M = 1\n", + "Pt = Po1*p2 \t\t\t\t#Critical pressure in kPa\n", + "t1 = 0.834 \t\t\t\t#Ratio of critical temperature to stagnation temperature from gas tables @M = 1\n", + "Tt = t1*To1 \t\t\t\t#critical temperature in K\n", + "ai_t = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound at critical state in m/s\n", + "Ct = ai_t \t\t\t\t#Velocity of air at critical state in m/s\n", + "a1 = 2.964 \t\t\t\t#Ratio of inlet area to critical area from gas tables @M = 1\n", + "At = A1/a1 \t\t\t\t#critical area in m**2\n", + "dt = Pt/(R*Tt) \t\t\t\t#Density at critical state in kg/m**3\n", + "mt = dt*At*Ct \t\t\t\t#Mass flow rate at critical satate in kg/s\n", + "\t\t\t\t#Sub-division (a)\n", + "a2 = 1.030 \t\t\t\t#Ratio of area after shock to critical area from gas tables @Mx\n", + "Ay_a = At*a2 \t\t\t\t#Area after shock in cm**2\n", + "p3 = 0.412 \t\t\t\t#Ratio of upstram of shock to stagnation pressures from isentropic gas tables @Mx\n", + "Px_a = Po1*p3 \t\t\t\t#Pressure upstram of shock in kPa\n", + "t2 = 0.776 \t\t\t\t#Ratio of upstram of shock to stagnation temperature from isentropic gas tables @Mx\n", + "Tx_a = To1*t2 \t\t\t\t#Temperature upstram of shock in K\n", + "My_a = 0.84 \t\t\t\t#Mach number downstream of shock from normal shock gas tables @Mx\n", + "p4 = 1.497 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py_a = Px_a*p4 \t\t\t\t#Static pressure after shock in kPa\n", + "t3 = 1.099 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty_a = Tx_a*t3 \t\t\t\t#Temperature ratio after the shock in K\n", + "p5 = 2.407 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @My\n", + "Poy_a = Px_a*p5 \t\t\t\t#Stagnation pressure after shock in kPa\n", + "a3 = 1.204 \t\t\t\t#Ratio of area after shock to throat area after shock from isentropic gas tables @My\n", + "At2_a = (Ay_a/a3)*10**4 \t\t\t\t#Throat area at exit in m**2, calculation mistake in textbook\n", + "a4 = A2/At2_a \t\t\t\t#Ratio of areas to find gas tables \n", + "M2_a = 0.2 \t\t\t\t#Exit mach number at section-A from gas tables @a4\n", + "p5 = 0.973 \t\t\t\t#ratio of exit pressure to stagnation pressure after shock from gas tables\n", + "P2_a = p5*Poy_a \t\t\t\t#exit pressure in kPa\n", + "#Sub-division (B)\n", + "a5 = Ax/At \t\t\t\t#Ratio of area before shock to critical area\n", + "Mx_b = 1.4 \t\t\t\t#Mach number at section-B from gas tables @a5\n", + "p6 = 0.314 \t\t\t\t#Ratio of upstram of shock to stagnation pressures from isentropic gas tables @Mx_b\n", + "Px_b = Po1*p6 \t\t\t\t#Pressure upstram of shock in kPa\n", + "t4 = 0.718 \t\t\t\t#Ratio of upstram of shock to stagnation temperature from isentropic gas tables @Mx_b\n", + "Tx_b = To1*t4 \t\t\t\t#Temperature upstram of shock in K\n", + "p20 = 3.049 \t\t\t\t#Stagnation pressure ratio after shock to Static pressure before shock from gas tables \n", + "Poy_b = Px_b*p20 \t\t\t\t#Stagnation pressure after shock in kPa\n", + "My_b = 0.735 \t\t\t\t#Mach number downstream of shock from normal shock gas tables @Mx_b\n", + "p7 = 2.085 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My_b\n", + "Py_b = Px_b*p7 \t\t\t\t#Static pressure after shock in kPa\n", + "t5 = 1.260 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My_b\n", + "Ty_b = Tx_b*t5 \t\t\t\t#Temperature after the shock in K\n", + "a6 = 1.071 \t\t\t\t#Ratio of area after shock to throat area after shock from isentropic gas tables My_b = 0.735\n", + "At2_b = Ay/a6 \t\t\t\t#Throat area at exit in m**2\n", + "a7 = A2/At2_b \t\t\t\t#Ratio of areas\n", + "M2_b = 0.21 \t\t\t\t#Exit mach number at section-B from gas tables @a7\n", + "p8 = 0.9697 \t\t\t\t#ratio of exit pressure to stagnation pressure after shock from gas tables\n", + "P2_b = p8*Poy_b \t\t\t\t#exit pressure in kPa\n", + "\t\t\t\t#Sub-division (C)\n", + "p9 = Px/Po1 \t\t\t\t#Ratio of upstram of shock to stagnation pressures \n", + "Mx_c = 1.65 \t\t\t\t#Mach number at section-B from gas tables @p9\n", + "a8 = 1.292 \t\t\t\t#Ratio of area before shock to critical area from gas tables @p9\n", + "Ax_c = At*a8*10**4 \t\t\t\t#Area before shock in cm**2\n", + "t6 = 0.647 \t\t\t\t#Ratio of upstram of shock to stagnation temperature from isentropic gas tables @p9\n", + "Tx_c = To1*t6 \t\t\t\t#Temperature upstram of shock in K\n", + "My_c = 0.654 \t\t\t\t#Mach number downstream of shock from normal shock gas tables @Mx_c\n", + "p10 = 3.0095 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My_c\n", + "Py_c = Px*p10 \t\t\t\t#Pressure downstram of shock in kPa\n", + "t7 = 1.423 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My_c\n", + "Ty_c = Tx_c*t7 \t\t\t\t#Temperature after the shock in K\n", + "p12 = 4 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @Mx_c\n", + "Poy_c = Px*p12 \t\t\t\t#Stagnation pressure after shock in kPa\n", + "a9 = 1.136 \t\t\t\t#Ratio of area after shock to throat area after shock from gas tables My_c = 0.654\n", + "At2_c = Ax_c/a9 \t\t\t\t#Throat area at exit in m**2\n", + "a8 = A2/At2_c \t\t\t\t#Ratio of areas\n", + "M2_c = 0.23 \t\t\t\t#Exit mach number at section-B from gas tables @a8\n", + "p11 = 0.964 \t\t\t\t#ratio of exit pressure to stagnation pressure after shock from gas tables\n", + "P2_c = p11*Poy_c \t\t\t\t#exit pressure in kPa\n", + "\t\t\t\t#Sub-division (D)\n", + "p13 = Poy/Po1 \t\t\t\t#Pressure ratio, Since Pox = Po1\n", + "Mx_d = 2.04 \t\t\t\t#Mach number upstream of shock from gas tables @p13\n", + "My_d = 0.571 \t\t\t\t#Mach number downstream of shock from gas tables @p13\n", + "p14 = 4.688 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My_d\n", + "t8 = 1.72 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My_d\n", + "p15 = 5.847 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @Mx_d\n", + "p16 = 0.120 \t\t\t\t#Ratio of upstram of shock to stagnation pressures from isentropic tables @Mx_d\n", + "Px_d = Po1*p16 \t\t\t\t#Pressure upstram of shock in kPa\n", + "t9 = 0.546 \t\t\t\t#Ratio of upstram of shock to stagnation temperature from isentropic gas tables @Mx_d\n", + "Tx_d = To1*t9 \t\t\t\t#Temperature upstram of shock in K\n", + "p21 = 4.688 \t\t\t\t#Static pressure ratio after and before the shock from gas tables \n", + "Py_d = Px_d*p21 \t\t\t\t#Pressure downstram of shock in kPa\n", + "t12 = 1.72 \t\t\t\t#Ratio of upstram of shock to stagnation temperature from isentropic gas tables \n", + "Ty_d = Tx_d*t12 \t\t\t\t#Temperature after the shock in K\n", + "a9 = 1.745 \t\t\t\t#Ratio of area before shock to throat area from isentropic gas tables \n", + "Ax_d = At*a9*10**4 \t\t\t\t#Area before shock in cm**2\n", + "a10 = 1.226 \t\t\t\t#Ratio of area after shock to throat area after shock from isentropic tables @My_d\n", + "At2_d = (Ax_d/a10) \t\t\t\t#Throat area at exit in cm**2\n", + "a11 = A2/At2_d \t\t\t\t#Ratio of areas\n", + "M2_d = 0.29 \t\t\t\t#Exit mach number at section-B from gas tables @a11\n", + "p17 = 0.943 \t\t\t\t#ratio of exit pressure to stagnation pressure after shock from gas tables\n", + "P2_d = p17*Poy \t\t\t\t#exit pressure in kPa\n", + "#Sub-division (E)\n", + "a12 = Ax/At \t\t\t\t#Ratio of areas\n", + "Mx_e = 2.62 \t\t\t\t#Mach number upstream of shock from gas tables @a12\n", + "t10 = 0.421 \t\t\t\t#Ratio of upstram of shock to stagnation temperature from isentropic gas tables \n", + "Tx_e = To1*t10 \t\t\t\t#Temperature upstram of shock in K\n", + "p18 = 0.0486 \t\t\t\t#Ratio of upstram of shock to stagnation pressures from isentropic tables @Mx_e\n", + "Px_e = p18*Po1 \t\t\t\t#Pressure upstram of shock in kPa\n", + "My_e = 0.502 \t\t\t\t#Mach number downstream of shock from gas tables @Mx_e\n", + "p19 = 7.842 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My_e\n", + "Py_e = Px_e*p19 \t\t\t\t#Pressure downstram of shock in kPa\n", + "P2_e = Py_e \t\t\t\t#Exit pressure in kPa\n", + "t11 = 2.259 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My_d\n", + "Ty_e = Tx_e*t11 \t\t\t\t#Temperaure downstram of shock in K\n", + "T2_e = Ty_e \t\t\t\t#Exit temperature in K\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'At throat: \\\n", + "\\nMass flow rate is %3.2f kg/s \\\n", + "\\nArea at throat is %3.5f m**2 \\\n", + "\\nPressure is %3i kPa \\\n", + "\\nTemperature is %3.1f K \\\n", + "\\nVelocity is %3.1f m/s \\\n", + "\\na)At section \\\n", + "\\nA): Pressure upstream is %3i kPa \\\n", + "\\nTemperature upstream is %3.1f K \\\n", + "\\nMack number downstream is %3.2f \\\n", + "\\nPressure downstream is %3.3f kPa \\\n", + "\\nTemperature downstream is %3.3f K \\\n", + "\\nStagnation pressure downstream is %3.1f kPa \\\n", + "\\nArea is %3.3f cm**2 \\\n", + "\\nAt exit: Mach number is %3.1f \\\n", + "\\nPressure is %3.1f kPa \\\n", + "\\nB)At section \\\n", + "\\nB): Pressure upstream is %3i kPa \\\n", + "\\nTemperature upstream is %3.1f K \\\n", + "\\nMack number upstream is %3.1f \\\n", + "\\nMack number downstream is %3.3f \\\n", + "\\nPressure downstream is %3.2f kPa \\\n", + "\\nTemperature downstream is %3.2f K \\\n", + "\\nStagnation pressure downstream is %3.1f kPa \\\n", + "\\nArea is %3.3f cm**2 At exit: \\\n", + "\\nMach number is %3.2f Pressure is %3.1f kPa \\\n", + "\\nC)At section \\\n", + "\\nC): Area upstream is %3.2f cm**2 \\\n", + "\\nTemperature upstream is %3.1f K \\\n", + "\\nMack number upstream is %3.2f \\\n", + "\\nMack number downstream is %3.3f \\\n", + "\\nPressure downstream is %3.2f kPa \\\n", + "\\nTemperature downstream is %3.2f K \\\n", + "\\nStagnation pressure downstream is %3i kPa \\\n", + "\\nArea is %3.4f cm**2 At exit: \\\n", + "\\nMach number is %3.2f \\\n", + "\\nPressure is %3.1f kPa \\\n", + "\\nD)At section \\\n", + "\\nD): Pressure upstream is %3i kPa \\\n", + "\\nTemperature upstream is %3.1f K \\\n", + "\\nArea upstream is %3.3f cm**2 \\\n", + "\\nMack number upstream is %3.2f \\\n", + "\\nMack number downstream is %3.2f \\\n", + "\\nPressure downstream is %3.2f kPa \\\n", + "\\nTemperature downstream is %3.2f K \\\n", + "\\nArea is %3.3f cm**2 \\\n", + "\\nAt exit: Mach number is %3.2f \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nE)At section \\\n", + "\\nE): Pressure upstream is %3.1f kPa \\\n", + "\\nTemperature upstream is %3.1f K \\\n", + "\\nMack number upstream is %3.2f \\\n", + "\\nMack number downstream is %3.3f \\\n", + "\\nPressure downstream is %3.1f kPa \\\n", + "\\nTemperature downstream is %3.2f K \\\n", + "\\nAt exit: Temperature is %3.2f K \\\n", + "\\nPressure is %3.1f kPa'%(m,At,Pt,Tt,Ct,Px_a,Tx_a,My_a,Py_a,Ty_a,Poy_a,At2_a,M2_a,P2_a,Px_b,Tx_b,Mx_b,My_b,Py_b,Ty_b,Poy_b,At2_b,M2_b,P2_b,Ax_c,Tx_c,Mx_c,My_c,Py_c,Ty_c,Poy_c,At2_c,M2_c,P2_c,Px_d,Tx_d,Ax_d,Mx_d,My_d,Py_d,Ty_d,At2_d,M2_d,P2_d,Px_e,Tx_e,Mx_e,My_e,Py_e,Ty_e,T2_e,P2_e)\n", + "\n", + "# note : rounding off error. kindly check using calculator." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "At throat: \n", + "Mass flow rate is 2.80 kg/s \n", + "Area at throat is 0.00337 m**2 \n", + "Pressure is 264 kPa \n", + "Temperature is 500.4 K \n", + "Velocity is 448.4 m/s \n", + "a)At section \n", + "A): Pressure upstream is 206 kPa \n", + "Temperature upstream is 465.6 K \n", + "Mack number downstream is 0.84 \n", + "Pressure downstream is 308.382 kPa \n", + "Temperature downstream is 511.694 K \n", + "Stagnation pressure downstream is 495.8 kPa \n", + "Area is 28.862 cm**2 \n", + "At exit: Mach number is 0.2 \n", + "Pressure is 482.5 kPa \n", + "B)At section \n", + "B): Pressure upstream is 157 kPa \n", + "Temperature upstream is 430.8 K \n", + "Mack number upstream is 1.4 \n", + "Mack number downstream is 0.735 \n", + "Pressure downstream is 327.34 kPa \n", + "Temperature downstream is 542.81 K \n", + "Stagnation pressure downstream is 478.7 kPa \n", + "Area is 35.107 cm**2 At exit: \n", + "Mach number is 0.21 Pressure is 464.2 kPa \n", + "C)At section \n", + "C): Area upstream is 43.59 cm**2 \n", + "Temperature upstream is 388.2 K \n", + "Mack number upstream is 1.65 \n", + "Mack number downstream is 0.654 \n", + "Pressure downstream is 330.74 kPa \n", + "Temperature downstream is 552.41 K \n", + "Stagnation pressure downstream is 439 kPa \n", + "Area is 38.3713 cm**2 At exit: \n", + "Mach number is 0.23 \n", + "Pressure is 423.8 kPa \n", + "D)At section \n", + "D): Pressure upstream is 60 kPa \n", + "Temperature upstream is 327.6 K \n", + "Area upstream is 58.873 cm**2 \n", + "Mack number upstream is 2.04 \n", + "Mack number downstream is 0.57 \n", + "Pressure downstream is 281.28 kPa \n", + "Temperature downstream is 563.47 K \n", + "Area is 48.021 cm**2 \n", + "At exit: Mach number is 0.29 \n", + "Pressure is 330.05 kPa \n", + "E)At section \n", + "E): Pressure upstream is 24.3 kPa \n", + "Temperature upstream is 252.6 K \n", + "Mack number upstream is 2.62 \n", + "Mack number downstream is 0.502 \n", + "Pressure downstream is 190.6 kPa \n", + "Temperature downstream is 570.62 K \n", + "At exit: Temperature is 570.62 K \n", + "Pressure is 190.6 kPa\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.14 page : 33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T = 300. \t\t\t\t#Temperature in K\n", + "P = 1.01325*10**5 \t\t\t\t#Absolute pressure in Pa\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "C_1 = 60. \t\t\t\t#Velocity of air in m/s\n", + "C_2 = 200. \t\t\t\t#Velocity of air in m/s\n", + "C_3 = 500. \t\t\t\t#Velocity of air in m/s\n", + "d_hg = 13600. \t\t\t\t#Density of mercury in kg/m**3\n", + "g = 9.81 \t\t\t\t#Acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Sound velocity in m/s\n", + "M_1 = C_1/a \t\t\t\t#Mach number \n", + "dP1 = (P*C_1**2)/(2*R*T) \t\t\t\t#Difference in mercury levels in Pa\n", + "dP1_hg = (dP1/(d_hg*g))*1000 \t\t\t\t#Difference in mercury levels in mm of Hg\n", + "M_2 = C_2/a \t\t\t\t#Mach number \n", + "p1 = (1+((k-1)/2)*M_2**2)**(k/(k-1)) \t\t\t\t#Stagnation to static pressure ratio \n", + "Po = p1*P \t\t\t\t#Stagnation pressure in Pa\n", + "dP2 = abs(Po-P) \t\t\t\t#Difference in mercury levels in Pa\n", + "dP2_hg = (dP2/(d_hg*g))*1000 \t\t\t\t#Difference in mercury levels in mm of Hg\n", + "M_3 = C_3/a \t\t\t\t#Mach number & M_3 = Mach number just before shock\n", + "My = 0.723 \t\t\t\t#Mach number just after shock\n", + "p1 = 2.2530 \t\t\t\t#Ratio of pressure after shock to before shock from gas tables @My\n", + "Py = p1*P \t\t\t\t#Pressure after shock in Pa\n", + "p2 = 0.706 \t\t\t\t#Ratio of pressure after shock to Stagnation pressure from gas tables @My\n", + "Po = Py/p2 \t\t\t\t#Stagnation pressure in Pa\n", + "dP3 = Po-Py \t\t\t\t#Difference in mercury levels in Pa\n", + "dP3_hg = (dP3/(d_hg*g))*1000 \t\t\t\t#Difference in mercury levels in mm of Hg\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Difference in mercury levels at velocity equal to: \\\n", + "\\nA)%2i m/s is %3.3f mm of Hg \\\n", + "\\nB)%3i m/s is %3.1f mm of Hg \\\n", + "\\nC)%3i m/s is %3i mm of Hg'%(C_1,dP1_hg,C_2,dP2_hg,C_3,dP3_hg)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Difference in mercury levels at velocity equal to: \n", + "A)60 m/s is 15.877 mm of Hg \n", + "B)200 m/s is 191.5 mm of Hg \n", + "C)500 m/s is 712 mm of Hg\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.15 page : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Px = 16. \t\t\t\t#Pressure before the shock in kPa\n", + "Poy = 70. \t\t\t\t#Stagnation pressure after shock in kPa\n", + "To = 300.+273 \t\t\t\t#Stagnation temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = Poy/Px \t\t\t\t#Pressure ratio \n", + "Mx = 1.735 \t\t\t\t#Mach number upstream of shock \n", + "My = 0.631 \t\t\t\t#Mach number downstream of shock \n", + "p2 = 0.84 \t\t\t\t#Ratio of stagnation pressures after and before shock from gas tables\n", + "t1 = 1.483 \t\t\t\t#Temperature ratio after and before shock from gas tables\n", + "Tx = To/(1+((k-1)/2)*Mx**2) \t\t\t\t#Temperature upstream of shock in K\n", + "Ty = Tx*t1 \t\t\t\t#Temperature downstream of shock in K\n", + "Pox = Poy/p2 \t\t\t\t#Stagnation pressure before shock in kPa\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Mach number of the tunnal is Mx = %3.3f My = %3.3f) \\\n", + "\\nB)Upstream of the tube: \\\n", + "\\nStatic temperature is %3i K \\\n", + "\\nTotal pressure is %3.1f kPa \\\n", + "\\nC)Downstream of the tube: \\\n", + "\\nStatic temperature is %3i K \\\n", + "\\nTotal pressure is %3i kPa'%(Mx,My,Tx,Pox,Ty,Poy)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number of the tunnal is Mx = 1.735 My = 0.631) \n", + "B)Upstream of the tube: \n", + "Static temperature is 357 K \n", + "Total pressure is 83.3 kPa \n", + "C)Downstream of the tube: \n", + "Static temperature is 530 K \n", + "Total pressure is 70 kPa\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.16 page : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Py = 455. \t\t\t\t#Pressure downstream of shock in kPa\n", + "Ty = 65.+273 \t\t\t\t#Temperature downstream of shock in K\n", + "dP = 65. \t\t\t\t#Difference between dynamic and static pressure in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Poy = dP+Py \t\t\t\t#Stagnation pressure after shock in kPa\n", + "p1 = Py/Poy \t\t\t\t#Pressure ratio \n", + "My = 0.44 \t\t\t\t#Mach number downstream of shock from isentropic gas tables @p1\n", + "Mx = 3.8 \t\t\t\t#Mach number upstream of shock from normal shock gas tables @My\n", + "t1 = 3.743 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Tx = Ty/t1 \t\t\t\t#Temperature before the shock in K\n", + "ax = math.sqrt(k*R*Tx) \t\t\t\t#Velocity of sound before the shock in m/s\n", + "Cx = Mx*ax \t\t\t\t#Air Velocity before the shock in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)Mach number is Mx = %3.1f My = %3.2f) \\\n", + "\\nB)Velocity is %3.2f m/s'%(Mx,My,Cx)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Mach number is Mx = 3.8 My = 0.44) \n", + "B)Velocity is 723.83 m/s\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.17 page : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "Px = 1.01325 \t\t\t\t#Pressure before the shock in bar\n", + "Tx = 15+273 \t\t\t\t#Temperature before the shock in K\n", + "Py = 13.789 \t\t\t\t#Pressure just after the shock in bar\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = Py/Px \t\t\t\t#Pressure ratio \n", + "Mx = 3.47 \t\t\t\t#Mach number upstream of shock from normal shock gas tables @p1\n", + "My = 0.454 \t\t\t\t#Mach number downstream of shock from isentropic gas tables @p1\n", + "t1 = 3.213 \t\t\t\t#Temperature ratio after and before the shock from gas tables @Mx\n", + "Ty = Tx*t1 \t\t\t\t#Temperature downstream of shock in K\n", + "p2 = 15.574 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @Mx\n", + "Poy = Px*p2 \t\t\t\t#Stagnation pressure after shock in bar\n", + "ax = math.sqrt(k*R*Tx) \t\t\t\t#Velocity of sound before the shock in m/s\n", + "Cx = Mx*ax \t\t\t\t#Velocity of air before the shock in m/s \n", + "Csh = Cx \t\t\t\t#Since Csh = Cx, see dig.\n", + "ay = math.sqrt(k*R*Ty) \t\t\t\t#Velocity of sound after the shock in m/s\n", + "Cy = My*ay \t\t\t\t#Velocity of air after the shock in m/s\n", + "C_y = Cx-Cy \t\t\t\t#Air velocity just inside the shock in m/s\n", + "P_y = Py \t\t\t\t#Pressure of air in bar, Since a powerful explosion creates a brief but intense blast wind as it passes\n", + "a_y = math.sqrt(k*R*Ty) \t\t\t\t#\t\t\t\t#Velocity of sound after the shock in m/s\n", + "M_y = C_y/a_y \t\t\t\t#Mach number\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Shock speed is %3.2f m/s \\\n", + "\\nB)Air velocity just inside the shock is %3.2f m/s'%(Cx,C_y)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Shock speed is 1180.40 m/s \n", + "B)Air velocity just inside the shock is 903.57 m/s\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.18 page : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "T = 300. \t\t\t\t#Temperature in K\n", + "P = 1.5 \t\t\t\t#Pressure in bar\n", + "C_y = 150. \t\t\t\t#Air velocity just inside the shock in m/s\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + " \n", + "\t\t\t\t\n", + "#Calculation\n", + "ax = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound before the shock in m/s\n", + "Mx = math.sqrt(((C_y*(k+1))/(2*ax))+1) \t\t\t\t#Mach number before the shock\n", + "My = 0.79 \t\t\t\t#\t\t\t\t#Mach number after the shock from normal shock gas tables \n", + "Cx = Mx*ax \t\t\t\t#Velocity of gas before the shock in m/s\n", + "p1 = 1.775 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @My\n", + "Py = P*p1 \t\t\t\t#Pressure just after the shock in bar\n", + "t1 = 1.1845 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = T*t1 \t\t\t\t#Temperature ratio after the shock in K\n", + "ay = math.sqrt(k*R*Ty) \t\t\t\t#Velocity of sound after the shock in m/s\n", + "Csh = My*ay \t\t\t\t#Speed of the wave in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)Speed of the wave is %3.1f m/s \\\n", + "\\nB)At rest condition: \\\n", + "\\nPressure is %3.4f bar \\\n", + "\\nTemperature is %3.2f K'%(Csh,Py,Ty)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Speed of the wave is 298.5 m/s \n", + "B)At rest condition: \n", + "Pressure is 2.6625 bar \n", + "Temperature is 355.35 K\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.19 page : 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Mx = 2. \t\t\t\t#Mach number before the shock\n", + "a1 = 3. \t\t\t\t#Diffuser area ratio\n", + "Pox = 0.1 \t\t\t\t#Stagnation pressure before shock in bar\n", + "Tx = 300. \t\t\t\t#Temperature before the shock in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.555 \t\t\t\t#Static to stagnation temperature ratio before shock from isentropic gas tables @Mx,k = 1.4\n", + "Tox = Tx/t1 \t\t\t\t#Stagnation temperature before shock in K\n", + "p1 = 0.128 \t\t\t\t#Static to stagnation pressure ratio before shock from isentropic gas tables @Mx,k = 1.4\n", + "Px = Pox*p1 \t\t\t\t#Pressure before the shock in bar\n", + "My = 0.577 \t\t\t\t#Mach number after the shock\n", + "p2 = 4.5 \t\t\t\t#Pressure ratio after and before the shock from gas tables @Mx\n", + "Py = Px*p2 \t\t\t\t#Pressure just after the shock in bar\n", + "t2 = 1.687 \t\t\t\t#Temperature ratio after and before the shock from gas tables @Mx\n", + "Ty = Tx*t2 \t\t\t\t#Temperature ratio after the shock in K\n", + "p3 = 0.721 \t\t\t\t#Stagnation pressure ratio after and before shock from gas tables @Mx\n", + "Poy = Pox*p3 \t\t\t\t#Stagnation pressure after shock in kPa\n", + "a2 = 1.2195 \t\t\t\t#Ratio of area after shock to throat area after shock from gas tables @My\n", + "a3 = a2*a1 \t\t\t\t#Ratio of exit area to throat area at exit \n", + "M2 = 0.16 \t\t\t\t#Exit mach number from gas tables @a3\n", + "t3 = 0.9946 \t\t\t\t#Static to stagnation temperature ratio at exit from isentropic gas tables @Mx\n", + "T2 = Tox*t3 \t\t\t\t#Exit Temperature in K, Since Tox = Toy = T02 in case of diffuser\n", + "p4 = 0.982 \t\t\t\t#Static to stagnation pressure ratio at exit from isentropic gas tables @Mx\n", + "P2 = Poy*p4 \t\t\t\t#Exit pressure in bar, Calculation mistake in textbook\n", + "eff = ((((Tox/Tx)*(Poy/Pox)**((k-1)/k))-1)/(((k-1)/2)*Mx**2))*100 \t\t\t\t#Diffuser efficiency including shock in percent\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)At the diffuser exit: \\\n", + "\\nMach number is %3.2f \\\n", + "\\nPressure is %3.3f bar \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nB)Diffuser efficiency including shock is %3.3f percent'%(M2,P2,T2,eff)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)At the diffuser exit: \n", + "Mach number is 0.16 \n", + "Pressure is 0.071 bar \n", + "Temperature is 537.62 K \n", + "B)Diffuser efficiency including shock is 80.129 percent\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.20 page : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "k = 1.3 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "P1 = 1. \t\t\t\t#Inlet pressure in bar\n", + "T1 = 400. \t\t\t\t#Inlet temperature in K\n", + "D = 0.3 \t\t\t\t#Duct diameter in m\n", + "M1 = 2. \t\t\t\t#Mach number at entry\n", + "Mx = 1.5 \t\t\t\t#Mach number upstream of shock \n", + "M2 = 1. \t\t\t\t#Mach number at outlet\n", + "f = 0.003 \t\t\t\t#Friction factor\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "d1 = P1*10**5/(R*T1) \t\t\t\t#Density at inlet in kg/m**3\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Velocity of sound at inlet in m/s \n", + "C1 = M1*a1 \t\t\t\t#Gas velocity at inlet in m/s\n", + "A1 = math.pi*D**2/4 \t\t\t\t#Inlet Area of the duct in m**2\n", + "m = d1*C1*A1 \t\t\t\t#Mass flow rate in kg/s\n", + "p1 = 0.131 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "Po1 = P1/p1 \t\t\t\t#Stagantion pressure at inlet in bar\n", + "t1 = 0.625 \t\t\t\t#Static to Stagnation temperature ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "To1 = T1/t1 \t\t\t\t#Stagnation temperature at inlet in K\n", + "p2 = 0.424 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Pt1 = P1/p2 \t\t\t\t#Critical pressure in bar\n", + "p3 = 1.773 \t\t\t\t#Stagnation pressure ratio at entry to critical state from gas tables,fanno flow tables @M1,k = 1.4\n", + "Pto1 = Po1/p3 \t\t\t\t#Stagnation pressure at critical state in bar \n", + "t2 = 0.719 \t\t\t\t#Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Tt1 = T1/t2 \t\t\t\t#Critical temperature in K\n", + "X1 = 0.357 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "p4 = 0.618 \t\t\t\t#Ratio of Static pressure before shock to critical pressure at entry from gas tables (fanno flow,Mx,k = 1.4) \n", + "Px = Pt1*p4 \t\t\t\t#pressure before shock in bar\n", + "t3 = 0.860 \t\t\t\t#Ratio of Static temperature before shock to critical temperature at entry from gas tables (fanno flow,Mx,k = 1.4) \n", + "Tx = Tt1*t3 \t\t\t\t#Temperature before shock in K\n", + "p5 = 1.189 \t\t\t\t#Ratio of Stagnation pressure before shock to Stagnation pressure at critical state at entry from gas tables (fanno flow,Mx,k = 1.4) \n", + "Pox = Pto1*p5 \t\t\t\t#Stagnation pressure at critical state in bar\n", + "Xx = 0.156 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @Mx,k = 1.4\n", + "X3 = X1-Xx \t\t\t\t#Overall frictional consmath.tant fanno parameter upstream of duct\n", + "L1 = (X3*D)/(4*f) \t\t\t\t#Length upstream of duct in m\n", + "My = 0.7 \t\t\t\t#Mach number downstream of shock from gas tables @Mx\n", + "p6 = 2.413 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = Px*p6 \t\t\t\t#Pressure after shock in bar\n", + "t4 = 1.247 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t4 \t\t\t\t#temperature after shock in K\n", + "p7 = 0.926 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @My\n", + "Poy = Pox*p7 \t\t\t\t#Stagnation pressure after shock in bar\n", + "p8 = 1.479 \t\t\t\t#Ratio of pressure after shock to pressure at critical state from gas tables @My\n", + "Pt = Py/p8 \t\t\t\t#Critical pressure in bar\n", + "p9 = 1.097 \t\t\t\t#Ratio of Stagnation pressure after shock to Stagnation pressure at critical state from gas tables @My\n", + "Pot = Poy/p9 \t\t\t\t#Stagnation pressure at critical state in bar\n", + "t5 = 1.071 \t\t\t\t#Ratio of temperature after shock to temperature at critical state from gas tables @My\n", + "Tt = Ty/t5 \t\t\t\t#Critical temperature in K\n", + "Xy = 0.231 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @My,k = 1.4\n", + "X2 = 0 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M = 1,k = 1.4\n", + "X4 = Xy-X2 \t\t\t\t#Overall frictional consmath.tant fanno parameter downstream of duct\n", + "L2 = (X4*D)/(4*f) \t\t\t\t#Length downstream of duct in m\n", + "ds1 = R*math.log(Po1/Pox) \t\t\t\t#Change of entropy upstream of the shock in J/kg-K\n", + "ds2 = R*math.log(Pox/Poy) \t\t\t\t#Change of entropy across the shock in J/kg-K\n", + "ds3 = R*math.log(Poy/Pot) \t\t\t\t#Change of entropy downstream of the shock in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the duct upstream and downstream of the duct is %3.3f m and %3.3f m respectively \\\n", + "\\nB)Mass flow rate of the gas is %3.3f kg/s \\\n", + "\\nC)Change of entropy: \\\n", + "\\nUpstream of the shock is %3.2f J/kg-K \\\n", + "\\nAcross the shock is %3.3f J/kg-K \\\n", + "\\nDownstream of the shock is %3.4f J/kg-K'%(L1,L2,m,ds1,ds2,ds3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the duct upstream and downstream of the duct is 5.025 m and 5.775 m respectively \n", + "B)Mass flow rate of the gas is 47.573 kg/s \n", + "C)Change of entropy: \n", + "Upstream of the shock is 114.67 J/kg-K \n", + "Across the shock is 22.065 J/kg-K \n", + "Downstream of the shock is 26.5702 J/kg-K\n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.21 page : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P1 = 0.685 \t\t\t\t#Inlet pressure in bar\n", + "T1 = 310. \t\t\t\t#Inlet temperature in K\n", + "D = 0.6 \t\t\t\t#Duct diameter in m\n", + "M1 = 3. \t\t\t\t#Mach number at entry\n", + "Mx = 2.5 \t\t\t\t#Mach number upstream of shock \n", + "M2 = 0.8 \t\t\t\t#Mach number at outlet\n", + "f = 0.005 \t\t\t\t#Friction factor\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "d1 = P1*10**5/(R*T1) \t\t\t\t#Density at inlet in kg/m**3\n", + "a1 = math.sqrt(k*R*T1) \t\t\t\t#Velocity of sound at inlet in m/s \n", + "C1 = M1*a1 \t\t\t\t#Air velocity at inlet in m/s\n", + "A1 = math.pi*D**2/4 \t\t\t\t#Inlet Area of the duct in m**2\n", + "m = d1*C1*A1 \t\t\t\t#Mass flow rate in kg/s\n", + "p1 = 0.218 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Pt1 = P1/p1 \t\t\t\t#Critical pressure in bar \n", + "t1 = 0.428 \t\t\t\t#Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Tt1 = T1/t1 \t\t\t\t#Critical temperature in K\n", + "X1 = 0.522 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "p2 = 0.292 \t\t\t\t#Ratio of Static pressure before shock to critical pressure at entry from gas tables (fanno flow,Mx,k = 1.4)\n", + "Px = Pt1*p2 \t\t\t\t#pressure before shock in bar\n", + "t2 = 0.533 \t\t\t\t#Ratio of Static temperature before shock to critical temperature at entry from gas tables (fanno flow,Mx,k = 1.4) \n", + "Tx = Tt1*t2 \t\t\t\t#Temperature before shock in K\n", + "Xx = 0.432 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @Mx,k = 1.4\n", + "X3 = X1-Xx \t\t\t\t#Overall frictional consmath.tant fanno parameter upstream of duct\n", + "L1 = (X3*D)/(4*f) \t\t\t\t#Length upstream of duct in m\n", + "My = 0.513 \t\t\t\t#Mach number downstream of shock from gas tables @Mx\n", + "p3 = 7.125 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = Px*p3 \t\t\t\t#Pressure after shock in bar\n", + "t3 = 2.138 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t3 \t\t\t\t#temperature after shock in K\n", + "p4 = 2.138 \t\t\t\t#Ratio of pressure after shock to pressure at critical state from gas tables @My\n", + "Pt = Py/p4 \t\t\t\t#Critical pressure in bar\n", + "t4 = 1.143 \t\t\t\t#Ratio of temperature after shock to temperature at critical state from gas tables @My\n", + "Tt = Ty/t4 \t\t\t\t#Critical temperature in K\n", + "p5 = 1.289 \t\t\t\t#Ratio of pressure at exit to pressure at critical state from gas tables @M2\n", + "P2 = Pt*p5 \t\t\t\t#Exit pressure in bar \n", + "t5 = 1.064 \t\t\t\t#Ratio of temperature at exit to temperature at critical state from gas tables @M2 \n", + "T2 = Tt*t5 \t\t\t\t#Exit temperature in K\n", + "Xy = 1.069 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @My,k = 1.4\n", + "X2 = 0.073 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M2,k = 1.4\n", + "X4 = Xy-X2 \t\t\t\t#Overall frictional consmath.tant fanno parameter downstream of duct\n", + "L2 = (X4*D)/(4*f) \t\t\t\t#Length downstream of duct in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length L1 and L2 are %3.1f m and %3.2f m respectively \\\n", + "\\nB)State of air at exit: Pressure is %3.3f bar Temperature is %3.1f K \\\n", + "\\nC)Mass flow rate through the duct is %3.2f kg/s'%(L1,L2,P2,T2,m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length L1 and L2 are 2.7 m and 29.88 m respectively \n", + "B)State of air at exit: Pressure is 3.941 bar Temperature is 768.3 K \n", + "C)Mass flow rate through the duct is 230.49 kg/s\n" + ] + } + ], + "prompt_number": 40 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.22 page : 42" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "At = 24. \t\t\t\t#Throat area in cm**2\n", + "A2 = 50. \t\t\t\t#Exit area in cm**2\n", + "Po = 700. \t\t\t\t#Stagnation pressure in kPa\n", + "To = 100.+273 \t\t\t\t#Stagnation temperature in K\n", + "Ax = 34. \t\t\t\t#Area before the shock in cm**2\n", + "Ay = 34. \t\t\t\t#Area after the shock in cm**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a1 = Ax/At \t\t\t\t#Ratio of areas\n", + "Mx = 1.78 \t\t\t\t#Mach number upstream of shock from gas tables @a1\n", + "t1 = 0.61212 \t\t\t\t#Ratio of temperature before shock to critical state from isentropic gas tables @Mx\n", + "Tx = To*t1 \t\t\t\t#temperature before shock in K\n", + "p1 = 0.179 \t\t\t\t#Ratio of pressure before shock to critical state from isentropic gas tables @Mx\n", + "Px = Po*p1 \t\t\t\t#pressure before shock in kPa\n", + "My = 0.621 \t\t\t\t#Mach number downstream of shock from gas tables @Mx\n", + "p2 = 3.5298 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = Px*p2 \t\t\t\t#Pressure after shock in kPa\n", + "t2 = 1.51669 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t2 \t\t\t\t#temperature after shock in K\n", + "p3 = 4.578 \t\t\t\t#Ratio of Stagnation pressure after the shock to static pressure before shock from gas tables @My\n", + "Po2 = Px*p3 \t\t\t\t#Stagnation pressure at exit in bar\n", + "a2 = 1.16565 \t\t\t\t#Ratio of area after shock to critical area across shock from isentropic gas tables @My\n", + "At2 = Ay/a2 \t\t\t\t#critical area at exit in cm**2\n", + "a3 = A2/At2 \t\t\t\t#Ratio of areas \n", + "M2 = 0.36 \t\t\t\t#Exit mach number from gas tables (a3,k = 1.4,isentropiC)\n", + "p4 = 0.914 \t\t\t\t#Static to Stagnation pressure ratio at exit from gas tables (a3,k = 1.4,isentropiC) \n", + "P2 = Po2*p4 \t\t\t\t#Stagnation pressure ratio at exit in kPa\n", + "t3 = 0.975 \t\t\t\t#Static to Stagnation temperature ratio at exit from gas tables (a3,k = 1.4,isentropiC)\n", + "T2 = To*t3 \t\t\t\t#Stagnation temperature at exit in K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Properties of fluid just after shock: \\\n", + "\\nMach number My = %3.3f \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nPressure is %3.2f kPa \\\n", + "\\nB)Exit mach number is %3.2f \\\n", + "\\nC)Properties of fluid at exit: \\\n", + "\\nPressure is %3i kPa \\\n", + "\\nTemperature is %3.3f K'%(My,Ty,Py,M2,P2,T2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Properties of fluid just after shock: \n", + "Mach number My = 0.621 \n", + "Temperature is 346.29 K \n", + "Pressure is 442.28 kPa \n", + "B)Exit mach number is 0.36 \n", + "C)Properties of fluid at exit: \n", + "Pressure is 524 kPa \n", + "Temperature is 363.675 K\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.23 page : 44" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D = 0.4 \t\t\t\t#Duct diameter in m\n", + "Po = 12. \t\t\t\t#Stagnation pressure in kPa\n", + "To = 600. \t\t\t\t#Stagnation temperature in K\n", + "f = 0.0025 \t\t\t\t#Friction factor\n", + "M1 = 1.8 \t\t\t\t#Mach number at entry\n", + "M2 = 1. \t\t\t\t#Mach number at outlet\n", + "Mx = 1.22 \t\t\t\t#Mach number upstream of shock \n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "A2 = math.pi*D**2/4 \t\t\t\t#Exit area in cm**2\n", + "p1 = 0.174 \t\t\t\t#Static to Stagnation pressure ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "P1 = Po*p1 \t\t\t\t#Inlet pressure in bar\n", + "t1 = 0.607 \t\t\t\t#Static to Stagnation temperature ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n", + "T1 = To*t1 \t\t\t\t#Inlet temperature in K\n", + "a1 = 1.094 \t\t\t\t#Ratio of area at exit to critical area across shock from isentropic gas tables @M1,k = 1.4\n", + "Ax = A2/a1 \t\t\t\t#Area before the shock in cm**2\n", + "Dt = math.sqrt((Ax*4)/(math.pi))*10**2 \t\t\t\t#Duct diameter at throat in cm\n", + "p2 = 0.474 \t\t\t\t#Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Pt = P1/p2 \t\t\t\t#Critical pressure in bar \n", + "t2 = 0.728 \t\t\t\t#Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k = 1.4\n", + "Tt = T1/t2 \t\t\t\t#Critical temperature in K\n", + "X1 = 0.242 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M1,k = 1.4\n", + "p3 = 0.788 \t\t\t\t#Ratio of Static pressure before shock to critical pressure at entry from gas tables (fanno flow,Mx,k = 1.4)\n", + "Px = Pt*p3 \t\t\t\t#pressure before shock in bar\n", + "t3 = 0.925 \t\t\t\t#Ratio of Static temperature before shock to critical temperature at entry from gas tables (fanno flow,Mx,k = 1.4)\n", + "Tx = Tt*t3 \t\t\t\t#Temperature before shock in K\n", + "Xx = 0.039 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @Mx,k = 1.4\n", + "X3 = X1-Xx \t\t\t\t#Overall frictional consmath.tant fanno parameter upstream of duct\n", + "L1 = (X3*D)/(4*f) \t\t\t\t#Length upstream of duct in m\n", + "My = 0.83 \t\t\t\t#Mach number downstream of shock from gas tables @Mx\n", + "p4 = 1.57 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @My\n", + "Py = Px*p4 \t\t\t\t#Pressure after shock in bar\n", + "t4 = 1.141 \t\t\t\t#Temperature ratio after and before the shock from gas tables @My\n", + "Ty = Tx*t4 \t\t\t\t#temperature after shock in K\n", + "p5 = 1.2375 \t\t\t\t#Ratio of pressure after shock to pressure at critical state from gas tables @My\n", + "Pt = Py/p5 \t\t\t\t#Critical pressure in bar\n", + "t5 = 1.055 \t\t\t\t#Ratio of temperature after shock to temperature at critical state from gas tables @My\n", + "Tt = Ty/t5 \t\t\t\t#Critical temperature in K\n", + "Xy = 0.049 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @My,k = 1.4\n", + "X2 = 0 \t\t\t\t#frictional consmath.tant fanno parameter from gas tables,fanno flow tables @M = 1,k = 1.4\n", + "X4 = Xy-X2 \t\t\t\t#Overall frictional consmath.tant fanno parameter downstream of duct\n", + "L2 = (X4*D)/(4*f) \t\t\t\t#Length downstream of duct in m\n", + "L = L1+L2 \t\t\t\t#Length of duct in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Length of the pipe is %3.2f m \\\n", + "\\nB)Diameter of the nozzle throat is %3.3f cm \\\n", + "\\nC)At the pipe exit: \\\n", + "\\nPressure is %3.3f bar \\\n", + "\\nTemperature is %3.2f K'%(L,Dt,Pt,Tt)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Length of the pipe is 10.08 m \n", + "B)Diameter of the nozzle throat is 38.243 cm \n", + "C)At the pipe exit: \n", + "Pressure is 4.404 bar \n", + "Temperature is 500.48 K\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.24 page : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Po = 700. \t\t\t\t#Stagnation pressure in kPa\n", + "To = 500.+273 \t\t\t\t#Stagnation temperature in K\n", + "a1 = 3.5 \t\t\t\t#Ratio of exit area to throat area\n", + "m = 5.5 \t\t\t\t#Mass flow rate in kg/s\n", + "Cp = 1.005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in kJ/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "My = 1/math.sqrt(k) \t\t\t\t#Mach number downstream of shock\n", + "M2 = 2.8 \t\t\t\t#Mach number at outlet from gas tables @a1 \n", + "t1 = 0.389 \t\t\t\t#Static to Stagnation temperature ratio at exit from gas tables (M1,k = 1.4,isentropiC)\n", + "T2 = To*t1 \t\t\t\t#Exit temperature in K\n", + "p1 = 0.0369 \t\t\t\t#Static to Stagnation pressure ratio at exit from gas tables (M1,k = 1.4,isentropiC)\n", + "P2 = Po*p1 \t\t\t\t#exit pressure in kPa\n", + "p2 = 0.2 \t\t\t\t#Ratio of pressure at exit to pressure at critical state at exit from Rayleigh flow gas tables @M2\n", + "Pt2 = P2/p2 \t\t\t\t#Exit pressure at critical state in kPa\n", + "t2 = 0.315 \t\t\t\t#Ratio of temperature at exit to temperature at critical state at exit from Rayleigh flow gas tables @M2\n", + "Tt2 = T2/t2 \t\t\t\t#Exit temperature at critical state in K\n", + "t3 = 0.674 \t\t\t\t#Ratio of Stagnation temperature at exit to stagnation temperature at critical state at exit from Rayleigh flow gas tables @M2\n", + "Tto2 = To/t3 \t\t\t\t#Exit stagnation temperature at critical state in K\n", + "Mx = 1.2 \t\t\t\t#Mach number upstream of shock from gas tables @My\n", + "p3 = 0.796 \t\t\t\t#Ratio of Static pressure before shock to critical pressure at exit from gas tables (Rayleigh flow,Mx,k = 1.4)\n", + "Px = Pt2*p3 \t\t\t\t#Static pressure before shock in kPa\n", + "t4 = 0.912 \t\t\t\t#Ratio of Static temperature before shock to critical temperature at exit from gas tables (Rayleigh flow,Mx,k = 1.4)\n", + "Tx = Tt2*t4 \t\t\t\t#Static temperature before shock in K\n", + "t5 = 0.978 \t\t\t\t#Ratio of Stagnation temperature before shock to critical Stagnation temperature at exit from gas tables (Rayleigh flow,Mx,k = 1.4)\n", + "Tox = Tto2*t5 \t\t\t\t#Stagnation temperature before shock in K\n", + "p4 = 1.513 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @Mx \n", + "Py = Px*p4 \t\t\t\t#Pressure after shock in kPa\n", + "t6 = 1.128 \t\t\t\t#Temperature ratio after and before the shock from gas tables @Mx\n", + "Ty = Tx*t6 \t\t\t\t#temperature after shock in K\n", + "t7 = 0.875 \t\t\t\t#Ratio of Temperature after the shock to Stagnation temperature after shock from gas tables @Mx \n", + "Toy = Ty/t7 \t\t\t\t#Stagnation temperature after shock in K,\n", + "p5 = 1.207 \t\t\t\t#Ratio of pressure after shock to pressure at critical state from gas tables @My\n", + "Pt = Py/p5 \t\t\t\t#Critical pressure in kPa\n", + "t8 = 1.028 \t\t\t\t#Ratio of temperature after shock to temperature at critical state from gas tables @My\n", + "Tt = Ty/t8 \t\t\t\t#Critical temperature in K\n", + "t9 = 0.978 \t\t\t\t#Ratio of Stagnation temperature after shock to Stagnation temperature at critical state from gas tables @My\n", + "Tot = Toy/t9 \t\t\t\t#Stagnation temperature at critical state in K, calculation mistake in textbbok \n", + "q1 = Cp*(Tox-To) \t\t\t\t#Amount of heat added in upstream of shock in kJ/s\n", + "q2 = Cp*(Tot-Toy) \t\t\t\t#Amount of heat added in downstream of shock in kJ/s\n", + "Q = m*(q1+q2) \t\t\t\t#Amount of heat added in two pipe section in kJ/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Amount of heat added in two pipe section is %3.2f kJ/s \\\n", + "\\nB)Properties: Upstream of shock: \\\n", + "\\nPressure is %3.1f kPa \\\n", + "\\nTemperature is %3.3f K \\\n", + "\\nStagnation temperature is %3.2f K \\\n", + "\\nMach number is %3.1f \\\n", + "\\nDownstream of shock: Pressure is %3.3f kPa \\\n", + "\\nTemperature is %3.3f K \\\n", + "\\nStagnation temperature is %3.1f K \\\n", + "\\nMach number is %3.3f \\\n", + "\\nAt the throat: Pressure is %3.2f kPa \\\n", + "\\nTemperature is %3.3f K \\\n", + "\\nStagnation temperature is %3.2f K \\\n", + "\\nAt the exit: Pressure is %3.2f kPa \\\n", + "\\nTemperature is %3.2f K \\\n", + "\\nMach number is %3.2f'%(Q,Px,Tx,Tox,Mx,Py,Ty,Toy,My,Pt,Tt,Tot,P2,T2,M2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Amount of heat added in two pipe section is 2066.73 kJ/s \n", + "B)Properties: Upstream of shock: \n", + "Pressure is 102.8 kPa \n", + "Temperature is 870.589 K \n", + "Stagnation temperature is 1121.65 K \n", + "Mach number is 1.2 \n", + "Downstream of shock: Pressure is 155.542 kPa \n", + "Temperature is 982.025 K \n", + "Stagnation temperature is 1122.3 K \n", + "Mach number is 0.845 \n", + "At the throat: Pressure is 128.87 kPa \n", + "Temperature is 955.277 K \n", + "Stagnation temperature is 1147.56 K \n", + "At the exit: Pressure is 25.83 kPa \n", + "Temperature is 300.70 K \n", + "Mach number is 2.80\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.25 page : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 2.8 \t\t\t\t#Inlet mach number \n", + "sig = 42. \t\t\t\t#Shock wave angle in degree\n", + "Px = 1. \t\t\t\t#Pressure upstream of shock in bar(Assuming)\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "Mx = M1*math.sin(math.radians(sig)) \t\t\t\t#Mach number before the shock\n", + "My = 0.601 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "p1 = 3.98 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @Mx \n", + "Py = Px*p1 \t\t\t\t#Pressure after shock in bar\n", + "p2 = 4.994 \t\t\t\t#Stagnation pressure after shock to Static pressure before shock from gas tables @Mx\n", + "Poy = Px*p2 \t\t\t\t#Stagnation pressure after shock in bar\n", + "p3 = 0.788 \t\t\t\t#Stagnation pressure ratio after and before the shock from gas tables @Mx\n", + "Pox = Poy/p3 \t\t\t\t#Stagnation pressure before shock in kPa\n", + "dPl = Pox-Poy \t\t\t\t#Total pressure loss in bar\n", + "#disp(((M1^2*sind(2*sig))-(2/tand(sig)))/(2+(M1^2*(k+cosd(2*sig)))))\n", + "#def=atand(((M1^2*sind(2*sig))-(2/tand(sig)))/(2+(M1^2*(k+cosd(2*sig))))) //Deflection angle in degree\n", + "def1 = (M1**2*math.sin(math.radians(2*sig)) - (2/math.tan(math.radians(sig))))/(2 + M1**2*(k+math.cos(math.radians(2*sig))))\n", + "def1 = math.degrees(math.atan(def1))\n", + "M2 = My/(math.sin(math.radians(sig-def1))) \t\t\t\t#Downstream mach number\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)Deflection angle is %3i degree \\\n", + "\\nB)Downstream mach number is %3.3f \\\n", + "\\nC)Static pressure is %3.3f bar \\\n", + "\\nD)Total pressure loss is %3.3f bar'%(def1,M2,Py,dPl)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Deflection angle is 22 degree \n", + "B)Downstream mach number is 1.758 \n", + "C)Static pressure is 3.980 bar \n", + "D)Total pressure loss is 1.344 bar\n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.26 page : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 2. \t\t\t\t#Inlet mach number \n", + "sig = 40. \t\t\t\t#Shock wave angle in degree\n", + "Px = 0.5 \t\t\t\t#Pressure upstream of shock in bar\n", + "Tx = 273. \t\t\t\t#Temperature upstream of shock in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Mx = M1*math.sin(math.radians(sig)) \t\t\t\t#Mach number before the shock\n", + "My = 0.796 \t\t\t\t#Mach number after the shock from gas tables @Mx\n", + "p1 = 1.745 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @Mx \n", + "Py = p1*Px \t\t\t\t#Pressure after shock in bar\n", + "t1 = 1.178 \t\t\t\t#Static temperature ratio after and before the shock from gas tables @Mx \n", + "Ty = Tx*t1 \t\t\t\t#Temperature after shock in K\n", + "Ws = math.degrees(math.atan(((M1**2*math.sin(math.radians(2*sig))) - (2/math.tan(math.radians(sig)))) / (2+ (M1**2*(k+math.cos(math.radians(2*sig)))))))\n", + "W = 2*Ws \t\t\t\t#Wedge angle in degree\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Static pressure is %3.4f bar \\\n", + "\\nB)Temperature behind the wave is %3.2f K \\\n", + "\\nC)Mach number of flow pasmath.sing over wedge is %3.3f \\\n", + "\\nD)Wedge angle is %3.2f degree'%(Py,Ty,Mx,W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Static pressure is 0.8725 bar \n", + "B)Temperature behind the wave is 321.59 K \n", + "C)Mach number of flow pasmath.sing over wedge is 1.286 \n", + "D)Wedge angle is 21.25 degree\n" + ] + } + ], + "prompt_number": 47 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.27 page : 48" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import roots\n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "def1 = 15.\n", + "M1 = 2\n", + "k = 1.4\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "#Umath.sing relation def = math.radians(math.tan((((M1**2*math.sin(math.radians(2*sig))-(2/math.radians(math.tan((sig)))/(2+(M1**2*(k+math.cos(math.radians(2*sig))))) and converting into 6th degree polynomial of math.sin(math.radians(sig) = x\n", + "#C=((2*tand(def))+((M1^2)*k*tand(def))+((M1^2)*tand(def))) \n", + "C = ((2*math.tan(math.radians(def1))) + ((M1**2)*k*math.tan(math.radians(def1))) + ((M1**2)*math.tan(math.radians(def1))))\n", + "#C = ((2*math.radians(math.tan((def1))+((M1**2)*k*math.radians(math.tan((def1))+((M1**2)*math.radians(math.tan((def1))) \t\t\t\t#Consmath.tant value for convenience\n", + "D = (2*M1**2*math.tan(math.radians(def1))) \t\t\t\t#Consmath.tant value for convenience\n", + "a = 4 \t\t\t\t#Value of consmath.tant in polynomial \n", + "b = 0 \t\t\t\t#Coefficient of power 1 i.e. x**1\n", + "c = (4+C**2+(8*M1**2)) \t\t\t\t#Coefficient of power 2 i.e. x**2\n", + "d = 0 \t\t\t\t#Coefficient of power 3 i.e. x**3\n", + "e = (4*(M1**4))+(2*C*D)+(8*M1**2) \t\t\t\t#Coefficient of power 4 i.e. x**4\n", + "f = 0 \t\t\t\t#Coefficient of power 5 i.e. x**5\n", + "g = (4*M1**4)+D**2 \t\t\t\t#Coefficient of power 6 i.e. x**6\n", + "#p4 = poly([a b -c -d e f -g],'x','c') \t\t\t\t#Expression for solving 6th degree polynomial\n", + "print ('Values for sine of wave angle are:')\n", + "print (roots([-g,f,e,-d,-c,b,a]))\n", + "sig1 = math.degrees(math.asin(0.9842)) \t\t\t\t#Strong shock wave angle in degree, nearer to 90 degree\n", + "sig2 = math.degrees(math.asin(0.7113)) \t\t\t\t#Weak shock wave angle in degree, nearer to 45 degree\n", + "\n", + "#(a)Strong Shock Wave\n", + "Mx_1 = M1*math.sin(math.radians(sig1)) \t\t\t\t#Mach number before the shock of stong shock wave\n", + "My_1 = 0.584 \t\t\t\t#Mach number after the shock from gas tables @Mx_1\n", + "p1 = 4.315 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @Mx_1\n", + "t1 = 1.656 \t\t\t\t#Static temperature ratio after and before the shock from gas tables @Mx_1\n", + "d1 = p1/t1 \t\t\t\t#Density ratio after and before the shock of stong shock wave\n", + "M2_1 = My_1/(math.sin(math.radians(sig1-def1))) \t\t\t\t#Exit mach number of stong shock wave\n", + "Mx_2 = M1*math.sin(math.radians(sig2)) \t\t\t\t#Mach number before the shock of weak shock wave\n", + "My_2 = 0.731 \t\t\t\t#Mach number after the shock from gas tables @Mx_2\n", + "p2 = 2.186 \t\t\t\t#Static pressure ratio after and before the shock from gas tables @Mx_2\n", + "t2 = 1.267 \t\t\t\t#Static temperature ratio after and before the shock from gas tables @Mx_2\n", + "d2 = p2/t2 \t\t\t\t#Density ratio after and before the shock of weak shock wave\n", + "M2_2 = My_2/(math.sin(math.radians(sig2-def1))) \t\t\t\t#Exit mach number of weak shock wave\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'Strong Shock Wave: A)Wave angle is %3.1f degree \\\n", + "\\nB)Pressure ratio is %3.3f \\\n", + "\\nC)Density ratio is %3.3f \\\n", + "\\nD)Temperature ratio is %3.3f \\\n", + "\\nE)Downstream Mach number is %3.3f \\\n", + "\\nWeak Shock Wave: A)Wave angle is %3.1f degree \\\n", + "\\nB)Pressure ratio is %3.3f \\\n", + "\\nC)Density ratio is %3.3f \\\n", + "\\nD)Temperature ratio is %3.3f \\\n", + "\\nE)Downstream Mach number is %3.3f'%(sig1,p1,d1,t1,M2_1,sig2,p2,d2,t2,M2_2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Values for sine of wave angle are:\n", + "[ 0.98429339 -0.98429339 0.71133473 -0.71133473 -0.34489365 0.34489365]\n", + "Strong Shock Wave: A)Wave angle is 79.8 degree \n", + "B)Pressure ratio is 4.315 \n", + "C)Density ratio is 2.606 \n", + "D)Temperature ratio is 1.656 \n", + "E)Downstream Mach number is 0.645 \n", + "Weak Shock Wave: A)Wave angle is 45.3 degree \n", + "B)Pressure ratio is 2.186 \n", + "C)Density ratio is 1.725 \n", + "D)Temperature ratio is 1.267 \n", + "E)Downstream Mach number is 1.447\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.28 page : 49" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\t\n", + "#Input data\n", + "k = 1.3 \t\t\t\t#Adiabatic consmath.tant \n", + "P1 = 0.345 \t\t\t\t#Inlet pressure in bar\n", + "T1 = 350. \t\t\t\t#Inlet temperature in K\n", + "M1 = 1.5 \t\t\t\t#Inlet mach number \n", + "P2 = 0.138 \t\t\t\t#Exit pressure in bar\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 0.284 \t\t\t\t#Pressure ratio at entry from gas tables @M1,k = 1.3\n", + "Po = P1/p1 \t\t\t\t#Stagnation Pressure in bar\n", + "t1 = 0.748 \t\t\t\t#Temperature ratio at entry from gas tables @M1,k = 1.3\n", + "To = T1/t1 \t\t\t\t#Stagnation temperature in K\n", + "p2 = P2/Po \t\t\t\t#Pressure ratio\n", + "M2 = 2.08 \t\t\t\t#Final Mach number from isentropic gas tables @p2\n", + "t2 = 0.606 \t\t\t\t#Temperature ratio at exit from gas tables @M2,k = 1.3\n", + "T2 = To*t2 \t\t\t\t#The temperature of the gas in K\n", + "w1 = 12.693 \t\t\t\t#Prandtl Merger function at M1 \n", + "w2 = 31.12 \t\t\t\t#Prandtl Merger function at M2\n", + "def1 = w2-w1 \t\t\t\t#Deflection Angle in degree\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Deflection Angle is %3.3f degree \\\n", + "\\nB)Final Mach number is %3.2f \\\n", + "\\nC)The temperature of the gas is %3.3f K'%(def1,M2,T2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Deflection Angle is 18.427 degree \n", + "B)Final Mach number is 2.08 \n", + "C)The temperature of the gas is 283.556 K\n" + ] + } + ], + "prompt_number": 49 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch6.ipynb b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch6.ipynb new file mode 100755 index 00000000..d2ff7316 --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch6.ipynb @@ -0,0 +1,1203 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:6ef501d87a4e150fa73f9d6a23345ef6ffddaecf1a006d99b9d65903d53edab9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 : Aircraft Propulsion" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 page : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "eff_com = 0.8 \t\t\t\t#Compressor efficiency\n", + "eff_t = 0.85 \t\t\t\t#Turbine efficiency\n", + "pr = 4. \t\t\t\t#Pressure ratio including combustion pressure loss(Po2s/Po1)\n", + "eff_c = 0.98 \t\t\t\t#Combustion efficiency\n", + "eff_m = 0.99 \t\t\t\t#Mechanical transmission efficiency \n", + "eff_n = 0.9 \t\t\t\t#Nozzle efficiency \n", + "Tmax = 1000. \t\t\t\t#Maximum cycle temperature in K\n", + "To3 = Tmax \t\t\t\t#Stagnation temperature before turbine inlet in K\n", + "w = 220. \t\t\t\t#mass flow rate in N/s\n", + "Cp_air = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant for air\n", + "Cp_gas = 1153. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "k_gas = 1.3 \t\t\t\t#Adiabatic consmath.tant\n", + "To1 = 15.+273 \t\t\t\t#Inlet Stagnation temperature of compressor in K\n", + "Po1 = 1. \t\t\t\t#Inlet Stagnation pressure in bar\n", + "Poe = Po1 \t\t\t\t#Exit stagnation pressure in bar, Since exit at ambient conditions\n", + "g = 9.81 \t\t\t\t#Acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation \n", + "To2s = To1*(pr)**((k-1)/k) \t\t\t\t#Exit Stagnation temperature of compressor at isentropic process in K\n", + "To2 = ((To2s-To1)/eff_com)+To1 \t\t\t\t#Exit Stagnation temperature of compressor in K\n", + "Wc = (Cp_air*(To2-To1)) \t\t\t\t#Work given to compressor in J/kg, Cp in J/kg-K\n", + "To4 = To3-(Wc/Cp_gas*eff_m) \t\t\t\t#Exit Stagnation temperature of turbine in K\n", + "To4s = To3-((To3-To4)/eff_t) \t\t\t\t#Exit Stagnation temperature of turbine at isentropic process in K\n", + "Po2 = Po1*pr \t\t\t\t#Exit Stagnation pressure of compressor in bar\n", + "Po3 = Po2 \t\t\t\t#Exit Stagnation pressure of combustion chamber in bar, Since the process takes place at consmath.tant pressure process \n", + "p1 = (To3/To4s)**(k_gas/(k_gas-1)) \t\t\t\t#Stagnation Pressure ratio of inlet and outlet of turbine \n", + "Po4s = Po3/p1 \t\t\t\t#Stagnation Pressure at outlet of turbine at isentropic process in bar \n", + "pr_n = Po4s/Poe \t\t\t\t#Pressure ratio of nozzle\n", + "Toes = To4/((pr_n)**((k_gas-1)/k_gas)) \t\t\t\t#Exit Stagnation temperature of nozzle at isentropic process in K\n", + "Toe = To4-((To4-Toes)*eff_n) \t\t\t\t#Exit Stagnation temperature of nozzle in K\n", + "Cj = math.sqrt(2*Cp_gas*(To4-Toe)) \t\t\t\t#Jet velocity in m/s\n", + "m = w/g \t\t\t\t#Mass flow rate of air in kg/s\n", + "F = m*Cj*10**-3 \t\t\t\t#Thrust in kN\n", + "Fs = (F*10**3)/m \t\t\t\t#Specific thrust in Ns/kg, F in N\n", + "Is = F/w \t\t\t\t#Specific impulse in sec\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Thrust is %3.3f kN \\\n", + "\\nB)Specific thrust is %3.2f Ns/kg'%(F,Fs)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Thrust is 10.180 kN \n", + "B)Specific thrust is 453.94 Ns/kg\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 page : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 800.*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "Pe = 60. \t\t\t\t\t#Ambient pressure in kPa\n", + "Pn = 300. \t\t\t\t\t#Pressure entering nozzle in kPa \n", + "Tn = 200.+273 \t\t\t\t#Temperature entering nozzle in K \n", + "m = 20. \t\t\t\t\t#Mass flow rate of air in kg/s\n", + "Cp = 1005. \t\t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", + "k = 1.4 \t\t\t\t\t#Adiabatic consmath.tant for air\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Te = Tn*(Pe/Pn)**((k-1)/k) \t\t\t\t#Exit temperature of nozzle in K\n", + "Cj = math.sqrt(2*Cp*(Tn-Te)) \t\t\t\t#Jet velocity in m/s\n", + "F = m*(Cj-u) \t\t\t\t#Thrust in N\n", + "P = F*u*10**-3 \t\t\t\t#Thrust power in kW\n", + "eff = ((2*u)/(Cj+u))*100 \t\t\t\t#Propulsive efficiency in percent\n", + "\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Thrust developed is %3.1f N \\\n", + "\\nB)Thrust developed is %3.2f kW \\\n", + "\\nC)Propulsive efficiency is %3.3f percent'%(F,P,eff)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Thrust developed is 7395.4 N \n", + "B)Thrust developed is 1643.42 kW \n", + "C)Propulsive efficiency is 54.586 percent\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 page : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Mi = 0.8 \t\t\t\t#Inlet mach number \n", + "h = 10000. \t\t\t\t#Altitude in m\n", + "pr_c = 8. \t\t\t\t#Pressure ratio of compressor\n", + "To3 = 1200. \t\t\t\t#Stagnation temperature at turbine inlet in K\n", + "eff_c = 0.87 \t\t\t\t#Compressor efficiency\n", + "eff_t = 0.9 \t\t\t\t#Turbine efficiency\n", + "eff_d = 0.93 \t\t\t\t#Diffuser efficiency \n", + "eff_n = 0.95 \t\t\t\t#Nozzle efficiency \n", + "eff_m = 0.99 \t\t\t\t#Mechanical transmission efficiency\n", + "eff_cc = 0.98 \t\t\t\t#Combustion efficiency\n", + "pl = 0.04 \t\t\t\t#Ratio of combustion pressure loss to compressor delivery pressure \n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant of air\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "k_g = 1.33 \t\t\t\t#Adiabatic consmath.tant of gas \n", + "Cp_a = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure of air in J/kg-K\n", + "Cp_g = 1100. \t\t\t\t#Specific heat capacity at consmath.tant pressure of gas in J/kg-K\n", + "CV = 43000000. \t\t\t\t#Calorific value in J/kg (AssumE)\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Ti = 223.15 \t\t\t\t#Inlet temperature in K from gas tables\n", + "Pi = 26.4 \t\t\t\t#Inlet pressure in kPa from gas tables \n", + "ai = math.sqrt(k*R*Ti) \t\t\t\t#Sound velocity in m/s\n", + "Ci = ai*Mi \t\t\t\t#Velocity of air in m/s,\n", + "u = Ci \t\t\t\t#Flight velocity in m/s, Since it is reaction force of Ci\n", + "t1 = 0.886 \t\t\t\t#Ratio of static to stagnation temperature a entry from gas tables at M = 0.8 \n", + "To1s = Ti/t1 \t\t\t\t#Stagnation temperature at inlet of compressor at isentropic process in K\n", + "To1 = ((To1s-Ti)/eff_d)+Ti \t\t\t\t#Stagnation temperature at inlet of compressor in K\n", + "p1 = (To1s/Ti)**(k/(k-1)) \t\t\t\t#Pressure ratio i.e. (Po1s/Pi)\n", + "Po1s = Pi*p1 \t\t\t\t#inlet Stagnation pressure of compressor at isentropic process in kPa\n", + "Po1 = Po1s \t\t\t\t#Inlet Stagnation pressure of compressor in kPa\n", + "Po2 = pr_c*Po1 \t\t\t\t#Exit Stagnation pressure of compressor in kPa\n", + "To2s = To1s*(Po2/Po1)**((k-1)/k) \t\t\t\t#Exit Stagnation temperature of compressor at isentropic process in K\n", + "To2 = ((To2s-To1)/eff_c)+To1 \t\t\t\t#Exit Stagnation temperature of compressor in K\n", + "P_los = pl*Po2 \t\t\t\t#combustion pressure loss in kPa\n", + "Po3 = Po2-P_los \t\t\t\t#Exit Stagnation pressure of combustion chamber in kPa\n", + "To4 = To3-((Cp_a*(To2-To1))/(eff_m*Cp_g)) \t\t\t\t#Exit Stagnation temperature of turbine in K\n", + "To4s = To3-((To3-To4)/eff_t) \t\t\t\t#Exit Stagnation temperature of turbine at isentropic process in K\n", + "p1 = (To3/To4s)**(k_g/(k_g-1)) \t\t\t\t#Pressure ratio i.e. (Po3/Po4s)\n", + "Po4s = Po3/p1 \t\t\t\t#Stagnation Pressure at outlet of turbine at isentropic process in kPa\n", + "Poe = Pi \t\t\t\t#Exit stagnation pressure in kPa, Since exit is at ambient conditions\n", + "pr_n = Po4s/Poe \t\t\t\t#Pressure ratio of nozzle\n", + "Toes = To4/((pr_n)**((k_g-1)/k_g)) \t\t\t\t#Exit Stagnation temperature of nozzle at isentropic process in K\n", + "Toe = To4-((To4-Toes)*eff_n) \t\t\t\t#Exit Stagnation temperature of nozzle in K\n", + "Cj = math.sqrt(2*Cp_g*(To4-Toe)) \t\t\t\t#Jet velocity in m/s\n", + "Fs = Cj-u \t\t\t\t#Specific thrust in Ns/kg\n", + "f = ((Cp_g*To3)-(Cp_a*To2))/((eff_cc*CV)-(Cp_g*To3)) \t\t\t\t#Fuel-air ratio\n", + "TSFC = (f/Fs)#*10**5 \t\t\t\t#Thrust specific fuel consumption in kg/s-N x10**-5\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Specific thrust is %3.2f Ns/kg \\\n", + "\\nB)Thrust specific fuel consumption is %.3e kg/s-N'%(Fs,TSFC)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Specific thrust is 575.62 Ns/kg \n", + "B)Thrust specific fuel consumption is 3.537e-05 kg/s-N\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 page : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 300. \t\t\t\t#Flight velocity in m/s\n", + "Pi = 35. \t\t\t\t#Inlet pressure in kPa\n", + "Ti = -40.+273 \t\t\t\t#Inlet temperature in K\n", + "pr_c = 10. \t\t\t\t#Pressure ratio of compressor\n", + "T3 = 1100.+273 \t\t\t\t#Inlet turbine temperature in K\n", + "m = 50. \t\t\t\t#Mass flow rate of air in kg/s\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant of air\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure of air in J/kg-K\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ai = math.sqrt(k*R*Ti) \t\t\t\t#Sound velocity at diffuser in m/s\n", + "C1 = u \t\t\t\t#Velocity of air in m/s, Since it is reaction force of u\n", + "T1 = Ti+(C1**2/(2*Cp)) \t\t\t\t#Temperature at inlet of compressor in K\n", + "P1 = Pi*((T1/Ti)**(k/(k-1))) \t\t\t\t#Inlet pressure of compressor in kPa\n", + "P2 = pr_c*P1 \t\t\t\t#Exit pressure of compressor in kPa\n", + "P3 = P2 \t\t\t\t#Exit pressure of combustion chamber in kPa, Since the process takes place at consmath.tant pressure process \n", + "T2 = T1*(P2/P1)**((k-1)/k) \t\t\t\t#Exit temperature of compressor in K\n", + "T4 = T3-(T2-T1) \t\t\t\t#Exit temperature of turbine in K\n", + "P4 = P3/((T3/T4)**(k/(k-1))) \t\t\t\t#Pressure at outlet of turbine in kPa\n", + "Pe = Pi \t\t\t\t#Exit pressure in kPa, Since exit is at ambient conditions\n", + "pr_n = P4/Pe \t\t\t\t#Pressure ratio of nozzle\n", + "Te = T4/((pr_n)**((k-1)/k)) \t\t\t\t#Exit temperature of nozzle in K\n", + "Cj = math.sqrt(2*Cp*(T4-Te)) \t\t\t\t#Jet velocity in m/s\n", + "sig = u/Cj \t\t\t\t#Jet speed ratio \n", + "eff_prop = ((2*sig)/(1+sig))*100 \t\t\t\t#Propulsive efficiency of the cycle in %\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Temperature and pressure of gases at turbine exit is %3.2f K and %3i kPa \\\n", + "\\nB)Velocity of gases is %3.2f m/s \\\n", + "\\nC)Propulsive efficiency of the cycle is %3.2f percent'%(T4,P4,Cj,eff_prop)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Temperature and pressure of gases at turbine exit is 1114.47 K and 311 kPa \n", + "B)Velocity of gases is 1020.35 m/s \n", + "C)Propulsive efficiency of the cycle is 45.44 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 page : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "n = 2 \t\t\t\t#Number of jets\n", + "D = 0.25 \t\t\t\t#Diameter of turbojet in m\n", + "P = 3000 \t\t\t\t#Net power at turbojet in W\n", + "mf_kWh = 0.42 \t\t\t\t#Fuel consumption in kg/kWh \n", + "CV = 49000 \t\t\t\t#Calorific value in kJ/kg\n", + "u = 300 \t\t\t\t#Flight velocity in m/s\n", + "d = 0.168 \t\t\t\t#Density in kg/m**3\n", + "AFR = 53 \t\t\t\t#Air fuel ratio \n", + "\n", + "\t\t\t\t#Calculatioon\n", + "mf = mf_kWh*P/3600 \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "ma = AFR*mf \t\t\t\t#Mass flow rate of air in kg/s\n", + "m = ma+mf \t\t\t\t#Mass flow rate of gas in kg/s\n", + "Q = m/d \t\t\t\t#Volume flow rate in m**3/s\n", + "Cj = (Q*4)/(2*math.pi*D**2) \t\t\t\t#Jet velocity in m/s\n", + "Ca = Cj-u \t\t\t\t#Absolute Jet velocity in m/s\n", + "F = ((m*Cj)-(ma*u))*10**-3 \t\t\t\t#Thrust in kN\n", + "eff = ((F*u)/(mf*CV))*100 \t\t\t\t#Overall efficiency in %\n", + "eff_prop = ((2*u)/(Cj+u))*100 \t\t\t\t#Propulsive efficiency of the cycle in %\n", + "eff_ther = (eff/eff_prop)*100 \t\t\t\t#Efficiency of turbine in %\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Absolute velocity of jet is %3.3f m/s \\\n", + "\\nB)Resistance of the plane is %3.4f kN \\\n", + "\\nC)Overall efficiency is %3.2f percent \\\n", + "\\nD)Efficiency of turbine is %3.3f percent'%(Ca,F,eff,eff_ther)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Absolute velocity of jet is 845.916 m/s \n", + "B)Resistance of the plane is 16.0928 kN \n", + "C)Overall efficiency is 28.15 percent \n", + "D)Efficiency of turbine is 67.839 percent\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 page : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 900*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "ma = 3000./60 \t\t\t\t#Mass flow rate of air in kg/s\n", + "dh = 200. \t\t\t\t#Enthalpy drop of nozzle in kJ/kg\n", + "eff_n = 0.9 \t\t\t\t#Nozzle efficiency \n", + "AFR = 85 \t\t\t\t#Air fuel ratio \n", + "eff_cc = 0.95 \t\t\t\t#Combustion efficiency\n", + "CV = 42000 \t\t\t\t#Calorific value in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "mf = ma/AFR \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "m = ma+mf \t\t\t\t#Mass flow rate of gas in kg/s\n", + "Cj = math.sqrt(2*eff_n*dh*10**3) \t\t\t\t#Jet velocity in m/s\n", + "sig = u/Cj \t\t\t\t#Jet speed ratio \n", + "F = ((m*Cj)-(ma*u))*10**-3 \t\t\t\t#Thrust in kN\n", + "Pt = F*u \t\t\t\t#Thrust power in kW\n", + "Pp = 0.5*((m*Cj**2)-(ma*u**2))*10**-3 \t\t\t\t#Propulsive power in kW\n", + "HS = eff_cc*mf*CV \t\t\t\t#Heat supplied in kW\n", + "eff_ther = (Pp/HS)*100 \t\t\t\t#Efficiency of turbine in %\n", + "eff_prop = (Pt/Pp)*100 \t\t\t\t#Propulsive efficiency of the cycle in %\n", + "eff = (Pt/HS)*100 \t\t\t\t#Overall efficiency in %\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Propulsive power is %3.2f kW \\\n", + "\\nB)Thrust power is %3.1f kW \\\n", + "\\nC)Propulsive efficiency is %3.3f percent \\\n", + "\\nD)Thermal efficiency is %3.2f percent \\\n", + "\\nE)Total fuel consumption is %3.3f kg/s F)Overall efficiency is %3.3f percent'%(Pp,Pt,eff_prop,eff_ther,mf,eff)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Propulsive power is 7543.38 kW \n", + "B)Thrust power is 4463.2 kW \n", + "C)Propulsive efficiency is 59.168 percent \n", + "D)Thermal efficiency is 32.14 percent \n", + "E)Total fuel consumption is 0.588 kg/s F)Overall efficiency is 19.016 percent\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7 page : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 0.8 \t\t\t\t#Mach number \n", + "CV = 42800. \t\t\t\t#Calorific value in kJ/kg\n", + "h = 10. \t\t\t\t#Altitude in km\n", + "F = 50. \t\t\t\t#Thrust in kN\n", + "ma = 45. \t\t\t\t#Mass flow rate of air in kg/s\n", + "mf = 2.65 \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "m = ma+mf \t\t\t\t#Mass flow rate of gas in kg/s\n", + "a = 299.6 \t\t\t\t#Sound velocity in m/s, from gas tables\n", + "T = 233.15 \t\t\t\t#Inlet temperature in K \n", + "u = a*M \t\t\t\t#Flight velocity in m/s\n", + "Cj = ((F*10**3)+(ma*u))/m \t\t\t\t#Jet velocity in m/s\n", + "sig = u/Cj \t\t\t\t#Jet speed ratio \n", + "Fs = F*10**3/m \t\t\t\t#Specific thrust in Ns/kg, F in N\n", + "TSFC = mf*3600/(F*10**3) \t\t\t\t#Thrust specific fuel consumption in kg/N-hr, F in N\n", + "Pt = F*u \t\t\t\t#Thrust power in kW\n", + "Pp = 0.5*((m*Cj**2)-(ma*u**2))*10**-3 \t\t\t\t#Propulsive power in kW\n", + "HS = mf*CV \t\t\t\t#Heat supplied in kW\n", + "eff_ther = (Pp/HS)*100 \t\t\t\t#Efficiency of turbine in %\n", + "eff_prop = (Pt/Pp)*100 \t\t\t\t#Propulsive efficiency of the cycle in %\n", + "eff = (Pt/HS)*100 \t\t\t\t#Overall efficiency in %\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)Specific thrust is %3.2f N/kg \\\n", + "\\nB)Thrust specific fuel consumption is %3.4f kg/N-hr \\\n", + "\\nC)Jet velocity is %3.3f m/s \\\n", + "\\nD)Thermal efficiency is %3.2f percent \\\n", + "\\nE)Propulsive efficiency is %3.3f percent F)Overall efficiency is %3.2f percent'%(Fs,TSFC,Cj,eff_ther,eff_prop,eff)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Specific thrust is 1049.32 N/kg \n", + "B)Thrust specific fuel consumption is 0.1908 kg/N-hr \n", + "C)Jet velocity is 1275.668 m/s \n", + "D)Thermal efficiency is 33.04 percent \n", + "E)Propulsive efficiency is 31.976 percent F)Overall efficiency is 10.57 percent\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.8 page : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Mi = 0.8 \t\t\t\t#Inlet mach number \n", + "h = 10. \t\t\t\t#Altitude in km\n", + "To3 = 1200. \t\t\t\t#Stagnation temperature before turbine inlet in K\n", + "dTc = 175. \t\t\t\t#Stagnation temperature rise through the compressor in K\n", + "CV = 43000. \t\t\t\t#Calorific value in kJ/kg\n", + "eff_c = 0.75 \t\t\t\t#Compressor efficiency\n", + "eff_cc = 0.75 \t\t\t\t#Combustion efficiency\n", + "eff_t = 0.81 \t\t\t\t#Turbine efficiency\n", + "eff_m = 0.98 \t\t\t\t#Mechanical transmission efficiency\n", + "eff_n = 0.97 \t\t\t\t#Nozzle efficiency \n", + "Is = 25. \t\t\t\t#Specific impulse in sec\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant of air\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure of air in J/kg-K\n", + "g = 9.81 \t\t\t\t#Acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Ti = 223.15 \t\t\t\t#Inlet temperature in K from gas tables\n", + "ai = math.sqrt(k*R*Ti) \t\t\t\t#Sound velocity in m/s\n", + "Toi = (1+((0.5*(k-1)*Mi**2)))*Ti \t\t\t\t#Stagnation temperature at diffuser inlet in K\n", + "To1 = Toi \t\t\t\t#Inlet Stagnation temperature of compressor in K, math.since hoi = ho1 \n", + "To2 = dTc+To1 \t\t\t\t#Exit Stagnation temperature of compressor in K\n", + "pr_c = (1+(eff_c*((To2-To1)/To1)))**(k/(k-1)) \t\t\t\t#Compressor pressure ratio \n", + "f = ((Cp*To3)-(Cp*To2))/((eff_cc*CV*10**3)-(Cp*To3)) \t\t\t\t#Fuel-air ratio, calculation mistake in textbook\n", + "dTt = dTc/(eff_m*(1+f)) \t\t\t\t#Temperature difference across turbine\n", + "pr_t = 1/((1-(dTt/(To3*eff_t)))**(k/(k-1))) \t\t\t\t#Turbine pressure ratio\n", + "To4 = To3-dTc \t\t\t\t#Exit Stagnation temperature of turbine in K\n", + "u = ai*Mi \t\t\t\t#Flight velocity in m/s\n", + "sig = 1/(((Is*g)/u)+1) \t\t\t\t#Jet speed ratio \n", + "Ce = u/sig \t\t\t\t#Exit velocity in m/s\n", + "Cj = Ce \t\t\t\t#Jet velocity in m/s, Since Cj is due to exit velociy\n", + "Te = To4-(Ce**2/(2*Cp)) \t\t\t\t#Exit temperature in K\n", + "Tes = To4-((To4-Te)*eff_n) \t\t\t\t#Exit temperature in K, (At isentropic process)\n", + "pr_n = (To4/Te)**(k/(k-1)) \t\t\t\t#Nozzle pressure ratio\n", + "ae = math.sqrt(k*R*Te) \t\t\t\t#Exit Sound velocity in m/s\n", + "Me = Ce/ae \t\t\t\t#Exit mach number \n", + "\n", + "print 'A)Fuel-air ratio is %3.5f \\\n", + "\\nB)Compressor, turbine, nozzle pressure ratio are %3.3f, %3.3f, %3.2f respectively \\\n", + "\\nC)Mach number at exhaust jet is %3.3f'%(f,pr_c,pr_t,pr_n,Me)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Fuel-air ratio is 0.02503 \n", + "B)Compressor, turbine, nozzle pressure ratio are 4.344, 1.996, 1.53 respectively \n", + "C)Mach number at exhaust jet is 0.803\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9 page : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D = 2.5 \t\t\t\t#Diameter in m\n", + "u = 500.*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "h = 8000. \t\t\t\t#Altitude in m\n", + "sig = 0.75 \t\t\t\t#Jet speed ratio \n", + "g = 9.81 \t\t\t\t#Acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "d = 0.525 \t\t\t\t#from gas tables\n", + "A = math.pi*D**2*0.25 \t\t\t\t#Area of flow in m**2 \n", + "Cj = u/sig \t\t\t\t#Jet velocity in m/s\n", + "Vf = (u+Cj)/2 \t\t\t\t#Velocity of flow in m/s\n", + "ma = d*A*Vf \t\t\t\t#Mass flow rate of air in kg/s\n", + "F = ma*(Cj-u)*10**-3 \t\t\t\t#Thrust in kN\n", + "P = F*u \t\t\t\t#Thrust power in kW\n", + "Fs = F*10**3/ma \t\t\t\t#Specific thrust in Ns/kg\n", + "Is = Fs/g \t\t\t\t#Specific impulse in sec\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Flow rate of air through the propeller is %3.3f m/s \\\n", + "\\nB)Thrust produced is %3.3f kN \\\n", + "\\nC)Specific thrust is %3.2f N-s/kg \\\n", + "\\nD)Specific impulse is %3.3f sec \\\n", + "\\nE)Thrust power is %3.1f kW'%(ma,F,Fs,Is,P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Flow rate of air through the propeller is 417.584 m/s \n", + "B)Thrust produced is 19.333 kN \n", + "C)Specific thrust is 46.30 N-s/kg \n", + "D)Specific impulse is 4.719 sec \n", + "E)Thrust power is 2685.1 kW\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.10 page : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "h = 3000. \t\t\t\t#Altitude in m\n", + "Pi = 0.701 \t\t\t\t#Inlet pressure in bar\n", + "Ti = 268.65 \t\t\t\t#Inlet temperature in K\n", + "u = 525*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "eff_d = 0.875 \t\t\t\t#Diffuser efficiency\n", + "eff_c = 0.79 \t\t\t\t#Compressor efficiency\n", + "C1 = 90. \t\t\t\t#Velocity of air at compressor in m/s\n", + "dTc = 230. \t\t\t\t#Temperature rise through compressor\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant of air\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure of air in J/kg-K\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ai = math.sqrt(k*R*Ti) \t\t\t\t#Sound velocity in m/s\n", + "Mi = u/ai \t\t\t\t#Inlet mach number \n", + "Toi = (1+((0.5*(k-1)*Mi**2)))*Ti \t\t\t\t#Stagnation temperature at diffuser inlet in K\n", + "To1 = Toi \t\t\t\t#Inlet Stagnation temperature of compressor in K, math.since hoi = ho1 \n", + "T1 = To1-(C1**2/(2*Cp)) \t\t\t\t#Temperature at inlet of compressor in K\n", + "P1 = Pi*((1+(eff_d*((T1/Ti)-1)))**(k/(k-1))) \t\t\t\t#Inlet pressure of compressor in bar\n", + "dPc = P1-Pi \t\t\t\t#Pressure rise through inlet diffuser in bar\n", + "pr_c = (((eff_c*dTc)/To1)+1)**(k/(k-1)) \t\t\t\t#Pressure ratio of compressor\n", + "P = Cp*(dTc) \t\t\t\t#Power required by the compressor in kW/(kg/s)\n", + "eff = 1-(1/pr_c**((k-1)/k)) \t\t\t\t#Air standard efficiency\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Pressure rise through diffuser is %3.4f bar \\\n", + "\\nB)Pressure developed by compressure is %3.4f bar \\\n", + "\\nC)Air standard efficiency of the engine is %3.4f'%(dPc,P1,eff)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Pressure rise through diffuser is 0.0538 bar \n", + "B)Pressure developed by compressure is 0.7548 bar \n", + "C)Air standard efficiency of the engine is 0.3942\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.11 page : 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "h = 9500. \t\t\t\t#Altitude in m\n", + "u = 800*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "eff_prop = 0.55 \t\t\t\t#Propulsive efficiency of the cycle\n", + "eff_o = 0.17 \t\t\t\t#Overall efficiency\n", + "F = 6100. \t\t\t\t#Thrust in N\n", + "d = 0.17 \t\t\t\t#Density in kg/m**3\n", + "CV = 46000. \t\t\t\t#Calorific value in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "mf = (F*u)/(eff_o*CV*10**3) \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "Cj = ((2*u)/(eff_prop))-u \t\t\t\t#Jet velocity in m/s, wrong calculation in textbook\n", + "Ca = Cj-u \t\t\t\t#Absolute Jet velocity in m/s\n", + "ma = (F-(mf*Cj))/(Ca) \t\t\t\t#Mass flow rate of air in kg/s\n", + "m = ma+mf \t\t\t\t#Mass flow rate of gas in kg/s\n", + "f = ma/mf \t\t\t\t#Air fuel ratio\n", + "Q = m/d \t\t\t\t#Volume flow rate in m**3/s\n", + "Dj = math.sqrt((4*Q)/(math.pi*Cj))*10**3 \t\t\t\t#Diameter of jet in mm, Cj value wrong in textbook \n", + "P = ((F*u)/eff_prop)*10**-3 \t\t\t\t#Power output of engine in kW\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Diamter of the jet is %3.1f mm \\\n", + "\\nB)Power output is %3.1f kW \\\n", + "\\nC)Air-fuel ratio is %3.3f \\\n", + "\\nD)Absolute velocity of the jet is %3i m/s'%(Dj,P,f,Ca)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Diamter of the jet is 461.6 mm \n", + "B)Power output is 2464.6 kW \n", + "C)Air-fuel ratio is 95.161 \n", + "D)Absolute velocity of the jet is 363 m/s\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.12 page : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 960*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "ma = 40. \t\t\t\t#Mass flow rate of air in kg/s\n", + "AFR = 50. \t\t\t\t#Air fuel ratio\n", + "sig = 0.5 \t\t\t\t#Jet speed ratio, for maximum thrust power\n", + "CV = 43000. \t\t\t\t#Calorific value in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "mf = ma/AFR \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "m = ma+mf \t\t\t\t#Mass flow rate of gas in kg/s\n", + "Cj = u/sig \t\t\t\t#Jet velocity in m/s\n", + "F = ((m*Cj)-(ma*u))*10**-3 \t\t\t\t#Thrust in kN\n", + "Fs = F*10**3/m \t\t\t\t#Specific thrust in Ns/kg, F in N\n", + "Pt = F*u \t\t\t\t#Thrust power in kW\n", + "eff_prop = ((2*sig)/(1+sig))*100 \t\t\t\t#Propulsive efficiency of the cycle in %\n", + "eff_ther = ((0.5*m*(Cj**2-u**2))/(mf*CV*10**3))*100 \t\t\t\t#Efficiency of turbine in %\n", + "eff = (eff_prop/100)*(eff_ther/100)*100 \t\t\t\t#Overall efficiency in %\n", + "TSFC = mf*3600/(F*10**3) \t\t\t\t#Thrust specific fuel consumption in kg/Nhr\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Jet velocity is %3.1f m/s \\\n", + "\\nB)Thrust is %3.3f kN \\\n", + "\\nC)Specific thrust is %3.2f N-s/kg \\\n", + "\\nD)Thrust power is %3.2f kW \\\n", + "\\nE)propulsive, thermal and overall efficiency is %3.2f, %3.2f and %3.3f respectively \\\n", + "\\nF)Thrust specific fuel consumption is %3.4f kg/Nhr'%(Cj,F,Fs,Pt,eff_prop,eff_ther,eff,TSFC)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Jet velocity is 533.3 m/s \n", + "B)Thrust is 11.093 kN \n", + "C)Specific thrust is 271.90 N-s/kg \n", + "D)Thrust power is 2958.22 kW \n", + "E)propulsive, thermal and overall efficiency is 66.67, 12.65 and 8.434 respectively \n", + "F)Thrust specific fuel consumption is 0.2596 kg/Nhr\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.13 page : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 960*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "ma = 54.5 \t\t\t\t#Mass flow rate of air in kg/s\n", + "dh = 200. \t\t\t\t#Change of enthalpy for nozzle in kJ/kg\n", + "Cv = 0.97 \t\t\t\t#Velocity coefficient \n", + "AFR = 75. \t\t\t\t#Air fuel ratio \n", + "eff_cc = 0.93 \t\t\t\t#Combustion efficiency\n", + "CV = 45000. \t\t\t\t#Calorific value in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "mf = ma/AFR \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "Cj = Cv*math.sqrt(2*dh*10**3) \t\t\t\t#Jet velocity in m/s\n", + "F = ma*(Cj-u) \t\t\t\t#Thrust in kN\n", + "TSFC = mf*3600/(F) \t\t\t\t#Thrust specific fuel consumption in kg/Nhr\n", + "HS = mf*eff_cc*CV \t\t\t\t#Heat supplied in kJ/s\n", + "Pp = 0.5*ma*(Cj**2-u**2)*10**-3 \t\t\t\t#Propulsive power in kW\n", + "Pt = F*u \t\t\t\t#Thrust power in kW\n", + "eff_p = Pt/(Pp*10**3) \t\t\t\t#Propulsive efficiency of the cycle\n", + "eff_t = Pp/HS \t\t\t\t#Efficiency of turbine\n", + "eff_o = Pt*10**-3/HS \t\t\t\t#Overall efficiency\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Exit velocity of the jet is %3.2f m/s \\\n", + "\\nB)Fuel rate is %3.4f kg/s \\\n", + "\\nC)Thrust specific fuel consumption is %3.5f kg/Nhr \\\n", + "\\nD)Thermal efficiency is %3.3f \\\n", + "\\nE)Propulsive power is %3.2f kW \\\n", + "\\nF)Propulsive efficiency is %3.4f \\\n", + "\\nG)Overall efficiency is %3.5f'%(Cj,mf,TSFC,eff_t,Pp,eff_p,eff_o)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Exit velocity of the jet is 613.48 m/s \n", + "B)Fuel rate is 0.7267 kg/s \n", + "C)Thrust specific fuel consumption is 0.13840 kg/Nhr \n", + "D)Thermal efficiency is 0.274 \n", + "E)Propulsive power is 8318.03 kW \n", + "F)Propulsive efficiency is 0.6060 \n", + "G)Overall efficiency is 0.16574\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.14 page : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 750*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "h = 10000. \t\t\t\t#Altitude in m\n", + "eff_p = 0.5 \t\t\t\t#Propulsive efficiency of the cycle\n", + "eff_o = 0.16 \t\t\t\t#Overall efficiency\n", + "d = 0.173 \t\t\t\t#Density in kg/m**3\n", + "F = 6250. \t\t\t\t#Thrust in N\n", + "CV = 45000. \t\t\t\t#Calorific value in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "sig = eff_p/(2-eff_p) \t\t\t\t#Jet speed ratio\n", + "Cj = u/sig \t\t\t\t#Jet velocity in m/s\n", + "Ca = Cj-u \t\t\t\t#Absolute Jet velocity in m/s\n", + "ma = F/Ca \t\t\t\t#Mass flow rate of air in kg/s\n", + "Q = ma*60/d \t\t\t\t#Volume flow rate in m**3/min\n", + "A = Q/(Cj*60) \t\t\t\t#Area of flow in m**2\n", + "D = math.sqrt((4*A)/(math.pi))*10**3 \t\t\t\t#Diameter in mm\n", + "Pt = F*u \t\t\t\t#Thrust power in W\n", + "Pp = (Pt/eff_p)*10**-3 \t\t\t\t#Propulsive power in kW\n", + "eff_t = eff_o/eff_p \t\t\t\t#Efficiency of turbine\n", + "HS = Pp/eff_t \t\t\t\t#Heat supplied in kJ/s\n", + "mf = HS/CV \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "AFR = ma/mf \t\t\t\t#Air fuel ratio \n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Absolute velocity of the jet is %3.2f m/s \\\n", + "\\nB)Volume of air compressed per minute is %3.2f m**3/min \\\n", + "\\nC)Diameter of the jet is %3i mm \\\n", + "\\nD)Power unit of the unit is %3.3f kW \\\n", + "\\nE)Air fuel ratio is %3.1f'%(Ca,Q,D,Pp,AFR)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Absolute velocity of the jet is 416.67 m/s \n", + "B)Volume of air compressed per minute is 5202.31 m**3/min \n", + "C)Diameter of the jet is 420 mm \n", + "D)Power unit of the unit is 2604.167 kW \n", + "E)Air fuel ratio is 82.9\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.15 page : 42" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P1 = 0.56 \t\t\t\t#Inlet pressure of compressor in bar\n", + "T1 = 260 \t\t\t\t#Temperature at inlet of compressor in K\n", + "pr_c = 6 \t\t\t\t#Pressure ratio of compressor\n", + "eff_c = 0.85 \t\t\t\t#Compressor efficiency\n", + "u = 360*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "D = 3 \t\t\t\t#Propeller diameter in m \n", + "eff_p = 0.8 \t\t\t\t#Efficiency of propeller \n", + "eff_g = 0.95 \t\t\t\t#Gear reduction efficiency \n", + "pr_t = 5 \t\t\t\t#Expansion ratio\n", + "eff_t = 0.88 \t\t\t\t#Turbine efficiency\n", + "T3 = 1100 \t\t\t\t#temperature at turbine inlet in K\n", + "eff_n = 0.9 \t\t\t\t#Nozzle efficiency \n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure of air in J/kg-K\n", + "CV = 40000 \t\t\t\t#Calorific value in kJ/kg\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant of air\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "P2 = pr_c*P1 \t\t\t\t#Exit pressure of compressor in bar\n", + "T2s = T1*(pr_c)**((k-1)/k) \t\t\t\t#Exit temperature of compressor at isentropic proces in K\n", + "T2 = T1+((T2s-T1)/eff_c) \t\t\t\t#Exit temperature of compressor in K\n", + "Wc = Cp*(T2-T1)*10**-3 \t\t\t\t#Power input to compressor in kJ/kg of air\n", + "C1 = u \t\t\t\t#Air velocity in m/s, math.since C1 is resulmath.tant of u\n", + "C = C1/eff_p \t\t\t\t#Average velocity in m/s\n", + "C2 = (2*C)-C1 \t\t\t\t#Exit velocity from compressor in m/s\n", + "Ap = 0.25*math.pi*D**2 \t\t\t\t#Area of propeller passage in m**2\n", + "Q = Ap*C \t\t\t\t#Quantity of air inducted in m**3/s\n", + "mf = ((T3-T2)*Cp)/((CV*10**3)-(Cp*T3)) \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "f = mf \t\t\t\t#Fuel consumption in kg/kg of air\n", + "AFR = 1/mf \t\t\t\t#Air fuel ratio\n", + "P3 = P2 \t\t\t\t#Exit pressure of combustion chamber in bar, Since process is at consmath.tant pressure \n", + "P4 = P3/pr_t \t\t\t\t#Exit pressure of turbine in bar\n", + "T4s = T3/((pr_t)**((k-1)/k)) \t\t\t\t#Exit temperature of turbine at isentropic proces in K, wrong calculation\n", + "T4 = T3-(eff_t*(T3-T4s)) \t\t\t\t#Exit temperature of turbine in K\n", + "Po = (1+f)*Cp*(T3-T4)*10**-3 \t\t\t\t#Power output per kg of air in kJ/kg of air\n", + "Pa = Po-Wc \t\t\t\t#Power available for propeller in kJ/kg of air\n", + "Pe = P1 \t\t\t\t#Exit pressure in bar, Since exit is at ambient conditions\n", + "Tes = T4/((P4/Pe)**((k-1)/k)) \t\t\t\t#Exit temperature of nozzle at isentropic proces in K\n", + "Cj = math.sqrt(2*Cp*eff_n*(T4-Tes)) \t\t\t\t#Jet velocity in m/s\n", + "Fs = ((1+f)*Cj)-u \t\t\t\t#Specific thrust in Ns/kg, F in N\n", + "Pp = ((0.5*P1*10**5*Q*(C2**2-C1**2))/(R*T1))*10**-3 \t\t\t\t#Propulsive power by propeller in kJ/s\n", + "Ps = Pp/eff_g \t\t\t\t#Power supplied by the turbine in kW\n", + "ma = Ps/Pa \t\t\t\t#Air flow rate in kg/s\n", + "Fj = ma*Cj*10**-3 \t\t\t\t#Jet thrust in kN, calculation mistake\n", + "Fp = (Pp*eff_p)/u \t\t\t\t#Thrust produced by propeller in kN\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Air fuel ratio is %3.2f \\\n", + "\\nB)Thrust produced by the nozzle is %3.3f kN \\\n", + "\\nC)Thrust by the propeller is %3.3f kN \\\n", + "\\nD)mass flow rate through the compressor is %3.2f kg/s'%(AFR,Fj,Fp,ma)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Air fuel ratio is 60.90 \n", + "B)Thrust produced by the nozzle is 7.168 kN \n", + "C)Thrust by the propeller is 33.155 kN \n", + "D)mass flow rate through the compressor is 27.44 kg/s\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.16 page : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M1 = 1.5 \t\t\t\t#Mach number \n", + "h = 6500. \t\t\t\t#Altitude in m\n", + "D = 0.5 \t\t\t\t#Diameter in m \n", + "To4 = 1600. \t\t\t\t#Stagnation temperature at nozzle inlet in K\n", + "CV = 40000. \t\t\t\t#Calorific value in kJ/kg\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant of air\n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "eff_d = 0.9 \t\t\t\t#Diffuser efficiency \n", + "eff_cc = 0.98 \t\t\t\t#Combustion efficiency\n", + "eff_n = 0.96 \t\t\t\t#Nozzle efficiency \n", + "pr_l = 0.02 \t\t\t\t#Pressure ratio i.e. Stagnation pressure loss to Exit presure of compressor\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure of air in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "P1 = 0.44 \t\t\t\t#Inlet pressure of compressor in bar\n", + "T1 = 245.9 \t\t\t\t#Temperature at inlet of compressor in K\n", + "a1 = 314.5 \t\t\t\t#Sound velocity at compressor in m/s \n", + "d1 = 0.624 \t\t\t\t#Density at compressor in kg/m**3 \n", + "A1 = 0.25*math.pi*D**2 \t\t\t\t#Area at diffuser inlet in m**2\n", + "u1 = M1*a1 \t\t\t\t#Flight velocity in m/s\n", + "ma = d1*A1*u1 \t\t\t\t#Mass flow rate of air in kg/s\n", + "To2 = T1*(1+(((k-1)/2)*M1**2)) \t\t\t\t#Stagnation temperature at commpressor inlet in K\n", + "To1 = To2 \t\t\t\t#Stagnation temperature at commpressor outlet in K, (It is in case of diffuser)\n", + "pr_d = ((eff_d*(((k-1)/2)*M1**2))+1)**(k/(k-1)) \t\t\t\t#Pressure ratio of diffuser \n", + "P2 = pr_d*P1 \t\t\t\t#Exit pressure of compressor in bar\n", + "Po2 = P2 \t\t\t\t#Stagnation pressure at exit of compressor in bar \n", + "Po3 = (Po2-(pr_l*Po2)) \t\t\t\t#Stagnation pressure at exit of combustion chamber in bar \n", + "Poe = P1 \t\t\t\t#Exit stagnation pressure in kPa, Since exit is at ambient conditions\n", + "pr_n = Po3/Poe \t\t\t\t#Pressure ratio of nozzle\n", + "p1 = 1/pr_n \t\t\t\t#Inverse of pr_n to find in gas tables \n", + "M4s = 1.41 \t\t\t\t#Mach number at turbine exit from gas tables \n", + "T4s = To4/(1+((0.5*(k-1)*M4s**2))) \t\t\t\t#Exit temperature of turbine at isentropic process in K\n", + "To3 = To4 \t\t\t\t#Stagnation temperature at inlet turbine in K,\n", + "T4 = To3-(eff_n*(To3-T4s)) \t\t\t\t#Exit temperature of turbine in K\n", + "C4 = math.sqrt(2*Cp*(To4-T4)) \t\t\t\t#Flight velocity of air in m/s\n", + "a4 = math.sqrt(k*R*T4) \t\t\t\t#Sound velocity in m/s\n", + "Me = C4/a4 \t\t\t\t#Nozzle jet mach number\n", + "f = (Cp*(To3-To2))/(eff_cc*CV*10**3) \t\t\t\t#Fuel air ratio\n", + "mf = ma*f \t\t\t\t#Mass flow rate of fuel in kg/s\n", + "m = ma+mf \t\t\t\t#Mass flow rate of gas in kg/s\n", + "eff_i = (1/(1+((2/(k-1))*(1/M1**2))))*100 \t\t\t\t#Efficiency of the ideal cycle in %\n", + "sig = u1/C4 \t\t\t\t#Jet speed ratio \n", + "eff_p = ((2*sig)/(1+sig)) \t\t\t\t#Propulsive efficiency in %\n", + "F = ((m*C4)-(ma*u1))*10**-3 \t\t\t\t#Thrust in kN\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Efficiency of the ideal cycle is %3i percent \\\n", + "\\nB)Flight speed is %3.3f m/s \\\n", + "\\nC)Air flow rate is %3.3f kg/s \\\n", + "\\nD)Diffuser pressure ratio is %3.4f \\\n", + "\\nE)Fuel air ratio is %3.5f \\\n", + "\\nF)Nozzle pressure ratio is %3.2f \\\n", + "\\nG)Nozzle jet mach number is %3.3f \\\n", + "\\nH)Propulsive efficiency is %3.4f percent \\\n", + "\\nI)Thrust is %3.3f kN'%(eff_i,C4,ma,pr_d,f,pr_n,Me,eff_p,F)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Efficiency of the ideal cycle is 31 percent \n", + "B)Flight speed is 937.202 m/s \n", + "C)Air flow rate is 57.800 kg/s \n", + "D)Diffuser pressure ratio is 3.2875 \n", + "E)Fuel air ratio is 0.03188 \n", + "F)Nozzle pressure ratio is 3.22 \n", + "G)Nozzle jet mach number is 1.371 \n", + "H)Propulsive efficiency is 0.6696 percent \n", + "I)Thrust is 28.630 kN\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.17 page : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "ma = 18. \t\t\t\t#Mass flow rate of air in kg/s\n", + "Mi = 0.6 \t\t\t\t#Inlet mach number \n", + "h = 4600. \t\t\t\t#Altitude in m\n", + "Pi = 55. \t\t\t\t#Inlet pressure in \n", + "Ti = -20.+273 \t\t\t\t#Inlet temperature in K\n", + "eff_d = 0.9 \t\t\t\t#Diffuser efficiency \n", + "pr_d = 5. \t\t\t\t#Diffuser pressure ratio \n", + "T3 = 1000.+273 \t\t\t\t#Inlet turbine temperature in K\n", + "Pe = 60. \t\t\t\t#Exit pressure in kPa\n", + "eff_c = 0.81 \t\t\t\t#Compressor efficiency\n", + "eff_t = 0.85 \t\t\t\t#Turbine efficiency\n", + "eff_n = 0.915 \t\t\t\t#Nozzle efficiency\n", + "CV = 46520. \t\t\t\t#Calorific value in kJ/kg\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure of air in J/kg-K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Ci = Mi*math.sqrt(k*R*Ti) \t\t\t\t#Velocity of air in m/s,\n", + "u = Ci \t\t\t\t#Flight velocity in m/s, Since it is reaction force of Ci\n", + "T1 = Ti+(Ci**2/(2*Cp)) \t\t\t\t#Temperature at inlet of compressor in K\n", + "P1s = Pi*(T1/Ti)**(k/(k-1)) \t\t\t\t#Inlet pressure of compressor at isentropic process in kPa\n", + "P1 = Pi+(eff_d*(P1s-Pi)) \t\t\t\t#Inlet pressure of compressor in kPa\n", + "P2 = P1*pr_d \t\t\t\t#Outlet pressure of compressor in kPa\n", + "T2s = T1*(pr_d)**((k-1)/k) \t\t\t\t#Outlet temperature of compressor at isentropic process in K\n", + "T2 = T1+((T2s-T1)/eff_c) \t\t\t\t#Exit temperature of compressor in K\n", + "Wc = Cp*(T2-T1)*10**-3 \t\t\t\t#Workdone on compressor in kJ/kg of air\n", + "Pc = ma*Wc \t\t\t\t#Power input in kW\n", + "Pt = Pc \t\t\t\t#Power out put of turbine for isentropic process in kW \n", + "f = (T3-T2)/((CV*10**3/Cp)-T3) \t\t\t\t#Fuel air ratio\n", + "Wt = Wc \t\t\t\t#Workdone by the turbine in kJ/kg of air\n", + "T4 = T3-(Wt*10**3/Cp) \t\t\t\t#Exit temperature of turbine in K\n", + "T4s = T3-((T3-T4)/eff_t) \t\t\t\t#Exit temperature of turbine at isentropic process in K\n", + "P3 = P2 \t\t\t\t#Exit pressure of combustion chamber in kPa, Since the process takes place at consmath.tant pressure process\n", + "P4 = P3*(T4s/T3)**(k/(k-1)) \t\t\t\t#Pressure at outlet of turbine in kPa\n", + "pr_n = P4/Pe \t\t\t\t#Pressure ratio of nozzle\n", + "Tes = T4/(pr_n)**((k-1)/k) \t\t\t\t#Exit temperature of nozzle at isentropic process in K\n", + "Te = T4-(eff_n*(T4-Tes)) \t\t\t\t#Exit temperature of nozzle in K\n", + "Cj = math.sqrt(2*Cp*(T4-Te)) \t\t\t\t#Jet velocity in m/s\n", + "Ce = Cj \t\t\t\t#Flight velocity in m/s\n", + "ae = math.sqrt(k*R*Te) \t\t\t\t#Sound velocity at nozzle in m/s\n", + "Me = Ce/ae \t\t\t\t#Nozzle jet mach number\n", + "F = ma*(((1+f)*Cj)-u) \t\t\t\t#Thrust in N\n", + "P = F*u*10**-3 \t\t\t\t#Thrust power in kW\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)Power input of compressor is %3.2f kW \\\n", + "\\nB)Power output of turbine is %3.2f kW \\\n", + "\\nC)F/A ratio on mass basis is %3.4f \\\n", + "\\nD)Exit mach number is %3.3f \\\n", + "\\nE)Thrust is %3.2f N \\\n", + "\\nF)Thrust power is %3.1f kW'%(Pc,Pt,f,Me,F,P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)Power input of compressor is 3536.17 kW \n", + "B)Power output of turbine is 3536.17 kW \n", + "C)F/A ratio on mass basis is 0.0179 \n", + "D)Exit mach number is 1.245 \n", + "E)Thrust is 9668.83 N \n", + "F)Thrust power is 1849.7 kW\n" + ] + } + ], + "prompt_number": 20 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch7.ipynb b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch7.ipynb new file mode 100755 index 00000000..bed8f135 --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch7.ipynb @@ -0,0 +1,831 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:2b84da90b712d0e24452d78c735ac1dad7be546c737e70f5e892f031f5d70de9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 : Rocket propulsion" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 page : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "mp = 12. \t\t\t\t#flow rate in kg/s\n", + "Ae = 335.*10**-4 \t\t\t\t#exit area in m**2\n", + "Ce = 2000. \t\t\t\t#exhaust velocity in m/s\n", + "h = 10. \t\t\t\t#altitude in km\n", + "Pe = 1.*10**5 \t\t\t\t#exhaust pressure in Pa\n", + "P0 = 1.*10**5 \t\t\t\t#p0 = atomspheric pressure in Pa at h = 0.\n", + "P10 = 0.25*10**5 \t\t\t\t#atmospheric pressure in Pa umath.sing gas tables\n", + "\n", + "\t\t\t\t\n", + "#Calculations\n", + "Fs = mp*Ce*10**-3 \t\t\t\t#thrust of motor at sea level math.since pe = p0 in kN\n", + "F10 = ((mp*Ce) + Ae*(Pe-P10))*10**-3 \t\t\t\t#thrust of motor at altitude of 10km in kN\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)thrust of motor at sea level is %3i kN upwards \\\n", + "\\nB)thrust of motor at an altitude 10km is %3.4f kN'%(Fs,F10)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)thrust of motor at sea level is 24 kN upwards \n", + "B)thrust of motor at an altitude 10km is 26.5125 kN\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 page : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P0 = 38*10**5 \t\t\t\t#combustion chamber pressure in Pa\n", + "T0 = 3500 \t\t\t\t#combustion chamber temperature in K\n", + "ma = 41.67 \t\t\t\t#oxidizer flow rate in kg/s\n", + "MR = 5 \t\t\t\t#mixture ratio\n", + "k = 1.3 \t\t\t\t#adiabatic consmath.tant\n", + "R = 287 \t\t\t\t#gas consmath.tant in J/kg-K\n", + "Pamb = 0.0582*10**5 \t\t\t\t#ambient pressure in Pa\n", + "Pe = Pamb \t\t\t\t#exhaust pressure at sea level in Pa\n", + "\n", + "\t\t\t\t\n", + "#Calculation \n", + "mf = ma/MR \t\t\t\t#mass flow of fuel in kg/s \n", + "mp = mf+ma \t\t\t\t#propellant mass flow in kg/s\n", + "Cp = (k*R)/(k-1) \t\t\t\t#specific heat at consmath.tant pressure in J/kg-k\n", + "p = P0/Pe \t\t\t\t#ratio of pressures at combustion chamber and exhaust \n", + "Me = ((((p**((k-1)/k))-1)*2)/(k-1))**0.5 \t\t\t\t#Mach number\n", + "t = 1/(1+(((k-1)/2)*Me**2)) \t\t\t\t#ratio of exhaust temperature to combustion temperature\n", + "Te = t*T0 \t\t\t\t#exhaust temperature in Kelvin\n", + "a = (1/Me)*(((2/(k+1))+(((k-1)/(k+1))*Me**2))**((k+1)/(2*(k-1)))) \t\t\t\t#ratio of areas at exit section and throat section of the nozzle\n", + "Ce = (k*R*Te)**0.5*Me \t\t\t\t#exit velocity in the exhaust in m/s\n", + "Cj = Ce \t\t\t\t#average effective jet velocity in m/s, math.since Pe = Pamb\n", + "P1 = P0*(2/(k+1))**(k/(k-1)) \t\t\t\t#pressure at throat section in Pa\n", + "T1 = T0*(2/(k+1)) \t\t\t\t#temperature at throat section in K\n", + "d1 = P1/(R*T1) \t\t\t\t#density of fuel at throat section in kg/m**3\n", + "C1 = (k*R*T1)**0.5 \t\t\t\t#velocity at throat section in m/s\n", + "A1 = (mp/(d1*C1))*10**4 \t\t\t\t#nozzle throat area in cm**2\n", + "Ae = a*A1 \t\t\t\t#exit area in cm**2\n", + "F = (mp*Ce)*10**-3 \t\t\t\t#thrust in kN\n", + "Cmax1 = (2*Cp*T0)**0.5 \t\t\t\t#maximum possible velocity in m/s\n", + "Cf = (F*10**3)/(P0*A1*10**-4) \t\t\t\t#thrust coefficient, F in kN and A1 in m**2\n", + "Cch1 = Cj/Cf \t\t\t\t#characteristic velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)nozzle throat area is %3.2f cm**2 \\\n", + "\\nB)thrust is %3.1f kN \\\n", + "\\nC)thrust coefficient is %3.2f \\\n", + "\\nD)characteristic velocity is %3i m/s \\\n", + "\\nE)exit velocity in exhaust is %3i m/s \\\n", + "\\nF)maximum possible exhaust velocity is %3i m/s'%(A1,F,Cf,Cch1,Ce,Cmax1)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)nozzle throat area is 197.65 cm**2 \n", + "B)thrust is 130.0 kN \n", + "C)thrust coefficient is 1.73 \n", + "D)characteristic velocity is 1502 m/s \n", + "E)exit velocity in exhaust is 2599 m/s \n", + "F)maximum possible exhaust velocity is 2950 m/s\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 page : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "a = 3. \t\t\t\t#exit area to throat area ratio\n", + "T0 = 2973. \t\t\t\t#combustion chamber temperature in K\n", + "P0 = 20.*10**5 \t\t\t\t#combustion chamber pressure in Pa\n", + "k = 1.3 \t\t\t\t#adiabatic consmath.tant\n", + "R = 248. \t\t\t\t#gas consmath.tant in J/kg-K\n", + "Pamb = 1.*10**5 \t\t\t\t#ambient pressure in Pa\n", + "Me = 2.52 \t\t\t\t#mach number for k = 1.3 and a = 3 umath.sing gas tables \n", + "g = 9.81 \t\t\t\t#acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p = 1/((1+(((k-1)/2)*Me**2))**(k/(k-1))) \t\t\t\t#ratio of pressures at exhaust and combustion chamber \n", + "Pe = p*P0 \t\t\t\t#exhaust pressure in Pa\n", + "t = 1/(1+(((k-1)/2)*Me**2)) \t\t\t\t#ratio of exhaust temperature to combustion temperature\n", + "Te = t*T0 \t\t\t\t#exhaust temperature in Kelvin\n", + "Ce = (k*R*Te)**0.5*Me \t\t\t\t#exit velocity in the exhaust in m/s\n", + "M = (Pe*Ce)/(R*Te) \t\t\t\t#propellant mass flow per unit area of exit in kg/m**2-s\n", + "Fa = ((M*Ce)+(Pe-Pamb))*10**-3 \t\t\t\t#thrust per unit area of exit in N/m**2\n", + "Is = (Fa*10**3)/(M*g) \t\t\t\t#specific impulse in sec\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)thrust per unit area of exit is %3.2f kN/m**2 \\\n", + "\\nB)specific impulse is %3.2f sec'%(Fa,Is)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)thrust per unit area of exit is 918.93 kN/m**2 \n", + "B)specific impulse is 181.98 sec\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 page : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "mp = 5. \t\t\t\t#propellent flow rate in kg/s (mismath.sing data)\n", + "de = 0.10 \t\t\t\t#nozzle exit diameter in m\n", + "Pe = 1.02*10**5 \t\t\t\t#nozzle exit pressure in Pa\n", + "Pamb = 1.013*10**5 \t\t\t\t#ambient pressure in Pa\n", + "P0 = 20. \t\t\t\t#thrust chamber pressure in Pa\n", + "F = 7000. \t\t\t\t#thrust in N\n", + "u = 1000. \t\t\t\t#rocket speed in m/s\n", + "g = 9.81 \t\t\t\t#acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Cj = F/mp \t\t\t\t#effective jet velocity in m/s\n", + "Ca = Cj-u \t\t\t\t#absolute jet velocity in m/s\n", + "wp = mp*g \t\t\t\t#weight flow rate of propellent in N/s\n", + "Is = F/(wp) \t\t\t\t#specific impulse in sec\n", + "SPC = 1/Is \t\t\t\t#specific propellent consumption in sec**-1\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)effective jet velocity is %3i m/s \\\n", + "\\nB)specific impulse is %3.2f sec \\\n", + "\\nC)specific propellent consumption is %3.3f s**-1 \\\n", + "\\nD)absolute jet velocity is %3i m/s'%(Cj,Is,SPC,Ca)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)effective jet velocity is 1400 m/s \n", + "B)specific impulse is 142.71 sec \n", + "C)specific propellent consumption is 0.007 s**-1 \n", + "D)absolute jet velocity is 400 m/s\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 page: 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data \n", + "Cj = 2700. \t\t\t\t#average effective jet velocity in m/s\n", + "u = 1350. \t\t\t\t#forward flight velocity in m/s\n", + "mp = 78.6 \t\t\t\t#propellant mass flow in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "s = u/Cj \t\t\t\t#effective jet speed ratio\n", + "np = (2*s)/(1+s**2) \t\t\t\t#propulsive efficiency\n", + "F = Cj*mp*10**-3 \t\t\t\t#thrust in kN\n", + "Pt = F*u*10**-3 \t\t\t\t#Thrust power in MW, F in N\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)thrust is %3.2f kN \\\n", + "\\nB)Thrust power is %3.3f MW \\\n", + "\\nC)propulsive efficiency is %3.1f'%(F,Pt,np)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)thrust is 212.22 kN \n", + "B)Thrust power is 286.497 MW \n", + "C)propulsive efficiency is 0.8\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 page : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from scipy.integrate import quad \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "mi = 15000. \t\t\t\t#mass of the rocket in kg\n", + "mp = 125. \t\t\t\t#propellant mass flow in kg/s\n", + "Cj = 2000. \t\t\t\t#velocity of gases coming out in m/s\n", + "t = 70. \t\t\t\t#time interval in sec\n", + "t0 = 0. \t\t\t\t#lower limit in integration in sec\n", + "t1 = 70. \t\t\t\t#upper limit in integration in sec\n", + "g = 9.81 \t\t\t\t#acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "u = (-Cj*(math.log(1-((mp*t)/mi))))-(g*t) \t\t\t\t#velocity attained in 70 sec in m/s\n", + "\n", + "def f0(t): \n", + "\t return ((-2000*(math.log(1-((125*t)/15000))))-(g*t))\n", + "\n", + "h1 = ( quad(f0,t0,t1))[0]\n", + "\n", + "h2 = (u**2/(2*g))*10**-3 \t\t\t\t#Distance reached after fuel last i.e. after 70 sec due to kinetic energy by umath.sing KE = PE in km\n", + "h = h1+h2 \t\t\t\t#maximum height the rocket will reach in km\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)velocity attained in %i sec is %3.2f m/s \\\n", + "\\nB)maximum height the rocket will reach is %3.3f km'%(t,u,h)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)velocity attained in 70 sec is 1064.24 m/s \n", + "B)maximum height the rocket will reach is 28476.353 km\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 page : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "A1 = 18.*10**-4 \t\t\t\t#throat area in m**2\n", + "P0 = 25.*10**5 \t\t\t\t#combustion chamber pressure in Pa\n", + "Is = 127.42 \t\t\t\t#specific impulse in sec\n", + "wp = 44.145 \t\t\t\t#weight flow rate of propellent in N/s\n", + "g = 9.81 \t\t\t\t#acceleration due to kravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "F = Is*wp \t\t\t\t#thrust in N\n", + "mp = wp/g \t\t\t\t#propellant mass flow in kg/s\n", + "Cj = F/mp \t\t\t\t#average effective jet velocity in m/s\n", + "Cf = F/(P0*A1) \t\t\t\t#thrust coefficient\n", + "Cw = wp/(P0*A1)/10**-3 \t\t\t\t#propellent weight flow coefficent *10**-3\n", + "SPC = (wp/F)/10**-3 \t\t\t\t#specific propellent consumption in sec**-1 *10**-3\n", + "Cch1 = Cj/Cf \t\t\t\t#characteristic velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)thrust coefficient is %3.2f \\\n", + "\\nB)propellent weight flow coefficent is %3.2f*10**-3 \\\n", + "\\nC)specific propellent consumption is %3.2f*10**-3 s**-1 \\\n", + "\\nD)characteristic velocity is %3.0f m/s'%(Cf,Cw,SPC,Cch1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)thrust coefficient is 1.25 \n", + "B)propellent weight flow coefficent is 9.81*10**-3 \n", + "C)specific propellent consumption is 7.85*10**-3 s**-1 \n", + "D)characteristic velocity is 1000 m/s\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 page : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "m1 = 200. \t\t\t\t#internal mass in kg\n", + "m2 = 130. \t\t\t\t#mass after rocket operation in kg\n", + "m3 = 110. \t\t\t\t#payload,non-propulsive structure, etc in kg\n", + "tp = 3. \t\t\t\t#rocket operation duration in sec\n", + "Is = 240. \t\t\t\t#specific impulse in sec\n", + "g = 9.81 \t\t\t\t#acceleration due to kravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "MR = m2/m1 \t\t\t\t#mass ratio\n", + "Mp = m1-m2 \t\t\t\t#mass of propellant in kg\n", + "mp = Mp/tp \t\t\t\t#propellent flow rate in kg/s\n", + "wp = mp*g \t\t\t\t#weight flow rate of propellent in N/s\n", + "IMF = (m2-m3)/(m1-m3) \t\t\t\t#initial mass fraction\n", + "PMF = 1-IMF \t\t\t\t#propellant mass fraction\n", + "F = Is*wp \t\t\t\t#thrust in N\n", + "TWRi = F/(m1*g) \t\t\t\t#initial thrust to weight ratio \n", + "TWRf = F/(m2*g) \t\t\t\t#final thrust to weight ratio\n", + "av = F/m2 \t\t\t\t#Maximum accelaration of the vechicle in m/s**2\n", + "Cj = Is*g \t\t\t\t#effective exhaust velocity in m/s\n", + "It = Is*Mp*g*10**-3 \t\t\t\t#total impulse in kN-s, units of the answer given in the book is wrong\n", + "IWR = (It*10**3)/((m1-m3)*g) \t\t\t\t#impulse to weighr ratio, It in N-s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)mass ratio is %3.2f \\\n", + "\\nB)propellent mass fraction is %3.3f \\\n", + "\\nC)propellent flow rate is %3.1f kg/s \\\n", + "\\nD)thrust is %3.1f N \\\n", + "\\nE)thrust to weight ratio is %3.2f intial) and %3.2f final) \\\n", + "\\nF)accelaration of the vechicle is %3.2f m/s**2 \\\n", + "\\nG)effective exhaust velocity is %3.1f m/s \\\n", + "\\nH)total impulse is %3.3f kN-s \\\n", + "\\nI)impulse to weighr ratio is %3.2f'%(MR,PMF,mp,F,TWRi,TWRf,av,Cj,It,IWR)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)mass ratio is 0.65 \n", + "B)propellent mass fraction is 0.778 \n", + "C)propellent flow rate is 23.3 kg/s \n", + "D)thrust is 54936.0 N \n", + "E)thrust to weight ratio is 28.00 intial) and 43.08 final) \n", + "F)accelaration of the vechicle is 422.58 m/s**2 \n", + "G)effective exhaust velocity is 2354.4 m/s \n", + "H)total impulse is 164.808 kN-s \n", + "I)impulse to weighr ratio is 186.67\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.9 page : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 2800. \t\t\t\t#rocket speed in m/s\n", + "Cj = 1400. \t\t\t\t#effective exhaust velocity in m/s\n", + "mp = 5. \t\t\t\t#propellent flow rate in kg/s\n", + "q = 6500. \t\t\t\t#heat of propellent per kg of propellant mixture in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "s = u/Cj \t\t\t\t#effective jet speed ratio\n", + "np = (2*s)/(1+s**2) \t\t\t\t#propulsive efficiency\n", + "F = Cj*mp*10**-3 \t\t\t\t#thrust in kN\n", + "Pt = F*10**3*u*10**-6 \t\t\t\t#Thrust power in MW, F in N\n", + "Pe = Pt/np \t\t\t\t#engine outputin MW\n", + "nth = Pe*10**3/(mp*q) \t\t\t\t#thermal efficiency, Pe in kW\n", + "no = np*nth \t\t\t\t#overall efficiency\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)propulsive efficiency is %3.1f \\\n", + "\\nB)propulsive power is %3.1f MW \\\n", + "\\nC)engine outut is %3.1f MW \\\n", + "\\nD)thermal efficiency is %3.4f \\\n", + "\\nE)overall efficiency is %3.3f'%(np,Pt,Pe,nth,no)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)propulsive efficiency is 0.8 \n", + "B)propulsive power is 19.6 MW \n", + "C)engine outut is 24.5 MW \n", + "D)thermal efficiency is 0.7538 \n", + "E)overall efficiency is 0.603\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.10 page : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Cj = 1250. \t\t\t\t#effective exhaust velocity in m/s\n", + "s = 0.8 \t\t\t\t#effective jet speed ratio i.e. flight to jet speed ratio\n", + "ma = 3.5 \t\t\t\t#oxidizer flow rate in kg/s\n", + "mf = 1. \t\t\t\t#fuel flow rate in kg/s\n", + "g = 9.81 \t\t\t\t#acceleration due to gravity in m/s**2\n", + "q = 2500.*10**3 \t\t\t\t#heat of propellent per kg of propellant mixture in J/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "u = s*Cj \t\t\t\t#flight velocity in m/s\n", + "mp = ma+mf \t\t\t\t#propellant mass flow in kg/s\n", + "F = Cj*mp*10**-3 \t\t\t\t#thrust in kN\n", + "wp = mp*g \t\t\t\t#weight flow rate of propellent in N/s\n", + "Is = (F*10**3)/(wp) \t\t\t\t#specific impulse in sec,F in N\n", + "np = (2*s)/(1+s**2) \t\t\t\t#propulsive efficiency\n", + "nth = 0.5*mp*((Cj**2+u**2)/(mp*q)) \t\t\t\t#thermal efficiency\n", + "no = np*nth \t\t\t\t#overall efficiency\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)thrust is %3.3f kN \\\n", + "\\nB)specific impulse is %3.2f sec \\\n", + "\\nC)propulsive efficiency is %3.4f \\\n", + "\\nD)thermal efficiency is %3.4f \\\n", + "\\nE)overall efficiency is %3.1f'%(F,Is,np,nth,no)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)thrust is 5.625 kN \n", + "B)specific impulse is 127.42 sec \n", + "C)propulsive efficiency is 0.9756 \n", + "D)thermal efficiency is 0.5125 \n", + "E)overall efficiency is 0.5\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.11 page : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "mp = 193. \t\t\t\t#propellent flow rate in kg/s\n", + "P1 = 27.*10**5 \t\t\t\t#pressure at throat section in Pa\n", + "T1 = 3000. \t\t\t\t#temperature at throat section in K\n", + "de = 0.6 \t\t\t\t#nozzle exit diameter in m\n", + "Pe = 1.1*10**5 \t\t\t\t#exhaust pressure in Pa\n", + "Pamb = 1.013*10**5 \t\t\t\t#ambient pressure in Pa\n", + "F = 380*10**3 \t\t\t\t#thrust of motor in N\n", + "u = 694.44 \t\t\t\t#flight velocity in m/s\n", + "g = 9.81 \t\t\t\t#acceleration due to gravity in m/s**2\n", + "q = 6500*10**3 \t\t\t\t#heat of propellent per kg of propellant mixture in J/kg\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Ae = (math.pi*0.6**2)/4 \t\t\t\t#exit area in m**2\n", + "Cj = F/mp \t\t\t\t#average effective jet velocity in m/s\n", + "Ce = (F-((Pe-Pamb)*Ae))/mp \t\t\t\t#exhaust velocity in m/s, wrong answer in textbook\n", + "wp = mp*g \t\t\t\t#weight flow rate of propellent in N/s\n", + "Is = (F)/(wp) \t\t\t\t#specific impulse in sec\n", + "SPC = (wp/F)/10**-3 \t\t\t\t#specific propellent consumption in sec**-1 *10**-3\n", + "Pt = F*u*10**-6 \t\t\t\t#Thrust power in MW\n", + "Pl = (0.5*mp*((Cj-u)**2))*10**-6 \t\t\t\t#Power loss in exhaust in MW\n", + "Pe = Pt+Pl \t\t\t\t#engine output in MW\n", + "np = Pt/Pe \t\t\t\t#propulsive efficiency\n", + "nth = Pe*10**3/(mp*q*10**-3) \t\t\t\t#thermal efficiency and Pe,q in kW\n", + "no = np*nth \t\t\t\t#overall efficiency\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)effective jet velocity is %3.4f m/s \\\n", + "\\nB)Actual jet velocity is %3.4f m/s \\\n", + "\\nC)specific impulse is %3.1f sec \\\n", + "\\nD)specific propellent consumption is %3.4f*10**-3 sec**-1 \\\n", + "\\nE)propulsive efficiency is %3.5f \\\n", + "\\nD)thermal efficiency is %3.3f \\\n", + "\\nE)overall efficiency is %3.5f'%(Cj,Ce,Is,SPC,np,nth,no)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)effective jet velocity is 1968.9119 m/s \n", + "B)Actual jet velocity is 1956.1665 m/s \n", + "C)specific impulse is 200.7 sec \n", + "D)specific propellent consumption is 4.9824*10**-3 sec**-1 \n", + "E)propulsive efficiency is 0.62736 \n", + "D)thermal efficiency is 0.335 \n", + "E)overall efficiency is 0.21035\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.12 page : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "m1 = 3600. \t\t\t\t#internal mass in kg\n", + "Cj = 2070. \t\t\t\t#average effective jet velocity in m/s\n", + "tp = 80. \t\t\t\t#rocket operation duration in sec\n", + "g = 9.81 \t\t\t\t#acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "up = 2*Cj \t\t\t\t#flight velocity in m/s\n", + "MR = 1/math.exp((up+(g*tp))/Cj) \t\t\t\t#mass ratio\n", + "m2 = MR*m1 \t\t\t\t#mass after rocket operation in kg\n", + "PMF = 1-MR \t\t\t\t#propellant mass fraction\n", + "Mp = m1-m2 \t\t\t\t#mass of propellant in kg\n", + "mp = Mp/tp \t\t\t\t#propellent flow rate in kg/s\n", + "F = Cj*mp*10**-3 \t\t\t\t#thrust in kN\n", + "Zp = (((1+((1-(1/PMF))*math.log(1/MR)))*Cj*tp)-(0.5*g*tp**2))*10**-3 \t\t\t\t#powered altitude gain in km\n", + "Zc = ((0.5*up**2)/g)*10**-3 \t\t\t\t#coasting altitude gain in km\n", + "Z = Zp+Zc \t\t\t\t#maximum altitude in km\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)flow rate of propellent is %3.2f kg/s \\\n", + "\\nB)thrust developed is %3.3f kN \\\n", + "\\nC)altitude gains during powered and coasting flights are %3.3f km and %3.3f km respectively'%(mp,F,Zp,Zc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)flow rate of propellent is 40.83 kg/s \n", + "B)thrust developed is 84.521 kN \n", + "C)altitude gains during powered and coasting flights are 93.987 km and 873.578 km respectively\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.13 page : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "s = 0.2105 \t\t\t\t#effective jet speed ratio\n", + "Is = 203.88 \t\t\t\t#specific impulse in sec\n", + "tp = 8 \t\t\t\t#rocket operation duration i.e. burn out time in sec\n", + "g = 9.81 \t\t\t\t#acceleration due to kravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Cj = g*Is \t\t\t\t#average effective jet velocity in m/s\n", + "up = s*Cj \t\t\t\t#maximum flight speed in m/s\n", + "MR = 1/math.exp((up+(g*tp))/Cj) \t\t\t\t#mass ratio\n", + "PMF = 1-MR \t\t\t\t#propellant mass fraction\n", + "Zp = (((1+((1-(1/PMF))*math.log(1/MR)))*Cj*tp)-(0.5*g*tp**2))*10**-3 \t\t\t\t#powered altitude gain in km\n", + "Zc = ((0.5*up**2)/g)*10**-3 \t\t\t\t#coasting altitude gain in km\n", + "Z = Zp+Zc \t\t\t\t#maximum altitude in km\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)effective jet velocity is %3i m/s \\\n", + "\\nB)mass ratio and propellent mass fraction are %3.2f and %3.2f respectively \\\n", + "\\nC)maximum flight speed is %3.2f m/s \\\n", + "\\nD))altitude gains during powered and coasting flights are %3.3f km and %3.3f km respectively'%(Cj,MR,PMF,up,Zp,Zc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)effective jet velocity is 2000 m/s \n", + "B)mass ratio and propellent mass fraction are 0.78 and 0.22 respectively \n", + "C)maximum flight speed is 421.01 m/s \n", + "D))altitude gains during powered and coasting flights are 1.601 km and 9.034 km respectively\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.14 page : 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "R0 = 6341.6*10**3 \t\t\t\t#radius of earth at mean sea-level in m\n", + "g = 9.809 \t\t\t\t#acceleration due to gravity in m/s**2\n", + "Z1 = 0 \t\t\t\t#altitude at sea-level in m\n", + "Z2 = 300*10**3 \t\t\t\t#altitude above sea-level in m\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "uorb1 = R0*math.sqrt(g/(R0+Z1)) \t\t\t\t#orbit velocity of a rocket at mean sea level in m/s\n", + "uesc1 = math.sqrt(2)*uorb1 \t\t\t\t#escape velocity of a rocket at mean sea level in m/s\n", + "uorb2 = R0*math.sqrt(g/(R0+Z2)) \t\t\t\t#orbit velocity of a rocket at an altitude of 300 km in m/s\n", + "uesc2 = math.sqrt(2)*uorb2 \t\t\t\t#escape velocity of a rocket at an altitude of 300 km in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'A)orbit and escape velocities of a rocket at mean sea level are %3i m/s and %3i m/s \\\n", + "\\nB)orbit and escape velocities of a rocket at an altitude of 300 km are %3.1f m/s and %3.2f m/s'%(uorb1,uesc1,uorb2,uesc2 )\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)orbit and escape velocities of a rocket at mean sea level are 7886 m/s and 11153 m/s \n", + "B)orbit and escape velocities of a rocket at an altitude of 300 km are 7706.8 m/s and 10899.08 m/s\n" + ] + } + ], + "prompt_number": 14 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch8.ipynb b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch8.ipynb new file mode 100755 index 00000000..b6e19d8f --- /dev/null +++ b/Gas_Dynamics_and_Jet_Propulsion_by_P._Murugaperumal/ch8.ipynb @@ -0,0 +1,1069 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:0ee42d9d2a59bb1cfbe70f62b85f016177a8e60e52a35949d0f6ab86ccafc621" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 : Two Marks Questions and Answers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.34 page : 8" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "C = 500. \t\t\t\t#Airplane velocity in m/s\n", + "T = 20.+273 \t\t\t\t#Temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "a = math.sqrt(k*R*T) \t\t\t\t#Sound velocity in m/s\n", + "M = C/a \t\t\t\t#Mach number\n", + "alp = math.degrees(math.asin((1/M))) \t\t\t\t#Mach angle in degree\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Mach angle is %3.3f degree'%(alp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mach angle is 43.332 degree\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.35 page : 8" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "a1 = 2.2 \t\t\t\t#Area ratio (A/At)\n", + "Po = 10 \t\t\t\t#Stagnation Pressure in bar\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "\t\t\t\t#Two values of mach number at a1 from gas tables\n", + "\n", + "M1 = 0.275 \t\t\t\t#Mach number from gas tables\n", + "p1 = 0.949 \t\t\t\t#Presure ratio (P/Po)\n", + "P1 = Po*p1 \t\t\t\t#back pressure in bar\n", + "\n", + "M2 = 2.295 \t\t\t\t#Mach number from gas tables\n", + "p2 = 0.0806 \t\t\t\t#Presure ratio (P/Po)\n", + "P2 = Po*p2 \t\t\t\t#back pressure in bar\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'A)When M = %3.3f, back pressure is %3.2f bar \\\n", + "\\nB)When M = %3.3f, back pressure is %3.3f bar'%(M1,P1,M2,P2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A)When M = 0.275, back pressure is 9.49 bar \n", + "B)When M = 2.295, back pressure is 0.806 bar\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.37 page : 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 0.8 \t\t\t\t#Mach number\n", + "T = 20+273 \t\t\t\t#Temperature in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "\n", + "\t\t\t\t\n", + "#Calculation \n", + "To = T*(1+(((k-1)/2)*M**2)) \t\t\t\t#Temperature of air at nose of aircraft in K\n", + "To1 = To-273 \t\t\t\t#Temperature of air at nose of aircraft in degree Centigrade\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'Temperature of air at nose of aircraft is %3.1f degree Centigrade'%(To1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of air at nose of aircraft is 57.5 degree Centigrade\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.38 page 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "P = 1. \t\t\t\t#Pressure in bar\n", + "T = 400. \t\t\t\t#Temperature in K\n", + "C = 400. \t\t\t\t#Air velocity in m/s\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at constnat pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation Temperature in K\n", + "Poi = P+((P*C**2)/(R*T*2)) \t\t\t\t#Stagnation Pressure (if it is incompressible) in bar\n", + "Poc = P*(To/T)**(k/(k-1)) \t\t\t\t#Stagnation Pressure (if it is compressible) in bar\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Stagnation Temperature is %3.1f K \\\n", + "\\nC)Stagnation Pressure: \\\n", + "\\nIf it is incompressible is %3.4f bar \\\n", + "\\nIf it is compressible is %3.4f bar'%(To,Poi,Poc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Stagnation Temperature is 479.6 K \n", + "C)Stagnation Pressure: \n", + "If it is incompressible is 1.6969 bar \n", + "If it is compressible is 1.8874 bar\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.39 page : 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "v1 = 8 \t\t\t\t#Intial volume in litres\n", + "P1 = 0.7 \t\t\t\t#Intial pressure in MPa\n", + "v2 = 7.8 \t\t\t\t#Final volume in litres\n", + "P2 = 2.7 \t\t\t\t#Final pressure in MPa\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "k = (P2-P1)/(math.log(v1/v2)) \t\t\t\t#Bulk modulus of elasticity of a liquid in MPa\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Bulk modulus of elasticity of a liquid is %3.3f MPa'%k\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Bulk modulus of elasticity of a liquid is 78.996 MPa\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.40 page : 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "To = 15+273 \t\t\t\t#Air Temperature in K\n", + "Cp = 1005 \t\t\t\t#Specific heat capacity at constnat pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation \n", + "Cmax = math.sqrt(2*Cp*To) \t\t\t\t#Highest possible velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Highest possible velocity is %3.2f m/s'%Cmax\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Highest possible velocity is 760.84 m/s\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3.10 page : 12" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 0.25 \t\t\t\t#mach number\n", + "D = 0.04 \t\t\t\t#Diamter in m\n", + "f = 0.002 \t\t\t\t#frictional factor\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "X = 8.483 \t\t\t\t#fanno parameter from gas tables at M\n", + "Lmax = (X*D)/(4*f) \t\t\t\t#Lenggth of the pipe in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Length of the pipe is %3.3f m'%Lmax\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Length of the pipe is 42.415 m\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3.15 page : 13" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 3. \t\t\t\t#mach number\n", + "D = 0.04 \t\t\t\t#Diamter in m\n", + "f = 0.002 \t\t\t\t#frictional factor\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "X = 0.522 \t\t\t\t#fanno parameter from gas tables at M\n", + "L = (X*D)/(4*f) \t\t\t\t#Lenggth of the pipe in m\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Lenggth of the pipe is %3.2f m'%L\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Lenggth of the pipe is 2.61 m\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3.31 page : 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 0.2 \t\t\t\t#Mach number\n", + "To = 120.+273 \t\t\t\t#Stagnation Temperature in K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at constnat pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.174 \t\t\t\t#Temperature ratio (To/Tot) from Rayleigh gas tables\n", + "Tot = To/t1 \t\t\t\t#Critical stagnation temperature in K\n", + "q = Cp*(Tot-To)*10**-3 \t\t\t\t#Maximum amount of heat transfer in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Maximum amount of heat transfer is %3.2f kJ/kg'%q\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum amount of heat transfer is 1874.95 kJ/kg\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3.32 page : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "p1 = 0.75 \t\t\t\t#Pressure ratio (Po2/Po1) Since Stagnation pressure drop is 25%\n", + "Cp = 1150. \t\t\t\t#Specific heat capacity at constnat pressure in J/kg-K\n", + "k = 1.33 \t\t\t\t#Adiabatic consmath.tant \n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "ds = ((k-1)/k)*Cp*math.log(1/p1) \t\t\t\t#Increase in entropy in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Output \n", + "print 'Increase in entropy is %3.2f J/kg-K'%ds\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Increase in entropy is 82.09 J/kg-K\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3.33 page : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Mi = 2.2 \t\t\t\t#Inlet Mach number\n", + "T = 100.+273 \t\t\t\t#Temperature in K\n", + "Cp = 1005. \t\t\t\t#Specific heat capacity at constnat pressure in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "t1 = 0.508 \t\t\t\t#Temperature ratio (To/Tot) from isentropic gas tables @Mi\n", + "To = T/t1 \t\t\t\t#Stagnation Temperature in K\n", + "t2 = 0.756 \t\t\t\t#Temperature ratio (To/Tot) from Rayleigh gas tables @Mi\n", + "Tot = To/t2 \t\t\t\t#Critical stagnation temperature in K\n", + "q = Cp*(Tot-To)*10**-3 \t\t\t\t#Maximum amount of heat transfer in kJ/kg\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Maximum amount of heat transfer is %3.4f kJ/kg'%q\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum amount of heat transfer is 238.1657 kJ/kg\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5.16 page: 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Mx = 1.5 \t\t\t\t#Mach number\n", + "P = 40. \t\t\t\t#Static pressure in kPa\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 3.413 \t\t\t\t#Pressure ratio in (Poy/Px) from normal shock gas tables @Mx\n", + "Poy = p1*P \t\t\t\t#Pressure acting on front of the body in kPa\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Pressure acting on front of the body is %3.1f kPa'%Poy\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure acting on front of the body is 136.5 kPa\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5.17 page : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "M = 2. \t\t\t\t#Mach number at shock\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = 4.5 \t\t\t\t#Pressure ratio (Py/Px) from normal shock gas tables @M\n", + "e = p1-1 \t\t\t\t#Strength of shock wave\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Strength of shock wave is %3.1f'%e\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Strength of shock wave is 3.5\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5.20 page : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Mx = 7 \t\t\t\t#mach number upstream of shock\n", + "P = 2 \t\t\t\t#pressure @Mx in bar\n", + "T = 57+273 \t\t\t\t#Temperature @Mx in K\n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation \n", + "p1 = 0.72 \t\t\t\t#Pressure ratio (Poy/Pox) from normal shock gas tables @Mx\n", + "ds = R*math.log(1/p1) \t\t\t\t#Irreversibility in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Irreversibility is %3.2f J/kg-K'%ds\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Irreversibility is 94.28 J/kg-K\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + " Example 8.5.21 page : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Px = 45. \t\t\t\t#Static pressure in kPa\n", + "T = -20.+273 \t\t\t\t#Static temperature in K\n", + "Poy = 395. \t\t\t\t#Stagnation pressure in kPa\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "p1 = Poy/Px \t\t\t\t#Pressure ratio\n", + "Mx = 2.536 \t\t\t\t#Mach number from normal shock gas tables @p1\n", + "Cx = Mx*math.sqrt(k*R*T) \t\t\t\t#Air velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Mach number is %3.3f \\\n", + "\\nAir velocity is %.f m/s'%(Mx,Cx)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mach number is 2.536 \n", + "Air velocity is 809 m/s\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5.22 page : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Cx = 750. \t\t\t\t#velocity upstream of shock in m/s\n", + "Px = 1. \t\t\t\t#Pressure upstream of shock in bar\n", + "Tx = 10.+273 \t\t\t\t#Temperature upstream of shock in K\n", + "k = 1.4 \t\t\t\t#Adiabatic consmath.tant \n", + "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Mx = Cx/math.sqrt(k*R*Tx) \t\t\t\t#Mach number upstream of shock\n", + "My = 0.545 \t\t\t\t#Mach number downstream of shock from normal shock gas tables, Mistake in textbook\n", + "t1 = 1.875 \t\t\t\t#Temperature ratio (Ty/Tx)\n", + "Ty = Tx*t1 \t\t\t\t#Static temperature downstream of shock in K\n", + "p1 = 5.583 \t\t\t\t#Pressure ratio (Py/Px)\n", + "Py = Px*p1 \t\t\t\t#Static pressure downstream of shock in bar\n", + "Cy = My*math.sqrt(k*R*Ty) \t\t\t\t#velocity downstream of shock in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Downstream of shock: Velocity is %3.3f m/s Pressure is %3.3f bar Temperature is %3.3f K'%(Cy,Py,Ty)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Downstream of shock: Velocity is 251.649 m/s Pressure is 5.583 bar Temperature is 530.625 K\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6.41 page : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Calculation \n", + "\n", + "#Differentiating P = m*(Cj-u)*u and equating it to zero we get jet speed ratio as 0.5\n", + "sig = 0.5 \t\t\t\t#Jet speed ratio \n", + "eff_max = ((2*sig)/(1+sig)) \t\t\t\t#Propulsive efficiency for optimum thrust power, wrong notation in textbook.\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Propulsive efficiency for optimum thrust power is %3.3f'%(eff_max)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Propulsive efficiency for optimum thrust power is 0.667\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6.42 page : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#Input data\n", + "u = 1200*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "Cj = 800. \t\t\t\t#Effective jet velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "sig = u/Cj \t\t\t\t#jet speed ratio\n", + "eff = ((2*sig)/(1+sig))*100 \t\t\t\t#Propulsive efficiency in %\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Propulsive efficiency is %3.1f percent'%eff\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Propulsive efficiency is 58.8 percent\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7.42 page : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "m = 5. \t\t\t\t#Propellent rate in kg/s\n", + "Pamb = 1.013 \t\t\t\t#Ambient pressure in bar\n", + "Pe = 1.02 \t\t\t\t#Nozzle exit pressure in bar\n", + "D = 0.1 \t\t\t\t#Nozzle exit diameter in m\n", + "Ce = 1400. \t\t\t\t#Exit jet velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Ae = math.pi*D**2/4 \t\t\t\t#Exit area in m**2\n", + "F = (m*Ce)+((Pe-Pamb)*Ae) \t\t\t\t#Thrust in N\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Thrust is %3i N'%F\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust is 7000 N\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7.43 page : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Is = 230. \t\t\t\t#Specific Impulse in sec\n", + "m = 1. \t\t\t\t#Propellent flow in kg/s\n", + "g = 9.81 \t\t\t\t#Acceleration due to gravity in m/s**2\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "F = m*Is*g \t\t\t\t#Thrust in N\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Thrust is %3.1f N'%F\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust is 2256.3 N\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7.45 page : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 1500. \t\t\t\t#Flight velocity in m/s\n", + "eff = 0.75 \t\t\t\t#Propulsive efficiency\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "\t\t\t\t#Converting relation eff = (2*sig)/(1+sig**2) into 2nd degree polynomial of sig\n", + "sig = ((2-(math.sqrt(4-(4*eff*eff))))/(2*eff)) \t\t\t\t#Jet speed ratio\n", + "Cj = u/sig \t\t\t\t#Jet velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Jet velocity is %3.2f m/s'%Cj\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Jet velocity is 3322.88 m/s\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7.46 page : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "Cj = 2700. \t\t\t\t#Jet velocity in m/s\n", + "u = 1350. \t\t\t\t#Flight velocity in m/s\n", + "m = 78.6 \t\t\t\t#Propellent flow in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "F = m*Cj*10**-3 \t\t\t\t#Thrust in kN\n", + "P = F*u*10**-3 \t\t\t\t#Thrust power in MW\n", + "sig = u/Cj \t\t\t\t#Jet speed ratio\n", + "eff = ((2*sig)/(1+sig**2))*100 \t\t\t\t#Propulsive efficiency in %\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Thrust is %3.1f kN \\\n", + "\\nThrust power is %3.2f MW \\\n", + "\\nPropulsive efficiency is %3i percent'%(F,P,eff)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust is 212.2 kN \n", + "Thrust power is 286.50 MW \n", + "Propulsive efficiency is 80 percent\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 47 page : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "D = 12683.*1000 \t\t\t\t#Diameter of Earth in m\n", + "g = 9.81 \t\t\t\t#Acceleration due to gravity in m/s\n", + "h = 500.*1000 \t\t\t\t#Altitude in m\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "Uorb = (D/2)*math.sqrt(g/((D/2)+h)) \t\t\t\t#Orbital velocity in m/s\n", + "Uesc = math.sqrt(2)*Uorb \t\t\t\t#Escape velocity in m/s\n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Orbital velocity is %3.2f m/s \\\n", + "\\nEscape velocity is %3.2f m/s'%(Uorb,Uesc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Orbital velocity is 7593.65 m/s \n", + "Escape velocity is 10739.05 m/s\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 48 page : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "\t\t\t\t\n", + "#Input data\n", + "u = 10080*(5./18) \t\t\t\t#Flight velocity in m/s\n", + "Cj = 1400. \t\t\t\t#Jet velocity in m/s\n", + "m = 5. \t\t\t\t#Propellent flow in kg/s\n", + "\n", + "\t\t\t\t\n", + "#Calculation\n", + "F = m*Cj*10**-3 \t\t\t\t#Thrust in kN\n", + "P = F*u*10**-3 \t\t\t\t#Thrust power in MW\n", + "sig = u/Cj \t\t\t\t#Jet speed ratio\n", + "eff = ((2*sig)/(1+sig**2)) \t\t\t\t#Propulsive efficiency \n", + "\n", + "\t\t\t\t\n", + "#Output\n", + "print 'Propulsive power is %3.1f MW \\\n", + "\\nPropulsive efficiency is %3.1f'%(P,eff)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Propulsive power is 19.6 MW \n", + "Propulsive efficiency is 0.8\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Integrated_Electronics__Analog_And_Digital_Circuits_and_Systems/README.txt b/Integrated_Electronics__Analog_And_Digital_Circuits_and_Systems/README.txt new file mode 100755 index 00000000..a6b0ade5 --- /dev/null +++ b/Integrated_Electronics__Analog_And_Digital_Circuits_and_Systems/README.txt @@ -0,0 +1,10 @@ +Contributed By: Santosh Pawar +Course: mca +College/Institute/Organization: ASM institute of computer studies +Department/Designation: MCA +Book Title: Integrated Electronics Analog And Digital Circuits and Systems +Author: Millman and Halkias +Publisher: Mc Graw Hill. +Year of publication: 2011 +Isbn: 9780070151420 +Edition: 2
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot01.png b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot01.png Binary files differnew file mode 100755 index 00000000..17ffcce2 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot01.png diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot02.png b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot02.png Binary files differnew file mode 100755 index 00000000..0388ae85 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot02.png diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot03.png b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot03.png Binary files differnew file mode 100755 index 00000000..7c896dc5 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085/screenshots/Screenshot03.png diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER10.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER10.ipynb new file mode 100755 index 00000000..d6527863 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER10.ipynb @@ -0,0 +1,679 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ab37bf0da99f9ad724be9260e3ab46ab9d66bf3d564712706deecc85bcc8ceb1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 10 -Code Conversion BCD Arithmetic and 16 bit Data Operations\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.1 - PG NO:310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# page no 310\n",
+ "# example 10.1\n",
+ "# BCD TO BINARY\n",
+ "# BCD into its binary equivalent.\n",
+ "# given BCD no is 72\n",
+ "import math\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "def modulo(a,n):\n",
+ " b=a%n\n",
+ " return b\n",
+ "\n",
+ "a=72#\n",
+ "print('binary equivalent of 72 is=')\n",
+ "print(bin(72)[2:])\n",
+ "x=modulo(a,10)# # seperating the units digit\n",
+ "print('\\n')\n",
+ "print('Unpacked BCD1 ')\n",
+ "print(dec2bin(x))#\n",
+ "a=a/10# # seperating the tens place digit\n",
+ "a=math.floor(a)#\n",
+ "print('\\n \\n Unpacked BCD2')#\n",
+ "print(dec2bin(a))#\n",
+ "print('\\n \\n Multiply BCD2 by 10 and add BCD1')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "binary equivalent of 72 is=\n",
+ "1001000\n",
+ "\n",
+ "\n",
+ "Unpacked BCD1 \n",
+ "00000010\n",
+ "\n",
+ " \n",
+ " Unpacked BCD2\n",
+ "00000111\n",
+ "\n",
+ " \n",
+ " Multiply BCD2 by 10 and add BCD1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.2 - PG NO: 321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 321\n",
+ "## example no 10.2\n",
+ "## ADDITION OF PACKED BCD NUMBERS\n",
+ "import math\n",
+ "def dec2bin(f):\n",
+ " if f >= 1:\n",
+ " g = int(math.log(f, 2))\n",
+ " else:\n",
+ " g = -1\n",
+ " h = g + 1\n",
+ " ig = math.pow(2, g)\n",
+ " st = \"\" \n",
+ " while f > 0 or ig >= 1: \n",
+ " if f < 1:\n",
+ " if len(st[h:]) >= 10: # 10 fractional digits max\n",
+ " break\n",
+ " if f >= ig:\n",
+ " st += \"1\"\n",
+ " f -= ig\n",
+ " else:\n",
+ " st += \"0\"\n",
+ " ig /= 2\n",
+ " st = st[:h] + \".\" + st[h:]\n",
+ " return st\n",
+ "\n",
+ "\n",
+ "\n",
+ "a=77#\n",
+ "b=48#\n",
+ "x=a%10#\n",
+ "y=b%10#\n",
+ "z=x+y#\n",
+ "if z>9:\n",
+ " p=z+6#\n",
+ " \n",
+ " print ('After addition BCD1 is: ')\n",
+ " print (dec2bin(p))#\n",
+ " print ('MSB of this sequence is the carry generated after addition. \\n \\n')\n",
+ "else:\n",
+ " print ('After addition BCD1 is: ')\n",
+ " print (z)#\n",
+ "x=a/10#\n",
+ "x=math.floor(x)#\n",
+ "y=b/10#\n",
+ "y=math.floor(y)#\n",
+ "z=x+y#\n",
+ "if z>9:\n",
+ " p=z+6#\n",
+ " p=p+1# ## this 1 is the carry of BCD1.\n",
+ " print ('After addition BCD2 is: ')\n",
+ " print (dec2bin(p))#\n",
+ " print ('MSB of this sequence is the carry generated after addition.')\n",
+ "else:\n",
+ " print ('After addition BCD1 is: ')\n",
+ " print (z)#\n",
+ "\n",
+ "print ('\\n \\nBCD1 : 0101 \\n \\n')#\n",
+ "print ('BCD2: 0010')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After addition BCD1 is: \n",
+ "10101.\n",
+ "MSB of this sequence is the carry generated after addition. \n",
+ " \n",
+ "\n",
+ "After addition BCD2 is: \n",
+ "10010.\n",
+ "MSB of this sequence is the carry generated after addition.\n",
+ "\n",
+ " \n",
+ "BCD1 : 0101 \n",
+ " \n",
+ "\n",
+ "BCD2: 0010\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.3 - PG NO:325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 325\n",
+ "## example no 10.3\n",
+ "## EXCHANGE OF DATA\n",
+ "print ('2050H--> 3FH \\n \\n');\n",
+ "print ('2051H--> 42H \\n \\n');\n",
+ "print ('DE--> 856FH \\n');\n",
+ "print ('D--> 85H E--> 6FH \\n \\n');\n",
+ "print ('LHLD 2050H \\n'); ## loads the HL register pair with data on 2050H & 2051H.\n",
+ "print ('H--> 42H L--> 3FH \\n \\n');\n",
+ "print ('XCHG \\n'); ## exchange the data of HL register pair with DE register pair.\n",
+ "print ('D<-->H E<-->L \\n');\n",
+ "print ('D--> 42H E--> 3FH \\n H--> 85H L--> 6FH \\n \\n');\n",
+ "print ('SHLD 2050H \\n'); ## stores the 16bit dat in HL register pair on memory location 2051H & 2050H.\n",
+ "print ('2050H--> 6FH \\n');\n",
+ "print ('2051H--> 85H');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2050H--> 3FH \n",
+ " \n",
+ "\n",
+ "2051H--> 42H \n",
+ " \n",
+ "\n",
+ "DE--> 856FH \n",
+ "\n",
+ "D--> 85H E--> 6FH \n",
+ " \n",
+ "\n",
+ "LHLD 2050H \n",
+ "\n",
+ "H--> 42H L--> 3FH \n",
+ " \n",
+ "\n",
+ "XCHG \n",
+ "\n",
+ "D<-->H E<-->L \n",
+ "\n",
+ "D--> 42H E--> 3FH \n",
+ " H--> 85H L--> 6FH \n",
+ " \n",
+ "\n",
+ "SHLD 2050H \n",
+ "\n",
+ "2050H--> 6FH \n",
+ "\n",
+ "2051H--> 85H\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.4 - PG NO:326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 326\n",
+ "## examle no 10.4\n",
+ "## ADDITION OF TWO 16 BIT NUMBERS\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "\n",
+ "print ('B--> 27H C--> 93H \\n')#\n",
+ "print ('D--> 31H E--> 82H \\n \\n')#\n",
+ "b=hex2dec('27')#\n",
+ "c=hex2dec('93')#\n",
+ "d=hex2dec('31')#\n",
+ "e=hex2dec('82')#\n",
+ "print ('MOV A,C \\n \\n')#\n",
+ "a=c#\n",
+ "print ('ADD E \\n')#\n",
+ "a=a+e#\n",
+ "Z=a-256#\n",
+ "X=dec2hex(Z)#\n",
+ "print ('Sum =')\n",
+ "print(X)#\n",
+ "if a>255:\n",
+ " print ('CY=1 \\n \\n')#\n",
+ " CY=1#\n",
+ "else:\n",
+ " print ('CY=0 \\n')#\n",
+ " CY=0#\n",
+ "\n",
+ "print ('MOV L,A \\n')#\n",
+ "print ('L-->')#\n",
+ "print(X)#\n",
+ "print ('\\n \\n MOV A,B \\n \\n')#\n",
+ "a=b#\n",
+ "print ('ADC D \\n')#\n",
+ "a=a+d+CY# ## CY is added because of the previous carry as per the instructions ADC (add with carry)\n",
+ "T=dec2hex(a)#\n",
+ "print ('Sum =')\n",
+ "print(T)#\n",
+ "if a>255:\n",
+ " print ('CY=1 \\n \\n')\n",
+ "else:\n",
+ " print ('CY=0 \\n \\n')\n",
+ "\n",
+ "print ('MOV H,A \\n')#\n",
+ "print ('H-->')#\n",
+ "print(T)#\n",
+ "print ('\\n \\n SHLD 2050H \\n')# ## stores the contents of HL register pair on memory locations 2051H & 2050H.\n",
+ "print ('2050H--> ')#\n",
+ "print(X)#\n",
+ "print ('2051H--> ')#\n",
+ "print(T)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B--> 27H C--> 93H \n",
+ "\n",
+ "D--> 31H E--> 82H \n",
+ " \n",
+ "\n",
+ "MOV A,C \n",
+ " \n",
+ "\n",
+ "ADD E \n",
+ "\n",
+ "Sum =\n",
+ "15\n",
+ "CY=1 \n",
+ " \n",
+ "\n",
+ "MOV L,A \n",
+ "\n",
+ "L-->\n",
+ "15\n",
+ "\n",
+ " \n",
+ " MOV A,B \n",
+ " \n",
+ "\n",
+ "ADC D \n",
+ "\n",
+ "Sum =\n",
+ "59\n",
+ "CY=0 \n",
+ " \n",
+ "\n",
+ "MOV H,A \n",
+ "\n",
+ "H-->\n",
+ "59\n",
+ "\n",
+ " \n",
+ " SHLD 2050H \n",
+ "\n",
+ "2050H--> \n",
+ "15\n",
+ "2051H--> \n",
+ "59\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.5 - PG NO:326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 326\n",
+ "## examle no 10.5\n",
+ "## SUBTRACTION OF TWO 16 BIT NUMBERS\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "print ('B--> 85H C--> 38H \\n')#\n",
+ "print ('D--> 62H E--> A5H \\n \\n')#\n",
+ "b=hex2dec('85')#\n",
+ "c=hex2dec('38')#\n",
+ "d=hex2dec('62')#\n",
+ "e=hex2dec('A5')#\n",
+ "print ('MOV A,C \\n \\n')#\n",
+ "a=c#\n",
+ "print ('SUB E \\n')#\n",
+ "a=a-e#\n",
+ "Z=a+256#\n",
+ "X=dec2hex(Z)#\n",
+ "print ('Difference =')\n",
+ "print (X)#\n",
+ "if a<0:\n",
+ " print ('Borrow=1 \\n \\n')#\n",
+ " B=1#\n",
+ "else:\n",
+ " print ('Borrow=0 \\n')\n",
+ " B=0#\n",
+ "\n",
+ "print ('MOV C,A \\n')#\n",
+ "print ('C-->')#\n",
+ "print (X)#\n",
+ "print ('\\n \\n MOV A,B \\n \\n')#\n",
+ "a=b#\n",
+ "print ('SBB D \\n')#\n",
+ "a=a-d-B# ## 1 is subtracted because of the previous borrow as per the instructions SBB (subtract with borrow)\n",
+ "T=dec2hex(a)#\n",
+ "print ('Difference =')\n",
+ "print (T)#\n",
+ "if a<0:\n",
+ " print ('Borrow=1 \\n \\n')\n",
+ "else:\n",
+ " print ('Borrow=0 \\n \\n')\n",
+ "\n",
+ "print ('MOV B,A \\n')#\n",
+ "print ('B-->')#\n",
+ "print (T)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B--> 85H C--> 38H \n",
+ "\n",
+ "D--> 62H E--> A5H \n",
+ " \n",
+ "\n",
+ "MOV A,C \n",
+ " \n",
+ "\n",
+ "SUB E \n",
+ "\n",
+ "Difference =\n",
+ "93\n",
+ "Borrow=1 \n",
+ " \n",
+ "\n",
+ "MOV C,A \n",
+ "\n",
+ "C-->\n",
+ "93\n",
+ "\n",
+ " \n",
+ " MOV A,B \n",
+ " \n",
+ "\n",
+ "SBB D \n",
+ "\n",
+ "Difference =\n",
+ "22\n",
+ "Borrow=0 \n",
+ " \n",
+ "\n",
+ "MOV B,A \n",
+ "\n",
+ "B-->\n",
+ "22\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.6 - PG NO:327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 327\n",
+ "## example no 10.6\n",
+ "## DISPLAY CONTENTS OF STACK\n",
+ "print ('LXI H,0000H \\n'); ## clears the HL register pair\n",
+ "print ('H--> 00H L--> 00H \\n \\n');\n",
+ "print ('DAD SP \\n'); ## place the stack pointer content in HL\n",
+ "print ('H--> higher bytes of stack pointer register \\n');\n",
+ "print ('L--> lower bytes of stack pointer register \\n \\n');\n",
+ "print ('MOV A,H \\n'); ## copies the contents of H in A.\n",
+ "print ('H--> A \\n \\n');\n",
+ "print ('OUT PORT1 \\n \\n');\n",
+ "print ('MOV A,L \\n'); ## copies the contents of L in A.\n",
+ "print ('L--> A \\n \\n');\n",
+ "print ('OUT PORT2');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LXI H,0000H \n",
+ "\n",
+ "H--> 00H L--> 00H \n",
+ " \n",
+ "\n",
+ "DAD SP \n",
+ "\n",
+ "H--> higher bytes of stack pointer register \n",
+ "\n",
+ "L--> lower bytes of stack pointer register \n",
+ " \n",
+ "\n",
+ "MOV A,H \n",
+ "\n",
+ "H--> A \n",
+ " \n",
+ "\n",
+ "OUT PORT1 \n",
+ " \n",
+ "\n",
+ "MOV A,L \n",
+ "\n",
+ "L--> A \n",
+ " \n",
+ "\n",
+ "OUT PORT2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.7 - PG NO:327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 327\n",
+ "## example no 10.7\n",
+ "## SUBROUTINE TO SET THE ZERO FLAG\n",
+ "import math\n",
+ "\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "def dec2bin(f):\n",
+ " if f >= 1:\n",
+ " g = int(math.log(f, 2))\n",
+ " else:\n",
+ " g = -1\n",
+ " h = g + 1\n",
+ " ig = math.pow(2, g)\n",
+ " st = \"\" \n",
+ " while f > 0 or ig >= 1: \n",
+ " if f < 1:\n",
+ " if len(st[h:]) >= 10: # 10 fractional digits max\n",
+ " break\n",
+ " if f >= ig:\n",
+ " st += \"1\"\n",
+ " f -= ig\n",
+ " else:\n",
+ " st += \"0\"\n",
+ " ig /= 2\n",
+ " st = st[:h] + \".\" + st[h:]\n",
+ " return st\n",
+ "\n",
+ "\n",
+ "print ('CHECK: PUSH H \\n \\n')# ## sends the contents of H to the location pointed by the stack pointer.\n",
+ "print (' MVI L,FFH \\n')#\n",
+ "l=hex2dec('FF')#\n",
+ "l=dec2bin(l)#\n",
+ "print (' L--> ')# ## set all bits in L to logic 1.\n",
+ "print(l)#\n",
+ "print ('\\n \\n PUSH PSW \\n \\n')# ## save flags on top of the stack\n",
+ "print (' XTHL \\n \\n')# ## set all bits in the top stack location.\n",
+ "print (' POP PSW \\n \\n')# ## now the zero flag is set.\n",
+ "print (' JZ NOEROR \\n \\n')# \n",
+ "print (' JMP ERROR \\n \\n')#\n",
+ "print ('NOEROR: POP H \\n \\n')# ## retrives the data from the stack into H if zero flag is set\n",
+ "print (' RET')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CHECK: PUSH H \n",
+ " \n",
+ "\n",
+ " MVI L,FFH \n",
+ "\n",
+ " L--> \n",
+ "11111111.\n",
+ "\n",
+ " \n",
+ " PUSH PSW \n",
+ " \n",
+ "\n",
+ " XTHL \n",
+ " \n",
+ "\n",
+ " POP PSW \n",
+ " \n",
+ "\n",
+ " JZ NOEROR \n",
+ " \n",
+ "\n",
+ " JMP ERROR \n",
+ " \n",
+ "\n",
+ "NOEROR: POP H \n",
+ " \n",
+ "\n",
+ " RET\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.8 - PG NO:328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 328\n",
+ "## example no 10.8\n",
+ "## TRANSFER A PROGRAM TO AN ADDRESS IN HL REGISTER\n",
+ "print ('\\n \\nThe program can be transfered using Jump instruction. \\n \\n');\n",
+ "print ('PCHL is a 1 byte instruction that can also be used in place of Jump instruction \\n \\n');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " \n",
+ "The program can be transfered using Jump instruction. \n",
+ " \n",
+ "\n",
+ "PCHL is a 1 byte instruction that can also be used in place of Jump instruction \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER12.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER12.ipynb new file mode 100755 index 00000000..bbd8ff97 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER12.ipynb @@ -0,0 +1,226 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:110c105c2f235f90124548a1a33e1ceab46ffa87ee1520decc137482fdd4cef9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 12 - Interrupts"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 12.1 - PG NO: 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 374\n",
+ "## example no 12.1\n",
+ "## ENABLE INTERRUPTS\n",
+ "import math\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "\n",
+ "\n",
+ "print ('EI \\n \\n')# ## enable interrupts\n",
+ "print ('MVI A,08H \\n')#\n",
+ "a=hex2dec('8')#\n",
+ "b=dec2bin(a)#\n",
+ "print ('A--> ')\n",
+ "print (b)#\n",
+ "print('\\n')\n",
+ "print ('SIM \\n \\n')# ## enable RST 7.5,6.5, and 5.5\n",
+ "print ('D3=1 SIM functional \\n')#\n",
+ "print ('D2=0 Enable RST 7.5 \\n')#\n",
+ "print ('D1=0 Enable RST 6.5 \\n')#\n",
+ "print ('D0=0 Enable RST 5.5 \\n')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "EI \n",
+ " \n",
+ "\n",
+ "MVI A,08H \n",
+ "\n",
+ "A--> \n",
+ "00001000\n",
+ "\n",
+ "\n",
+ "SIM \n",
+ " \n",
+ "\n",
+ "D3=1 SIM functional \n",
+ "\n",
+ "D2=0 Enable RST 7.5 \n",
+ "\n",
+ "D1=0 Enable RST 6.5 \n",
+ "\n",
+ "D0=0 Enable RST 5.5 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 12.2 - PG NO:374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 374\n",
+ "## example no 12.2\n",
+ "## RESET 7.5 INTERRUPT\n",
+ "import math\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "\n",
+ "print ('MVI A,18H \\n')# ## set D4=1\n",
+ "a=hex2dec('18')#\n",
+ "b=dec2bin(a)#\n",
+ "print ('A--> ')\n",
+ "print (b)#\n",
+ "print('\\n')\n",
+ "print ('SIM Reset 7.5 interrupt flip-flop \\n') ## Reset 7.5 interrupt flip flop\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MVI A,18H \n",
+ "\n",
+ "A--> \n",
+ "00011000\n",
+ "\n",
+ "\n",
+ "SIM Reset 7.5 interrupt flip-flop \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 12.3 - PG NO:375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 375\n",
+ "## example no 12.3\n",
+ "## CHECK PENDING INTERRUPT\n",
+ "print ('RIM instruction interpretation \\n \\n');\n",
+ "print ('D7=SID Serial input data if any \\n');\n",
+ "print ('D6,D5,D4= I7.5,I6.5,I5.5 Pending interrupts: 1= pending \\n');\n",
+ "print ('D3=IE Interrupt enable flag: 1= enabled \\n');\n",
+ "print ('D2,D1,D0= M7.5,M6.5,M5.5 Interrupt masks: 1= masked \\n \\n \\n');\n",
+ "\n",
+ "\n",
+ "print ('Instructions \\n \\n');\n",
+ "print (' RIM \\n'); ## Read interrupt mask\n",
+ "print (' MOV B,A \\n'); ## save mask information\n",
+ "print (' ANI 20H \\n'); ## check whether RST 6.5 is pending\n",
+ "print (' JNZ NEXT \\n');\n",
+ "print (' EI \\n');\n",
+ "print (' RET \\n'); ## RST 6.5 is not pending, return to main program\n",
+ "print ('NEXT: MOV A,B \\n'); ## get bit pattern; RST 6.5 is pending\n",
+ "print (' ANI 0DH \\n'); ## enables RST 6.5 by setting D1=0\n",
+ "print (' ORI 08H\\n'); ## enable SIM by setting D3=1\n",
+ "print (' SIM \\n');\n",
+ "print (' JMP SERV \\n'); ## jump to service routine for RST 6.5\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RIM instruction interpretation \n",
+ " \n",
+ "\n",
+ "D7=SID Serial input data if any \n",
+ "\n",
+ "D6,D5,D4= I7.5,I6.5,I5.5 Pending interrupts: 1= pending \n",
+ "\n",
+ "D3=IE Interrupt enable flag: 1= enabled \n",
+ "\n",
+ "D2,D1,D0= M7.5,M6.5,M5.5 Interrupt masks: 1= masked \n",
+ " \n",
+ " \n",
+ "\n",
+ "Instructions \n",
+ " \n",
+ "\n",
+ " RIM \n",
+ "\n",
+ " MOV B,A \n",
+ "\n",
+ " ANI 20H \n",
+ "\n",
+ " JNZ NEXT \n",
+ "\n",
+ " EI \n",
+ "\n",
+ " RET \n",
+ "\n",
+ "NEXT: MOV A,B \n",
+ "\n",
+ " ANI 0DH \n",
+ "\n",
+ " ORI 08H\n",
+ "\n",
+ " SIM \n",
+ "\n",
+ " JMP SERV \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER14.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER14.ipynb new file mode 100755 index 00000000..dc516473 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER14.ipynb @@ -0,0 +1,152 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:21e34af805d3a967e3ff0f0e49775cacd1377f45335c591a926420214bd47fe5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 14- Programmable Interface Devices"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 14.1 - PG NO:414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 414\n",
+ "## example no 14.1\n",
+ "## INITIALIZE HYPOTHETICAL CHIP AS OUTPUT BUFFER\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "\n",
+ "\n",
+ "\n",
+ "print ('MVI A,01H \\n')# ## Set D0=1, D1 through D7 are don't care lines.\n",
+ "a=hex2dec('1')#\n",
+ "b=dec2bin(a)#\n",
+ "print ('A--> ')\n",
+ "print (b)#\n",
+ "print('\\n')\n",
+ "print ('OUT FFH \\n')# ## write in the control register.\n",
+ "print ('MVI A,BYTE1 \\n')# ## load data byte.\n",
+ "print ('OUT FEH')# ## send data out.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MVI A,01H \n",
+ "\n",
+ "A--> \n",
+ "00000001\n",
+ "\n",
+ "\n",
+ "OUT FFH \n",
+ "\n",
+ "MVI A,BYTE1 \n",
+ "\n",
+ "OUT FEH\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 14.2 - PG NO:420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 420\n",
+ "## example no 14.2\n",
+ "## ADDRESS DETERMINATION OF GIVEN FIGURE\n",
+ "print ('To select the chip: \\n \\n');\n",
+ "print ('A15 A14 A13 A12 A11 \\n');\n",
+ "print ('0 0 1 0 0 \\n \\n');\n",
+ "print ('A15,A14 Enable lines of 8205 \\n');\n",
+ "print ('A13,A12,A11 Input logic to activate the output line O4 of the 8205 \\n \\n');\n",
+ "print ('A15,A14,A13,A12,A11 = A7,A6,A5,A4,A3, = 20H \\n \\n');\n",
+ "print ('AD2 AD1 AD0 = Address Ports \\n');\n",
+ "print (' 0 0 0 = 20H Control or status register \\n');\n",
+ "print (' 0 0 1 = 21H Port A \\n');\n",
+ "print (' 0 1 0 = 22H Port B \\n');\n",
+ "print (' 0 1 1 = 23H Port C \\n');\n",
+ "print (' 1 0 0 = 24H Timer LSB \\n');\n",
+ "print (' 1 0 1 = 25H Timer MSB \\n \\n');\n",
+ "print ('Port numbers in given figure thus range from 20H-25H');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "To select the chip: \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 \n",
+ "\n",
+ "0 0 1 0 0 \n",
+ " \n",
+ "\n",
+ "A15,A14 Enable lines of 8205 \n",
+ "\n",
+ "A13,A12,A11 Input logic to activate the output line O4 of the 8205 \n",
+ " \n",
+ "\n",
+ "A15,A14,A13,A12,A11 = A7,A6,A5,A4,A3, = 20H \n",
+ " \n",
+ "\n",
+ "AD2 AD1 AD0 = Address Ports \n",
+ "\n",
+ " 0 0 0 = 20H Control or status register \n",
+ "\n",
+ " 0 0 1 = 21H Port A \n",
+ "\n",
+ " 0 1 0 = 22H Port B \n",
+ "\n",
+ " 0 1 1 = 23H Port C \n",
+ "\n",
+ " 1 0 0 = 24H Timer LSB \n",
+ "\n",
+ " 1 0 1 = 25H Timer MSB \n",
+ " \n",
+ "\n",
+ "Port numbers in given figure thus range from 20H-25H\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER15.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER15.ipynb new file mode 100755 index 00000000..93ab05d9 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER15.ipynb @@ -0,0 +1,771 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:019dd6c91f8f3f2524ad4ad6c982de836286fc191cb0dfd930c559bd249cc8be"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 15 - General Purpose Programmable Peripheral Devices"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 15.1 - PG NO: 449"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 449\n",
+ "## example no 15.1\n",
+ "## PORT ADDRESS CONTROL WORD ADDRESS AND READ THE DIP SWITCHES\n",
+ "print ('1 Port Address \\n \\n')#\n",
+ "print ('Port A = 8000H (A1=0,A0=0) \\n')#\n",
+ "print ('Port B = 8001H (A1=0,A0=1) \\n')#\n",
+ "print ('Port C = 8002H (A1=1,A0=0) \\n')#\n",
+ "print ('Control Register = 8003H (A1=1,A0=1) \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('2 Control Word \\n \\n')#\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n')#\n",
+ "print ('1 0 0 0 0 0 1 1 = 83H \\n \\n')# \n",
+ "print ('D7=1 I#O Function \\n')#\n",
+ "print ('D6,D5=0 Port A in Mode 0 \\n')#\n",
+ "print ('D4=0 Port A= output \\n')#\n",
+ "print ('D3=0 Port C upper= output \\n')#\n",
+ "print ('D2=0 Port B in Mode 0 \\n')#\n",
+ "print ('D1=1 Port B= input \\n')#\n",
+ "print ('D0=1 Port C1= input \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('3 Program \\n \\n')#\n",
+ "print ('MVI A,83H \\n')# ## load accumulator with the control word.\n",
+ "print ('STA 8003H \\n')# ## write word in the control register to initialize the ports.\n",
+ "print ('LDA 8001H \\n')# ## reads switches at port B.\n",
+ "print ('STA 8000H \\n')# ## display the reading at port A.\n",
+ "print ('LDA 8002H \\n')# ## read switches at port C.\n",
+ "print ('ANI 0FH \\n')# ## mask the upper four bits of port C, these bits are not input data.\n",
+ "print ('RLC \\n')# ## rotate and place the data in the upper half of the accumulator.\n",
+ "print ('RLC \\n')#\n",
+ "print ('RLC \\n')#\n",
+ "print ('RLC \\n')#\n",
+ "print ('STA 8002H Display data at port C upper\\n')# ## display data at port C upper.\n",
+ "print ('HLT \\n')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 Port Address \n",
+ " \n",
+ "\n",
+ "Port A = 8000H (A1=0,A0=0) \n",
+ "\n",
+ "Port B = 8001H (A1=0,A0=1) \n",
+ "\n",
+ "Port C = 8002H (A1=1,A0=0) \n",
+ "\n",
+ "Control Register = 8003H (A1=1,A0=1) \n",
+ " \n",
+ "\n",
+ "2 Control Word \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ "1 0 0 0 0 0 1 1 = 83H \n",
+ " \n",
+ "\n",
+ "D7=1 I#O Function \n",
+ "\n",
+ "D6,D5=0 Port A in Mode 0 \n",
+ "\n",
+ "D4=0 Port A= output \n",
+ "\n",
+ "D3=0 Port C upper= output \n",
+ "\n",
+ "D2=0 Port B in Mode 0 \n",
+ "\n",
+ "D1=1 Port B= input \n",
+ "\n",
+ "D0=1 Port C1= input \n",
+ " \n",
+ "\n",
+ "3 Program \n",
+ " \n",
+ "\n",
+ "MVI A,83H \n",
+ "\n",
+ "STA 8003H \n",
+ "\n",
+ "LDA 8001H \n",
+ "\n",
+ "STA 8000H \n",
+ "\n",
+ "LDA 8002H \n",
+ "\n",
+ "ANI 0FH \n",
+ "\n",
+ "RLC \n",
+ "\n",
+ "RLC \n",
+ "\n",
+ "RLC \n",
+ "\n",
+ "RLC \n",
+ "\n",
+ "STA 8002H Display data at port C upper\n",
+ "\n",
+ "HLT \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 15.2 - PG NO: 453"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 453\n",
+ "## example no 15.2\n",
+ "## BSR CONTROL WORD SUBROUTINE\n",
+ "print ('BSR Control Words \\n \\n')#\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n')#\n",
+ "print ('0 0 0 0 1 1 1 1 = 0FH To set bit PC7 \\n')# \n",
+ "print ('0 0 0 0 1 1 1 0 = 0EH To reset bit PC7 \\n')#\n",
+ "print ('0 0 0 0 0 1 1 1 = 07H To set bit PC3 \\n')#\n",
+ "print ('0 0 0 0 0 1 1 0 = 06H To reset bit PC3 \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('Port Address \\n \\n')#\n",
+ "print ('Control Register Address = 83H \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('Subroutine \\n \\n')#\n",
+ "print('BSR: \\n')\n",
+ "print ('\\n MVI A,0FH \\n')# ## load byte in accumulator to set PC7\n",
+ "print ('\\n OUT 83H \\n')# ## set PC7=1\n",
+ "print ('\\n MVI A,07H \\n')# ## load byte in accumulator to set PC3.\n",
+ "print ('\\n OUT 83H \\n')# ## set PC3=1.\n",
+ "print ('\\n CALL DELAY \\n')# ## this is a 10 microsec delay.\n",
+ "print ('\\n MVI A,06H \\n')# ## load byte in accumulator to reset PC3\n",
+ "print ('\\n OUT 83H \\n')# ## reset PC3\n",
+ "print ('\\n MVI A,0EH \\n')# ## load byte in accumulator to reset PC7.\n",
+ "print ('\\n OUT 83H \\n')# ## reset PC7\n",
+ "print ('\\n RET')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "BSR Control Words \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ "0 0 0 0 1 1 1 1 = 0FH To set bit PC7 \n",
+ "\n",
+ "0 0 0 0 1 1 1 0 = 0EH To reset bit PC7 \n",
+ "\n",
+ "0 0 0 0 0 1 1 1 = 07H To set bit PC3 \n",
+ "\n",
+ "0 0 0 0 0 1 1 0 = 06H To reset bit PC3 \n",
+ " \n",
+ "\n",
+ "Port Address \n",
+ " \n",
+ "\n",
+ "Control Register Address = 83H \n",
+ " \n",
+ "\n",
+ "Subroutine \n",
+ " \n",
+ "\n",
+ "BSR: \n",
+ "\n",
+ "\n",
+ " MVI A,0FH \n",
+ "\n",
+ "\n",
+ " OUT 83H \n",
+ "\n",
+ "\n",
+ " MVI A,07H \n",
+ "\n",
+ "\n",
+ " OUT 83H \n",
+ "\n",
+ "\n",
+ " CALL DELAY \n",
+ "\n",
+ "\n",
+ " MVI A,06H \n",
+ "\n",
+ "\n",
+ " OUT 83H \n",
+ "\n",
+ "\n",
+ " MVI A,0EH \n",
+ "\n",
+ "\n",
+ " OUT 83H \n",
+ "\n",
+ "\n",
+ " RET\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 15.3 - PG NO:483"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 483\n",
+ "## example no 15.3\n",
+ "## INSTRUCTIONS TO GENERATE A PULSE FROM COUNTER 0\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "print ('Control Word \\n \\n')#\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n')#\n",
+ "print ('0 0 0 1 0 1 0 0 = 14H \\n \\n')# \n",
+ "print ('D7,D6=0 Select counter 0 \\n')#\n",
+ "print ('D5,D4=01 Load 8 bit count \\n')#\n",
+ "print ('D3,D2,D1=010 Mode 2 \\n')#\n",
+ "print ('D0=0 Binary Count \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('Count \\n \\n')#\n",
+ "count=(50.*10.**-6.)/(0.5*10.**-6.)#\n",
+ "print ('Count= ')#\n",
+ "print'%d' %(count)#\n",
+ "print('\\n')\n",
+ "print (dec2hex(count))#\n",
+ "print ('in hexadecimal \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('Instructions \\n \\n')#\n",
+ "print ('PULSE: \\n')\n",
+ "print ('\\n MVI A,00010100B')# ## control word mode 2 & counter 0.\n",
+ "print ('\\n OUT 83H')# ## write in 8254 control register.\n",
+ "print ('\\n MVI A,64H')# ## low order byte of the count.\n",
+ "print ('\\n OUT 80H')# ## load counter 0 with low order byte\n",
+ "print ('\\n HLT')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Control Word \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ "0 0 0 1 0 1 0 0 = 14H \n",
+ " \n",
+ "\n",
+ "D7,D6=0 Select counter 0 \n",
+ "\n",
+ "D5,D4=01 Load 8 bit count \n",
+ "\n",
+ "D3,D2,D1=010 Mode 2 \n",
+ "\n",
+ "D0=0 Binary Count \n",
+ " \n",
+ "\n",
+ "Count \n",
+ " \n",
+ "\n",
+ "Count= \n",
+ "100\n",
+ "\n",
+ "\n",
+ "64\n",
+ "in hexadecimal \n",
+ " \n",
+ "\n",
+ "Instructions \n",
+ " \n",
+ "\n",
+ "PULSE: \n",
+ "\n",
+ "\n",
+ " MVI A,00010100B\n",
+ "\n",
+ " OUT 83H\n",
+ "\n",
+ " MVI A,64H\n",
+ "\n",
+ " OUT 80H\n",
+ "\n",
+ " HLT\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 15.4 - PG NO:484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 484\n",
+ "## example no 15.4\n",
+ "## INSTRUCTIONS TO GENERATE SQUARE WAVE PULSE FROM COUNTER 1\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "\n",
+ "print ('Control Word \\n \\n')#\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n')#\n",
+ "print ('0 1 1 1 0 1 1 0 = 76H \\n \\n')# \n",
+ "print ('D7,D6=01 Select counter 1 \\n')#\n",
+ "print ('D5,D4=11 Load 16 bit count \\n')#\n",
+ "print ('D3,D2,D1=011 Mode 3 \\n')#\n",
+ "print ('D0=0 Binary Count \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('Count \\n \\n')#\n",
+ "count=(1*10**-3)/(0.5*10**-6)#\n",
+ "print ('Count= ')#\n",
+ "print'%d' %(count)#\n",
+ "b=dec2hex(2000)#\n",
+ "print('\\n')\n",
+ "print (b)#\n",
+ "print ('in hexadecimal \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('Instructions :\\n \\n')#\n",
+ "print ('SQWAVE: \\n')#\n",
+ "print ('\\n MVI A,01110110B')# ## control word mode 3 & counter 1.\n",
+ "print ('\\n OUT 83H ')# ## write in 8254 control register.\n",
+ "print ('\\n MVI A,D0H ')# ## low order byte of the count.\n",
+ "print ('\\n OUT 81H ')# ## load counter 1 with low order byte.\n",
+ "print ('\\n MVI A,07H ')# ## high order byte of the count.\n",
+ "print ('\\n OUT 81H ')# ## load counter 1 with high order byte\n",
+ "print ('\\n HLT')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Control Word \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ "0 1 1 1 0 1 1 0 = 76H \n",
+ " \n",
+ "\n",
+ "D7,D6=01 Select counter 1 \n",
+ "\n",
+ "D5,D4=11 Load 16 bit count \n",
+ "\n",
+ "D3,D2,D1=011 Mode 3 \n",
+ "\n",
+ "D0=0 Binary Count \n",
+ " \n",
+ "\n",
+ "Count \n",
+ " \n",
+ "\n",
+ "Count= \n",
+ "2000\n",
+ "\n",
+ "\n",
+ "7D0\n",
+ "in hexadecimal \n",
+ " \n",
+ "\n",
+ "Instructions :\n",
+ " \n",
+ "\n",
+ "SQWAVE: \n",
+ "\n",
+ "\n",
+ " MVI A,01110110B\n",
+ "\n",
+ " OUT 83H \n",
+ "\n",
+ " MVI A,D0H \n",
+ "\n",
+ " OUT 81H \n",
+ "\n",
+ " MVI A,07H \n",
+ "\n",
+ " OUT 81H \n",
+ "\n",
+ " HLT\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 15.5 - PG NO: 486"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 486\n",
+ "## example no 15.5\n",
+ "## SUBROUTINE TO GENERATE AN INTERRUPT\n",
+ "print ('Control Word \\n \\n')#\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n')#\n",
+ "print ('0 1 1 1 0 1 0 0 = 74H Counter 1 \\n')# \n",
+ "print ('1 0 0 1 0 1 0 0 = 94H Counter 2 \\n \\n')#\n",
+ "print ('D7,D6 Select counter \\n')#\n",
+ "print ('D5,D4 Load count \\n')#\n",
+ "print ('D3,D2,D1=010 Mode 2 \\n')#\n",
+ "print ('D0=0 Binary Count \\n \\n')#\n",
+ "\n",
+ "\n",
+ "\n",
+ "print ('Instructions \\n \\n')#\n",
+ "print ('CNT1LO EQU 50H \\n')#\n",
+ "print ('CNT1HI EQU C3H \\n')#\n",
+ "print ('COUNT2 EQU 40H \\n')#\n",
+ "print ('SECOND: MVI A,01110100B \\n')# ## control word mode 2 & counter 1.\n",
+ "print (' OUT 83H \\n')# ## write in 8254 control register.\n",
+ "print (' MVI A,10010100B \\n')# ## control word mode 2 & counter 2.\n",
+ "print (' OUT 83H \\n')# ## write in 8254 control register.\n",
+ "print (' MVI A,CNT1LO \\n')# ## Low order byte of count 50000\n",
+ "print (' OUT 81H \\n')# ## Load counter 1 with low order byte\n",
+ "print (' MVI A,CNT1HI \\n')# ## high order byte of count 50000.\n",
+ "print (' OUT 81H \\n')# ## load counter 1 with high order byte\n",
+ "print (' MVI A,COUNT2 \\n')# ## Count for Counter 2.\n",
+ "print (' OUT 82H \\n')# ## load counter 2.\n",
+ "print (' RET')#\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Control Word \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ "0 1 1 1 0 1 0 0 = 74H Counter 1 \n",
+ "\n",
+ "1 0 0 1 0 1 0 0 = 94H Counter 2 \n",
+ " \n",
+ "\n",
+ "D7,D6 Select counter \n",
+ "\n",
+ "D5,D4 Load count \n",
+ "\n",
+ "D3,D2,D1=010 Mode 2 \n",
+ "\n",
+ "D0=0 Binary Count \n",
+ " \n",
+ "\n",
+ "Instructions \n",
+ " \n",
+ "\n",
+ "CNT1LO EQU 50H \n",
+ "\n",
+ "CNT1HI EQU C3H \n",
+ "\n",
+ "COUNT2 EQU 40H \n",
+ "\n",
+ "SECOND: MVI A,01110100B \n",
+ "\n",
+ " OUT 83H \n",
+ "\n",
+ " MVI A,10010100B \n",
+ "\n",
+ " OUT 83H \n",
+ "\n",
+ " MVI A,CNT1LO \n",
+ "\n",
+ " OUT 81H \n",
+ "\n",
+ " MVI A,CNT1HI \n",
+ "\n",
+ " OUT 81H \n",
+ "\n",
+ " MVI A,COUNT2 \n",
+ "\n",
+ " OUT 82H \n",
+ "\n",
+ " RET\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 15.6 - PG NO:493"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 493\n",
+ "## example no 15.6\n",
+ "## EXPLANATION OF INSTRUCTIONS\n",
+ "print ('1) DI instruction disables the interrupts. \\n \\n');\n",
+ "print ('2) Command word 76H specifies the following parameters \\n');\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print ('0 1 1 1 0 1 1 0 =76H \\n');\n",
+ "print ('A7,A6,A5 Low order address bits \\n');\n",
+ "print ('A3 Edge triggered \\n');\n",
+ "print ('A2 Call address interval is four locations \\n');\n",
+ "print ('A1 Single 8259A \\n \\n');\n",
+ "print ('Low order byte of the IR0 call address \\n');\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print ('0 1 1 0 0 0 0 0 =60H \\n');\n",
+ "print ('The address bits A4-A0 are supplied by 8259A. \\n');\n",
+ "print ('Subsequent addresses are four locations apart (eg. IR1=64H)')\n",
+ "print ('3) Port address of the 8259SA for ICW1 is 80H, A0 should be at \\n logic 0 & the other bits are determined by the decoder. \\n \\n');\n",
+ "print ('4) Command word ICW2 is 20H. \\n which specifies the high-order byte of the call address \\n \\n');\n",
+ "print ('5) Port address of ICW2 is 81H, A0 should be at logic 1.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1) DI instruction disables the interrupts. \n",
+ " \n",
+ "\n",
+ "2) Command word 76H specifies the following parameters \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "0 1 1 1 0 1 1 0 =76H \n",
+ "\n",
+ "A7,A6,A5 Low order address bits \n",
+ "\n",
+ "A3 Edge triggered \n",
+ "\n",
+ "A2 Call address interval is four locations \n",
+ "\n",
+ "A1 Single 8259A \n",
+ " \n",
+ "\n",
+ "Low order byte of the IR0 call address \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "0 1 1 0 0 0 0 0 =60H \n",
+ "\n",
+ "The address bits A4-A0 are supplied by 8259A. \n",
+ "\n",
+ "Subsequent addresses are four locations apart (eg. IR1=64H)\n",
+ "3) Port address of the 8259SA for ICW1 is 80H, A0 should be at \n",
+ " logic 0 & the other bits are determined by the decoder. \n",
+ " \n",
+ "\n",
+ "4) Command word ICW2 is 20H. \n",
+ " which specifies the high-order byte of the call address \n",
+ " \n",
+ "\n",
+ "5) Port address of ICW2 is 81H, A0 should be at logic 1.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 15.8 - PG NO: 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 502\n",
+ "## example no 15.8\n",
+ "## INITIALIZATION INSTRUCTIONS FOR DMA\n",
+ "print ('MVI A,00000100B \\n \\n');\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print ('0 0 0 0 0 1 0 0 \\n');\n",
+ "print ('A2=1 Disable DMA \\n \\n');\n",
+ "print ('OUT 08H \\n');\n",
+ "print ('MVI A,00000111B \\n \\n');\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print ('0 0 0 0 0 1 1 1 \\n');\n",
+ "print ('A7,A6=00 Demand mode \\n');\n",
+ "print ('A5=0 Increment address \\n');\n",
+ "print ('A4=0 Disable auto load \\n');\n",
+ "print ('A3,A2=01 Write \\n');\n",
+ "print ('A1,A0=11 Ch 3 \\n \\n');\n",
+ "print ('OUT 0BH \\n'); ## Send to mode reg.\n",
+ "print ('MVI A,75H \\n'); ## Low order byte of starting address\n",
+ "print ('OUT 06H \\n'); ## Output to CH3 memory address reg.\n",
+ "print ('MVI A,40H \\n'); ## High order byte of starting address\n",
+ "print ('OUT 06H \\n'); ## Output to CH3 memory address reg.\n",
+ "print ('MVI A,FFH \\n'); ## Low order byte of the count 03FFH\n",
+ "print ('OUT 07H \\n'); ## Output to CH3 count reg.\n",
+ "print ('MVI A,03H \\n'); ## High order byte of the count 03FFH\n",
+ "print ('OUT 07H \\n'); ## Output to CH3 count reg.\n",
+ "print ('MVI A,10000000B \\n \\n');\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print ('1 0 0 0 0 0 0 0 \\n');\n",
+ "print ('A7,A6=10 DACK DREQ High \\n');\n",
+ "print ('A5=0 Late write \\n');\n",
+ "print ('A4=0 Fixed priority \\n');\n",
+ "print ('A3=0 Normal time \\n');\n",
+ "print ('A2=0 DMA enable \\n')\n",
+ "print ('A0=0 Disable mem to mem \\n \\n');\n",
+ "print ('OUT 08H \\n');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MVI A,00000100B \n",
+ " \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "0 0 0 0 0 1 0 0 \n",
+ "\n",
+ "A2=1 Disable DMA \n",
+ " \n",
+ "\n",
+ "OUT 08H \n",
+ "\n",
+ "MVI A,00000111B \n",
+ " \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "0 0 0 0 0 1 1 1 \n",
+ "\n",
+ "A7,A6=00 Demand mode \n",
+ "\n",
+ "A5=0 Increment address \n",
+ "\n",
+ "A4=0 Disable auto load \n",
+ "\n",
+ "A3,A2=01 Write \n",
+ "\n",
+ "A1,A0=11 Ch 3 \n",
+ " \n",
+ "\n",
+ "OUT 0BH \n",
+ "\n",
+ "MVI A,75H \n",
+ "\n",
+ "OUT 06H \n",
+ "\n",
+ "MVI A,40H \n",
+ "\n",
+ "OUT 06H \n",
+ "\n",
+ "MVI A,FFH \n",
+ "\n",
+ "OUT 07H \n",
+ "\n",
+ "MVI A,03H \n",
+ "\n",
+ "OUT 07H \n",
+ "\n",
+ "MVI A,10000000B \n",
+ " \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "1 0 0 0 0 0 0 0 \n",
+ "\n",
+ "A7,A6=10 DACK DREQ High \n",
+ "\n",
+ "A5=0 Late write \n",
+ "\n",
+ "A4=0 Fixed priority \n",
+ "\n",
+ "A3=0 Normal time \n",
+ "\n",
+ "A2=0 DMA enable \n",
+ "\n",
+ "A0=0 Disable mem to mem \n",
+ " \n",
+ "\n",
+ "OUT 08H \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER19.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER19.ipynb new file mode 100755 index 00000000..69c256ca --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER19.ipynb @@ -0,0 +1,691 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2e17f6da276f0ba9b6bc1e392aaea96bc0bdcca5f1f3b0814e64f45db6d6c18c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 19 - Appendix A Number System "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.1 - PG NO: 622"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 622\n",
+ "## example no A.1\n",
+ "## BINARY INTO HEX AND OCTAL\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "def bin2dec(string_num):\n",
+ " return int(string_num, 2)\n",
+ "\n",
+ "def dec2oct(n):\n",
+ "\treturn \"%o\" % n;\n",
+ "\n",
+ "print ('Binary no= 10011010 \\n \\n')#\n",
+ "st='10011010'#\n",
+ "h=bin2dec(st)#\n",
+ "H=dec2hex(h)#\n",
+ "print ('Hex Equivalent= ')#\n",
+ "print(H)#\n",
+ "print('\\n')\n",
+ "O=dec2oct(h)#\n",
+ "print ('Octal Equivalent= ')\n",
+ "print(O)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Binary no= 10011010 \n",
+ " \n",
+ "\n",
+ "Hex Equivalent= \n",
+ "9A\n",
+ "\n",
+ "\n",
+ "Octal Equivalent= \n",
+ "232\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.2 - PG NO. 623"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 623\n",
+ "## example no A.2\n",
+ "## SUBTRACTION OF TWO NUMBERS\n",
+ "print ('Minuend: 52 \\n');\n",
+ "print ('Subtrahend: 23 \\n \\n')\n",
+ "print ('BORROW METHOD \\n \\n');\n",
+ "\n",
+ "m=5*10+2; ## minuend\n",
+ "s=2*10+3; ## subtrahend\n",
+ "## to subtract 3 from 2, 10 must be borrowed from the second place of the minuend.\n",
+ "\n",
+ "m=4*10+12;\n",
+ "\n",
+ "sub=m-s;\n",
+ "print ('Subtraction= ')\n",
+ "print (sub);\n",
+ "\n",
+ "print ('\\n \\n 10s COMPLEMENT METHOD \\n \\n');\n",
+ "\n",
+ "## 9's complement of 23 is\n",
+ "\n",
+ "n=99-23;\n",
+ "## add 1 to the 9's complement to find the 10's complement\n",
+ "t=n+1;\n",
+ "## add the 10's complement of the subtrahend(23) to minuend(52) to subtract 23 from 52\n",
+ "a=m+t;\n",
+ "## subtract 100 from a to compensate for the 100 that was added to find the 10's complement of 23\n",
+ "sub=a-100;\n",
+ "print ('Subtraction= ');\n",
+ "print (sub);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minuend: 52 \n",
+ "\n",
+ "Subtrahend: 23 \n",
+ " \n",
+ "\n",
+ "BORROW METHOD \n",
+ " \n",
+ "\n",
+ "Subtraction= \n",
+ "29\n",
+ "\n",
+ " \n",
+ " 10s COMPLEMENT METHOD \n",
+ " \n",
+ "\n",
+ "Subtraction= \n",
+ "29\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.3 - PG NO: 624"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 624\n",
+ "## example no A.3\n",
+ "## SUBTRACTION OF TWO NUMBERS\n",
+ "print ('Minuend: 23 \\n');\n",
+ "print ('Subtrahend: 52 \\n \\n')\n",
+ "print ('BORROW METHOD \\n \\n');\n",
+ "\n",
+ "m=2*10+3; ## minuend\n",
+ "s=5*10+2; ## subtrahend\n",
+ "## subtraction of the digits in the first place results in \n",
+ "a=3-2;\n",
+ "## to subtract the digits in the second place a borrow is required from the third place. assuming 1 at third place.\n",
+ "\n",
+ "x=12-5; ## with a borrowed 1 from the third place\n",
+ "\n",
+ "sub=10*x+a;\n",
+ "print ('Subtraction= ')\n",
+ "print (sub);\n",
+ "print ('this is negative 29, expressed in 10s complement. \\n negative sign is verified by the borrowed 1 from the third place.');\n",
+ "\n",
+ "print ('\\n \\n 10s COMPLEMENT METHOD \\n \\n');\n",
+ "\n",
+ "## 9's complement of 52 is\n",
+ "\n",
+ "n=99-52;\n",
+ "## add 1 to the 9's complement to find the 10's complement\n",
+ "t=n+1;\n",
+ "## add the 10's complement of the subtrahend(23) to minuend(52) to subtract 23 from 52\n",
+ "a=m+t;\n",
+ "\n",
+ "print ('Subtraction= ');\n",
+ "print (a);\n",
+ "print ('this is negative 29, expressed in 10s complement');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minuend: 23 \n",
+ "\n",
+ "Subtrahend: 52 \n",
+ " \n",
+ "\n",
+ "BORROW METHOD \n",
+ " \n",
+ "\n",
+ "Subtraction= \n",
+ "71\n",
+ "this is negative 29, expressed in 10s complement. \n",
+ " negative sign is verified by the borrowed 1 from the third place.\n",
+ "\n",
+ " \n",
+ " 10s COMPLEMENT METHOD \n",
+ " \n",
+ "\n",
+ "Subtraction= \n",
+ "71\n",
+ "this is negative 29, expressed in 10s complement\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.4 - PG NO: 625"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# page no 625\n",
+ "# example no A.4\n",
+ "# 2's COMPLIMENT OF BINARY NUMBER\n",
+ "\n",
+ "def bin2dec(b):\n",
+ " x = int(b, 2)\n",
+ " if b[0] == '1': # \"sign bit\", big-endian\n",
+ " x -= 2**len(b)\n",
+ " return x\n",
+ "\n",
+ "def bitcmp(a):\n",
+ " mask = (1 << a.bit_length()) - 1\n",
+ " b=(a ^ mask)\n",
+ " return int(b)\n",
+ "\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "\n",
+ "\n",
+ "print('Given binary no= 00011100 \\n \\n')#\n",
+ "string='00011100'\n",
+ "d=bin2dec(string)#\n",
+ "x=bitcmp(d)#\n",
+ "s=x+1\n",
+ "f=s-32\n",
+ "y=dec2bin(f)#\n",
+ "print('2s complement=')#\n",
+ "print(y)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Given binary no= 00011100 \n",
+ " \n",
+ "\n",
+ "2s complement=\n",
+ "11100100\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.5 - PG NO: 626"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 626\n",
+ "## example no A.5\n",
+ "## SUBTRACTION OF TWO NUMBERS\n",
+ "\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "def bitcmp(a):\n",
+ "\tmask = (1 << a.bit_length()) - 1\n",
+ "\tb=(a ^ mask)\n",
+ "\treturn int(b)\n",
+ "\n",
+ "print ('Subtrahend= 32H \\n')#\n",
+ "print ('Minuend= 45H \\n \\n')#\n",
+ "## finding 2's complement of subtrahend (32H)#\n",
+ "m=hex2dec('45')#\n",
+ "x=hex2dec('32')#\n",
+ "y=bitcmp(x)# ## 1's compliment of 32H\n",
+ "z=y+1# ## 2's compliment of 32H\n",
+ "s=m+z# \n",
+ "f=s-64# ## to compensate the effect of 2's compliment\n",
+ "e=dec2hex(f)#\n",
+ "print ('Subtraction= ')#\n",
+ "print (e)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Subtrahend= 32H \n",
+ "\n",
+ "Minuend= 45H \n",
+ " \n",
+ "\n",
+ "Subtraction= \n",
+ "13\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.6 - PG NO: 626"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 626\n",
+ "## example no A.6\n",
+ "## SUBTRACTION OF TWO NUMBERS\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "def bitcmp(a):\n",
+ "\tmask = (1 << a.bit_length()) - 1\n",
+ "\tb=(a ^ mask)\n",
+ "\treturn int(b)\n",
+ "\n",
+ "def bin2dec(b):\n",
+ " x = int(b, 2)\n",
+ " if b[0] == '1': # \"sign bit\", big-endian\n",
+ " x -= 2**len(b)\n",
+ " return x\n",
+ "\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "\n",
+ "\n",
+ "print ('Subtrahend= 45H \\n')#\n",
+ "print ('Minuend= 32H \\n \\n')#\n",
+ "## finding 2's complement of subtrahend (32H)#\n",
+ "m=hex2dec('32')#\n",
+ "x=hex2dec('45')#\n",
+ "y=bitcmp(x)# ## 1's compliment of 32H\n",
+ "z=y+1# ## 2's compliment of 32H\n",
+ "s=m+z# \n",
+ "f=s+128\n",
+ "r=dec2hex(f)#\n",
+ "print ('Subtraction= ')#\n",
+ "print (r)#\n",
+ "print('in hexadecimal \\n')\n",
+ "\n",
+ "d=hex2dec(r)#\n",
+ "x=bitcmp(d)#\n",
+ "s=x-1\n",
+ "f=s+2\n",
+ "y=dec2hex(f)#\n",
+ "print ('The result is negative & it is expressed in 2s complement.')\n",
+ "print(y)#\n",
+ "print('in hexadecimal \\n')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Subtrahend= 45H \n",
+ "\n",
+ "Minuend= 32H \n",
+ " \n",
+ "\n",
+ "Subtraction= \n",
+ "ED\n",
+ "in hexadecimal \n",
+ "\n",
+ "The result is negative & it is expressed in 2s complement.\n",
+ "13\n",
+ "in hexadecimal \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.7 - PG NO: 628"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 628\n",
+ "## example no A.7\n",
+ "## SUBTRACTION OF UNSIGNED NUMBERS\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def bitcmp(a):\n",
+ "\tmask = (1 << a.bit_length()) - 1\n",
+ "\tb=(a ^ mask)\n",
+ "\treturn int(b)\n",
+ "print ('Part a \\n \\n')\n",
+ "print ('Subtrahend= 62H \\n')#\n",
+ "print ('Minuend= FAH \\n \\n')#\n",
+ "## finding 2's complement of subtrahend (62H)#\n",
+ "m=hex2dec('FA')#\n",
+ "x=hex2dec('62')#\n",
+ "y=bitcmp(x)\n",
+ "z=y+1# ##2's compliment of 62H\n",
+ "s=m+z# \n",
+ "f=s-128# ## to compensate the effect of 2's compliment\n",
+ "e=dec2hex(f)#\n",
+ "print ('Subtraction= ')#\n",
+ "print (e)#\n",
+ "print ('This result is positive \\n \\n')#\n",
+ "\n",
+ "\n",
+ "print ('Part b \\n \\n')\n",
+ "print ('Subtrahend= FAH \\n')#\n",
+ "print ('Minuend= 62H \\n \\n')#\n",
+ "## finding 2's complement of subtrahend (FAH)#\n",
+ "m=hex2dec('62')#\n",
+ "x=hex2dec('FA')#\n",
+ "y=bitcmp(x)# ## 1's compliment of FAH\n",
+ "z=y+1# ##2's compliment of 62H\n",
+ "s=m+z# \n",
+ "r=dec2hex(s)#\n",
+ "print ('Subtraction= ')#\n",
+ "print (r)#\n",
+ "print ('The result is negative & it is expressed in 2s complement.')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part a \n",
+ " \n",
+ "\n",
+ "Subtrahend= 62H \n",
+ "\n",
+ "Minuend= FAH \n",
+ " \n",
+ "\n",
+ "Subtraction= \n",
+ "98\n",
+ "This result is positive \n",
+ " \n",
+ "\n",
+ "Part b \n",
+ " \n",
+ "\n",
+ "Subtrahend= FAH \n",
+ "\n",
+ "Minuend= 62H \n",
+ " \n",
+ "\n",
+ "Subtraction= \n",
+ "68\n",
+ "The result is negative & it is expressed in 2s complement.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.8 - PG NO: 629"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# page no 629\n",
+ "# example no A.8\n",
+ "# SUBTRACTION OF SIGNED NUMBERS\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "\n",
+ "def bitcmp(a):\n",
+ "\tmask = (1 << a.bit_length()) - 1\n",
+ "\tb=(a ^ mask)\n",
+ "\treturn int(b)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "print('Part a \\n \\n')\n",
+ "print('Minuend= FAH \\n \\n')#\n",
+ "print('It is a negative no since D7= 1 for FAH, this must be represented in \\n2s compliment form. \\n')#\n",
+ "# finding 2's complement of subtrahend (FAH)#\n",
+ "m=hex2dec('FA')#\n",
+ "x=hex2dec('62')#\n",
+ "y=bitcmp(m)# # 1's compliment of FAH\n",
+ "z=y+1# # 2's compliment of FAH\n",
+ "print('2s compliment of minuend is= ')#\n",
+ "print(z)#\n",
+ "print('in hexadecimal \\n')\n",
+ "\n",
+ "print('\\n \\n Subtrahend= 62H \\n')#\n",
+ "print('It is a positive no since D7= 0 for 62H. \\n')#\n",
+ "# subtraction can be represented as\n",
+ "# FAH-62H= (-06H)-(+62H)\n",
+ "s=-x-z# \n",
+ "a=-s#\n",
+ "d=dec2hex(a)#\n",
+ "print('Subtraction= ')#\n",
+ "print(s)#\n",
+ "print('\\n')\n",
+ "print(d)#\n",
+ "print('in hexadecimal with a negative sign \\n \\n')#\n",
+ "g=bitcmp(a)# # 1's compliment of result\n",
+ "q=g+129# # 2's compliment of result\n",
+ "e=dec2hex(q)#\n",
+ "print('2s compliment of result would be= ')#\n",
+ "print(e)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part a \n",
+ " \n",
+ "\n",
+ "Minuend= FAH \n",
+ " \n",
+ "\n",
+ "It is a negative no since D7= 1 for FAH, this must be represented in \n",
+ "2s compliment form. \n",
+ "\n",
+ "2s compliment of minuend is= \n",
+ "6\n",
+ "in hexadecimal \n",
+ "\n",
+ "\n",
+ " \n",
+ " Subtrahend= 62H \n",
+ "\n",
+ "It is a positive no since D7= 0 for 62H. \n",
+ "\n",
+ "Subtraction= \n",
+ "-104\n",
+ "\n",
+ "\n",
+ "68\n",
+ "in hexadecimal with a negative sign \n",
+ " \n",
+ "\n",
+ "2s compliment of result would be= \n",
+ "98\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 19.9 - PG NO: 629"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 629\n",
+ "##example no A.9\n",
+ "## ADDITION OF TWO POSITIVE NUMBERS\n",
+ "##the given numbers are 41H & 54H.\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "A=hex2dec('41')#\n",
+ "B=hex2dec('54') \n",
+ "Y=A+B# \n",
+ "X=dec2hex(Y)#\n",
+ "print ('Sum =')\n",
+ "print (X)#\n",
+ "print('in hexadecimal \\n')\n",
+ "if Y>255: ## checking the carry flag.\n",
+ " print ('CY=1 \\n \\n') \n",
+ "else:\n",
+ " print ('CY=0 \\n \\n')\n",
+ "\n",
+ "if Y>127: ## checking the sign flag.\n",
+ " print ('S=1 \\n \\n')\n",
+ "else:\n",
+ " print ('S=0 \\n \\n')\n",
+ "\n",
+ "if Y>0: ## checking the zero flag.\n",
+ " print ('Z=0 \\n \\n')\n",
+ "else:\n",
+ " print ('Z=1 \\n \\n')\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum =\n",
+ "95\n",
+ "in hexadecimal \n",
+ "\n",
+ "CY=0 \n",
+ " \n",
+ "\n",
+ "S=1 \n",
+ " \n",
+ "\n",
+ "Z=0 \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER2.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER2.ipynb new file mode 100755 index 00000000..426e33a5 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER2.ipynb @@ -0,0 +1,294 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5bde2d708f0f6314a9ce2bbaebd8be7d8b932147d24c3a735ae61026c957a8a8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2-MICROPROCESSOR ARCHITECHTURE AND MICROCOMPUTER SYSTEMS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1-Pg 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no 39\n",
+ "#example no 2.1\n",
+ "#MEMORY ADDRESS RANGE.\n",
+ "print ('A7-A0 are address lines for register select. \\n');\n",
+ "print ('A15-A8 are address lines for chip select. \\n \\n');\n",
+ "print ('A15 A14 A13 A12 A11 A10 A9 A8 \\n');\n",
+ "print (' 0 0 0 0 0 0 0 0 =00H \\n \\n'); #chip select bits have to be active low always to select that chip.\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print (' 0 0 0 0 0 0 0 0 =00H \\n'); #this selects the register 00.\n",
+ "print ('The above combination selects the memory address 0000H. \\n \\n');\n",
+ "print ('A15 A14 A13 A12 A11 A10 A9 A8 \\n');\n",
+ "print (' 0 0 0 0 0 0 0 0 =00H \\n \\n'); #chip select bits have to be active low always to select that chip.\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print (' 1 1 1 1 1 1 1 1 =FFH \\n'); #this selects the register FF.\n",
+ "print ('The above combination selects the memory address 00FFH. \\n \\n');\n",
+ "#thus this chip can select any memory location from 0000H to 00FFH.\n",
+ "#the memory addressed of the chip can be changed by modifying the hardware.For example if we remove the inverter on line A15.\n",
+ "print ('A15 A14 A13 A12 A11 A10 A9 A8 \\n');\n",
+ "print (' 1 0 0 0 0 0 0 0 =80H \\n \\n'); #chip select bits have to be active low always to select that chip.\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print (' 0 0 0 0 0 0 0 0 =00H \\n'); #this selects the register 00.\n",
+ "print ('The above combination selects the memory address 8000H. \\n \\n');\n",
+ "#The memory address range from above change will be 8000H to 80FFH.\n",
+ "#Thus a memory can be assigned address in various locations over the entire map of 0000H to FFFFH.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A7-A0 are address lines for register select. \n",
+ "\n",
+ "A15-A8 are address lines for chip select. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 A10 A9 A8 \n",
+ "\n",
+ " 0 0 0 0 0 0 0 0 =00H \n",
+ " \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ " 0 0 0 0 0 0 0 0 =00H \n",
+ "\n",
+ "The above combination selects the memory address 0000H. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 A10 A9 A8 \n",
+ "\n",
+ " 0 0 0 0 0 0 0 0 =00H \n",
+ " \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ " 1 1 1 1 1 1 1 1 =FFH \n",
+ "\n",
+ "The above combination selects the memory address 00FFH. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 A10 A9 A8 \n",
+ "\n",
+ " 1 0 0 0 0 0 0 0 =80H \n",
+ " \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ " 0 0 0 0 0 0 0 0 =00H \n",
+ "\n",
+ "The above combination selects the memory address 8000H. \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2-Pg 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 41\n",
+ "##example no 2.2\n",
+ "##MEMORY ADDRESS RANGE.\n",
+ "print ('A9-A0 are address lines for register select. \\n');\n",
+ "print ('A15-A10 are address lines for chip select. \\n \\n');\n",
+ "print ('A15 A14 A13 A12 A11 A10 \\n');\n",
+ "print (' 0 0 0 0 0 0 \\n \\n'); ##chip select bits have to be active low always to select that chip.\n",
+ "print ('A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print (' 0 0 0 0 0 0 0 0 0 0 \\n'); ##this selects the register \n",
+ "print ('The above combination selects the memory address 0000H. \\n \\n');\n",
+ "print ('A15 A14 A13 A12 A11 A10 \\n');\n",
+ "print (' 0 0 0 0 0 0 \\n \\n'); ##chip select bits have to be active low always to select that chip.\n",
+ "print ('A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \\n');\n",
+ "print (' 1 1 1 1 1 1 1 1 1 1 \\n'); ##this selects the register \n",
+ "print ('The above combination selects the memory address 03FFH. \\n \\n');\n",
+ "##thus this chip can select any memory location from 0000H to 03FFH.\n",
+ "##the memory addressed of the chip can be changed by modifying the hardware.Like we did in the previous example.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A9-A0 are address lines for register select. \n",
+ "\n",
+ "A15-A10 are address lines for chip select. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 A10 \n",
+ "\n",
+ " 0 0 0 0 0 0 \n",
+ " \n",
+ "\n",
+ "A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ " 0 0 0 0 0 0 0 0 0 0 \n",
+ "\n",
+ "The above combination selects the memory address 0000H. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 A10 \n",
+ "\n",
+ " 0 0 0 0 0 0 \n",
+ " \n",
+ "\n",
+ "A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ " 1 1 1 1 1 1 1 1 1 1 \n",
+ "\n",
+ "The above combination selects the memory address 03FFH. \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3-Pg 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 43\n",
+ "##example no 2.3\n",
+ "##CALCULATING ADDRESS LINES\n",
+ "##number of address lines are given by x\n",
+ "import math\n",
+ "x=(math.log(8192))/(math.log(2));\n",
+ "print ('Number of address lines= ')\n",
+ "print (x);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of address lines= \n",
+ "13.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4-Pg 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 43\n",
+ "##example no 2.4\n",
+ "##CALCULATING NO OF CHIPS.\n",
+ "##chip 1024*1 has 1024(1k) registers & each register can store one bit with one data line. We need 8 data lines for byte size memory. Therefore 8 chips are necessary for 1k byte memory.For 1k byte memory we will need 64 chips. We can arrive at the same ans by dividing 8k byte by 1k*1 as follows:\n",
+ "import math\n",
+ "no=(8192*8)/(1024*1);\n",
+ "print ('No of chips= ');\n",
+ "print (no);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No of chips= \n",
+ "64\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5-Pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 44\n",
+ "##example no 2.5\n",
+ "##FETCHING AN INSTRUCTION.\n",
+ "print ('Memory Location 2005H= 4FH \\n');\n",
+ "print ('Address bus= 2005H \\n') ##program counter places the 16-bit address on the address bus.\n",
+ "print ('Control bus--> (MEMR) \\n'); ##control bus sends memory read control signal.\n",
+ "print ('Data bus= 4FH \\n'); ##instruction 4FH is fetched and transferred to instruction decoder.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Memory Location 2005H= 4FH \n",
+ "\n",
+ "Address bus= 2005H \n",
+ "\n",
+ "Control bus--> (MEMR) \n",
+ "\n",
+ "Data bus= 4FH \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER3.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER3.ipynb new file mode 100755 index 00000000..d4cafbd3 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER3.ipynb @@ -0,0 +1,285 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3cd12fdd76503b0f934ce929baca0be26acfc3c1276a8f5fb125347acf7ddd61"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 3- 8085 MICROPROCESSOR ARCHITECHTURE AND MEMORY INTERFACING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2- Pg no. 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 78\n",
+ "##example no 3.2\n",
+ "##EXECUTING THE INSTRUCTION.\n",
+ "A=82# ##contents of the accumulator.\n",
+ "print ('Accumulator= ')#\n",
+ "print (A)#\n",
+ "TR=A# ##contents of the accumulator tranferred to the temporary register.\n",
+ "print ('Temporary Register= ')#\n",
+ "print (TR)#\n",
+ "C=TR# ##contents of the temporary register are transferred to register C.\n",
+ "print ('Register C= ')#\n",
+ "print (C)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Accumulator= \n",
+ "82\n",
+ "Temporary Register= \n",
+ "82\n",
+ "Register C= \n",
+ "82\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3- Pg no.82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 82\n",
+ "##example no 3.3\n",
+ "##TIME REQUIRED FOR EXECUTION.\n",
+ "A=32# ## MVI A,32H loads the value 32 in accumulator.\n",
+ "print '%s' %('Accumulator= ')#\n",
+ "print '%s' %(A)#\n",
+ "##calculating the execution time for instruction.\n",
+ "f=2# ## clock frequncy.\n",
+ "print '%s %.6f %s' % ('clock frequency= ',f,' MHz \\n')#\n",
+ "t=1./f# ## T-state=clock period\n",
+ "print '%s %.6f %s' % ('T-state=clock period= ',t,' microsec \\n')#\n",
+ "t1=4.*t# ## execution time for opcode fetch.\n",
+ "print '%s %.6f %s' % ('Execution time for opcode fetch= ',t1,' microsec \\n')#\n",
+ "t2=3.*t# ## execution time for memory read.\n",
+ "print '%s %.6f %s' % ('Execution time for memory read= ',t2,' microsec \\n')#\n",
+ "t3=7.*t# ## execution time for instruction.\n",
+ "print '%s %.6f %s' % ('Execution time for instruction= ',t3,' microsec \\n')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Accumulator= \n",
+ "32\n",
+ "clock frequency= 2.000000 MHz \n",
+ "\n",
+ "T-state=clock period= 0.500000 microsec \n",
+ "\n",
+ "Execution time for opcode fetch= 2.000000 microsec \n",
+ "\n",
+ "Execution time for memory read= 1.500000 microsec \n",
+ "\n",
+ "Execution time for instruction= 3.500000 microsec \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 - Pg no. 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "####page no 91\n",
+ "##example no 3.5\n",
+ "##MEMORY ADDRESS RANGE OF 6116.\n",
+ "print ('A10-A0 are address lines for register select. \\n')#\n",
+ "print ('A15-A11 are address lines for chip select. \\n \\n')#\n",
+ "print ('A15 A14 A13 A12 A11 \\n')#\n",
+ "print (' 1 0 0 0 1 \\n \\n')# ##chip select bits have to be active low always to select that chip.\n",
+ "print ('A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \\n')#\n",
+ "print ('0 0 0 0 0 0 0 0 0 0 0 \\n')# ##this selects the register \n",
+ "print ('The above combination selects the memory address 8800H. \\n \\n')#\n",
+ "print ('A15 A14 A13 A12 A11 \\n')#\n",
+ "print (' 1 0 0 0 1 \\n \\n')# ##chip select bits have to be active low always to select that chip.\n",
+ "print ('A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \\n')#\n",
+ "print ('1 1 1 1 1 1 1 1 1 1 1 \\n')# ##this selects the register \n",
+ "print ('The above combination selects the memory address 88FFH. \\n \\n')#\n",
+ "##thus this chip can select any memory location from 8800H to 88FFH.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A10-A0 are address lines for register select. \n",
+ "\n",
+ "A15-A11 are address lines for chip select. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 \n",
+ "\n",
+ " 1 0 0 0 1 \n",
+ " \n",
+ "\n",
+ "A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "0 0 0 0 0 0 0 0 0 0 0 \n",
+ "\n",
+ "The above combination selects the memory address 8800H. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 \n",
+ "\n",
+ " 1 0 0 0 1 \n",
+ " \n",
+ "\n",
+ "A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "1 1 1 1 1 1 1 1 1 1 1 \n",
+ "\n",
+ "The above combination selects the memory address 88FFH. \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6 - Pg no. 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "####page no 95\n",
+ "##example no 3.6\n",
+ "##MEMORY ADDRESS RANGE OF 8155.\n",
+ "print ('A7-A0 are address lines for register select. \\n')#\n",
+ "print ('A10-A8 address lines are dont care conditions. \\n')#\n",
+ "print ('A15-A11 are address lines for chip select. \\n \\n')#\n",
+ "print ('A15 A14 A13 A12 A11 \\n')#\n",
+ "print (' 0 0 1 0 0 \\n \\n')# ##chip select bits have to be active low always to select that chip.\n",
+ "print ('A10 A9 A8 \\n')#\n",
+ "print ('0 0 1 \\n \\n')# ##this is the don't care condition.\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n')#\n",
+ "print ('0 0 0 0 0 0 0 0 \\n')# ##this selects the register \n",
+ "print ('The above combination selects the memory address 2100H. \\n \\n')#\n",
+ "print ('A15 A14 A13 A12 A11 \\n')#\n",
+ "print (' 0 0 1 0 0 \\n \\n')# ##chip select bits have to be active low always to select that chip.\n",
+ "print ('A10 A9 A8 \\n')#\n",
+ "print ('0 0 1 \\n \\n')# ##this is the don't care condition.\n",
+ "print ('A7 A6 A5 A4 A3 A2 A1 A0 \\n')#\n",
+ "print ('1 1 1 1 1 1 1 1 \\n')# ##this selects the register \n",
+ "print ('The above combination selects the memory address 21FFH. \\n \\n')#\n",
+ "##thus this chip can select any memory location from 2100H to 21FFH.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A7-A0 are address lines for register select. \n",
+ "\n",
+ "A10-A8 address lines are dont care conditions. \n",
+ "\n",
+ "A15-A11 are address lines for chip select. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 \n",
+ "\n",
+ " 0 0 1 0 0 \n",
+ " \n",
+ "\n",
+ "A10 A9 A8 \n",
+ "\n",
+ "0 0 1 \n",
+ " \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "0 0 0 0 0 0 0 0 \n",
+ "\n",
+ "The above combination selects the memory address 2100H. \n",
+ " \n",
+ "\n",
+ "A15 A14 A13 A12 A11 \n",
+ "\n",
+ " 0 0 1 0 0 \n",
+ " \n",
+ "\n",
+ "A10 A9 A8 \n",
+ "\n",
+ "0 0 1 \n",
+ " \n",
+ "\n",
+ "A7 A6 A5 A4 A3 A2 A1 A0 \n",
+ "\n",
+ "1 1 1 1 1 1 1 1 \n",
+ "\n",
+ "The above combination selects the memory address 21FFH. \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER6.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER6.ipynb new file mode 100755 index 00000000..4e051dfe --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER6.ipynb @@ -0,0 +1,534 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1bd4edcbc2b1ae9b67fe169c6f3466bc12b5c7f7594b61c1a046ae12d4b071be"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 6 - Introduction To 8085 Instructions "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.1 - PG NO: 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 164\n",
+ "##example no 6.1\n",
+ "##LOAD A DATA TO ONE REGISTER AND MOVE IT TO ANOTHER.\n",
+ "import math\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ " \n",
+ "A=hex2dec('82')# ##storing the decimal value of hexadecimal no 82 in accumulator A\n",
+ "B=dec2hex(A)# ##storing the hexadecimal value of A in B\n",
+ "print('B=\\n')\n",
+ "print (B)# ##displaying the hexadecimal number in register B\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B=\n",
+ "\n",
+ "82\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.2 - PG NO:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no 164\n",
+ "#example 6.2\n",
+ "#TO SWITCH ON SOME DEVICES\n",
+ "#let the switches which are ON are at bit no D0,D1,D2,D3,D6#\n",
+ "import math\n",
+ "\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "\n",
+ "\n",
+ "x=hex2dec('4F')# #hexadecimal to decimal conversion\n",
+ "y=dec2bin(x)# #decimal to binary conversion\n",
+ "print ('At output port 01H: ')# #same input appears at the putput\n",
+ "print (y)#\n",
+ "print ('Value 1s are showing the devices are ON.')\n",
+ "print ('Value 0s are showing the devices are switched OFF.')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At output port 01H: \n",
+ "01001111\n",
+ "Value 1s are showing the devices are ON.\n",
+ "Value 0s are showing the devices are switched OFF.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.3 - PG NO:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 174\n",
+ "##example 6.3\n",
+ "##ADDITION OF TWO NUMBERS.\n",
+ "##93H is stored in accumulator. Converting it into decimal.\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "A=hex2dec('93')#\n",
+ "##B7H is stored in register C. Converting it into decimal.\n",
+ "C=hex2dec('B7')#\n",
+ "X=A+C# ## the result comes out to be 330\n",
+ "Z=X-256#\n",
+ "##X=330# ## this is a decimal value. Converting it into hexadecimal\n",
+ "\n",
+ "Y=dec2hex(Z)#\n",
+ "print ('Sum= ')\n",
+ "print (Y)#\n",
+ "if X>255:\n",
+ " print ('CY=1')\n",
+ "else:\n",
+ " print ('CY=0')\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum= \n",
+ "4A\n",
+ "CY=1\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.4 - PG NO:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 175\n",
+ "##example 6.4\n",
+ "##CONTINUATION OF PREVIOUS EXAMPLE.\n",
+ "##the sum of previous example is added to 35H\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "def hex2dec(p):\n",
+ "\t return int(p, 16)\n",
+ "\n",
+ "\n",
+ "S=hex2dec('4A'); ##4AH is converted into decimal value.\n",
+ "A=hex2dec('35'); ##35H is converted into decimal value\n",
+ "s=A+S; ##the result comes out to be 127. it is a decimal value\n",
+ "Y=dec2hex(s);\n",
+ "print ('Sum= ')\n",
+ "print (Y);\n",
+ "if s>255:\n",
+ " print ('CY=1')\n",
+ "else:\n",
+ " print ('CY=0')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum= \n",
+ "7F\n",
+ "CY=0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.5 - PG NO:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 175\n",
+ "##example no 6.5\n",
+ "##INCRIMENTING ACCUMULATOR CONTENT.\n",
+ "##accumulator holds the data FFH\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "A=hex2dec('FF')# ##converting FFH into decimal value\n",
+ "##decimal value of 01H is 01. Adding 01 to A\n",
+ "Y=A+1# ##the result comes out to be 256\n",
+ "Z=Y-256#\n",
+ "X=dec2hex(Z)#\n",
+ "print ('Sum =')\n",
+ "print (X)#\n",
+ "if Y>255:\n",
+ " print ('CY=1 \\n')\n",
+ "else:\n",
+ " print ('CY=0 \\n')\n",
+ "\n",
+ "if Z>127:\n",
+ " print ('S=1 \\n')\n",
+ "else:\n",
+ " print ('S=0 \\n')\n",
+ "\n",
+ "if Z>0:\n",
+ " print ('Z=0 \\n')\n",
+ "else:\n",
+ " print ('Z=1 \\n')\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum =\n",
+ "0\n",
+ "CY=1 \n",
+ "\n",
+ "S=0 \n",
+ "\n",
+ "Z=1 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.6 - PG NO:179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 179\n",
+ "##example 6.6\n",
+ "##SUBTRACTION OF TWO NUMBERS.\n",
+ "##accumulator has 97H. Converting it into decimal value\n",
+ "\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "A=hex2dec('97')#\n",
+ "##register B has 65H. Finding 2's compliment of 65H.\n",
+ "B=hex2dec('65')#\n",
+ "X=256-B#\n",
+ "Y=A+X#\n",
+ "S=Y-256#\n",
+ "Z=dec2hex(S)#\n",
+ "print ('Subtraction= ')\n",
+ "print (Z)#\n",
+ "if Y>255:\n",
+ " CY=1#\n",
+ " print ('The result is positive. \\n')#\n",
+ "else:\n",
+ " CY=0#\n",
+ " print ('The result is negative. \\n')\n",
+ "\n",
+ "if S>127:\n",
+ " print ('S=1 \\n')\n",
+ "else:\n",
+ " print ('S=0 \\n')\n",
+ "\n",
+ "if S>0:\n",
+ " print ('Z=0 \\n')\n",
+ "else:\n",
+ " print ('Z=1 \\n')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Subtraction= \n",
+ "32\n",
+ "The result is positive. \n",
+ "\n",
+ "S=0 \n",
+ "\n",
+ "Z=0 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.7 - PG NO:185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no 185\n",
+ "#example no 6.7\n",
+ "#PERFORMING LOGICAL OPERATIONS.\n",
+ "#register B holds 93H.Binary of 93H is 10010011\n",
+ "#register A holds 15H. Binary of 15H is 00010101.\n",
+ "def bitor(a,b):\n",
+ " d=dec2bin(a|b)\n",
+ " return d\n",
+ "\n",
+ "def bitcmp(a):\n",
+ " s=~a\n",
+ " d=dec2bin(s)\n",
+ " return d\n",
+ "\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "\n",
+ "\n",
+ "def bitxor(a,b):\n",
+ " d=dec2bin(a^b)\n",
+ " return d\n",
+ "\n",
+ "def bin2dec(s):\n",
+ " return str(int(s,2))\n",
+ "\n",
+ "\n",
+ "B=int('10010011',2)# #taking the value of A in matrix form.\n",
+ "A=int('00010101',2)# #taking the value of B in matrix form.\n",
+ "Y= bitor(A,B)# # getting OR of A & B\n",
+ "print('OR of A & B is')\n",
+ "print(Y)#\n",
+ "if Y==1:\n",
+ " print('S=1 \\n')#\n",
+ "else:\n",
+ " print('S=0 \\n')#\n",
+ "\n",
+ "if Y==0:\n",
+ " print('Z=1 \\n')#\n",
+ "else:\n",
+ " print('Z=0 \\n')#\n",
+ "\n",
+ "print('CY=0 \\n')#\n",
+ "R=bitxor(A,B)# #getting XOR of A & B\n",
+ "print('XOR of A & B is')\n",
+ "print(R)#\n",
+ "if R==1:\n",
+ " print('S=1 \\n')#\n",
+ "else:\n",
+ " print('S=1 \\n')#\n",
+ "\n",
+ "if R==0:\n",
+ " print('Z=1 \\n')#\n",
+ "else:\n",
+ " print('Z=0 \\n')#\n",
+ "\n",
+ "print('CY=0 \\n')#\n",
+ "K=bitcmp(A)# #getting the compliment of A\n",
+ "print('Compliment of A is: \\n')#\n",
+ "print(K)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "OR of A & B is\n",
+ "10010111\n",
+ "S=0 \n",
+ "\n",
+ "Z=0 \n",
+ "\n",
+ "CY=0 \n",
+ "\n",
+ "XOR of A & B is\n",
+ "10000110\n",
+ "S=1 \n",
+ "\n",
+ "Z=0 \n",
+ "\n",
+ "CY=0 \n",
+ "\n",
+ "Compliment of A is: \n",
+ "\n",
+ "11101010\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.8 - PG NO:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 186\n",
+ "##example no 6.8\n",
+ "##KEEPING THE RADIO ON.\n",
+ "##to keep the radio on without affecting the other appliances, the D4 bit should always be 1\n",
+ "##assuming an input input binary 10101010\n",
+ "import numpy\n",
+ "A=[1, 0, 1, 0, 1, 0, 1, 0]#\n",
+ "B=[0, 0, 0, 1, 0, 0, 0, 0]#\n",
+ "Y=numpy.asarray(A)|numpy.asarray(B)# ##ORing input (A) with B to keep the D4 bit always set\n",
+ "print (Y)#\n",
+ "print ('D4 bit will always be one without affecting the other bits')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[1 0 1 1 1 0 1 0]\n",
+ "D4 bit will always be one without affecting the other bits\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 6.9 - PG NO:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 187\n",
+ "##example no 6.9\n",
+ "##TURN OFF THE AIR CONDITIONER.\n",
+ "##to turn OFF the air conditioner, reset bit D7\n",
+ "##Assuming the same input as earlier as it is a continuation of previous example.\n",
+ "import numpy\n",
+ "A=[1,0,1,0,1,0,1,0]#\n",
+ "B=[0,1,1,1,1,1,1,1]#\n",
+ "Y=numpy.asarray(A)&numpy.asarray(B)# ##ANDing input (A) with B to keep the D4 bit always set\n",
+ "print (Y)#\n",
+ "print ('D7 bit will always be zero without affecting the other bits')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[0 0 1 0 1 0 1 0]\n",
+ "D7 bit will always be zero without affecting the other bits\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER7.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER7.ipynb new file mode 100755 index 00000000..c9ae1020 --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER7.ipynb @@ -0,0 +1,876 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fac961f1bfa632829584c3db6ea9fb17be6fc3cbdbd046eda5c4ca96ae66b57e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 7 - Programming Techniques With Additional Instructions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.1 - PG NO: 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 216\n",
+ "##example no 7.1\n",
+ "##STEPS TO ADD 10 BYTES OF DATA.\n",
+ "print ('The micriprocessor needs :')#\n",
+ "print ('a. a counter to count 10 data bytes')#\n",
+ "print ('b. an index or a memory pointer to locate where data bytes are stored')#\n",
+ "print ('c. to transfer data from a memory location to the microprocessor')#\n",
+ "print ('d. to perform addition')#\n",
+ "print ('e. registers for temporary storage of partial answers')#\n",
+ "print ('f. a flag to indicate the completion of the task')#\n",
+ "print ('g. to store or output the result')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The micriprocessor needs :\n",
+ "a. a counter to count 10 data bytes\n",
+ "b. an index or a memory pointer to locate where data bytes are stored\n",
+ "c. to transfer data from a memory location to the microprocessor\n",
+ "d. to perform addition\n",
+ "e. registers for temporary storage of partial answers\n",
+ "f. a flag to indicate the completion of the task\n",
+ "g. to store or output the result\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.2 - PG NO: 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 219\n",
+ "##example no 7.2\n",
+ "##LOADING 16-BIT NUMBER.\n",
+ "##working of LXI instruction.\n",
+ "print ('LXI H,2050H'); ## loads HL register pair.\n",
+ "print ('L=50H'); ## 50H in L register.\n",
+ "print ('H=20H'); ##20H in H register pair.\n",
+ "print ('LXI instruction takes 3 bytes of memory and 10 clock periods.')\n",
+ "##working of MVI instruction.\n",
+ "print ('MVI H,20H');\n",
+ "print ('H=20H'); ## load 20H in register H.\n",
+ "print ('MVI L,50H'); ## load 50H in register L.\n",
+ "print ('L=50H');\n",
+ "print ('2 MVI instructions take 4 bytes of memory and 14 clock periods.')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LXI H,2050H\n",
+ "L=50H\n",
+ "H=20H\n",
+ "LXI instruction takes 3 bytes of memory and 10 clock periods.\n",
+ "MVI H,20H\n",
+ "H=20H\n",
+ "MVI L,50H\n",
+ "L=50H\n",
+ "2 MVI instructions take 4 bytes of memory and 14 clock periods.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.3 - PG NO: 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no 220\n",
+ "#example no 7.3\n",
+ "# TRANSFER OF DATA BYTES TO ACCUMULATOR.\n",
+ "# Memory location 2050H has the data F7H.\n",
+ "\n",
+ "# using MOV instruction.\n",
+ "#indirect addressing mode.\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "\n",
+ "print '%s' %('LXI H,2050H')#\n",
+ "print '%s' %('H=20H L=50H \\n \\n')# # the 16-bit address of the data is loaded in HL register pair.\n",
+ "M=hex2dec('F7')# # M is the memory location pointer of address 2050H.\n",
+ "print '%s' %('MOV A,M ')#\n",
+ "A=dec2hex(M)#\n",
+ "print '%s' %('A= ')#\n",
+ "print (A)# # the contents of the HL register pair are used as memory pointer to the location 2050H.\n",
+ "\n",
+ "# using LDAX instruction.\n",
+ "# indirect addressing mode.\n",
+ "\n",
+ "print '%s' %('LXI B,2050H')#\n",
+ "print '%s' %('B=20H C=50H \\n \\n')# # the 16-bit address of the data is loaded in BC register pair.\n",
+ "M=hex2dec('F7')# # M is the memory location pointer of address 2050H.\n",
+ "print '%s' %('LDAX B ')#\n",
+ "A=dec2hex(M)#\n",
+ "print '%s' %('A= ')#\n",
+ "print (A)# # the contents of the BC register pair are used as memory pointer to the location 2050H.\n",
+ "\n",
+ "# using LDA instruction.\n",
+ "# direct addressing mode.\n",
+ "print '%s' %('\\n LDA 2050H \\n')# #directly sends the data of memory location 2050H to accumulator.\n",
+ "print '%s' %('A= ')#\n",
+ "print (A)#\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LXI H,2050H\n",
+ "H=20H L=50H \n",
+ " \n",
+ "\n",
+ "MOV A,M \n",
+ "A= \n",
+ "F7\n",
+ "LXI B,2050H\n",
+ "B=20H C=50H \n",
+ " \n",
+ "\n",
+ "LDAX B \n",
+ "A= \n",
+ "F7\n",
+ "\n",
+ " LDA 2050H \n",
+ "\n",
+ "A= \n",
+ "F7\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.4 - PG NO: 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no 222\n",
+ "#example no 7.4\n",
+ "# USE OF ADDRESSING MODES.\n",
+ "#register B contains 32H\n",
+ "B=32#\n",
+ "\n",
+ "#using indirect addressing modes\n",
+ "print '%s %d' %('B= ',B )#\n",
+ "print('\\n')#\n",
+ "print '%s' %('1) LXI H,8000H')# # loads HL register pair.\n",
+ "print('\\n')#\n",
+ "print '%s' %('H=80H L=00H')# \n",
+ "print('\\n')#\n",
+ "print '%s' %('MOV M,B')# # contents of register B are moved in memory location pointed by HL register pair.\n",
+ "\n",
+ "M=B# \n",
+ "\n",
+ "print '%s %d' %('\\n 8000H --> ',M)#\n",
+ "print('\\n')#\n",
+ "print '%s' %('LXI D,8000H')# #loads the memory location 8000H in DE register pair.\n",
+ "print('\\n')#\n",
+ "print '%s' %('D=80H E=00H')# \n",
+ "print('\\n')#\n",
+ "print '%s' %('MOV A,B')#\n",
+ "\n",
+ "A=B#\n",
+ "\n",
+ "print '%s %d' %('A= ',A)#\n",
+ "print('\\n')#\n",
+ "print '%s' %('STAX D')# #stores the value of accumulator in the memory location pointer by DE register pair.\n",
+ "print('\\n')#\n",
+ "print '%s %d' %('8000H --> ',A)#\n",
+ "print('\\n')#\n",
+ "#using direct addressing mode.\n",
+ "print '%s' %('2) A= F2H')#\n",
+ "print('\\n')#\n",
+ "print '%s' %('STA 8000H')# #this instruction stores the value of accumulator in the memory location 8000H.\n",
+ "print('\\n')#\n",
+ "print '%s' %('8000H --> F2H')#\n",
+ "print('\\n')#\n",
+ "#using indirect addressing mode.\n",
+ "print '%s' %('3) LXI H,8000H')# # loads HL register pair.\n",
+ "print('\\n')#\n",
+ "print '%s' %('H=80H L=00H')# \n",
+ "print('\\n')#\n",
+ "print '%s' %('MVI M,F2H')# #moving the data in the memory.\n",
+ "print('\\n')#\n",
+ "print '%s' %('8000H --> F2H')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B= 32\n",
+ "\n",
+ "\n",
+ "1) LXI H,8000H\n",
+ "\n",
+ "\n",
+ "H=80H L=00H\n",
+ "\n",
+ "\n",
+ "MOV M,B\n",
+ "\n",
+ " 8000H --> 32\n",
+ "\n",
+ "\n",
+ "LXI D,8000H\n",
+ "\n",
+ "\n",
+ "D=80H E=00H\n",
+ "\n",
+ "\n",
+ "MOV A,B\n",
+ "A= 32\n",
+ "\n",
+ "\n",
+ "STAX D\n",
+ "\n",
+ "\n",
+ "8000H --> 32\n",
+ "\n",
+ "\n",
+ "2) A= F2H\n",
+ "\n",
+ "\n",
+ "STA 8000H\n",
+ "\n",
+ "\n",
+ "8000H --> F2H\n",
+ "\n",
+ "\n",
+ "3) LXI H,8000H\n",
+ "\n",
+ "\n",
+ "H=80H L=00H\n",
+ "\n",
+ "\n",
+ "MVI M,F2H\n",
+ "\n",
+ "\n",
+ "8000H --> F2H\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.5 - PG NO: 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no 224\n",
+ "#example no 7.5\n",
+ "# INCREMENT A NUMBER.\n",
+ "print '%s' %('LXI B,2050H \\n')# #loads the data 2050H in BC register pair.\n",
+ "print '%s' %('B=20H C=50H \\n')#\n",
+ "B=20#\n",
+ "C=50#\n",
+ "print '%s' %('INX B')#\n",
+ "C=C+1#\n",
+ "print '%s %d %s %d' %('B= ',B, 'C= ',C)#\n",
+ "print('\\n')#\n",
+ "print '%s' %('The contents of BC register pair will be 2051H')#\n",
+ "print('\\n')#\n",
+ "print '%s' %('INR B')#\n",
+ "B=B+1#\n",
+ "print '%s %d' %('B=',B)#\n",
+ "print('\\n')#\n",
+ "print '%s' %('INR C')#\n",
+ "C=50#\n",
+ "C=C+1#\n",
+ "print '%s %d' %('C=',C)#\n",
+ "print('\\n')#\n",
+ "print '%s' %('The contents of BC register pair will be 2151H')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LXI B,2050H \n",
+ "\n",
+ "B=20H C=50H \n",
+ "\n",
+ "INX B\n",
+ "B= 20 C= 51\n",
+ "\n",
+ "\n",
+ "The contents of BC register pair will be 2051H\n",
+ "\n",
+ "\n",
+ "INR B\n",
+ "B= 21\n",
+ "\n",
+ "\n",
+ "INR C\n",
+ "C= 51\n",
+ "\n",
+ "\n",
+ "The contents of BC register pair will be 2151H\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.6 - PG NO: 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 228\n",
+ "##example no 7.6\n",
+ "## ARITHEMETIC OPERATIONS.\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "\n",
+ "print ('A-->30H \\n')#\n",
+ "print ('2040H-->68H \\n')#\n",
+ "print ('2041H-->7FH \\n')#\n",
+ "print ('LXI H,2040H \\n')# ## loads HL register pair.\n",
+ "print ('H=20H L=40H M=68H \\n')# \n",
+ "print ('ADD M \\n')#\n",
+ "A=hex2dec('30')#\n",
+ "M=hex2dec('68')#\n",
+ "S=A+M# ## adds the contents of A and data at memory location 2040H.\n",
+ "s=dec2hex(S)#\n",
+ "print ('\\n Content of A after addition with 2040H= ')#\n",
+ "print (s)#\n",
+ "print('\\n')\n",
+ "print ('INX H \\n')# ## takes the program to the next memory location.\n",
+ "print ('H=20H L=41H M=7FH \\n')# \n",
+ "print ('SUB M \\n')#\n",
+ "M=hex2dec('7F')#\n",
+ "D=S-M# ## subtracts the contents of A from the data at memory location 2041H.\n",
+ "d=dec2hex(D)#\n",
+ "print ('\\n Content of A after subtraction with 2041H= ')#\n",
+ "print (d)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A-->30H \n",
+ "\n",
+ "2040H-->68H \n",
+ "\n",
+ "2041H-->7FH \n",
+ "\n",
+ "LXI H,2040H \n",
+ "\n",
+ "H=20H L=40H M=68H \n",
+ "\n",
+ "ADD M \n",
+ "\n",
+ "\n",
+ " Content of A after addition with 2040H= \n",
+ "98\n",
+ "\n",
+ "\n",
+ "INX H \n",
+ "\n",
+ "H=20H L=41H M=7FH \n",
+ "\n",
+ "SUB M \n",
+ "\n",
+ "\n",
+ " Content of A after subtraction with 2041H= \n",
+ "19\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.7 - PG NO: 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 229\n",
+ "##example no 7.7\n",
+ "## INCREMENT & DECREMENT.\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "\n",
+ "print ('LXI H,2040H\\n' )# ## loads HL register pair.\n",
+ "print ('H=20H L=40H\\n' )#\n",
+ "print ('MVI M,59H\\n' )# \n",
+ "M=59#\n",
+ "M=hex2dec('59' )#\n",
+ "print ('2040H-->59H\\n' )\n",
+ "print ('INR M\\n' )#\n",
+ "M=M+1# ## increments the value at the memory location by 1.\n",
+ "m=dec2hex(M)#\n",
+ "print ('Content of 2040H after increment= ' )#\n",
+ "print (m)#\n",
+ "print('\\n' )\n",
+ "print ('INX H\\n' )# ##takes the program to the next memory location.\n",
+ "print ('H=20H L=41H\\n' )#\n",
+ "print ('MVI M,90H\\n' )#\n",
+ "M=90#\n",
+ "M=hex2dec('90' )#\n",
+ "print ('2041H-->90H\\n' )#\n",
+ "print ('DCR M\\n' )#\n",
+ "M=M-1# ##decrements the value at the memory location by 1.\n",
+ "m=dec2hex(M)#\n",
+ "print ('Content of 2041H after decrement= ' )#\n",
+ "print (m)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LXI H,2040H\n",
+ "\n",
+ "H=20H L=40H\n",
+ "\n",
+ "MVI M,59H\n",
+ "\n",
+ "2040H-->59H\n",
+ "\n",
+ "INR M\n",
+ "\n",
+ "Content of 2040H after increment= \n",
+ "5A\n",
+ "\n",
+ "\n",
+ "INX H\n",
+ "\n",
+ "H=20H L=41H\n",
+ "\n",
+ "MVI M,90H\n",
+ "\n",
+ "2041H-->90H\n",
+ "\n",
+ "DCR M\n",
+ "\n",
+ "Content of 2041H after decrement= \n",
+ "8F\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.8 - PG NO: 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 233\n",
+ "## example no 7.8\n",
+ "## LEFT ROTATION (RLC) OF BITS.\n",
+ "## initially\n",
+ "print ('Accumulator= AAH \\n');\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 1 0 1 0 1 0 1 0 =AAH \\n \\n');\n",
+ "print ('CY= 0 \\n \\n');\n",
+ "print ('RLC \\n \\n');\n",
+ "print ('CY= 1 \\n \\n');\n",
+ "## carry flag is set because D7 bit was 1.\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 0 1 0 1 0 1 0 1 =55H \\n \\n'); ## after the executuion of first RLC.\n",
+ "## RLC instruction places D7 bit in CY flag as well as in D0 bit.\n",
+ "print ('RLC \\n \\n');\n",
+ "print ('CY= 0 \\n \\n');\n",
+ "## carry flag is reset because D7 bit was 0.\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 1 0 1 0 1 0 1 0 =AAH \\n \\n'); ## after the executuion of second RLC.\n",
+ "## RLC instruction places D7 bit in CY flag as well as in D0 bit.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Accumulator= AAH \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 1 0 1 0 1 0 1 0 =AAH \n",
+ " \n",
+ "\n",
+ "CY= 0 \n",
+ " \n",
+ "\n",
+ "RLC \n",
+ " \n",
+ "\n",
+ "CY= 1 \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 0 1 0 1 0 1 0 1 =55H \n",
+ " \n",
+ "\n",
+ "RLC \n",
+ " \n",
+ "\n",
+ "CY= 0 \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 1 0 1 0 1 0 1 0 =AAH \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.9 - PG NO: 234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 234\n",
+ "## example no 7.9\n",
+ "## LEFT ROTATION (RAL) OF BITS.\n",
+ "## initially\n",
+ "print ('Accumulator= AAH \\n');\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 1 0 1 0 1 0 1 0 =AAH \\n \\n');\n",
+ "print ('CY= 0 \\n \\n');\n",
+ "print ('RAL \\n \\n');\n",
+ "print ('CY= 1 \\n \\n');\n",
+ "## carry flag is set because D7 bit was 1.\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 0 1 0 1 0 1 0 0 =54H \\n \\n'); ## after the executuion of first RAL.\n",
+ "## RAL instruction places D7 bit in CY flag & CY flags bit is send to D0 bit.\n",
+ "print ('RAL \\n \\n');\n",
+ "print ('CY= 0 \\n \\n');\n",
+ "## carry flag is reset because D7 bit was 0.\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 1 0 1 0 1 0 0 1 =A9H \\n \\n'); ## after the executuion of second RAL.\n",
+ "## RAL instruction places D7 bit in CY flag & CY flags bit is send to D0 bit.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Accumulator= AAH \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 1 0 1 0 1 0 1 0 =AAH \n",
+ " \n",
+ "\n",
+ "CY= 0 \n",
+ " \n",
+ "\n",
+ "RAL \n",
+ " \n",
+ "\n",
+ "CY= 1 \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 0 1 0 1 0 1 0 0 =54H \n",
+ " \n",
+ "\n",
+ "RAL \n",
+ " \n",
+ "\n",
+ "CY= 0 \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 1 0 1 0 1 0 0 1 =A9H \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.10 - PG NO: 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##page no 235\n",
+ "## example no 7.10\n",
+ "## RIGHT ROTATION (RRC & RAR) OF BITS.\n",
+ "## initially\n",
+ "print ('Accumulator= 81H \\n');\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 1 0 0 0 0 0 0 1 =81H \\n \\n');\n",
+ "print ('CY= 0 \\n \\n');\n",
+ "print ('RRC \\n \\n');\n",
+ "print ('CY= 1 \\n \\n');\n",
+ "## carry flag is set because D0 bit was 1.\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 1 1 0 0 0 0 0 0 =C0H \\n \\n'); ## after the executuion of RRC.\n",
+ "## RRC instruction places D0 bit in CY flag as well as in D7 bit.\n",
+ "\n",
+ "\n",
+ "\n",
+ "## initially\n",
+ "print ('Accumulator= 81H \\n');\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 1 0 0 0 0 0 0 1 =81H \\n \\n');\n",
+ "print ('CY= 0 \\n \\n');\n",
+ "print ('RAR \\n \\n');\n",
+ "print ('CY= 1 \\n \\n');\n",
+ "## carry flag is set because D0 bit was 1.\n",
+ "print ('D7 D6 D5 D4 D3 D2 D1 D0 \\n');\n",
+ "print (' 0 1 0 0 0 0 0 0 =40H \\n \\n'); ## after the executuion of RAR.\n",
+ "## RAR instruction places D0 bit in CY flag & CY flags bit is send to D7 bit.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Accumulator= 81H \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 1 0 0 0 0 0 0 1 =81H \n",
+ " \n",
+ "\n",
+ "CY= 0 \n",
+ " \n",
+ "\n",
+ "RRC \n",
+ " \n",
+ "\n",
+ "CY= 1 \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 1 1 0 0 0 0 0 0 =C0H \n",
+ " \n",
+ "\n",
+ "Accumulator= 81H \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 1 0 0 0 0 0 0 1 =81H \n",
+ " \n",
+ "\n",
+ "CY= 0 \n",
+ " \n",
+ "\n",
+ "RAR \n",
+ " \n",
+ "\n",
+ "CY= 1 \n",
+ " \n",
+ "\n",
+ "D7 D6 D5 D4 D3 D2 D1 D0 \n",
+ "\n",
+ " 0 1 0 0 0 0 0 0 =40H \n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 7.11 - PG NO: 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no 241\n",
+ "#example no 7.11\n",
+ "# COMPARISION OF DATA.\n",
+ "def hex2dec(s):\n",
+ " return int(s, 16)\n",
+ "\n",
+ "def dec2bin(n):\n",
+ " return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])\n",
+ "\n",
+ "def dec2hex(n):\n",
+ "\t return \"%X\" % n\n",
+ "\n",
+ "\n",
+ "def isequalbitwise(a,b):\n",
+ "\te=a-b\n",
+ "\tif(e==0):\n",
+ "\t\treturn 'True'\n",
+ "\telse:\n",
+ "\t\treturn 'False'\n",
+ "\n",
+ "\n",
+ "\n",
+ "print('MVI A,64H')# #loads accumulator with 64H.\n",
+ "print('A-->64H')#\n",
+ "print('LXI H,2050H')# # loads HL register pair.\n",
+ "print('H=20H L=50H')#\n",
+ "print('M-->9AH')# #assumed in the solution.\n",
+ "print('CMP M')#\n",
+ "#this command compares the contents of A with M by subtracting M from A.\n",
+ "A=hex2dec('64')#\n",
+ "#register M has 9AH. Finding 2's compliment of 9AH.\n",
+ "M=hex2dec('9A')#\n",
+ "t=isequalbitwise(A,M)# #compares the two datas bitwise.\n",
+ "if(A==M): # Jump condition\n",
+ " print('\\n Result after comparision is= ')#\n",
+ " print('OUT1')#\n",
+ "else:\n",
+ " print('Result after comparision is= ')#\n",
+ " print(t)# #this shows the false condition of the bitwise comparision.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MVI A,64H\n",
+ "A-->64H\n",
+ "LXI H,2050H\n",
+ "H=20H L=50H\n",
+ "M-->9AH\n",
+ "CMP M\n",
+ "Result after comparision is= \n",
+ "False\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER9.ipynb b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER9.ipynb new file mode 100755 index 00000000..8900d60d --- /dev/null +++ b/Microprocessor_Architecture,_Programming_&_Applications_with_the_8085_by_R._S._Goankar/CHAPTER9.ipynb @@ -0,0 +1,276 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d3183521e796ca9161662d967202a5a164310a5ae0de1d4fbead3c4d5f6496df"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 9 - Stack And Subroutines "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 9.1 - PG NO:283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 283\n",
+ "## example no 9.1\n",
+ "## PUSH POP AND DELAY INSTRUCTIONS\n",
+ "def hex2dec(s):\n",
+ "\t return int(s, 16)\n",
+ "\n",
+ "print ('LXI SP,2099H \\n \\n')# ## the stack pointer is located at 2099H.\n",
+ "print ('LXI H,42F2H ')#\n",
+ "print ('H--> 42 L-->F2 \\n \\n')#\n",
+ "print ('PUSH H')# ## sends the data of HL register pair in the stack.\n",
+ "## stack pointer is decremented by one to 2098H and the contents of the H register are copied to memory location 2098H\n",
+ "print ('2098H--> 42')# \n",
+ "## stack pointer is again decremented by one to 2097H and the contents of the L register are copied to memory location 2097H\n",
+ "print ('2097H--> F2 \\n \\n')#\n",
+ "print ('Delay Counter \\n \\n')#\n",
+ "\n",
+ "\n",
+ "n=hex2dec('42F2')#\n",
+ "\n",
+ "#for i in '1n' ## DELAY LOOP\n",
+ "# (\n",
+ "# )\n",
+ " \n",
+ " \n",
+ "\n",
+ "print ('POP H ')# ## sends the data in the stack back to the HL register pair.\n",
+ "## the contents of the top of the stack are copied to L register and the stack pointer is incremented by one to 2098H\n",
+ "print ('L--> F2H ')#\n",
+ "## the contents of the current location of stack are copied to H register and the stack pointer is again incremented by one to 2099H.\n",
+ "print ('H--> 42H ')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LXI SP,2099H \n",
+ " \n",
+ "\n",
+ "LXI H,42F2H \n",
+ "H--> 42 L-->F2 \n",
+ " \n",
+ "\n",
+ "PUSH H\n",
+ "2098H--> 42\n",
+ "2097H--> F2 \n",
+ " \n",
+ "\n",
+ "Delay Counter \n",
+ " \n",
+ "\n",
+ "POP H \n",
+ "L--> F2H \n",
+ "H--> 42H \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 9.2 - PG NO:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 285\n",
+ "## example no 9.2\n",
+ "## EXCHANGE OF DATA USING STACK.\n",
+ "print ('LXI SP,2400H \\n \\n'); ## the stack pointer is located at 2400H.\n",
+ "print ('LXI H,2150H \\n ');\n",
+ "print ('H--> 21 L-->50 \\n \\n');\n",
+ "print ('LXI B,2280H \\n ');\n",
+ "print ('B--> 22 C-->80 \\n \\n');\n",
+ "print ('PUSH H \\n'); ## sends the data of HL register pair in the stack.\n",
+ "## stack pointer is decremented by one to 23FFH and the contents of the H register are copied to memory location 23FFH\n",
+ "print ('23FFH--> 21 \\n'); \n",
+ "## stack pointer is again decremented by one to 23FEH and the contents of the L register are copied to memory location 23FEH\n",
+ "print ('23FEH--> 50 \\n \\n');\n",
+ "print ('PUSH B \\n'); ## sends the data of BC register pair in the stack.\n",
+ "## stack pointer is decremented by one to 23FDH and the contents of the H register are copied to memory location 23FDH\n",
+ "print ('23FDH--> 22 \\n'); \n",
+ "## stack pointer is again decremented by one to 23FCH and the contents of the L register are copied to memory location 23FCH\n",
+ "print ('23FCH--> 80 \\n \\n');\n",
+ "print ('PUSH PSW \\n'); ## sends the data of accumulator & flag register in the stack.\n",
+ "## stack pointer is decremented by one to 23FBH and the contents of the H register are copied to memory location 23FBH\n",
+ "print ('23FBH--> contents of accumulator \\n'); \n",
+ "## stack pointer is again decremented by one to 23FAH and the contents of the L register are copied to memory location 23FAH\n",
+ "print ('23FAH--> contents of flag register \\n \\n');\n",
+ "\n",
+ "print ('To exchange the data. \\n \\n')\n",
+ "print (' POP PSW \\n'); ## sends the data in the stack back to the accumulator & flag register.\n",
+ "## the contents of the top of the stack are copied to A register and the stack pointer is incremented by one to 23FBH\n",
+ "print ('A--> contents of accumulator \\n');\n",
+ "## the contents of the current location of stack are copied to flag register and the stack pointer is again incremented by one to 23FCH.\n",
+ "print ('F--> contents of flag register \\n \\n');\n",
+ "print (' POP H \\n'); ## sends the data in the stack back to the HL register pair.\n",
+ "## the contents of the current location of the stack are copied to L register and the stack pointer is incremented by one to 23FDH\n",
+ "print ('L--> 80H \\n');\n",
+ "## the contents of the current location of stack are copied to H register and the stack pointer is again incremented by one to 23FEH.\n",
+ "print ('H--> 22H \\n \\n');\n",
+ "print (' POP B \\n'); ## sends the data in the stack back to the BC register pair.\n",
+ "## the contents of the current location of the stack are copied to C register and the stack pointer is incremented by one to 23FFH\n",
+ "print ('C--> 50H \\n');\n",
+ "## the contents of the current location of stack are copied to B register and the stack pointer is again incremented by one to 2400H.\n",
+ "print ('B--> 21H \\n');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LXI SP,2400H \n",
+ " \n",
+ "\n",
+ "LXI H,2150H \n",
+ " \n",
+ "H--> 21 L-->50 \n",
+ " \n",
+ "\n",
+ "LXI B,2280H \n",
+ " \n",
+ "B--> 22 C-->80 \n",
+ " \n",
+ "\n",
+ "PUSH H \n",
+ "\n",
+ "23FFH--> 21 \n",
+ "\n",
+ "23FEH--> 50 \n",
+ " \n",
+ "\n",
+ "PUSH B \n",
+ "\n",
+ "23FDH--> 22 \n",
+ "\n",
+ "23FCH--> 80 \n",
+ " \n",
+ "\n",
+ "PUSH PSW \n",
+ "\n",
+ "23FBH--> contents of accumulator \n",
+ "\n",
+ "23FAH--> contents of flag register \n",
+ " \n",
+ "\n",
+ "To exchange the data. \n",
+ " \n",
+ "\n",
+ " POP PSW \n",
+ "\n",
+ "A--> contents of accumulator \n",
+ "\n",
+ "F--> contents of flag register \n",
+ " \n",
+ "\n",
+ " POP H \n",
+ "\n",
+ "L--> 80H \n",
+ "\n",
+ "H--> 22H \n",
+ " \n",
+ "\n",
+ " POP B \n",
+ "\n",
+ "C--> 50H \n",
+ "\n",
+ "B--> 21H \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 9.3 - PG NO:292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## page no 292\n",
+ "## example no 9.3\n",
+ "## EXCHANGE INFORMATION BETWEEN STACK AND PROGRAM COUNTER\n",
+ "print ('After the CALL instruction \\n \\n');\n",
+ "print ('STACK MEMORY: \\n \\n');\n",
+ "print ('23FFH--> 20 \\n');\n",
+ "print ('23FEH-->43 \\n');\n",
+ "print ('Stack pointer--> 23FEH \\n');\n",
+ "print ('Program counter--> 2070H \\n \\n');\n",
+ "print ('After RET instruction \\n \\n');\n",
+ "print ('Program counter--> 2043H \\n');\n",
+ "print ('Stack pointer--> 2400H');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After the CALL instruction \n",
+ " \n",
+ "\n",
+ "STACK MEMORY: \n",
+ " \n",
+ "\n",
+ "23FFH--> 20 \n",
+ "\n",
+ "23FEH-->43 \n",
+ "\n",
+ "Stack pointer--> 23FEH \n",
+ "\n",
+ "Program counter--> 2070H \n",
+ " \n",
+ "\n",
+ "After RET instruction \n",
+ " \n",
+ "\n",
+ "Program counter--> 2043H \n",
+ "\n",
+ "Stack pointer--> 2400H\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering/README.txt b/Microwave_and_Radar_Engineering/README.txt index 37a02654..542f2405 100755 --- a/Microwave_and_Radar_Engineering/README.txt +++ b/Microwave_and_Radar_Engineering/README.txt @@ -1,10 +1,10 @@ -Contributed By: Sachin Naik -Course: be -College/Institute/Organization: ITSource Technologies Ltd. -Department/Designation: Telecom Engineer +Contributed By: Gude Prithvi +Course: btech +College/Institute/Organization: IIT Hyderabad +Department/Designation: ELECTRICAL ENGINEERING Book Title: Microwave and Radar Engineering Author: M. Kulkarni -Publisher: Umesh Publications -Year of publication: 2005 +Publisher: Umesh Publications, New Delhi +Year of publication: 2008 Isbn: 81-88114-00-6 -Edition: 3rd
\ No newline at end of file +Edition: 3
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering/screenshots/sachin1.png b/Microwave_and_Radar_Engineering/screenshots/001_prithvi.png Binary files differindex dd2559b4..dd2559b4 100755 --- a/Microwave_and_Radar_Engineering/screenshots/sachin1.png +++ b/Microwave_and_Radar_Engineering/screenshots/001_prithvi.png diff --git a/Microwave_and_Radar_Engineering/screenshots/sachin2.png b/Microwave_and_Radar_Engineering/screenshots/002_prithvi.png Binary files differindex 93f52d70..93f52d70 100755 --- a/Microwave_and_Radar_Engineering/screenshots/sachin2.png +++ b/Microwave_and_Radar_Engineering/screenshots/002_prithvi.png diff --git a/Microwave_and_Radar_Engineering/screenshots/sachin3.png b/Microwave_and_Radar_Engineering/screenshots/003_prithvi.png Binary files differindex 21abafa9..21abafa9 100755 --- a/Microwave_and_Radar_Engineering/screenshots/sachin3.png +++ b/Microwave_and_Radar_Engineering/screenshots/003_prithvi.png diff --git a/Microwave_and_Radar_Engineering/screenshots/s1.png b/Microwave_and_Radar_Engineering/screenshots/s1.png Binary files differnew file mode 100755 index 00000000..ff57dabd --- /dev/null +++ b/Microwave_and_Radar_Engineering/screenshots/s1.png diff --git a/Microwave_and_Radar_Engineering/screenshots/s2.png b/Microwave_and_Radar_Engineering/screenshots/s2.png Binary files differnew file mode 100755 index 00000000..10277f48 --- /dev/null +++ b/Microwave_and_Radar_Engineering/screenshots/s2.png diff --git a/Microwave_and_Radar_Engineering/screenshots/s3.png b/Microwave_and_Radar_Engineering/screenshots/s3.png Binary files differnew file mode 100755 index 00000000..04df6b0e --- /dev/null +++ b/Microwave_and_Radar_Engineering/screenshots/s3.png diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter03.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter03.ipynb new file mode 100755 index 00000000..5e391149 --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter03.ipynb @@ -0,0 +1,536 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4bd6c8c288e718d72cee337cd9fe483874c85b5eb4a00b0ee5d5f593b823861e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter03: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": 1
+ },
+ {
+ "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": 2
+ },
+ {
+ "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": 3
+ },
+ {
+ "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.413 A\n",
+ "Power delivered to the load is 48.47 W\n",
+ "Current flowing through the load is 0.696 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "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": 5
+ },
+ {
+ "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": 6
+ },
+ {
+ "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": 7
+ },
+ {
+ "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": 8
+ },
+ {
+ "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": 9
+ },
+ {
+ "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": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter04.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter04.ipynb new file mode 100755 index 00000000..eabf105e --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter04.ipynb @@ -0,0 +1,1255 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:90a8210af9bbd341fd0161ae92317cb94b49dff94f57602b89ee58a96a935fea"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter04:Microwave Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1, Page number 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Inductance per unit lengths,Capacitance per unit lengths,Characteristic Impedance ,Velocity of propagation\n",
+ "#chapter-4 page 141 example 4.1\n",
+ "import math\n",
+ "\n",
+ "d=0.0049;#Diameter of inner conductor in met \n",
+ "D=0.0110;#Inner Diameter of outer conductor in met\n",
+ "er=2.3;#Polyethylene dielectric\n",
+ "c=3.*10.**8.;#Velocity of Light in m/sec\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "x=math.log(D/d);\n",
+ "L=(2.*10.**(-1.)*x);#Inductance per unit lengths in microH/m\n",
+ "C=(55.56*(er/x));#The Capacitance per unit lengths in picoF/m\n",
+ "R0=(x*(60./math.sqrt(er)));#The Characteristic Impedance in ohms\n",
+ "V=(c/math.sqrt(er))/(10.**8.);#The Velocity of propagation in Km/s\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.2f %s %s %.2f %s %s %.2f %s %s %.3f %s' %('\\nInductance per unit lengths is L=',L,'microH/m' ,'\\nThe Capacitance per unit lengths is C=',C,'picoF/m' ,'\\nThe Characteristic Impedance is R0=',R0,'ohms','\\nThe Velocity of propagation is V=',V,'*10**8 m/s');"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Inductance per unit lengths is L= 0.16 microH/m \n",
+ "The Capacitance per unit lengths is C= 158.02 picoF/m \n",
+ "The Characteristic Impedance is R0= 31.99 ohms \n",
+ "The Velocity of propagation is V= 1.978 *10**8 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2, Page number 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Attenuation Constant,Phase Constant ,Phase Velocity,Relative Permittivit,Power Loss\n",
+ "#chapter-4 page 142 example 4.2\n",
+ "import math\n",
+ "R=0.05##Resistance in ohm/m\n",
+ "L=0.16173*10.**(-6.)##Inductance per unit lengths in H/m\n",
+ "C=0.15802*10.**(-6.)##The Capacitance per unit lengths in F/m\n",
+ "V=197814.14##The Velocity of propagation in Km/s\n",
+ "l=50.##Length of Coaxial Line in met\n",
+ "Pin=480.##Input Power to the System in watts\n",
+ "f=3.*10.**9.##Frequency in Hz\n",
+ "c=3.*10.**5.##Velocity of Light in Km/sec\n",
+ "e0=8.854*10.**(-12.)##Permittivity in free space in F/m\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Z0=math.sqrt(L/C)#\n",
+ "A=(R/(2.*Z0))##Attenuation Constant in NP/m\n",
+ "w=(2.*(math.pi)*f)##Angular Frequency in rad/sec\n",
+ "B=(w*math.sqrt(L*C))##Phase Constant in rad/m\n",
+ "Vp=(1./math.sqrt(L*C))/(10.**3.)##Phase Velocity in Km/s\n",
+ "er=(((c/V)**2.)/e0)##Relative Permittivity\n",
+ "Pl=(2.*Pin*l)##Power Loss in watts\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.3f %s %s %.2f %s %s %.f %s %s %.f %s %.f %s ' %('\\nAttenuation Constant is A=',A,'NP/m','\\nPhase Constant is B=',B,'rad/m','\\nPhase Velocity is Vp=',Vp,'Km/s','\\nRelative Permittivity is er=',er,'\\nPower Loss is Pl=',Pl,'watts')#"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Attenuation Constant is A= 0.025 NP/m \n",
+ "Phase Constant is B= 3013.37 rad/m \n",
+ "Phase Velocity is Vp= 6255 Km/s \n",
+ "Relative Permittivity is er= 259769600965 \n",
+ "Power Loss is Pl= 48000 watts \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3, Page number 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-4 page 142 example 4.3\n",
+ "#For an air filled coaxial cable\n",
+ "import math\n",
+ "f=9.375*10.**9.##operating frequency in Hz\n",
+ "c=3.*10.**10.##Velocity of Light in cm/sec\n",
+ "print '%s' %('Assuming a ratio of (b/a)=2.3 and (b+a)<(w/pi) to exclude higher order modes and a dominant mode propagating')#\n",
+ "a=0.36432##length of coaxial cable in cm\n",
+ "x=2.3##ratio of b/a\n",
+ " \n",
+ "#CALCULATION\n",
+ "w0=(c/f)##free space wavelength in cm\n",
+ "Pbd=(3600.*(a**2.)*math.log(x))##Breakdown power of a coaxial cable in kW\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.f %s' %('\\nBreakdown power of a coaxial cable is Pbd=',Pbd,'kW')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming a ratio of (b/a)=2.3 and (b+a)<(w/pi) to exclude higher order modes and a dominant mode propagating\n",
+ "\n",
+ "Breakdown power of a coaxial cable is Pbd= 398 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4, Page number 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Characteristic Impedance, Velocity of propagation\n",
+ "#chapter-4 page 142 example 4.4\n",
+ "import math\n",
+ "b=0.3175##Distance between ground planes of strip line in cm\n",
+ "d=0.0539##Diameter of circular conductor in cm\n",
+ "er=2.32##Dielectric Constant \n",
+ "c=3.*10.**8.##Velocity of Light in m/sec\n",
+ "\n",
+ "#CALCULATION\n",
+ "Z0=((60./math.sqrt(er))*math.log((4.*b)/(d*(math.pi))))##Characteristic Impedance in ohms\n",
+ "V=(c/math.sqrt(er))/(10.**8.)##The Velocity of propagation in Km/s\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.2f %s %s %.2f %s' %('Characteristic Impedance is Z0=',Z0,'ohms','\\nThe Velocity of propagation is V =',V,'*10**8 m/s')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Characteristic Impedance is Z0= 79.37 ohms \n",
+ "The Velocity of propagation is V = 1.97 *10**8 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5, Page number 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-4 page 143 example 4.5\n",
+ "import math\n",
+ "#For a microstrip transmission line \n",
+ "er=9.7##relative dielectric constant of an alumina substrate \n",
+ "x1=0.5##w/h ratio in first transmission line \n",
+ "x2=5##w/h ratio in second transmission line \n",
+ "c=3.*10.**8.##Velocity of Light in m/sec\n",
+ "\n",
+ "#CALCULATION\n",
+ "print '%s' %('For case1: w/h=0.5')#\n",
+ "print '%s' %('Since x1=0.5<1, for this we use high impedance analysis')#\n",
+ "Eeff1=(((er+1.)/2.)+((er-1.)/2.)*(1./((math.sqrt(1.+(12./x1)))+(0.04*(1.-x1)**2.))))##Effective dielectric constant\n",
+ "Zo1=((60./math.sqrt(Eeff1))*math.log((8./x1)+(x1/4.)))##Characteristic impedance in ohms\n",
+ "V1=(c/math.sqrt(Eeff1))/10.**8.##Velocity of propagation in 10**8 m/sec\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s ' %('\\nEffective dielectric constant is Eeff1 =',Eeff1,'\\nCharacteristic impedance is Zo1 =',Zo1,'ohms','\\nVelocity of propagation is V1 =',V1 ,'*10**8 m/sec')#\n",
+ "\n",
+ "print '%s' %('\\nFor case2: w/h=5')#\n",
+ "print '%s' %('here x2>1')#\n",
+ "Eeff2=(((er+1)/2)+((er-1)/2)*(1/(math.sqrt(1+(12/x2)))))##Effective dielectric constant\n",
+ "Zo2=((120*(math.pi)/math.sqrt(Eeff2))*(1/(x2+1.393+(0.667*math.log(1.444+x2)))))##Characteristic impedance in ohms\n",
+ "V2=(c/math.sqrt(Eeff2))/10**8##Velocity of propagation in 10**8 m/sec\n",
+ "print '%s %.2f %s %.2f %s %s %.2f %s' %('\\nEffective dielectric constant is Eeff2 =',Eeff2,'\\nCharacteristic impedance is Zo2 =',Zo2,'ohms' ,'\\nVelocity of propagation is V2 =',V2,'*10**8 m/sec')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For case1: w/h=0.5\n",
+ "Since x1=0.5<1, for this we use high impedance analysis\n",
+ "\n",
+ "Effective dielectric constant is Eeff1 = 6.22 \n",
+ "Characteristic impedance is Zo1 = 66.90 ohms \n",
+ "Velocity of propagation is V1 = 1.2 *10**8 m/sec \n",
+ "\n",
+ "For case2: w/h=5\n",
+ "here x2>1\n",
+ "\n",
+ "Effective dielectric constant is Eeff2 = 7.86 \n",
+ "Characteristic impedance is Zo2 = 17.61 ohms \n",
+ "Velocity of propagation is V2 = 1.07 *10**8 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6, Page number 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Ratio of area of circular to area of rectangular waveguide in case a and case b\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a1 = 1.70645 #for case a\n",
+ "b1 = a1/2 #for case a\n",
+ "b2 = 1.4621 #for case b\n",
+ "\n",
+ "#Calculations\n",
+ "#Case a(For TE10 mode)\n",
+ "Area_rw1 = a1*b1\n",
+ "Area_cw1 = math.pi\n",
+ "Ratio1 = Area_cw1/Area_rw1\n",
+ "\n",
+ "#Case b(For TM mode)\n",
+ "Area_rw2 = b2**2\n",
+ "Area_cw2 = math.pi\n",
+ "Ratio2 = Area_cw2/Area_rw2\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"Case a\"\n",
+ "print \"Ratio of area of circular to area of rectangular waveguide =\",round(Ratio1,1),\"\\n\"\n",
+ "print \"Case b\"\n",
+ "print \"Ratio of area of circular to area of rectangular waveguide =\",round(Ratio2,1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case a\n",
+ "Ratio of area of circular to area of rectangular waveguide = 2.2 \n",
+ "\n",
+ "Case b\n",
+ "Ratio of area of circular to area of rectangular waveguide = 1.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7, Page number 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate breadth of rectangular waveguide\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 9.*10**9 #frequency(Hz)\n",
+ "lamda_g = 4. #guide wavelength(cm)\n",
+ "c = 3.*10**10 #velocity of propagation(cm/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "lamda_c = math.sqrt((lamda_o**2)/(1-(lamda_o**2/lamda_g**2)))\n",
+ "#For TE10 mode,\n",
+ "a = lamda_c/2\n",
+ "b = lamda_c/4 #@since a=2b\n",
+ "#Results\n",
+ "print \"The breadth of rectangular waveguide is\",round(b,1),\"cms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The breadth of rectangular waveguide is 1.5 cms\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8, Page number 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate cut-off wavelength,guided wavelength,pahse velocity,group velocity\n",
+ "#Variable declaration\n",
+ "a = 10 #breadth of waveguide(cms)\n",
+ "f = 2.5*10**9 #frequency of signal(Hz)\n",
+ "c = 3*10**10 #velocity of propagation(cm/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_c = 2*a #cut-off wavelength\n",
+ "lamda_o = c/f \n",
+ "x = math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "lamda_g = (lamda_o/x) #guided wavelength\n",
+ "Vp = c/x #Phase velocity\n",
+ "Vg = c**2/Vp #Group velocity\n",
+ "\n",
+ "#Results\n",
+ "print \"The cut-off wavelength is\", round(lamda_c),\"cm\"\n",
+ "print \"The guided wavelength is\",round(lamda_g),\"cm\"\n",
+ "print \"The pahse velocity is\",round((Vp/1E+10),2),\"*10^10 cm/sec\"\n",
+ "print \"The group velocity is\",round((Vg/1E+10),2),\"*10^10 cm/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The cut-off wavelength is 20.0 cm\n",
+ "The guided wavelength is 15.0 cm\n",
+ "The pahse velocity is 3.75 *10^10 cm/sec\n",
+ "The group velocity is 2.4 *10^10 cm/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9, Page number 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-4 page 147 example 4.9\n",
+ "import math\n",
+ "\n",
+ "f=8.6*10.**9.##frequency in Hz\n",
+ "c=3.*10.**10.##Velocity of Light in cm/sec\n",
+ "a=2.5##Length of a Waveguide in cm\n",
+ "b=1.##Width of a Waveguide in cm\n",
+ "\n",
+ "#CALCULATION\n",
+ "print '%s' %('The condition for the wave to propagate along a guide is that wc>w0.')#\n",
+ "w0=c/f##free space wavelength in cm\n",
+ "print '%s %.3f' %('\\nFree space wavelength w0 in cm is =',w0)#\n",
+ "print '%s' %('\\nFor TE waves, wc=(2ab/sqrt((mb)**2+(na)**2))')#\n",
+ "print '%s ' %('For TE01 waves')#\n",
+ "m1=0#\n",
+ "n1=1.#\n",
+ "wc1=((2.*a*b)/(math.sqrt((m1*b)**2+(n1*a)**2)))##Cutoff wavelength for TE01 mode in cm\n",
+ "print '%s %.f' %('\\nCutoff wavelength for TE01 mode in cm is =',wc1)#\n",
+ "print '%s' %('\\nSince wc for TE01=2cm is not greater than w0 TE01,will not propagate for TE01 mode.')#\n",
+ "print '%s' %('For TE10 waves')#\n",
+ "m2=1.#\n",
+ "n2=0#\n",
+ "wc2=((2.*a*b)/(math.sqrt((m2*b)**2.+(n2*a)**2.)))##Cutoff wavelength for TE10 mode in cm\n",
+ "print '%s %.f' %('\\nCutoff wavelength for TE10 mode in cm is =',wc2)#\n",
+ "print '%s' %('\\nSince wc TE10 > w0 TE10 is a possible mode.')#\n",
+ "fc=(c/wc2)/10.**9.##Cutoff frequency in GHz\n",
+ "print '%s' %('\\nFor TE11 and TM11 waves')#\n",
+ "m3=1.#\n",
+ "n3=1.#\n",
+ "wc3=((2.*a*b)/(math.sqrt((m3*b)**2.+(n3*a)**2.)))##Cutoff wavelength for TE11 mode in cm\n",
+ "print '%s %.3f' %('Cutoff wavelength for TE11 and TM11 modes in cm is =',wc3)#\n",
+ "print '%s' %('\\nAs wc for TE11 and TM11 is < w0 both TE11 and TM11 do not propagate as higher modes.')#\n",
+ "wg=(w0/math.sqrt(1-(w0/wc2)**2))##Guide wavelength in cm\n",
+ "print '%s' %('\\nFrom the above analysis we conclude that only TE10 mode is possible')#\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.f %s %s %.3f %s' %('\\nCutoff frequency is fc=',fc,'GHz','\\nGuide wavelength is wg=',wg,'cm')#"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The condition for the wave to propagate along a guide is that wc>w0.\n",
+ "\n",
+ "Free space wavelength w0 in cm is = 3.488\n",
+ "\n",
+ "For TE waves, wc=(2ab/sqrt((mb)**2+(na)**2))\n",
+ "For TE01 waves \n",
+ "\n",
+ "Cutoff wavelength for TE01 mode in cm is = 2\n",
+ "\n",
+ "Since wc for TE01=2cm is not greater than w0 TE01,will not propagate for TE01 mode.\n",
+ "For TE10 waves\n",
+ "\n",
+ "Cutoff wavelength for TE10 mode in cm is = 5\n",
+ "\n",
+ "Since wc TE10 > w0 TE10 is a possible mode.\n",
+ "\n",
+ "For TE11 and TM11 waves\n",
+ "Cutoff wavelength for TE11 and TM11 modes in cm is = 1.857\n",
+ "\n",
+ "As wc for TE11 and TM11 is < w0 both TE11 and TM11 do not propagate as higher modes.\n",
+ "\n",
+ "From the above analysis we conclude that only TE10 mode is possible\n",
+ "\n",
+ "Cutoff frequency is fc= 6 GHz \n",
+ "Guide wavelength is wg= 4.869 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.10, Page number 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate required cross sectional area\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda_c = 10 #cut-off wavelength(cms)\n",
+ "c = 3*10**10 #velocity of propagation\n",
+ "\n",
+ "#Calculations\n",
+ "#For TE11 mode in a circular waveguide,\n",
+ "r = (lamda_c*1.841)/(2*math.pi) #radius of circular waveguide(cms)\n",
+ "a = math.pi*r**2 #area of circular waveguide\n",
+ "fc = c/lamda_c #cut-off frequency(Hz)\n",
+ "\n",
+ "#Results\n",
+ "print \"The required cross sectional area is\", round(a,2),\"cms^2\"\n",
+ "print \"Frequencies above\",round((fc/1E+9),2),\"GHz can be propagated throught the waveguide\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required cross sectional area is 26.97 cms^2\n",
+ "Frequencies above 3.0 GHz can be propagated throught the waveguide\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.11, Page number 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-4 page 149 example 4.11\n",
+ "#For a rectangular waveguide\n",
+ "import math\n",
+ "f=5.*10.**9.##frequency in Hz\n",
+ "c=3.*10.**10.##Velocity of Light in cm/sec\n",
+ "a=4.##Length of Rectangular Waveguide in cm\n",
+ "b=3.##Width of Rectangular Waveguide in cm\n",
+ "\n",
+ "#CALCULATION\n",
+ "print '%s' %('The condition for the wave to propagate along a guide is that wc>w0.')#\n",
+ "w0=c/f##free space wavelength in cm\n",
+ "print '%s %.2f' %('Free space wavelength w0 in cm is =',w0)#\n",
+ "print '%s' %('\\nFor TE waves, wc=(2ab/sqrt((mb)**2+(na)**2))')#\n",
+ "print '%s' %('For TE01 waves')#\n",
+ "m1=0#\n",
+ "n1=1.#\n",
+ "wc1=((2.*a*b)/(math.sqrt((m1*b)**2.+(n1*a)**2.)))##Cutoff wavelength for TE01 mode in cm\n",
+ "print '%s %.f' %('\\nCutoff wavelength for TE01 mode in cm is =',wc1)#\n",
+ "print '%s' %('\\nSince wc for TE01=6cm is not greater than w0 TE01,will not propagate for TE01 mode.')#\n",
+ "print '%s' %('For TE10 waves')#\n",
+ "m2=1.#\n",
+ "n2=0#\n",
+ "wc2=((2.*a*b)/(math.sqrt((m2*b)**2.+(n2*a)**2.)))##Cutoff wavelength for TE10 mode in cm\n",
+ "print '%s %.f' %('\\nCutoff wavelength for TE10 mode in cm is =',wc2)#\n",
+ "print '%s' %('\\nSince wc TE10 > w0 TE10 is a possible mode.')#\n",
+ "print '%s' %('For TE11 waves')#\n",
+ "m3=1.#\n",
+ "n3=1.#\n",
+ "wc3=((2.*a*b)/(math.sqrt((m3*b)**2.+(n3*a)**2.)))##Cutoff wavelength for TE11 mode in cm\n",
+ "print '%s %.1f' %('\\nCutoff wavelength for TE11 mode in cm is =',wc3)#\n",
+ "print '%s' %('\\nAs wc TE11 < w0 TE11 does not propagate.')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The condition for the wave to propagate along a guide is that wc>w0.\n",
+ "Free space wavelength w0 in cm is = 6.00\n",
+ "\n",
+ "For TE waves, wc=(2ab/sqrt((mb)**2+(na)**2))\n",
+ "For TE01 waves\n",
+ "\n",
+ "Cutoff wavelength for TE01 mode in cm is = 6\n",
+ "\n",
+ "Since wc for TE01=6cm is not greater than w0 TE01,will not propagate for TE01 mode.\n",
+ "For TE10 waves\n",
+ "\n",
+ "Cutoff wavelength for TE10 mode in cm is = 8\n",
+ "\n",
+ "Since wc TE10 > w0 TE10 is a possible mode.\n",
+ "For TE11 waves\n",
+ "\n",
+ "Cutoff wavelength for TE11 mode in cm is = 4.8\n",
+ "\n",
+ "As wc TE11 < w0 TE11 does not propagate.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.12, Page number 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Cut-off wavelength,Cut-off wavelength,Guide wavelength\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 4 #inner diameter of circular waveguide(cms)\n",
+ "c = 3*10**10 #velocity od propagation(m/s)\n",
+ "fs = 5*10**9 #signal frequency(Hz)\n",
+ "\n",
+ "#Calculations\n",
+ "r = d/2 #radius(cms)\n",
+ "lamda_c = (2*math.pi*r)/1.841\n",
+ "fc = c/lamda_c\n",
+ "lamda_o = c/fs\n",
+ "lamda_g = lamda_o/math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "\n",
+ "#Results\n",
+ "print \"Cut-off wavelength =\",round(lamda_c,4),\"cms\"\n",
+ "print \"Cut-off frequency =\",round((fc/1E+9),3),\"GHz\"\n",
+ "print \"Guide wavelength =\",round(lamda_g,2),\"cms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cut-off wavelength = 6.8258 cms\n",
+ "Cut-off frequency = 4.395 GHz\n",
+ "Guide wavelength = 12.58 cms\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.13, Page number 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Frequency of wave\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 6. #length of rectangular waveguide(cms)\n",
+ "b = 4. #breadth of rectangular waveguide(cms)\n",
+ "d = 4.55 #distance between maximum and minimum(cms)\n",
+ "c = 3.*10**10 #velocity of propagation(cm/s)\n",
+ "\n",
+ "#Calculations\n",
+ "#For TE10 mode:\n",
+ "lamda_c = 2*a\n",
+ "lamda_g = d*4\n",
+ "lamda_o = math.sqrt(1./(((1./lamda_g**2)+(1./lamda_c**2))))\n",
+ "f = c/lamda_o\n",
+ "\n",
+ "#Results\n",
+ "print \"Frequency of wave is\",round((f/1E+9)),\"GHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of wave is 3.0 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.14, Page number 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Guide wavelength,Phase constant,Phase velocity \n",
+ "#chapter-4 page 151 example 4.14\n",
+ "#For a rectangular waveguide\n",
+ "import math\n",
+ "b=2.5##Length of Rectangular Waveguide in cm\n",
+ "a=5.##breadth of Rectangular Waveguide in cm\n",
+ "c=3.*10.**10.##Velocity of Light in cm/sec\n",
+ "w0=4.5##Free space wavelength in cm\n",
+ "\n",
+ "#CALCULATION\n",
+ "print '%s' %('For a TE10 mode which is the dominant mode')#\n",
+ "wc=2.*a##Cutoff wavelength in cm\n",
+ "wg=(w0/math.sqrt(1.-(w0/wc)**2.))##Guide wavelength in cm\n",
+ "Vp=(c/math.sqrt(1.-(w0/wc)**2.))/10.**10.##Phase Velocity in 10**10 cm/sec\n",
+ "B=((2.*(math.pi)*math.sqrt(wc**2.-w0**2.))/(w0*wc))##Phase constant in radians\n",
+ "\n",
+ "#OUTPUT\n",
+ "print \"Solutions obtained in the textbook are incorrect due to calculation mistake in lamda_g\"\n",
+ "print '%s %1.5f %s %s %1.3f %s %s %1.2f %s ' %('\\nGuide wavelength is wg =',wg,'cm','\\nPhase constant is B =',B,'radians','\\nPhase Velocity is Vp =',Vp,'*10**10 cm/sec')#\n",
+ "\n",
+ "#Note: Check the answers once\n",
+ "#Correct answers are\n",
+ "#Guide wavelength is wg = 5.03903 cm \n",
+ "#Phase constant is B = 1.247 radians \n",
+ "#Phase Velocity is Vp = 3.36*10**10 cm/sec"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For a TE10 mode which is the dominant mode\n",
+ "Solutions obtained in the textbook are incorrect due to calculation mistake in lamda_g\n",
+ "\n",
+ "Guide wavelength is wg = 5.03903 cm \n",
+ "Phase constant is B = 1.247 radians \n",
+ "Phase Velocity is Vp = 3.36 *10**10 cm/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.15, Page number 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate For any wave to be propagated, the condition to be met is wc>wo\n",
+ "#chapter-4 page 152 example 4.15\n",
+ "wcTE10=16.##Critical wavelength of TE10 mode in cm\n",
+ "wcTM11=7.16##Critical wavelength of TM11 mode in cm\n",
+ "wcTM21=5.6##Critical wavelength of TM21 mode in cm\n",
+ "print '%s' %('For any wave to be propagated, the condition to be met is wc>wo')#\n",
+ "wo1=10.##Free space wavelength in cm\n",
+ "wo2=5.##Free space wavelength in cm\n",
+ "print '%s %.2f' %('Critical wavelength of TE10 mode in cm is =',wcTE10)#\n",
+ "print '%s %.2f' %('Critical wavelength of TM11 mode in cm is =',wcTM11)#\n",
+ "print '%s %.2f' %('Critical wavelength of TM21 mode in cm is =',wcTM21)#\n",
+ "print '%s' %('\\nFor wo1=10cm,\\nThe mode that propagates only TE10. Because wcTE10>wo1 and all other modes that is TM11 TM21 donot propagate')#\n",
+ "print '%s' %('\\nFor wo2=5cm')#\n",
+ "print '%s' %('wcTE10>wo2, so TE10 mode propagates')#\n",
+ "print '%s' %('wcTM11>wo2, so TE11 mode propagates')#\n",
+ "print '%s' %('wcTE21>wo2, so TE21 mode propagates')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For any wave to be propagated, the condition to be met is wc>wo\n",
+ "Critical wavelength of TE10 mode in cm is = 16.00\n",
+ "Critical wavelength of TM11 mode in cm is = 7.16\n",
+ "Critical wavelength of TM21 mode in cm is = 5.60\n",
+ "\n",
+ "For wo1=10cm,\n",
+ "The mode that propagates only TE10. Because wcTE10>wo1 and all other modes that is TM11 TM21 donot propagate\n",
+ "\n",
+ "For wo2=5cm\n",
+ "wcTE10>wo2, so TE10 mode propagates\n",
+ "wcTM11>wo2, so TE11 mode propagates\n",
+ "wcTE21>wo2, so TE21 mode propagates\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.16, Page number 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Characteristic Wave Impedance\n",
+ "#chapter-4 page 152 example 4.16\n",
+ "import math\n",
+ "n=120.*(math.pi)##Intrinsic Impedance\n",
+ "a=3.##Length of Rectangular Waveguide in cm\n",
+ "b=2.##Width of Rectangular Waveguide in cm\n",
+ "f=10.**10.##Frequency in Hz\n",
+ "c=3.*10.**10.##Velocity of Light in cm/sec\n",
+ "\n",
+ "#CALCULATION\n",
+ "wc=((2.*a*b)/math.sqrt(a**2.+b**2.))##Cutoff wavelength in TM11 mode in cms\n",
+ "w0=(c/f)##Free space wavelength in cms\n",
+ "ZTM=(n*math.sqrt(1.-(w0/wc)**2.))##Characteristic Wave Impedance in ohms\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.3f %s ' %('\\nCharacteristic Wave Impedance is ZTM=',ZTM,'ohms')#\n",
+ "\n",
+ "#Note: Check the given answer once it is wrong\n",
+ "#correct answer is 163.242 ohms"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Characteristic Wave Impedance is ZTM= 163.242 ohms \n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.17, Page number 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate diameter of waveguide,guide wavelength\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 6.*10**9 #frequency(Hz)\n",
+ "c = 3.*10**10 #velocity of propagation(cm/s)\n",
+ "\n",
+ "#Calculations\n",
+ "fc = 0.8*f\n",
+ "lamda_c = c/fc\n",
+ "D = (lamda_c*1.841)/math.pi\n",
+ "lamda_o = c/f\n",
+ "lamda_g = lamda_o/(math.sqrt(1-((lamda_o/lamda_c)**2)))\n",
+ "\n",
+ "#Results\n",
+ "print \"diameter of waveguide =\",round(D,4),\"cms\"\n",
+ "print \"guide wavelength =\",round(lamda_g,3),\"cms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diameter of waveguide = 3.6626 cms\n",
+ "guide wavelength = 8.333 cms\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.18, Page number 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-4 page 153 example 4.18\n",
+ "#For a TE10 mode\n",
+ "import math\n",
+ "a=1.5##Length of an air filled square Waveguide in m\n",
+ "b=1.##breadth of an air filled square Waveguide in cm\n",
+ "c=3.*10.**10.##Velocity of Light in cm/sec\n",
+ "f=6.*10.**9.##Impressed Frequency in Hz\n",
+ "er=4.##dielectric constant\n",
+ "\n",
+ "#CALCULATION\n",
+ "wc=2.*a##Cutoff wavelength in cm\n",
+ "fc=(c/wc)/10.**9.##Cutoff frequency in GHz\n",
+ "print '%s %.2f' %('Cutoff frequency in GHz is =',fc)#\n",
+ "\n",
+ "\n",
+ "print '%s' %('\\nThe impressed frequency of 6 GHz is less than the Cutoff frequency and hence the signal will not pass through the guide')#\n",
+ "w=(c/f)##Wavelength in cm\n",
+ "print '%s %.2f' %('\\nAlternatively, the wavelength of the impressed signal in cm is =',w)#\n",
+ "wair=w#\n",
+ "print '%s' %('\\nwhich is longer than the cutoff wavelength (3cm) and hence no propagation of the wave')#\n",
+ "w1=wair/math.sqrt(er)##Wavelength in cm\n",
+ "print '%s' %('If the waveguide is loaded with dielectric of er=4')#\n",
+ "print '%s %.2f' %('\\nthen the wavelength in cm is =',w1)\n",
+ "print '%s' %('\\nwhich is lessthan wair')#\n",
+ "print '%s' %('Now the signal with 6 GHz frequency will pass through the dielectric loaded waveguide')#"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cutoff frequency in GHz is = 10.00\n",
+ "\n",
+ "The impressed frequency of 6 GHz is less than the Cutoff frequency and hence the signal will not pass through the guide\n",
+ "\n",
+ "Alternatively, the wavelength of the impressed signal in cm is = 5.00\n",
+ "\n",
+ "which is longer than the cutoff wavelength (3cm) and hence no propagation of the wave\n",
+ "If the waveguide is loaded with dielectric of er=4\n",
+ "\n",
+ "then the wavelength in cm is = 2.50\n",
+ "\n",
+ "which is lessthan wair\n",
+ "Now the signal with 6 GHz frequency will pass through the dielectric loaded waveguide\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.19, Page number 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate amount of attenuation\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 1.5*10**-2 #length of rectangular waveguide(m)\n",
+ "b = 1 #breadth of rectangular waveguide(cms)\n",
+ "f = 6*10**9 #frequency(Hz)\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "m = 1\n",
+ "n = 0\n",
+ "mu = 4*math.pi*10**-7\n",
+ "e = 8.854*10**-12\n",
+ "\n",
+ "#Calculations\n",
+ "#For dominant TE10 mode,\n",
+ "lamda_c = 2*a\n",
+ "fc = c/lamda_c\n",
+ "w = 2*math.pi*f\n",
+ "alpha = math.sqrt((((m*math.pi)/a)**2)+(((n*math.pi)/b)**2)- ((w**2)*mu*e))\n",
+ "\n",
+ "#Results\n",
+ "print \"The amount of attenuation is\",round(alpha,1),\"nepass/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of attenuation is 167.5 nepass/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.20, Page number 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate The maximum power handling capacity of the waveguide\n",
+ "#chapter-4 page 154 example 4.20\n",
+ "import math\n",
+ "a=3.##Length of Rectangular Waveguide in cm\n",
+ "b=1.##Width of Rectangular Waveguide in cm\n",
+ "f=9.*10.**9.##Frequency in Hz in TE10 mode\n",
+ "c=3.*10.**10.##Velocity of Light in cm/sec\n",
+ "Emax=3000.##Max potential gradient in V/cm\n",
+ "\n",
+ "#CALCULATION\n",
+ "w0=(c/f)##Free space wavelength in cms\n",
+ "print '%s %.2f' %('Free space Wavelength in cm is =',w0)#\n",
+ "wc=2.*a##Cutoff wavelength in TE10 mode in cms\n",
+ "wg=(w0/math.sqrt(1.-(w0/wc)**2.))##Guide wavelength in cms\n",
+ "print '%s %.2f' %('Guide Wavelength in cm is =',wg)#\n",
+ "P=((6.63*10.**(-4.))*(Emax**2.)*a*b*(w0/wg))/1000.##Power handling capability of the waveguide in kW\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s'%('\\nSolution obtained in the textbook is incorrect due to rounding off the actual value of lamda_g')\n",
+ "print '%s %3.3f %s' %('\\nPower handling capability of the waveguide is P=',P,'kW')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Free space Wavelength in cm is = 3.33\n",
+ "Guide Wavelength in cm is = 4.01\n",
+ "\n",
+ "Solution obtained in the textbook is incorrect due to rounding off the actual value of lamda_g\n",
+ "\n",
+ "Power handling capability of the waveguide is P= 14.884 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.21, Page number 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Maximum power\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 9*10**9 #frequency(Hz)\n",
+ "d = 5 #internal diameter(cms)\n",
+ "Emax = 300 #maximum field strength(V/cm)\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "#For domnant mode TE11,\n",
+ "lamda_c = (math.pi*d)/1.841\n",
+ "lamda_g = lamda_o/math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "Pmax = 0.490*(Emax**2)*(d**2)*(lamda_o/lamda_g)\n",
+ "\n",
+ "#Results\n",
+ "print \"Maximum power =\",round((Pmax/1E+6),3),\"*10^6 W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum power = 1.032 *10^6 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.22, Page number 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-4 page 155 example 4.22\n",
+ "#calculate The Peak value of Electric field occuring in the guide\n",
+ "#For an air filled square waveguide\n",
+ "import math\n",
+ "a=0.01##Length of an air filled square Waveguide in m\n",
+ "b=0.01##breadth of an air filled square Waveguide in m\n",
+ "c=3.*10.**8.##Velocity of Light in m/sec\n",
+ "f=30.*10.**9.##Frequency in Hz in TE11 mode\n",
+ "Pmax=746.##Max power =1 horsepower in W\n",
+ "n=120.*(math.pi)##Impedance of freespace in ohms\n",
+ "\n",
+ "#CALCULATION\n",
+ "w0=(c/f)##Free space wavelength in m\n",
+ "wc=2.*a##Cutoff wavelength in m\n",
+ "ZTE=(n/math.sqrt(1.-(w0/wc)**2.))##Impedance in ohms\n",
+ "Emax=(math.sqrt((Pmax*4*ZTE)/(a*b)))/1000.##The Peak value of Electric field occuring in the guide in kV/m\n",
+ "#From P=(1/2)*Integration(Re(E*H))da\n",
+ "#and Pmax=(1/(4*ZTE))*Emax**2*a*b\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.2f %s' %('\\nThe Peak value of Electric field occuring in the guide is Emax=',Emax,'kV/m')#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The Peak value of Electric field occuring in the guide is Emax= 113.97 kV/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.23, Page number 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Breakdown power\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 2.3 #length of rectangular waveguide(cms)\n",
+ "b = 1.0 #breadth of rectangular waveguide(cms)\n",
+ "f = 9.375*10**9 #frequency(Hz)\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "x = (1-((lamda_o/(2*a))**2))**0.5\n",
+ "Pbd = 597*a*b*x\n",
+ "\n",
+ "#Results\n",
+ "print \"calculation error\"\n",
+ "print \"\\nBreakdown power =\",round(Pbd,2),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "calculation error\n",
+ "\n",
+ "Breakdown power = 986.41 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.24, Page number 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Breakdown power\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 5. #internal diameter(cms)\n",
+ "a = d/2\n",
+ "f = 9.*10**9 #frequency(Hz)\n",
+ "c = 3.*10**10 #velocity of propagation\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "lamda_c = (math.pi*d)/1.841\n",
+ "fc = c/lamda_c\n",
+ "x = (1 - ((fc/f)**2))**0.5\n",
+ "Pbd = 1790.*a*a*x\n",
+ "\n",
+ "#Results\n",
+ "print \"Breakdown power =\",round((Pbd/1E+3),3),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Breakdown power = 10.298 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter05.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter05.ipynb new file mode 100755 index 00000000..0c7ab714 --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter05.ipynb @@ -0,0 +1,193 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:da3f0d89152a41cee5e69bb72810cbf709f6002aabb5d20615441a6c713ff653"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter05:Cavity Resonators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1, Page number 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate minimum distance between two plates\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 3 #radius of circular waveguide(cm)\n",
+ "fo = 10*10**9 #frequency for TM011 mode(Hz)\n",
+ "P01 = 2.405\n",
+ "c = 3*10**10 #velocity of proapagation(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "d = math.sqrt((math.pi**2)/(((4*math.pi**2)/9)-((P01/a)**2)))\n",
+ "\n",
+ "#Result\n",
+ "print \"The minimum distance between two plates is\",round(d,2),\"cms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum distance between two plates is 1.62 cms\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2, Page number 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate lowest resonating frequency of a circular resonator\n",
+ "a = 2.\n",
+ "b = 1.\n",
+ "d = 3.\n",
+ "#For dominant mode TE101,\n",
+ "m = 1.\n",
+ "n = 0\n",
+ "p = 1.\n",
+ "\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "fo = (c/2)*(((m/a)**2+(n/b)**2+(p/d)**2))**0.5\n",
+ "\n",
+ "#Result\n",
+ "print \"The lowest resonating frequency of a rectangular cavity resonator is\",round((fo/1E+9)),\"Ghz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The lowest resonating frequency of a rectangular cavity resonator is 9.0 Ghz\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3, Page number 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate resonating frequency of a circular resonator\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 12.5 #diameter of resonator(cm)\n",
+ "d = 5 #length of resonator(cm)\n",
+ "P01 = 2.405 #dominant mode TM01\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#For TM012 mode,\n",
+ "m = 1\n",
+ "n = 0\n",
+ "p = 2\n",
+ "\n",
+ "#Calculation\n",
+ "a = D/2\n",
+ "fo = (c/(2*math.pi))*((P01/a)**2+((p*math.pi)/d)**2)**0.5\n",
+ "\n",
+ "#Result\n",
+ "print \"The resonanat frequency of a circular resonator is\",round((fo/1E+9),2),\"GHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resonanat frequency of a circular resonator is 6.27 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4, Page number 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate lowest resonating frequency of a circular resonator\n",
+ "a = 3.\n",
+ "b = 2.\n",
+ "d = 4.\n",
+ "#For dominant mode TE101,\n",
+ "m = 1.\n",
+ "n = 0\n",
+ "p = 1.\n",
+ "\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "fo = (c/2)*(((m/a)**2+(n/b)**2+(p/d)**2))**0.5\n",
+ "\n",
+ "#Result\n",
+ "print \"The lowest resonating frequency of a circular resonator is\",round((fo/1E+9),2),\"Ghz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The lowest resonating frequency of a circular resonator is 6.25 Ghz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter06.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter06.ipynb new file mode 100755 index 00000000..ee74a6cb --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter06.ipynb @@ -0,0 +1,479 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4e82c096f59276d07f565f054e36b76b972f48192010c629f646cb460b6d633f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "chapter06:Microwave components" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2, Page number 234" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Chapter-6, Example 6.2, Page 234\n", + "#=============================================================================\n", + "#Input parameters\n", + "#[s]=[0,(0.3+(%i)*(0.4));(0.3+(%i)*(0.4)),0];#scattering matrix of a two port\n", + "#Calculations\n", + "#to find l such that S12 and S21 will be real when port1 is shifted lm to the left\n", + "#let port 1 be shifted by phi1 degree to the left and port2 position be remained unchanged i.e.,phi2=delta\n", + "#Then [phi]=[e**-(j*phi1),0;0,1]\n", + "#[S']=[phi]*[s]*[phi]\n", + "#for S12 and S21 to be real\n", + "import math\n", + "phi1=53.13;#in degrees\n", + "phi1=phi1*(math.pi/180);#phi in radians\n", + "b=34.3;#measured in rad/m\n", + "l=(phi1)/b;#distance of shift in m\n", + "#Output\n", + "print \"distance that the position of part1 should be shifted to the left so that S21 and S12 will be real numbers is (m) = \",round(l,3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "distance that the position of part1 should be shifted to the left so that S21 and S12 will be real numbers is (m) = 0.027\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3, Page number 236" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Chapter-6, Example 6.3, Page 236\n", + "#=============================================================================\n", + "import math\n", + "import numpy\n", + "from math import sqrt\n", + "#Input parameters\n", + "D=30.;#directivity in dB\n", + "VSWR=1.;#VSWR at each port under matched conditions\n", + "C=10.;#coupling factor\n", + "#Calculations\n", + "S41=sqrt(0.1);\n", + "S14=S41;#under matched and lossless conditions\n", + "S31=sqrt(((S41)**2)/(10)**(D/10));\n", + "S13=S31;\n", + "S11=(VSWR-1)/(VSWR+1);\n", + "S22=S11;\n", + "S33=S22;\n", + "S44=S33;\n", + "#let input power is given at port1 \n", + "#p1=p2+P3+p4\n", + "S21=sqrt(1-(S41)**2-(S31)**2);\n", + "S12=S21;\n", + "S34=sqrt((0.5)*(1+(S12)**2-0.1-0.0001));\n", + "S43=S34\n", + "S23=sqrt(1-10**-4-(S34)**2)\n", + "S32=S23;\n", + "S24=sqrt(1-0.1-(S34)**2)\n", + "S42=S24;\n", + "S=numpy.matrix([[S11,S12,S13,S14],[S21,S22,S23,S24],[S31,S32,S33,S34],[S41,S42,S43,S44]]);\n", + "#Output\n", + "print \"The scattering matrix is\"\n", + "print S\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The scattering matrix is\n", + "[[ 0. 0.94863059 0.01 0.31622777]\n", + " [ 0.94863059 0. 0.31622777 0.01 ]\n", + " [ 0.01 0.31622777 0. 0.94863059]\n", + " [ 0.31622777 0.01 0.94863059 0. ]]\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4, Page number 238" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Chapter-6, Example 6.4, Page 238\n", + "#=============================================================================\n", + "import numpy\n", + "#Input parameters\n", + "a1=32*10**-3;#power in watts\n", + "a2=0;\n", + "a3=0;\n", + "#Calculations\n", + "S=numpy.array([[0.5,-0.5,0.707],[-0.5,0.5,0.707],[0.707,0.707,0]]);#S-matrix for H-plane tee\n", + "X=numpy.array([[a1,0,0],[0,0,0],[0,0,0]]);\n", + "#[B]=[b1,b2,b3]\n", + "B =S*X\n", + "b1=(0.5)**2*a1;#power at port 1\n", + "b2=(-0.5)**2*a1;#power at port 2\n", + "b3=(0.707)**2*a1;#power at port 3\n", + "#Output\n", + "print \"Thus b1,b2,b3 are\",b1,\"W,\",b2,\"W,\",round(b3,5),\"W respectively\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thus b1,b2,b3 are 0.008 W, 0.008 W, 0.016 W respectively\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5, Page number 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Chapter-6, Example 6.5, Page 239\n", + "#=============================================================================\n", + "\n", + "#Input parameters\n", + "S=([[0.5,-0.5,0.707],[-0.5,0.5,0.707],[0.707,0.707,0]]);\n", + "R1=60.;#load at port1 in ohms\n", + "R2=75.;#load at port2 in ohms\n", + "R3=50.;#characteristic impedance in ohms\n", + "P3=20*10**-3;#power at port 3 in Watts\n", + "#calculations\n", + "p1=(R1-R3)/(R1+R3);\n", + "p2=(R2-R3)/(R2+R3);\n", + "P1=0.5*P3*(1-(p1)**2);#power delivered to the port1 in Watts\n", + "P2=0.5*P3*(1-(p2)**2);#power delivered to the port2 in Watts\n", + "#Output\n", + "print \"Thus power delivered to the port1 and port2 are\",round(P1,5), \"W,\",P2,\" W respectively\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thus power delivered to the port1 and port2 are 0.00992 W, 0.0096 W respectively\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7, Page number 240" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Calculate\n", + "from numpy import array\n", + "\n", + "#Variable declaration\n", + "Il=0.5 #inserion loss(dB)\n", + "Is = 30 #isolation loss(dB)\n", + "\n", + "#Calculations\n", + "#Il = -20log(S21)\n", + "S21 = 10**(-Il/20)\n", + "#Is = -20log(S12)\n", + "S12 = 10**(-Is/20)\n", + "#Perfectly matched ports\n", + "S11=0\n", + "S22=0\n", + "\n", + "S = array([[S11,S12],[S21,S22]])\n", + "\n", + "#Result\n", + "print \"The scattering matrix is:\\n\",S\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The scattering matrix is:\n", + "[[ 0. 0.01 ]\n", + " [ 0.94406088 0. ]]\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9, Page number 241" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Chapter-6, Example 6.9, Page 241\n", + "#=============================================================================\n", + "\n", + "#Input parameters\n", + "ins=0.5;#insertion loss in db\n", + "iso=20;#isolation loss in db\n", + "S=2;#VSWR \n", + "#Calculations\n", + "S21=10**-(ins/20.);#insertion loss=0.5=-20*log[S21]\n", + "S13=S21;\n", + "S32=S13;\n", + "S12=10**-(iso/20.);#isolation loss=30=-20*log[s12]\n", + "S23=S12;\n", + "S31=S23;\n", + "p=(S-1)/(S+1);\n", + "S11=p;\n", + "S22=p;\n", + "S33=p;\n", + "S=([[S11,S12,S13],[S21,S22,S23],[S31,S32,S33]]);\n", + "print S\n", + "#for a perfectly matched,non-reciprocal,lossless 3-port circulator,[S] is given by\n", + "#[S]=[0,0,S13;S21,0,0;,0,S32,0]\n", + "#i.e.,S13=S21=S32=1\n", + "#[S]=[0,0,1;1,0,0;0,1,0]" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "[[0, 0.1, 0.9440608762859234], [0.9440608762859234, 0, 0.1], [0.1, 0.9440608762859234, 0]]\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.10, Page number 242" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Calculate The output power at the port\n", + "import math\n", + "\n", + "#Variable declaration\n", + "Pi = 90. #power source(W)\n", + "C = 20 #dB\n", + "D = 35 #dB\n", + "Is = 0.5 #insertion loss(dB)\n", + "\n", + "#Calculations\n", + "#C = 20=10log(Pi/Pf)\n", + "Pf = Pi/(10**(20./10.))\n", + "#D=350=10log(Pf/Pb)\n", + "Pb = Pf/(10**(35./10.))\n", + "Pr = Pi-Pf-Pb #received power\n", + "Pr_db = 10*math.log10(Pi/Pr)\n", + "Pr_dash=Pr_db-Is\n", + "\n", + "#Result\n", + "print \"The output power at the port is\",round(Pr_dash,3),\"dB\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The output power at the port is -0.456 dB\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.11, Page number 243" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Chapter-6, Example 6.11, Page 242\n", + "#=============================================================================\n", + "import math\n", + "import cmath\n", + "from math import sin\n", + "from math import cos,log10\n", + "#Calculations\n", + "S13=0.1*(cos(90*math.pi/180.)+(1j)*sin(90*math.pi/180.));#conversion from polar to rectangular\n", + "S13=abs(S13);\n", + "C=-20*log10(S13);#coupling coefficient in dB\n", + "S14=0.05*(cos(90*math.pi/180.)+(1j)*sin(90*math.pi/180.));#conversion from polar to rectangular\n", + "S14=abs(S14);\n", + "D=20*log10(S13/S14);#directivity in dB\n", + "I=-20*log10(S14);#isolation in dB\n", + "print \"Thus coupling,directivity and isolation are\",C,\" dB\",round(D,1),\"dB and\",round(I,0),\"dB respetively \"\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thus coupling,directivity and isolation are 20.0 dB 6.0 dB and 26.0 dB respetively \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.12, Page number 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Calculate VSWR\n", + "import math\n", + "\n", + "#Variable declaration\n", + "lamda2 = 3.5 #distance between 2 minimas(cm)\n", + "lamda_g = 7 #guided wavelength(cm)\n", + "d2_1 = 2.5*10**-1 #distance between minimum power points(cm)\n", + "\n", + "#Calculation\n", + "S = lamda_g/(math.pi*d2_1)\n", + "\n", + "#Result\n", + "print \"VSWR =\",round(S,4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "VSWR = 8.9127\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.13, Page number 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#calculate Phase shift introduced\n", + "#chapter-6 page 244 example 6.13\n", + "import math\n", + "wg=7.2##guide wavelength in cm\n", + "x=10.5##Position of reference null without the waveguide component in cm\n", + "y=9.3##Position of reference null with the waveguide component in cm\n", + "\n", + "#CALCULATION\n", + "z=x-y##Path difference introduced due to the component in cm\n", + "p=(2.*(math.pi)*(z/wg))##Phase difference introduced in rad\n", + "Pd=(p*180.)/(math.pi)##Phase shift introduced in deg\n", + "\n", + "#OUTPUT\n", + "print '%s %.2f %s' %('\\nPhase shift introduced is Pd=',Pd,'deg')#\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Phase shift introduced is Pd= 60.00 deg\n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter07.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter07.ipynb new file mode 100755 index 00000000..251aabef --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter07.ipynb @@ -0,0 +1,190 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ea57204c71725b24fd5e19dcadce0d03f6181962151b0fccf8c6b17f9528b683"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter07:Microwave Measurements"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page number 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate VSWR\n",
+ "#chapter-7 page 278 example 7.1\n",
+ "\n",
+ "import math\n",
+ "a=4.##Length of Waveguide in cm\n",
+ "b=2.5##breadth Waveguide in cm\n",
+ "f=10.**10.##Frequency in Hz\n",
+ "x=0.1##distance between twice minimum power points in cm\n",
+ "c=3.*10.**10.##Velocity of Light in cm/sec\n",
+ "\n",
+ "#CALCULATION\n",
+ "wc=2.*a##Cutoff wavelength in TE10 mode in cms\n",
+ "w0=(c/f)##Free space wavelength in cms\n",
+ "wg=(w0/math.sqrt(1-(w0/wc)**2.))##Guide wavelength in cms\n",
+ "S=(wg/(x*(math.pi)))##Voltage Standing Wave Ratio(VSWR) for double minimum method\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.1f' %('\\nFor double minimum method, Voltage Standing Wave Ratio(VSWR) is S=',S)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "For double minimum method, Voltage Standing Wave Ratio(VSWR) is S= 10.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page number 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate reflected power and VSWR\n",
+ "#chapter-7 page 279 example 7.2\n",
+ "import math\n",
+ "x=3##O/P incident power from first directional coupler in mW\n",
+ "y=0.1##O/P reflected power from second directional coupler in mW\n",
+ "\n",
+ "#CALCULATION\n",
+ "Pi=x*100.##Incident Power in mW\n",
+ "Pr=y*100.##Reflected Power in mW\n",
+ "p=math.sqrt(Pr/Pi)##Reflection Coefficient\n",
+ "S=((1+p)/(1-p))##Voltage Standing Wave Ratio(VSWR)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.f %s %s %.2f' %('\\nReflected Power is Pr=',Pr,'mW','\\nVoltage Standing Wave Ratio(VSWR)in the main waveguide is S=',S)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Reflected Power is Pr= 10 mW \n",
+ "Voltage Standing Wave Ratio(VSWR)in the main waveguide is S= 1.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page number 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate VSWR\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr = 0.15*10**-3 #reflected power(W)\n",
+ "Pi = 2.5*10**-3 #incident power(W)\n",
+ "\n",
+ "#Calculations\n",
+ "rho = math.sqrt(Pr/Pi)\n",
+ "s = (1+rho)/(1-rho)\n",
+ "\n",
+ "#Results\n",
+ "print \"VSWR =\",round(s,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VSWR = 1.65\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4, Page number 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate reflected power\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 2. #VSWR\n",
+ "Pi = 4.5*10**-3*1000 #incident power(W)\n",
+ "c = 30 #couplers\n",
+ "\n",
+ "#Calculations\n",
+ "#s = (1+rho)/(1-rho)\n",
+ "rho = (s-1)/(s+1)\n",
+ "Pr = rho**2*Pi\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflected power =\",Pr,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflected power = 0.5 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter08.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter08.ipynb new file mode 100755 index 00000000..bbd68684 --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter08.ipynb @@ -0,0 +1,966 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d439d067395b74774cf6c48eee6faf76e1ea4d6facd8e7473f6ce6c6bc2e5f25"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter08:Microwave Tubes and Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1, Page number 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate dc electron velocity,dc Phase Constant,Plasma Frequency,Reduced Plasma Frequency,dc beam current density,instantaneous beam current density \n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 14.5*10**3 #beam voltage(V)\n",
+ "i = 1.4 #beam current(A)\n",
+ "f = 10*10**9 #frequency(Hz)\n",
+ "rho_o = 10**-6 #dc electron charge density(c/m^3)\n",
+ "rho = 10**-8 #RF charge density(c/m^3)\n",
+ "V = 10**5 #velocity perturbations(m/s)\n",
+ "eo = 8.854*10**-12\n",
+ "R = 0.4\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.593*10**6*math.sqrt(Vo) #dc electron velocity\n",
+ "\n",
+ "#Part b\n",
+ "w = 2.*math.pi*f\n",
+ "ip = w/vo #dc phase current\n",
+ "\n",
+ "#Part c\n",
+ "wp = math.sqrt((1.759*10**11*rho_o)/eo)\n",
+ "\n",
+ "#Part d\n",
+ "wq = R*wp\n",
+ "\n",
+ "#Part e\n",
+ "Jo = rho_o * vo\n",
+ "\n",
+ "#Part f\n",
+ "J = rho*vo+rho_o*V\n",
+ "\n",
+ "#Results\n",
+ "print \"dc electron velocity =\",round((vo/1E+8),3),\"*10**8 m/sec\"\n",
+ "print \"dc phase curent =\",round(ip,2),\"rad/sec (Calculation mistake in the textbook)\"\n",
+ "print \"plasma frequency =\",round((wp/1E+8),2),\"*10**8 rad/sec\"\n",
+ "print \"Reduced plasma frequency =\",round((wq/1E+8),3),\"*10**8 rad/sec\"\n",
+ "print \"dc beam current density =\",round(Jo,1), \"A/m^2\"\n",
+ "print \"instantaeneous beam current density =\",round(J,3),\"A/m^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc electron velocity = 0.714 *10**8 m/sec\n",
+ "dc phase curent = 879.92 rad/sec (Calculation mistake in the textbook)\n",
+ "plasma frequency = 1.41 *10**8 rad/sec\n",
+ "Reduced plasma frequency = 0.564 *10**8 rad/sec\n",
+ "dc beam current density = 71.4 A/m^2\n",
+ "instantaeneous beam current density = 0.814 A/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2, Page number 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate input rms voltage,output rms voltage,output power\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Av = 15. #voltage gain(dB)\n",
+ "Pin = 5*10**-3 #input power(W)\n",
+ "Rsh_in = 30*10**3 #Rsh of input cavity(Ohms)\n",
+ "Rsh_out = 20.*10**3 #Rsh of output cavity(Ohms)\n",
+ "Rl = 40*10**4 #load impedance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "V1 = math.sqrt(Pin*Rsh_in) #input rms voltage\n",
+ "\n",
+ "#Part b\n",
+ "#Av = 20log(V2/V1) db\n",
+ "V2 = V1*10**(Av/20) #deriving V2 from above equation\n",
+ "\n",
+ "#Part c\n",
+ "Pout = (V2**2)/Rsh_out #output power\n",
+ "\n",
+ "#Results\n",
+ "print \"input rms voltage =\",round(V1,2),\"V\"\n",
+ "print \"output rms voltage =\",round(V2,2),\"V\"\n",
+ "print \"output power =\",round((Pout/1E-3),1),\"mW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input rms voltage = 12.25 V\n",
+ "output rms voltage = 68.87 V\n",
+ "output power = 237.2 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3, Page number 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate input power output power,efficiency\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 2 #no. of modes\n",
+ "Vo = 300 #beam voltage(V)\n",
+ "Io = 20*10**-3 #beam current(A)\n",
+ "J1X = 1.25\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Pdc = Vo*Io #input power\n",
+ "\n",
+ "#Part b\n",
+ "Pac = (2*Pdc*J1X)/(2*math.pi*n-(math.pi/2))\n",
+ "\n",
+ "#Part c\n",
+ "N = (Pac/Pdc)*100. #efficiency\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"Input power =\",round(Pdc,2),\"W\"\n",
+ "print \"Output power =\",round(Pac,2),\"W\"\n",
+ "print \"Efficiency =\",round(N,1),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 6.0 W\n",
+ "Output power = 1.36 W\n",
+ "Efficiency = 22.7 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4, Page number 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Electron velocity,dc transit time of electrons,Maximum input voltage,Volatge gain\n",
+ "import math\n",
+ "\n",
+ "#Varaible declaration\n",
+ "Vo = 900 #beam voltage(V)\n",
+ "Io = 30*10**-3 #beam current(A)\n",
+ "f = 8*10**9 #frequency(Hz)\n",
+ "d = 1*10**-3 #gap spacing in either cavity(m)\n",
+ "L = 4*10**-2 #spacing between centers of cavities(m)\n",
+ "Rsh = 40*10**3 #effective shunt impedance(Ohms)\n",
+ "J1X = 0.582\n",
+ "X = 1.841\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.593*10**6*math.sqrt(Vo)\n",
+ "\n",
+ "#Part b\n",
+ "To = L/vo\n",
+ "\n",
+ "#Part c\n",
+ "w = 2*math.pi*f\n",
+ "theta_o = w*To\n",
+ "theta_g = (w*d)/vo\n",
+ "Bo = math.sin(theta_g/2)/(theta_g/2)\n",
+ "V1_max = (Vo*3.68)/(Bo*theta_o)\n",
+ "\n",
+ "#Part d\n",
+ "Ro = Vo/Io\n",
+ "Av = ((Bo**2)*theta_o*J1X*Rsh)/(Ro*X)\n",
+ "\n",
+ "#Results\n",
+ "print \"Electron velocity =\",round((vo/1E+6),2),\"*10**6 m/sec\"\n",
+ "print \"dc transit time of electrons =\",round((To/1E-8),3),\"*10**-8 sec\"\n",
+ "print \"Maximum input voltage =\",round(V1_max,3),\"V\"\n",
+ "print \"Volatge gain =\",round(Av,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electron velocity = 17.79 *10**6 m/sec\n",
+ "dc transit time of electrons = 0.225 *10**-8 sec\n",
+ "Maximum input voltage = 41.923 V\n",
+ "Volatge gain = 23.278 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5, Page number 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate input microwave voltage V1 in order to generate maximum output voltage, \n",
+ "#Calculate voltage gain,efficiency of the amplifier neglecting beam loading, beam loading conductance\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 1200. #beam voltage(V)\n",
+ "Io = 28*10**-3 #beam current(A)\n",
+ "f = 8*10**9 #frequency(Hz)\n",
+ "d = 1*10**-3 #gap spacing in either cavity(m)\n",
+ "L = 4.*10**-2 #spacing between centers of cavities(m)\n",
+ "Rsh = 40*10**3 #effective shunt impedance(Ohms)\n",
+ "J1X = 0.582\n",
+ "X = 1.841\n",
+ "Go = 23.3*10**-6\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.593*10**6*math.sqrt(Vo)\n",
+ "w = 2*math.pi*f\n",
+ "theta_o = (w*L)/vo\n",
+ "theta_g = (w*d)/vo\n",
+ "Bo = math.sin(theta_g/2)/(theta_g/2)\n",
+ "V1_max = (Vo*3.68)/(Bo*theta_o)\n",
+ "\n",
+ "#Part b\n",
+ "Ro = Vo/Io\n",
+ "Av = ((Bo**2)*theta_o*J1X*Rsh)/(Ro*X)\n",
+ "\n",
+ "#Part c\n",
+ "V2 = 2*Io*J1X*Bo*Rsh\n",
+ "N = ((0.58*V2)/Vo)*100\n",
+ "\n",
+ "#Part d\n",
+ "Gb = (Go*((Bo**2)-(Bo*math.cos(theta_g))))/2\n",
+ "Rb = 1/Gb\n",
+ "\n",
+ "#Results\n",
+ "print \"The input microwave voltage V1 in order to generate maximum output voltage is\",round(V1_max,2),\"V\"\n",
+ "print \"The voltage gain (reflecting beam loading in the output cavity) is\",round(Av,3)\n",
+ "print \"The efficiency of the amplifier neglecting beam loading is\",round(N,2),\"%\" \n",
+ "print \"The beam loading conductance is\",round((Rb/1E+3)),\"K Ohms\"\n",
+ "print \"The value of\",round((Rb/1E+3)),\"K Ohms is very much comparable to Rsh and cannot be neglected because theta_g is quite high\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input microwave voltage V1 in order to generate maximum output voltage is 58.71 V\n",
+ "The voltage gain (reflecting beam loading in the output cavity) is 17.058\n",
+ "The efficiency of the amplifier neglecting beam loading is 48.43 %\n",
+ "The beam loading conductance is 73.0 K Ohms\n",
+ "The value of 73.0 K Ohms is very much comparable to Rsh and cannot be neglected because theta_g is quite high\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.6, Page number 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate value of repeller voltage,dc necesaary to give the microwave gap of voltage of 200V,elctron efficiency\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 500. #beam voltage(V)\n",
+ "Rsh = 20*10**3 #effective shunt impedance(Ohms)\n",
+ "f = 8*10**9 #frequency(Hz)\n",
+ "L = 1.*10**-3 #spacing between centers of cavities(m)\n",
+ "n = 2\n",
+ "e_m = 1.759*10**11\n",
+ "V1 = 200\n",
+ "J1X = 0.582\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "w = 2*math.pi*f\n",
+ "x = (e_m*((2*math.pi*n)-(math.pi/2))**2)/(8*(w**2)*(L**2))\n",
+ "y = math.sqrt(Vo/x)\n",
+ "Vr = y+Vo\n",
+ "\n",
+ "#Part b\n",
+ "Bo = 1 #Assumption\n",
+ "Io = V1/(2*J1X*Rsh)\n",
+ "\n",
+ "#Part c\n",
+ "vo = 0.593*10**6*math.sqrt(Vo)\n",
+ "theta_o = (w*2*L*vo)/(e_m*(Vr+Vo))\n",
+ "Bi = 1 #Assumption\n",
+ "X_dash = (V1*theta_o)/(2*Vo)\n",
+ "X = 1.51 #from graph\n",
+ "J1X = 0.84\n",
+ "N = ((2*J1X)/((2*math.pi*n)-(math.pi/2)))*100\n",
+ "\n",
+ "#Results\n",
+ "print \"The value of repeller voltage is\",round(Vr,2),\"V (Calculation mistake in the textbook)\"\n",
+ "print \"The dc necesaary to give the microwave gap of voltage of 200V is\",round((Io/1E-3),2),\"mA\"\n",
+ "print \"The elctron efficiency is\", round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of repeller voltage is 1189.36 V (Calculation mistake in the textbook)\n",
+ "The dc necesaary to give the microwave gap of voltage of 200V is 8.59 mA\n",
+ "The elctron efficiency is 15.28 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7, Page number 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate efficiency of the reflex klystron,total power output,elctron efficiency\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 1 #no. of modes\n",
+ "Pdc = 40*10**-3 #input power(W)\n",
+ "V1_Vo = 0.278 #ratio\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "N = (V1_Vo*3*math.pi)/4\n",
+ "\n",
+ "#Part b \n",
+ "Pout = (8.91*Pdc)/100\n",
+ "\n",
+ "#Part c\n",
+ "Pl = (Pout*80)/100\n",
+ "\n",
+ "#Results\n",
+ "print \"The efficiency of the reflex klystron is\",round(N,3)\n",
+ "print \"The total power output is\",round((Pout/1E-3),3),\"W\"\n",
+ "print \"The power delivered to the load is\",round((Pl/1E-3),2),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency of the reflex klystron is 0.655\n",
+ "The total power output is 3.564 W\n",
+ "The power delivered to the load is 2.85 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.8, Page number 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Hull cut-off voltage,Cut-off magnetic flux density,Cyclotron frequency\n",
+ "#chapter-8 page 342 example 8.8\n",
+ "#For a circular magnetron\n",
+ "import math\n",
+ "a=0.15##inner radius in m\n",
+ "b=0.45##outer radius in m\n",
+ "B=1.2*10**(-3)##magnetic flux density in Wb/sqm\n",
+ "x=1.759*10**11##Value of e/m in C/kg\n",
+ "V=6000.##beam voltage in V\n",
+ "\n",
+ "#CALCULATION\n",
+ "V0=((x/8.)*(B**2.)*(b**2.)*(1.-(a/b)**2.)**2.)/1000.##Hull cut-off voltage in kV\n",
+ "Bc=((math.sqrt(8.*(V/x)))/(b*(1.-(a/b)**2.)))*1000.##Cut-off magnetic flux density in mWb/sqm\n",
+ "fc=((x*B)/(2.*(math.pi)))/10.**9.##Cyclotron frequency in GHz\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %2.3f %s %s %3.3f %s %s %.4f %s' %('\\nHull cut-off voltage is V0=',V0,'kV','\\nCut-off magnetic flux density is Bc=',Bc,'mWb/sqm','\\nCyclotron frequency is fc=',fc,'GHz')#\n",
+ "\n",
+ "#Check the answers once \n",
+ "#Correct answers are\n",
+ "#Hull cut-off voltage is V0=5.066 kV\n",
+ "#Cut-off magnetic flux density is Bc=1.305953 mWb/sqm \n",
+ "#Cyclotron frequency is fc=0.0336 GHz \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Hull cut-off voltage is V0= 5.066 kV \n",
+ "Cut-off magnetic flux density is Bc= 1.306 mWb/sqm \n",
+ "Cyclotron frequency is fc= 0.0336 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.9, Page number 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Axial phase velocity, anode voltage\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 2*10**-3 #diameter of helical TWT(m)\n",
+ "n = 50. #no. of turns per cm\n",
+ "v = 3*10**8 #velocity of light(m/s)\n",
+ "m = 9.1*10**-31 #mass of electron\n",
+ "e = 1.6*10**-19 #charge on electron\n",
+ "\n",
+ "#Calculations\n",
+ "p = 1/n*10**-2 #pitch(m)\n",
+ "c = math.pi*d #circumference(m)\n",
+ "Vp = (v*p)/c \n",
+ "\n",
+ "Vo = (m*(Vp**2))/(2*e)\n",
+ "\n",
+ "#Results\n",
+ "print \"Axial phase velociity =\",round(Vp,2),\"m/sec\"\n",
+ "print \"Anode voltage =\",round(Vo,2),\"V(Calculation mistake in the textbook)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Axial phase velociity = 9549296.59 m/sec\n",
+ "Anode voltage = 259.32 V(Calculation mistake in the textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.10, Page number 344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate dc electron velocity,Transit time,Input voltage,Voltage gain \n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 900 #beam voltage(V)\n",
+ "Io = 30.*10**-3 #beam current(A)\n",
+ "f = 8.*10**9 #frequency(Hz)\n",
+ "d = 1.*10**-3 #gap spacing in either cavity(m)\n",
+ "L = 4.*10**-2 #spacing between centres of cavity(m)\n",
+ "Rsh = 40.*10**3 #effective shunt impedance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.593*10**6*math.sqrt(Vo)\n",
+ "\n",
+ "#Part b\n",
+ "Tt = d/vo\n",
+ "\n",
+ "#Part c\n",
+ "w = 2*math.pi*f\n",
+ "theta_g = (w*d)/vo\n",
+ "Bo = math.sin(theta_g/2)/(theta_g/2) #Beam coupling coefficient\n",
+ "theta_o = (w*L)/vo #dc transit angle\n",
+ "#For maximum o/p volltage,\n",
+ "J1X = 0.582\n",
+ "X = 1.841\n",
+ "V1max = (2*Vo*X)/(Bo*theta_o)\n",
+ "\n",
+ "#Part d\n",
+ "Av = (Bo**2*theta_o*J1X*Rsh)/(Io*X)\n",
+ "\n",
+ "#Results\n",
+ "print \"dc electron velocity =\",round((vo/1E+7),1),\"*10**7 m/sec\"\n",
+ "print \"Transit time =\",round((Tt/1E-10),2),\"*10^-10 s\"\n",
+ "print \"Input voltage for maximum output voltage =\",round(V1max,2),\"V\"\n",
+ "print \"Voltage gain =\",round((Av/1E+6),2),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc electron velocity = 1.8 *10**7 m/sec\n",
+ "Transit time = 0.56 *10^-10 s\n",
+ "Input voltage for maximum output voltage = 41.95 V\n",
+ "Voltage gain = 23.28 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.11, Page number 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate dc electron velocity,dc phase constant,plasma frequency ,Reduced plasma frequency ,dc beam current density,instantaeneous beam current density\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 20*10**3 #beam voltage(V)\n",
+ "Io = 2 #beam current(A)\n",
+ "f = 9*10**9 #frequency(Hz)\n",
+ "rho_o = 10**-6 #dc electron charge density(c/m^3)\n",
+ "rho = 10**-8 #RF charge density(c/m^3)\n",
+ "V = 10**5 #velocity perturbations(m/s)\n",
+ "eo = 8.854*10**-12\n",
+ "R = 0.5\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.59*10**6*math.sqrt(Vo)\n",
+ "\n",
+ "#Part b\n",
+ "w = 2.*math.pi*f\n",
+ "ip = w/vo #dc phase current\n",
+ "\n",
+ "#Part c\n",
+ "wp = math.sqrt((1.759*10**11*rho_o)/eo)\n",
+ "\n",
+ "#Part d\n",
+ "wq = R*wp\n",
+ "\n",
+ "#Part e\n",
+ "Jo = rho_o * vo\n",
+ "\n",
+ "#Part f\n",
+ "J = rho*vo-rho_o*V\n",
+ "\n",
+ "#Results\n",
+ "print \"dc electron velocity =\",round((vo/1E+7),3),\"*10**7 m/sec\"\n",
+ "print \"dc phase constant =\",round(ip,2),\"rad/sec (Calculation mistake in the textbook)\"\n",
+ "print \"plasma frequency =\",round((wp/1E+8),2),\"*10**8 rad/sec\"\n",
+ "print \"Reduced plasma frequency =\",round((wq/1E+8),3),\"*10**8 rad/sec\"\n",
+ "print \"dc beam current density =\",round(Jo,2), \"A/m^2\"\n",
+ "print \"instantaeneous beam current density =\",round(J,4),\"A/m^2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc electron velocity = 8.344 *10**7 m/sec\n",
+ "dc phase constant = 677.73 rad/sec (Calculation mistake in the textbook)\n",
+ "plasma frequency = 1.41 *10**8 rad/sec\n",
+ "Reduced plasma frequency = 0.705 *10**8 rad/sec\n",
+ "dc beam current density = 83.44 A/m^2\n",
+ "instantaeneous beam current density = 0.7344 A/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.12, Page number 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Transit angle \n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 5*10**9 #frequency(Hz)\n",
+ "Vo = 1000 #operating voltage(V)\n",
+ "n = 1.75 #no. of turns\n",
+ "Vr = -500 #repeller voltage(V)\n",
+ "d = 2*10**-3 #cavity gap(m)\n",
+ "\n",
+ "#Calculations\n",
+ "w = 2*math.pi*f\n",
+ "uo = 5.93*10**5*math.sqrt(Vo)\n",
+ "theta_g = (w*d)/uo\n",
+ "\n",
+ "#Results\n",
+ "print \"Transit angle =\",round(theta_g,3),\"radians\"\n",
+ "print \"\\nThe length of drift region cannot be computed as the value of F is not given\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transit angle = 3.351 radians\n",
+ "\n",
+ "The length of drift region cannot be computed as the value of F is not given\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.13, Page number 346"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Input RF voltage ,Voltage gain ,efficiency \n",
+ "#Variable declaration\n",
+ "import math\n",
+ "f = 10*10**9 #frequency(Hz)\n",
+ "Vo = 1200 #beam voltage(V)\n",
+ "Io = 30*10**-3 #beam current(A)\n",
+ "d = 1*10**-3 #diameter(m)\n",
+ "Rsh = 40*10**3 #shunt resistance(Ohms)\n",
+ "L = 4*10**-2 #length(m)\n",
+ "X = 1.84\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.59*10**6*math.sqrt(Vo)\n",
+ "w = 2*math.pi*f\n",
+ "theta_o = (w*L)/vo\n",
+ "V1 = (2*X*Vo)/theta_o\n",
+ "theta_g = (theta_o*d)/L\n",
+ "Bi = (math.sin(theta_g/2))/(theta_g/2)\n",
+ "V1max = V1/Bi\n",
+ "\n",
+ "#Part b\n",
+ "J1X = 0.58 #from table\n",
+ "I2 = 2*Io*J1X\n",
+ "V2 = Bi*I2*Rsh\n",
+ "A = V2/V1\n",
+ "Av = 20*math.log10(A)\n",
+ "\n",
+ "#Part c\n",
+ "N = ((0.58*V2)/Vo)*100\n",
+ "\n",
+ "#Results\n",
+ "print \"Input RF voltage is\",round(V1max,3),\"V\" \n",
+ "print \"Voltage gain is\",round(Av,2),\"dB\"\n",
+ "print \"efficiency is\",round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input RF voltage is 55.231 V\n",
+ "Voltage gain is 28.03 dB\n",
+ "efficiency is 43.75 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.14, Page number 347"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Cyclotron angular frequency,Hull cut-off voltage,Cut-off magnetic flux density\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 30*10**3 #beam voltage(V)\n",
+ "Io = 80 #beam current(A)\n",
+ "Bo = 0.01 #Wb/m**2\n",
+ "a = 4*10**-2 #length of magnetron(m)\n",
+ "b = 8*10**-2 #breadth of magnetron(m)\n",
+ "e = 1.6*10**-19 #charge on electron(C)\n",
+ "m = 9.1*10**-31 #mass of electron\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "w = (e*Bo)/m\n",
+ "\n",
+ "#Part b\n",
+ "Vhc = (e*(Bo**2)*(b**2)*((1-((a/b)**2))**2))/(8*m)\n",
+ "\n",
+ "#PArt c\n",
+ "Bc = ((8*Vo*(m/e))**0.5)/(b*(1-((a/b)**2)))\n",
+ "\n",
+ "#Results\n",
+ "print \"Cyclotron angular frequency =\",round((w/1E+9),3),\"*10**9 rad/s\"\n",
+ "print \"Hull cut-off voltage =\",round((Vhc/1E+3),4),\"kV\"\n",
+ "print \"Cut-off magnetic flux density =\",round((Bc/1E-3),3),\"mWb/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cyclotron angular frequency = 1.758 *10**9 rad/s\n",
+ "Hull cut-off voltage = 7.9121 kV\n",
+ "Cut-off magnetic flux density = 19.472 mWb/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.15, Page number 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Input power,Output power,Efficiency\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 2 #mode\n",
+ "Vo = 280 #beam volatge(V)\n",
+ "Io = 22*10**-3 #beam current(A)\n",
+ "V1 = 30 #signal voltage(V)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Pdc = Vo*Io\n",
+ "\n",
+ "#Part b\n",
+ "J1X = 1.25 #from table\n",
+ "Pac = (2*Pdc*J1X)/((2*n*math.pi)-(math.pi/2))\n",
+ "\n",
+ "#Part c\n",
+ "N = (Pac/Pdc)*100\n",
+ "\n",
+ "#Results\n",
+ "print \"Input power =\",round(Pdc,2),\"W\"\n",
+ "print \"Output power =\",round(Pac,2),\"W\"\n",
+ "print \"Efficiency =\",round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 6.16 W\n",
+ "Output power = 1.4 W\n",
+ "Efficiency = 22.74 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.16, Page number 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 8*10**9 #frequency(Hz)\n",
+ "Vo = 300 #beam voltage(V)\n",
+ "Rsh = 20*10**3 #shunt resistance(Ohms)\n",
+ "L = 1*10**-3 #length(m)\n",
+ "V1 = 200 #gap voltage(V)\n",
+ "e_m = 1.759*10**11\n",
+ "n = 2 #mode\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "w = 2*math.pi*f\n",
+ "x = (e_m*((2*math.pi*n)-(math.pi/2))**2)/(8*(w**2)*(L**2))\n",
+ "y = math.sqrt(Vo/x)\n",
+ "Vr = y+Vo\n",
+ "\n",
+ "#Part b\n",
+ "Bo = 1 #assumption\n",
+ "J1X = 0.582 #from table\n",
+ "Io = V1/(2*J1X*Rsh)\n",
+ "\n",
+ "#Results\n",
+ "print \"Repeller voltage =\",round(Vr,3),\"V\"\n",
+ "print \"Beam current =\",round((Io/1E-3),2),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Repeller voltage = 833.98 V\n",
+ "Beam current = 8.59 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter09.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter09.ipynb new file mode 100755 index 00000000..9e8fad38 --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter09.ipynb @@ -0,0 +1,605 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:700ab6262dd3fd322aa3ece04f53175fb8f709a487cc0649654e8878a7afd58c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter09:Solid State Microwave devices"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page number 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Frequncy of IMPATT diode\n",
+ "#Variable declaration\n",
+ "L = 2*10**-6 #drift length(m)\n",
+ "Vd = 10**7*10**-2 #dfrift velocit(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "f = Vd/(2*L)\n",
+ "\n",
+ "#Results\n",
+ "print \"Frequncy of IMPATT diode is\",round((f/1E+9),2),\"GHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequncy of IMPATT diode is 25.0 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page number 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate threshold electric field\n",
+ "#Variable declaration\n",
+ "f = 10*10**9 #operating frequency(Hz)\n",
+ "L = 75*10**-6 #device length(m)\n",
+ "V = 25. #voltage pulse amplified(V)\n",
+ "\n",
+ "#Calculations\n",
+ "Eth = V/(L)\n",
+ "\n",
+ "#Result\n",
+ "print \"The threshold electric field is\",round((Eth/1E+5),2),\"KV/cm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The threshold electric field is 3.33 KV/cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3, Page number 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Power gain,Power gain as USB converter\n",
+ "#chapter-9 page 411 example 9.3\n",
+ "import math\n",
+ "fs=2.*10.**9.;#Signal Frequency in Hz\n",
+ "fp=12.*10.**9.#Pump Frequency in Hz\n",
+ "Ri=16.;#O/P resistance of signal generator in ohms\n",
+ "Rs=1000.;#On types resistance of signal generator in ohms\n",
+ "\n",
+ "#CALCULATION\n",
+ "P=10*math.log10((fp-fs)/fs);#Power gain in dB\n",
+ "Pusb=10*math.log10((fp+fs)/fs);#Power gain as USB converter in dB\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.2f %s %s %.2f %s' %('Power gain is P=',P,'dB','\\nPower gain as USB converter is Pusb=',Pusb,'dB')\n",
+ "\n",
+ "#Note: Answer given in textbook is wrong Check it once..\n",
+ "#Correct answers are Power gain is P=6.99 dB \n",
+ "#Power gain as USB converter is Pusb=8.45 dB \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain is P= 6.99 dB \n",
+ "Power gain as USB converter is Pusb= 8.45 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4, Page number 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Critical voltage ,Breakdown voltage,Breakdown electric field \n",
+ "#Variable declaration\n",
+ "Es = 12.5 #relative dielectric constant\n",
+ "N = 3.2*10**22 #donor concentration(/m**3)\n",
+ "L = 8*10**-6 #length(m)\n",
+ "Eo = 8.854*10**-12 #dielectric constant\n",
+ "q = 1.6*10**-19\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Vc = (q*N*L**2)/(2*Eo*Es)\n",
+ "\n",
+ "#Part b\n",
+ "Vbd = 2*Vc\n",
+ "\n",
+ "#Part c\n",
+ "Ebd = Vbd/L\n",
+ "\n",
+ "#Results\n",
+ "print \"Critical voltage =\",round((Vc/1E+3),2),\"kV\"\n",
+ "print \"Breakdown voltage =\",round((Vbd/1E+3),2),\"kV\"\n",
+ "print \"Breakdown electric field =\",round((Ebd/1E+8),2),\"*10**8 V/cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Critical voltage = 1.48 kV\n",
+ "Breakdown voltage = 2.96 kV\n",
+ "Breakdown electric field = 3.7 *10**8 V/cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate avalanche zone velocity\n",
+ "#Variable declaration\n",
+ "Na = 2.5*10**16 #doping concentration(/cm**3)\n",
+ "J = 33*10**3 #current density(A/cm**2)\n",
+ "q = 1.6*10**-19\n",
+ "\n",
+ "#Calculations\n",
+ "Vz = J/(q*Na)\n",
+ "\n",
+ "#Results\n",
+ "print \"The avalanche zone velocity is\",round((Vz/1E+6),2),\"*10**6 cm/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The avalanche zone velocity is 8.25 *10**6 cm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate power gain\n",
+ "#Variable declaration\n",
+ "Rd = -25 #negative resistance(Ohms)\n",
+ "Rl = 50 #load resistance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "G = ((Rd-Rl)/(Rd+Rl))**2\n",
+ "\n",
+ "#Results\n",
+ "print \"Power gain =\",G"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain = 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate minimum voltage required\n",
+ "#chapter-9 page 412 example 9.7\n",
+ "#For a Gunn Diode\n",
+ "L=5.*10.**(-4.);#Drift Length in cm\n",
+ "Vg=3300.;#Voltage gradient in V/cm [Vg>3.3 kV/cm]\n",
+ " \n",
+ "#CALCULATION\n",
+ "Vmin=Vg*L;#Minimum Voltage needed to initiate Gunn effect in volts\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.2f %s' %('\\nMinimum Voltage needed to initiate Gunn effect is Vmin=',Vmin,'volts');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Minimum Voltage needed to initiate Gunn effect is Vmin= 1.65 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Natural(Rational) Frequency,Critical Voltage of the diode\n",
+ "#chapter-9 page 412 example 9.8\n",
+ "#For a Gunn Diode\n",
+ "L=20.*10.**(-4.);#Active Length in cm\n",
+ "Vd=2.*10.**7.;#Drift Velocity of Electrons in cm/sec\n",
+ "Ec=3.3*10.**3.;#Criticl Field for GaAs in V/cm\n",
+ "\n",
+ "#CALCULATION\n",
+ "fn=(Vd/L)/10.**9.;#Natural(Rational) Frequency in GHz\n",
+ "Vc=L*Ec;#Critical Voltage of the diode in volts\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.f %s %s %.1f %s ' %('\\nNatural(Rational) Frequency is fn=',fn,'GHz','\\nCritical Voltage of the diode is Vc=',Vc,'volts');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Natural(Rational) Frequency is fn= 10 GHz \n",
+ "Critical Voltage of the diode is Vc= 6.6 volts \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.9, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the resonant frequency,Efficiency\n",
+ "from math import pi,sqrt\n",
+ "\n",
+ "#Variable declaration\n",
+ "Cj = 0.5*10**-12 #capacitance of IMPATT diode(F)\n",
+ "Lp = 0.5*10**-9 #Inductance of IMPATT diode(H)\n",
+ "Vbd = 100 #breakdown voltage(V)\n",
+ "Ib = 100*10**-3 #dc bias current(A)\n",
+ "Ip = 0.8 #peak current(A)\n",
+ "Rl = 2 #load resistance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "f = 1/(2*pi*sqrt(Lp*Cj))\n",
+ "Pl = ((Ip**2)*Rl)/2\n",
+ "Pdc = Vbd*Ib\n",
+ "N = (Pl/Pdc)*100\n",
+ "\n",
+ "#Results\n",
+ "print \"The resonant frequency is\",round((f/1E+9)),\"GHz\"\n",
+ "print \"Efficiency is\",round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resonant frequency is 10.0 GHz\n",
+ "Efficiency is 6.4 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.10, Page number 413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Drift time of the carrier,Operating frequency of diode\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vd = 10**5 #carrier dirft velocity(cm/s)\n",
+ "L = 2*10**-6 #drift length(m)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "tou = L/Vd\n",
+ "\n",
+ "#Part b\n",
+ "f = 1/(2*tou)\n",
+ "\n",
+ "#Results\n",
+ "print \"Drift time of the carrier is\",round((tou/1E-11),2),\"*10**-11 sec\"\n",
+ "print \"Operating frequency of diode is\",(f/1E+9),\"GHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift time of the carrier is 2.0 *10**-11 sec\n",
+ "Operating frequency of diode is 25.0 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.11, Page number 413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Breakdown voltage,Breakdown electric field\n",
+ "\n",
+ "#Variable declaration\n",
+ "Er = 11.8 #relative dielectric constant\n",
+ "N = 3*10**21 #donor concentration(m^-3)\n",
+ "L = 6.2*10**-6 #Si length(m)\n",
+ "q = 1.6*10**-19 #charge of an electron(C)\n",
+ "Eo = 8.854*10**-12 #dielctric constant\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Vbd = (q*N*L**2)/(Eo*Er)\n",
+ "\n",
+ "#Part b\n",
+ "Ebd = Vbd/L\n",
+ "\n",
+ "#Results\n",
+ "print \"Breakdown voltage =\",round(Vbd,1),\"V\"\n",
+ "print \"Breakdown electric field =\",round((Ebd/1E+7),2),\"*10**7 V/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Breakdown voltage = 176.6 V\n",
+ "Breakdown electric field = 2.85 *10**7 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.12, Page number 413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Maximum power gain,Noise figure,Bandwidth\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "rQ = 8. #figure of merit\n",
+ "fo_fs = 8. #ratio of o/p to i/p frequency\n",
+ "Td = 300. #diode temperatur(K)\n",
+ "To = 300. #ambient temperature(K)\n",
+ "r = 0.2\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "X = rQ**2/fo_fs\n",
+ "G = (X/((1+math.sqrt(1+X))**2))*fo_fs\n",
+ "g = 10*math.log10(G)\n",
+ "\n",
+ "#Part b\n",
+ "F = 1+((2*Td)/To)*((1/rQ)+(1/rQ**2))\n",
+ "f = 10*math.log10(F)\n",
+ "\n",
+ "#Part c\n",
+ "BW = 2*r*math.sqrt(fo_fs)\n",
+ "\n",
+ "#Results\n",
+ "print \"Maximum power gain =\",round(g,2),\"dB\"\n",
+ "print \"Noise figure =\",round(f,2),\"dB\"\n",
+ "print \"Bandwidth =\",round(BW,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum power gain = 6.02 dB\n",
+ "Noise figure = 1.08 dB\n",
+ "Bandwidth = 1.13\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.13, Page number 414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Equivalent noise resistance,Gain,Noise figure,Bandwidth\n",
+ "#Variable declaration\n",
+ "import math\n",
+ "fs = 2*10**9 #signal frequency(Hz)\n",
+ "fp = 12*10**9 #amplifier frquency(Hz)\n",
+ "fi = 10*10**9 #input frequency(Hz)\n",
+ "fd = 5*10**9 #diode frequency(Hz)\n",
+ "Ri = 1*10**3 #input resistance(Ohms)\n",
+ "Rg = 1*10**3 #gate resistance(Ohms)\n",
+ "RTs = 1*10**3 #resistance(Ohms)\n",
+ "RTi = 1*10**3 #resistance(Ohms)\n",
+ "r = 0.35 #resistane(Ohms)\n",
+ "rQ = 10. #figure of merit\n",
+ "rd = 300 #diode temperature(K)\n",
+ "C = 0.01*10**-12 #capacitance(F)\n",
+ "Td = 300\n",
+ "To = 300\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "ws = 2*math.pi*fs\n",
+ "wi = 2*math.pi*fi\n",
+ "R = (r**2)/(ws*wi*C**2*RTi)\n",
+ "a = R/RTs\n",
+ "\n",
+ "#Part b\n",
+ "G = (4*fi*Rg*Ri*a)/(fs*RTs*RTi*(1-a)**2)\n",
+ "g = 10*math.log10(G)\n",
+ "\n",
+ "#Part c\n",
+ "F = 1+((2*Td)/To)*((1/rQ)+(1/rQ**2))\n",
+ "f = 10*math.log10(F)\n",
+ "\n",
+ "#Part d\n",
+ "BW = (r/2)*math.sqrt(fd/(fs*G))\n",
+ "\n",
+ "#Results\n",
+ "print \"Equivalent noise resistance =\",round(a,2),\"Ohms\"\n",
+ "print \"Gain =\",round(g,1),\"dB\"\n",
+ "print \"Noise figure =\",round(f,2),\"dB\"\n",
+ "print \"Bandwidth =\",round(BW,3),\"(Calculation error in the textbook)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent noise resistance = 1.55 Ohms\n",
+ "Gain = 20.1 dB\n",
+ "Noise figure = 0.86 dB\n",
+ "Bandwidth = 0.027 (Calculation error in the textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter10.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter10.ipynb new file mode 100755 index 00000000..c3f955b3 --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter10.ipynb @@ -0,0 +1,565 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e0413e9c9e3050091f310d4afb4ca2e525621132a18cab203347bc4619b6cd5d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter10:Microwave Communication Systems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1, Page number 486"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate radio horizon and the maximum distance of propagation of the TV signal\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable declaration\n",
+ "ht = 144 #transmitter antenna height(m)\n",
+ "hr = 25 #receiving antenna height(M)\n",
+ "\n",
+ "#Calculations\n",
+ "dt = 4*sqrt(ht)\n",
+ "dr = 4*sqrt(hr)\n",
+ "d = dt+dr\n",
+ "\n",
+ "#Results\n",
+ "print \"Radio horizon is\",dt,\"km\"\n",
+ "print \"The maximum distance of propagation of the TV signal is\",d,\"km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radio horizon is 48.0 km\n",
+ "The maximum distance of propagation of the TV signal is 68.0 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2, Page number 486"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate horizon distance of the transmitter\n",
+ "from fractions import Fraction\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 6370*10**3 #radius of earth(km)\n",
+ "du_dh = -0.05*10**-6 #refractive index of air near ground\n",
+ "\n",
+ "#Calculations\n",
+ "k = 1/(1+(r*du_dh))\n",
+ "\n",
+ "#Result\n",
+ "print \"The horizon distance of the transmitter can be modified by replaing r by r' is\",round(k,3),\"r\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The horizon distance of the transmitter can be modified by replaing r by r' is 1.467 r\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3, Page number 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate carrier tansmitted power required\n",
+ "import math \n",
+ "#Variable declaration\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "f = 2*10**9 #frequency(Hz)\n",
+ "r = 50*10**3 #repeater spacing(km)\n",
+ "Pr = 20 #carrier power(dBm)\n",
+ "Gt = 34 #antenna gain(dB)\n",
+ "L = 10 #dB\n",
+ "Gr = 34 #dB\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "Pt = -Pr+(10*math.log10(4*math.pi*r**2))-Gt-(10*math.log10(lamda**2/(4*math.pi)))+L-Gr\n",
+ "\n",
+ "#Results\n",
+ "print \"The carrier tansmitted power required is\",round(Pt,1),\"dBm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The carrier tansmitted power required is 54.4 dBm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.4, Page number 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Received power\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 6.*10**9 #uplink frequency(Hz)\n",
+ "e = 5 #elevation angle(degrees)\n",
+ "Pt = 1.*10**3 #transmitter power(W)\n",
+ "Gt = 60. #gain of transmitter(dB)\n",
+ "Gr = 0 #gain of receiver(dB)\n",
+ "d = 36000*10**3 #distance between ground and satellite(m)\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "Gt1 = 10**(Gt/10)\n",
+ "Gr1 = 10.**(Gr/10)\n",
+ "r = d/(math.sin(math.radians(e)))\n",
+ "lamda = c/f\n",
+ "Pr = (Pt*Gt1*Gr1*lamda**2)/(4*math.pi*r**2*4*math.pi)\n",
+ "\n",
+ "#Result\n",
+ "print \"Received power =\",round((Pr/1E-14),1),\"*10^-14 W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Received power = 9.3 *10^-14 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.5, Page number 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Antenna beam angle\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 6371 #radius of the earth(km)\n",
+ "\n",
+ "#Calculation\n",
+ "d = 35855+r #distance of satellite from center of the earth(km)\n",
+ "b = (math.degrees(math.pi)*r)/d\n",
+ "\n",
+ "#Result\n",
+ "print \"Antenna beam angle =\",round(b,2),\"degrees\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Antenna beam angle = 27.16 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.6, Page number 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate round trip time between earth station and satellite,round trip time for vertical transmission\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 6371 #radius of earth(km)\n",
+ "h = 35855 #height(km) \n",
+ "phi = 5 #elevation angle(degrees)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "B = 90 #angle for vertical transmission(degrees)\n",
+ "\n",
+ "#Calculations\n",
+ "d = math.sqrt(((r+h)**2)-((r*math.cos(math.radians(phi)))**2))- (r*math.sin(math.radians(phi)))\n",
+ "T = (2*d*10**3)/c\n",
+ "dv = math.sqrt(((r+h)**2)-(r**2))\n",
+ "Tv = (2*(dv-r)*10**3)/c\n",
+ "\n",
+ "#Results\n",
+ "print \"The round trip time between earth station and satellite is\",round((T/1E-3)),\"msec\"\n",
+ "print \"The round trip time for vertical transmission is\",round((Tv/1E-3)),\"msec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The round trip time between earth station and satellite is 275.0 msec\n",
+ "The round trip time for vertical transmission is 236.0 msec\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.7, Page number 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate figure of merit for earth station\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tant = 25 #effective noise temperature for antenna(K)\n",
+ "Tr = 75 #receiver oise temperature(K)\n",
+ "G = 45 #power gain(dB)\n",
+ "\n",
+ "#Calculations\n",
+ "T = Tant+Tr\n",
+ "Tdb = 10*math.log10(T)\n",
+ "M = G - Tdb\n",
+ "\n",
+ "#Results\n",
+ "print \"The figure of merit for earth station is\",M,\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The figure of merit for earth station is 25.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.8, Page number 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate carrier to noise ratio\n",
+ "#Variable declaration\n",
+ "EIRP = 55.5 #satellite ESM(dBW)\n",
+ "M = 35 #freespace loss(dB)\n",
+ "Lfs = 245.3 #GT of earth station(dB)\n",
+ "\n",
+ "#Calculation\n",
+ "C_No = EIRP + M - Lfs + 228.6\n",
+ "\n",
+ "#Result\n",
+ "print \"The carrier to noise ratio is\",round(C_No,2),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The carrier to noise ratio is 73.8 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.9, Page number 489"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate system noise temperature\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 30 #diameter of dish(m)\n",
+ "f = 4*10**9 #downlink frequency(Hz)\n",
+ "M = 20 #G/T ratio of earth station\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "Ae = (math.pi*D**2)/4\n",
+ "lamda = c/f\n",
+ "G = (4*math.pi*Ae)/lamda**2\n",
+ "Gdb = 10*math.log10(G)\n",
+ "Ts = Gdb - M\n",
+ "\n",
+ "#Result\n",
+ "print \"The system noise temperature is\",round(Ts),\"dB\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The system noise temperature is 42.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.10, Page number 489"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-10 page 489 example 10.10\n",
+ "#calculate Diameter of the circular mouth of a parabolic antenna, Half Power BeamWidth of the antenna\n",
+ "#For a parabolic antenna\n",
+ "import math\n",
+ "Gp=1500.;#Power gain\n",
+ "w=0.1;#wavelength in m\n",
+ "\n",
+ "#CALCULATION\n",
+ "D=math.sqrt(Gp)*(w/(math.pi));#Diameter of the circular mouth of a parabolic antenna in m\n",
+ "HPBW=58*(w/D);#Half Power BeamWidth of the antenna in deg\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.4f %s %s %.3f %s'%('\\nDiameter of the circular mouth of a parabolic antenna is D=',D,'m','\\nHalf Power BeamWidth of the antenna is HPBW=',HPBW,'deg');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Diameter of the circular mouth of a parabolic antenna is D= 1.2328 m \n",
+ "Half Power BeamWidth of the antenna is HPBW= 4.705 deg\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.11, Page number 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-10 page 490 example 10.11\n",
+ "#calculate Overall gain that can be expected, Overall gain of the system\n",
+ "import math\n",
+ "D=1.;#Assume diameter of the parabolic reflectors in the original system in m\n",
+ "w=1.;#Assume wavelength in m\n",
+ "\n",
+ "#CALCULATION\n",
+ "D1=2.*D;#diameter of the parabolic reflectors in the modified system in m\n",
+ "G=6.*(D/w)**2.;#gain in original system\n",
+ "G1=6.*(D1/w)**2.;#gain in modified system\n",
+ "GdB=10.*math.log10(G1/G);#Overall gain that can be expected in dB\n",
+ "GdBo=2.*GdB;#Overall gain of the system(combining the two antennas one at the Tx and other at the Rx) in dB\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.f %s %s %.f %s' %('\\nOverall gain that can be expected is GdB=',GdB,'dB', '\\nOverall gain of the system(combining the two antennas one at the Tx and other at the Rx) is GdBo=',GdBo,'dB');\n",
+ "\n",
+ "#Note: Check the answer once ..it should be GdB=10log(4)=6 dB and GdBo=12dB\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Overall gain that can be expected is GdB= 6 dB \n",
+ "Overall gain of the system(combining the two antennas one at the Tx and other at the Rx) is GdBo= 12 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.12, Page number 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#chapter-10 page 490 example 10.12\n",
+ "#calculate a)beamwidth between first nulls\n",
+ "#calculate b)beamwidth between half power points\n",
+ "\n",
+ "\n",
+ "D=3.##dimension of a paraboloid in m\n",
+ "f=3.*10.**9.##frequency (S band) in Hz\n",
+ "c=3.*10.**8.##Velocity of light in m/sec\n",
+ "\n",
+ "#CALCULATION\n",
+ "w=c/f##wave length in m\n",
+ "BWFN=140.*(w/D)##BeamWidth between First Nulls in deg\n",
+ "BWHP=70.*(w/D)##BeamWidth between HalfPower points in deg\n",
+ "G=6.*(D/w)**2.##Gain of the antenna \n",
+ "\n",
+ "#OUTPUT\n",
+ "print '%s %.2f %s %s %.2f %s %s %.f' %('BeamWidth between First Nulls is BWFN=',BWFN,'deg','\\nBeamWidth between HalfPower points is BWHP=',BWHP,'deg','\\nGain of the Antenna is G=',G)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "BeamWidth between First Nulls is BWFN= 4.67 deg \n",
+ "BeamWidth between HalfPower points is BWHP= 2.33 deg \n",
+ "Gain of the Antenna is G= 5400\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.13, Page number 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate power gain of optimum horn antenna\n",
+ "#Variable declaration\n",
+ "A = 5\n",
+ "\n",
+ "#Calculation\n",
+ "Gp = 4.5*A**2\n",
+ "\n",
+ "#Result\n",
+ "print \"Power gain of optimum horn antenna =\",Gp\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain of optimum horn antenna = 112.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter11.ipynb b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter11.ipynb new file mode 100755 index 00000000..b654a166 --- /dev/null +++ b/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter11.ipynb @@ -0,0 +1,300 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ea268596f26e72d0ba255402f7b7713669572ea36ff236412ed512a3e76cc14b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter11:Radars"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.1, Page number 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate maximum range of radar system, maximum range of radar system in nautical miles\n",
+ "import math\n",
+ "\n",
+ "#Variable declaraion\n",
+ "lamda = 3.*10**-2#operating unit(cm)\n",
+ "Pt = 600.*10**3 #peak pulse power(W)\n",
+ "Smin = 10.**-13 #minimum detectable signal(W)\n",
+ "Ae = 5. #m^2\n",
+ "sigma = 20. #cross sectional area(m^2)\n",
+ "\n",
+ "#Calculations\n",
+ "Rmax = ((Pt*Ae**2*sigma)/(4*math.pi*lamda**2*Smin))**0.25\n",
+ "Rmax_nau = Rmax/1.853\n",
+ "\n",
+ "#Result\n",
+ "print \"The maximum range of radar system is\",round((Rmax/1E+3),3),\"km\"\n",
+ "print \"The maximum range of radar system in nautical miles is\",round((Rmax_nau/1E+3)),\"nm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum range of radar system is 717.657 km\n",
+ "The maximum range of radar system in nautical miles is 387.0 nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.2, Page number 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Maximum range possible of the antenna\n",
+ "#Variable declaration\n",
+ "Pt = 250.*10**3 #peak pulse power(W)\n",
+ "Smin = 10.**-14 #minimum detectable signal(W)\n",
+ "Ae = 10. #m^2\n",
+ "sigma = 2. #cross sectional area(m^2)\n",
+ "f = 10*10**9 #frequency(Hz)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "G = 2500 #power gain of antenna\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "Rmax = ((Pt*G*Ae*sigma)/((4*math.pi)**2*Smin))**0.25\n",
+ "\n",
+ "#Result\n",
+ "print \"Maximum range possible of the antenna is\",round((Rmax/1E+3),2),\"km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum range possible of the antenna is 298.28 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.3, Page number 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate sight cross section area\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pt = 250.*10**3 #peak pulse power(W)\n",
+ "f = 10.*10**9 #frequency(Hz)\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "G = 4000 #power gain of antenna\n",
+ "R = 50*10**3 #range(m)\n",
+ "Pr = 10**-11 #minimum detectable signal(W)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "Ae = (G*lamda**2)/(4*math.pi)\n",
+ "sigma = (Pr*((4*math.pi*R**2)**2))/(Pt*G*Ae)\n",
+ "\n",
+ "#Result\n",
+ "print \"The radar can sight cross section area of\",round(sigma,2),\"m^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The radar can sight cross section area of 34.45 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.4, Page number 505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate radar's unambiguous range, duty cycle for radar, average power, Bandwidth range for radar\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pt = 400*10**3 #transmitted power(W)\n",
+ "prf = 1500. #pulse repitiion frequency(pps)\n",
+ "tw = 0.8*10**-6 #pulse width(sec)\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Run = c/(2*prf)\n",
+ "\n",
+ "#Part b\n",
+ "dc = tw/(1/prf)\n",
+ "\n",
+ "#Part c\n",
+ "Pav = Pt*dc\n",
+ "\n",
+ "#Part d\n",
+ "n1 = 1\n",
+ "BW1 = n1/tw\n",
+ "\n",
+ "n2 = 1.4\n",
+ "BW2 = n2/tw\n",
+ "\n",
+ "#Results\n",
+ "print \"The radar's unambiguous range is\",round((Run/1E+3),2),\"km\"\n",
+ "print \"The duty cycle for radar is\",dc\n",
+ "print \"The average power is\",round(Pav,2),\"W\"\n",
+ "print \"Bandwidth range for radar is\",(BW1/1E+6),\"MHz and\",(BW2/1E+6),\"MHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The radar's unambiguous range is 100.0 km\n",
+ "The duty cycle for radar is 0.0012\n",
+ "The average power is 480.0 W\n",
+ "Bandwidth range for radar is 1.25 MHz and 1.75 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.5, Page number 505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate maximum detection range \n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pt = 2.5*10**6 #power output(W)\n",
+ "D = 5 #antenna diameter(m)\n",
+ "sigma = 1 #cross sectional area of target(m^2)\n",
+ "B = 1.6*10**6 #receiver bandwidth(Hz)\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "Nf = 12. #noise figure(dB)\n",
+ "f = 5*10**9 #frequency(Hz)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "F = 10**(Nf/10)\n",
+ "Rmax = 48*(((Pt*D**4*sigma)/(B*lamda**2*(F-1)))**0.25)\n",
+ "\n",
+ "#Result\n",
+ "print \"The maximum detection range is\",round(Rmax),\"km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum detection range is 558.0 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.6, Page number 506"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Maximum range with echoing of 50 times and If transmitter power is doubled, range would increase by a factor of\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "Rmax = 30 #maximum range of radar(km)\n",
+ "n = 50 #no. of echos\n",
+ "\n",
+ "#Calculation\n",
+ "R = Rmax*math.sqrt(math.sqrt(n))\n",
+ "\n",
+ "#After doubling the power\n",
+ "R1 = math.sqrt(math.sqrt(2))\n",
+ "\n",
+ "#Results\n",
+ "print \"Maximum range with echoing of 50 times is\",round(R),\"km\"\n",
+ "print \"If transmitter power is doubled, range would increase by a factor of\",round(R1,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum range with echoing of 50 times is 80.0 km\n",
+ "If transmitter power is doubled, range would increase by a factor of 1.19\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Nuclear_Physics/Chapter12.ipynb b/Nuclear_Physics/Chapter12.ipynb index 7fbad62a..68299296 100755 --- a/Nuclear_Physics/Chapter12.ipynb +++ b/Nuclear_Physics/Chapter12.ipynb @@ -1,510 +1,510 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:4e35225448e1e6a4105db4a5e756370df804ed5cec1af259aab244cf2b566068"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Chapter12-Neutrons"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Exx1-pg573"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.1 : : Page-573 (2011)\n",
- "#calculate activity for Cu-63 and disintegrations\n",
- "import math \n",
- "N_0 = 6.23e+23; ## Avogadro's number, per mole\n",
- "m = 0.1; ## Mass of copper foil, Kg\n",
- "phi = 10**12; ## Neutron flux density, per square centimetre sec\n",
- "a_63 = 0.691; ## Abundance of Cu-63\n",
- "a_65 = 0.309; ## Abundance of Cu-65\n",
- "W_m = 63.57; ## Molecular weight, gram\n",
- "sigma_63 = 4.5e-24; ## Activation cross section for Cu-63, square centi metre\n",
- "sigma_65 = 2.3e-24; ## Activation cross section for Cu-65, square centi metre\n",
- "A_63 = phi*sigma_63*m*a_63/W_m*N_0; ## Activity for Cu-63, disintegrations per sec\n",
- "A_65 = phi*sigma_65*m*a_65/W_m*N_0; ## Activity for Cu-65, disintegrations per sec\n",
- "print'%s %.2e %s %.2e %s'%(\"\\nThe activity for Cu-63 is = \",A_63,\" disintegrations per sec\" and \"\\nThe activity for Cu-65 is = \",A_65,\" disintegrations per sec\");\n",
- "\n",
- "## Result\n",
- "## The activity for Cu-63 is = 3.047e+009 disintegrations per sec \n",
- "## The activity for Cu-65 is = 6.97e+008 disintegrations per sec "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The activity for Cu-63 is = 3.05e+09 \n",
- "The activity for Cu-65 is = 6.97e+08 disintegrations per sec\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex2-pg573"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.2 : : Page-573 (2011)\n",
- "import math \n",
- "#calculate enegy loss \n",
- "A_Be = 9.; ## Mass number of beryllium\n",
- "A_U = 238.; ## Mass number of uranium\n",
- "E_los_Be = (1-((A_Be-1)**2/(A_Be+1)**2))*100.; ## Energy loss for beryllium\n",
- "E_los_U = round((1-((A_U-1)**2/(A_U+1)**2))*100.); ## Energy loss for uranium\n",
- "print'%s %.2f %s %.2f %s '%(\"\\nThe energy loss for beryllium is = \",E_los_Be,\" percent\"and \" \\nThe energy loss for uranium is = \",E_los_U,\" percent\");\n",
- "\n",
- "## Check for greater energy loss !!!!\n",
- "if E_los_Be >= E_los_U :\n",
- " print(\"\\nThe energy loss is greater for beryllium\");\n",
- "else:\n",
- " print(\"\\nThe energy loss is greater for uranium\");\n",
- "\n",
- "\n",
- "## Result\n",
- "## The energy loss for beryllium is = 36 percent \n",
- "## The energy loss for uranium is = 2 percent\n",
- "## The energy loss is greater for beryllium \n",
- " "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The energy loss for beryllium is = 36.00 \n",
- "The energy loss for uranium is = 2.00 percent \n",
- "\n",
- "The energy loss is greater for beryllium\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex3-pg574"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.3 : : Page-574 (2011)\n",
- "#calculate energy loss of neutron\n",
- "import math \n",
- "A = 12.; ## Mass number of Carbon\n",
- "alpha = (A-1)**2/(A+1)**2; ## Scattering coefficient\n",
- "E_loss = 1/2.*(1-alpha)*100.; ## Energy loss of neutron\n",
- "print'%s %.2f %s'%(\"\\nThe energy loss of neutron = \",E_loss,\" percent\")\n",
- "\n",
- "## Result\n",
- "## The energy loss of neutron = 14.201 percent \n",
- " "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The energy loss of neutron = 14.20 percent\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex4-pg574"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.4 : : Page-574 (2011)\n",
- "#calculate number of collisions of neutrons \n",
- "import math \n",
- "zeta = 0.209; ## Moderated assembly\n",
- "E_change = 100./1.; ## Change in energy of the neutron\n",
- "E_thermal = 0.025; ## Thermal energy of the neutron, electron volts\n",
- "E_n = 2*10**6; ## Energy of the neutron, electron volts\n",
- "n = 1/zeta*math.log(E_change); ## Number of collisions of neutrons to loss 99 percent of their energies \n",
- "n_thermal = 1/zeta*math.log(E_n/E_thermal); ## Number of collisions of neutrons to reach thermal energies\n",
- "print'%s %.2f %s %.2f %s'%(\"\\nThe number of collisions of neutrons to loss 99 percent of their energies = \",n,\" \\nThe number of collisions of neutrons to reach thermal energies = \",n_thermal,\"\")\n",
- "\n",
- "## Result\n",
- "## The number of collisions of neutrons to loss 99 percent of their energies = 22 \n",
- "## The number of collisions of neutrons to reach thermal energies = 87 \n",
- " "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The number of collisions of neutrons to loss 99 percent of their energies = 22.03 \n",
- "The number of collisions of neutrons to reach thermal energies = 87.07 \n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex5-pg574"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.5 : : Page-574 (2011)\n",
- "#calculate average distance travelled by the neutron\n",
- "import math\n",
- "import scipy\n",
- "from scipy import integrate\n",
- "L = 1.; ## For simplicity assume thermal diffusion length to be unity, unit\n",
- "def fun(x):\n",
- " y=x*math.exp(-x/L)\n",
- " return y\n",
- "x_b = scipy.integrate.quad(fun, 0, 100); ## Average distance travelled by the neutron, unit\n",
- "x_b1=x_b[0]\n",
- "def fun2(x): \n",
- " y1=x**2*math.exp(-x/L)\n",
- " return y1\n",
- "X=scipy.integrate.quad(fun2, 0, 100)\n",
- "x_rms = math.sqrt(X[0]); ## Root mean square of the distance trvelled by the neutron, unit\n",
- "print'%s %.2f %s'%(\"\\nThe average distance travelled by the neutron = \", x_b1,\"*L\");\n",
- "print'%s %.2f %s %.2f %s '%(\"\\nThe root mean square distance travelled by the neutron = \",x_rms,\"\"and \"\",x_rms,\"x_bar\")\n",
- "\n",
- "## Result\n",
- "## The average distance travelled by the neutron = 1*L\n",
- "## The root mean square distance travelled by the neutron = 1.414L = 1.414x_bar \n",
- " "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The average distance travelled by the neutron = 1.00 *L\n",
- "\n",
- "The root mean square distance travelled by the neutron = 1.41 1.41 x_bar \n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex6-pg574"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.6 : : Page-574 (2011)\n",
- "#calculate neutron flux through water \n",
- "import math\n",
- "Q = 5e+08; ## Rate at which neutrons produce, neutrons per sec\n",
- "r = 20.; ## Distance from the source, centi metre\n",
- "## For water\n",
- "lambda_wtr = 0.45; ## Transport mean free path, centi metre\n",
- "L_wtr = 2.73; ## Thermal diffusion length, centi metre\n",
- "phi_wtr = 3*Q/(4.*math.pi*lambda_wtr*r)*math.exp(-r/L_wtr); ## Neutron flux for water, neutrons per square centimetre per sec\n",
- "## For heavy water\n",
- "lambda_h_wtr = 2.40; ## Transport mean free path, centi metre\n",
- "L_h_wtr = 171.; ## Thermal diffusion length, centi metre\n",
- "phi_h_wtr = 3*Q/(4.*math.pi*lambda_h_wtr*r)*math.exp(-r/L_h_wtr); ## Neutron flux for heavy water, neutrons per square centimetre per sec\n",
- "print'%s %.2e %s %.2e %s '%(\"\\nThe neutron flux through water = \",phi_wtr,\" neutrons per square cm per sec\"and \"\\nThe neutron flux through heavy water = \",phi_h_wtr,\" neutrons per square cm per sec\")\n",
- "\n",
- "## Result\n",
- "## The neutron flux through water = 8.730e+003 neutrons per square cm per sec \n",
- "## The neutron flux through heavy water = 2.212e+006 neutrons per square cm per sec \n",
- " "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The neutron flux through water = 8.73e+03 \n",
- "The neutron flux through heavy water = 2.21e+06 neutrons per square cm per sec \n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex7-pg575"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.7 : : Page-575 (2011)\n",
- "#calculate neutron flux and diffusion length\n",
- "import math\n",
- "k = 1.38e-23; ## Boltzmann constant, joules per kelvin\n",
- "T = 323.; ## Temperature, kelvin\n",
- "E = (k*T)/1.6e-19; ## Thermal energy, joules\n",
- "sigma_0 = 13.2e-28; ## Cross section, square metre\n",
- "E_0 = 0.025; ## Energy of the neutron, electron volts\n",
- "sigma_a = sigma_0*math.sqrt(E_0/E); ## Absorption cross section, square metre\n",
- "t_half = 2.25; ## Half life, hours\n",
- "D= 0.69/t_half; ## Decay constant, per hour\n",
- "N_0 = 6.023e+026; ## Avogadro's number, per \n",
- "m_Mn = 55.; ## Mass number of mangnese\n",
- "w = 0.1e-03; ## Weight of mangnese foil, Kg\n",
- "A = 200.; ## Activity, disintegrations per sec\n",
- "N = N_0*w/m_Mn; ## Number of mangnese nuclei in the foil\n",
- "x1 = 1.5; ## Base, metre\n",
- "x2 = 2.0; ## Height, metre\n",
- "phi = A/(N*sigma_a*0.416); ## Neutron flux, neutrons per square metre per sec\n",
- "phi1 = 1.; ## For simplicity assume initial neutron flux to be unity, neutrons/Sq.m-sec\n",
- "phi2 = 1/2.*phi1; ## Given neutron flux, neutrons/Sq.m-sec\n",
- "L1 = 1/math.log(phi1/phi2)/(x2-x1); ## Thermal diffusion length for given neutron flux, m\n",
- "L = math.sqrt(1./((1./L1)**2+(math.pi/x1)**2+(math.pi/x2)**2)); ## Diffusion length, metre\n",
- "print'%s %.2e %s %.2f %s '%(\"\\nThe neutron flux = \",phi,\" neutrons per square metre per sec\"and \" \\nThe diffusion length = \",L,\" metre\");\n",
- "\n",
- "## Result\n",
- "## The neutron flux = 3.51e+008 neutrons per square metre per sec \n",
- "## The diffusion length = 0.38 metre\n",
- "## Note: the difussion length is solved wrongly in the testbook\n",
- " "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The neutron flux = 3.51e+08 \n",
- "The diffusion length = 0.38 metre \n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex8-pg575"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.8 : : Page-575(2011)\n",
- "#find diffusion length for thermal neutron\n",
- "import math\n",
- "N_0 = 6.023e+026; ## Avogadro's number, per mole\n",
- "rho = 1.62e+03; ## Density, kg per cubic metre\n",
- "sigma_a = 3.2e-31; ## Absorption cross section, square metre\n",
- "sigma_s = 4.8e-28; ## Scattered cross section, square metre\n",
- "A = 12.; ## Mass number\n",
- "lambda_a = A/(N_0*rho*sigma_a); ## Absorption mean free path, metre\n",
- "lambda_tr = A/(N_0*rho*sigma_s*(1.-2./(3.*A))); ## Transport mean free path, metre\n",
- "L = math.sqrt(lambda_a*lambda_tr/3.); ## Diffusion length for thermal neutron\n",
- "print'%s %.2f %s'%(\"\\nThe diffusion length for thermal neutron = \",L,\" metre \")\n",
- "\n",
- "## Result\n",
- "## The diffusion length for thermal neutron = 0.590 metre \n",
- " "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The diffusion length for thermal neutron = 0.59 metre \n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex9-pg575"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.9 : : Page-575 (2011)\n",
- "#calculate graphite and neutron age and slowing down length and same as berylliums\n",
- "import math\n",
- "E_0 = 2e+06; ## Average energy of the neutron, electron volts\n",
- "E = 0.025; ## Thermal energy of the neutron, electron volts\n",
- "## For graphite\n",
- "A = 12. ## Mass number\n",
- "sigma_g = 33.5; ## The value of sigma for graphite\n",
- "tau_0 = 1./(6.*sigma_g**2)*(A+2./3.)/(1.-2./(3.*A))*math.log(E_0/E); ## Age of neutron for graphite, Sq.m\n",
- "L_f = math.sqrt(tau_0); ## Slowing down length of neutron through graphite, m\n",
- "print'%s %.2f %s'%(\"\\nFor Graphite, A = \", A,\"\");\n",
- "print'%s %.2f %s'%(\"\\nNeutron age = \",tau_0*1e+004,\" Sq.cm\");\n",
- "print'%s %.2f %s'%(\"\\nSlowing down length =\",L_f,\" m\");\n",
- "## For beryllium\n",
- "A = 9. ## Mass number\n",
- "sigma_b = 57.; ## The value of sigma for beryllium\n",
- "tau_0 = 1/(6.*sigma_b**2)*(A+2./3.)/(1.-2./(3.*A))*math.log(E_0/E); ## Age of neutron for beryllium, Sq.m\n",
- "L_f = math.sqrt(tau_0); ## Slowing down length of neutron through graphite, m\n",
- "print'%s %.2f %s'%(\"\\n\\nFor Beryllium, A = \", A,\"\");\n",
- "print'%s %.2f %s'%(\"\\nNeutron age = \",tau_0*1e+004,\" Sq.cm\");\n",
- "print'%s %.2e %s'%(\"\\nSlowing down length = \",L_f,\" m\");\n",
- "\n",
- "## Result\n",
- "## For Graphite, A = 12\n",
- "## Neutron age = 362 Sq.cm\n",
- "## Slowing down length = 0.190 m\n",
- "\n",
- "## For Beryllium, A = 9\n",
- "## Neutron age = 97 Sq.cm\n",
- "## Slowing down length = 9.9e-002 m "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "For Graphite, A = 12.00 \n",
- "\n",
- "Neutron age = 362.46 Sq.cm\n",
- "\n",
- "Slowing down length = 0.19 m\n",
- "\n",
- "\n",
- "For Beryllium, A = 9.00 \n",
- "\n",
- "Neutron age = 97.46 Sq.cm\n",
- "\n",
- "Slowing down length = 9.87e-02 m\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Ex10-pg576"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "## Exa12.10 : : Page-576 (2011)\n",
- "#find enegy of the neutrons\n",
- "import math\n",
- "theta = 3.5*math.pi/180.; ## Reflection angle, radian\n",
- "d = 2.3e-10; ## Lattice spacing, metre\n",
- "n = 1.; ## For first order\n",
- "h = 6.6256e-34; ## Planck's constant, joule sec\n",
- "m = 1.6748e-27; ## Mass of the neutron, Kg\n",
- "E = n**2*h**2/(8.*m*d**2*math.sin(theta)**2*1.6023e-19); ## Energy of the neutrons, electron volts\n",
- "print'%s %.2f %s'%(\"\\nThe energy of the neutrons = \",E,\" eV\");\n",
- "\n",
- "## Result\n",
- "## The energy of the neutrons = 1.04 eV \n",
- " "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "The energy of the neutrons = 1.04 eV\n"
- ]
- }
- ],
- "prompt_number": 14
- }
- ],
- "metadata": {}
- }
- ]
+{ + "metadata": { + "name": "", + "signature": "sha256:7bae67184aff3b5018323a5a7fd8d73277287467e3722f9114aa02be5e49dd72" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter12-Neutrons" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exx1-pg573" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.1 : : Page-573 (2011)\n", + "#calculate activity for Cu-63 and disintegrations\n", + "import math \n", + "N_0 = 6.23e+23; ## Avogadro's number, per mole\n", + "m = 0.1; ## Mass of copper foil, Kg\n", + "phi = 10**12; ## Neutron flux density, per square centimetre sec\n", + "a_63 = 0.691; ## Abundance of Cu-63\n", + "a_65 = 0.309; ## Abundance of Cu-65\n", + "W_m = 63.57; ## Molecular weight, gram\n", + "sigma_63 = 4.5e-24; ## Activation cross section for Cu-63, square centi metre\n", + "sigma_65 = 2.3e-24; ## Activation cross section for Cu-65, square centi metre\n", + "A_63 = phi*sigma_63*m*a_63/W_m*N_0; ## Activity for Cu-63, disintegrations per sec\n", + "A_65 = phi*sigma_65*m*a_65/W_m*N_0; ## Activity for Cu-65, disintegrations per sec\n", + "print'%s %.2e %s %.2e %s'%(\"\\nThe activity for Cu-63 is = \",A_63,\" disintegrations per sec\" and \"\\nThe activity for Cu-65 is = \",A_65,\" disintegrations per sec\");\n", + "\n", + "## Result\n", + "## The activity for Cu-63 is = 3.047e+009 disintegrations per sec \n", + "## The activity for Cu-65 is = 6.97e+008 disintegrations per sec " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The activity for Cu-63 is = 3.05e+09 \n", + "The activity for Cu-65 is = 6.97e+08 disintegrations per sec\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2-pg573" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.2 : : Page-573 (2011)\n", + "import math \n", + "#calculate enegy loss \n", + "A_Be = 9.; ## Mass number of beryllium\n", + "A_U = 238.; ## Mass number of uranium\n", + "E_los_Be = (1-((A_Be-1)**2/(A_Be+1)**2))*100.; ## Energy loss for beryllium\n", + "E_los_U = round((1-((A_U-1)**2/(A_U+1)**2))*100.); ## Energy loss for uranium\n", + "print'%s %.2f %s %.2f %s '%(\"\\nThe energy loss for beryllium is = \",E_los_Be,\" percent\"and \" \\nThe energy loss for uranium is = \",E_los_U,\" percent\");\n", + "\n", + "## Check for greater energy loss !!!!\n", + "if E_los_Be >= E_los_U :\n", + " print(\"\\nThe energy loss is greater for beryllium\");\n", + "else:\n", + " print(\"\\nThe energy loss is greater for uranium\");\n", + "\n", + "\n", + "## Result\n", + "## The energy loss for beryllium is = 36 percent \n", + "## The energy loss for uranium is = 2 percent\n", + "## The energy loss is greater for beryllium \n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The energy loss for beryllium is = 36.00 \n", + "The energy loss for uranium is = 2.00 percent \n", + "\n", + "The energy loss is greater for beryllium\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3-pg574" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.3 : : Page-574 (2011)\n", + "#calculate energy loss of neutron\n", + "import math \n", + "A = 12.; ## Mass number of Carbon\n", + "alpha = (A-1)**2/(A+1)**2; ## Scattering coefficient\n", + "E_loss = 1/2.*(1-alpha)*100.; ## Energy loss of neutron\n", + "print'%s %.2f %s'%(\"\\nThe energy loss of neutron = \",E_loss,\" percent\")\n", + "\n", + "## Result\n", + "## The energy loss of neutron = 14.201 percent \n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The energy loss of neutron = 14.20 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4-pg574" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.4 : : Page-574 (2011)\n", + "#calculate number of collisions of neutrons \n", + "import math \n", + "zeta = 0.209; ## Moderated assembly\n", + "E_change = 100./1.; ## Change in energy of the neutron\n", + "E_thermal = 0.025; ## Thermal energy of the neutron, electron volts\n", + "E_n = 2*10**6; ## Energy of the neutron, electron volts\n", + "n = 1/zeta*math.log(E_change); ## Number of collisions of neutrons to loss 99 percent of their energies \n", + "n_thermal = 1/zeta*math.log(E_n/E_thermal); ## Number of collisions of neutrons to reach thermal energies\n", + "print'%s %.2f %s %.2f %s'%(\"\\nThe number of collisions of neutrons to loss 99 percent of their energies = \",n,\" \\nThe number of collisions of neutrons to reach thermal energies = \",n_thermal,\"\")\n", + "\n", + "## Result\n", + "## The number of collisions of neutrons to loss 99 percent of their energies = 22 \n", + "## The number of collisions of neutrons to reach thermal energies = 87 \n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The number of collisions of neutrons to loss 99 percent of their energies = 22.03 \n", + "The number of collisions of neutrons to reach thermal energies = 87.07 \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5-pg574" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.5 : : Page-574 (2011)\n", + "#calculate average distance travelled by the neutron\n", + "import math\n", + "import scipy\n", + "from scipy import integrate\n", + "L = 1.; ## For simplicity assume thermal diffusion length to be unity, unit\n", + "def fun(x):\n", + " y=x*math.exp(-x/L)\n", + " return y\n", + "x_b = scipy.integrate.quad(fun, 0, 100); ## Average distance travelled by the neutron, unit\n", + "x_b1=x_b[0]\n", + "def fun2(x): \n", + " y1=x**2*math.exp(-x/L)\n", + " return y1\n", + "X=scipy.integrate.quad(fun2, 0, 100)\n", + "x_rms = math.sqrt(X[0]); ## Root mean square of the distance trvelled by the neutron, unit\n", + "print'%s %.2f %s'%(\"\\nThe average distance travelled by the neutron = \", x_b1,\"*L\");\n", + "print'%s %.2f %s %.2f %s '%(\"\\nThe root mean square distance travelled by the neutron = \",x_rms,\"\"and \"\",x_rms,\"x_bar\")\n", + "\n", + "## Result\n", + "## The average distance travelled by the neutron = 1*L\n", + "## The root mean square distance travelled by the neutron = 1.414L = 1.414x_bar \n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The average distance travelled by the neutron = 1.00 *L\n", + "\n", + "The root mean square distance travelled by the neutron = 1.41 1.41 x_bar \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6-pg574" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.6 : : Page-574 (2011)\n", + "#calculate neutron flux through water \n", + "import math\n", + "Q = 5e+08; ## Rate at which neutrons produce, neutrons per sec\n", + "r = 20.; ## Distance from the source, centi metre\n", + "## For water\n", + "lambda_wtr = 0.45; ## Transport mean free path, centi metre\n", + "L_wtr = 2.73; ## Thermal diffusion length, centi metre\n", + "phi_wtr = 3*Q/(4.*math.pi*lambda_wtr*r)*math.exp(-r/L_wtr); ## Neutron flux for water, neutrons per square centimetre per sec\n", + "## For heavy water\n", + "lambda_h_wtr = 2.40; ## Transport mean free path, centi metre\n", + "L_h_wtr = 171.; ## Thermal diffusion length, centi metre\n", + "phi_h_wtr = 3*Q/(4.*math.pi*lambda_h_wtr*r)*math.exp(-r/L_h_wtr); ## Neutron flux for heavy water, neutrons per square centimetre per sec\n", + "print'%s %.2e %s %.2e %s '%(\"\\nThe neutron flux through water = \",phi_wtr,\" neutrons per square cm per sec\"and \"\\nThe neutron flux through heavy water = \",phi_h_wtr,\" neutrons per square cm per sec\")\n", + "\n", + "## Result\n", + "## The neutron flux through water = 8.730e+003 neutrons per square cm per sec \n", + "## The neutron flux through heavy water = 2.212e+006 neutrons per square cm per sec \n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The neutron flux through water = 8.73e+03 \n", + "The neutron flux through heavy water = 2.21e+06 neutrons per square cm per sec \n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7-pg575" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.7 : : Page-575 (2011)\n", + "#calculate neutron flux and diffusion length\n", + "import math\n", + "k = 1.38e-23; ## Boltzmann constant, joules per kelvin\n", + "T = 323.; ## Temperature, kelvin\n", + "E = (k*T)/1.6e-19; ## Thermal energy, joules\n", + "sigma_0 = 13.2e-28; ## Cross section, square metre\n", + "E_0 = 0.025; ## Energy of the neutron, electron volts\n", + "sigma_a = sigma_0*math.sqrt(E_0/E); ## Absorption cross section, square metre\n", + "t_half = 2.25; ## Half life, hours\n", + "D= 0.69/t_half; ## Decay constant, per hour\n", + "N_0 = 6.023e+026; ## Avogadro's number, per \n", + "m_Mn = 55.; ## Mass number of mangnese\n", + "w = 0.1e-03; ## Weight of mangnese foil, Kg\n", + "A = 200.; ## Activity, disintegrations per sec\n", + "N = N_0*w/m_Mn; ## Number of mangnese nuclei in the foil\n", + "x1 = 1.5; ## Base, metre\n", + "x2 = 2.0; ## Height, metre\n", + "phi = A/(N*sigma_a*0.416); ## Neutron flux, neutrons per square metre per sec\n", + "phi1 = 1.; ## For simplicity assume initial neutron flux to be unity, neutrons/Sq.m-sec\n", + "phi2 = 1/2.*phi1; ## Given neutron flux, neutrons/Sq.m-sec\n", + "L1 = 1/math.log(phi1/phi2)/(x2-x1); ## Thermal diffusion length for given neutron flux, m\n", + "L = math.sqrt(1./((1./L1)**2+(math.pi/x1)**2+(math.pi/x2)**2)); ## Diffusion length, metre\n", + "print'%s %.2e %s %.2f %s '%(\"\\nThe neutron flux = \",phi,\" neutrons per square metre per sec\"and \" \\nThe diffusion length = \",L,\" metre\");\n", + "\n", + "## Result\n", + "## The neutron flux = 3.51e+008 neutrons per square metre per sec \n", + "## The diffusion length = 0.38 metre\n", + "## Note: the difussion length is solved wrongly in the testbook\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The neutron flux = 3.51e+08 \n", + "The diffusion length = 0.38 metre \n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8-pg575" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.8 : : Page-575(2011)\n", + "#find diffusion length for thermal neutron\n", + "import math\n", + "N_0 = 6.023e+026; ## Avogadro's number, per mole\n", + "rho = 1.62e+03; ## Density, kg per cubic metre\n", + "sigma_a = 3.2e-31; ## Absorption cross section, square metre\n", + "sigma_s = 4.8e-28; ## Scattered cross section, square metre\n", + "A = 12.; ## Mass number\n", + "lambda_a = A/(N_0*rho*sigma_a); ## Absorption mean free path, metre\n", + "lambda_tr = A/(N_0*rho*sigma_s*(1.-2./(3.*A))); ## Transport mean free path, metre\n", + "L = math.sqrt(lambda_a*lambda_tr/3.); ## Diffusion length for thermal neutron\n", + "print'%s %.2f %s'%(\"\\nThe diffusion length for thermal neutron = \",L,\" metre \")\n", + "\n", + "## Result\n", + "## The diffusion length for thermal neutron = 0.590 metre \n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The diffusion length for thermal neutron = 0.59 metre \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9-pg575" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.9 : : Page-575 (2011)\n", + "#calculate graphite and neutron age and slowing down length and same as berylliums\n", + "import math\n", + "E_0 = 2e+06; ## Average energy of the neutron, electron volts\n", + "E = 0.025; ## Thermal energy of the neutron, electron volts\n", + "## For graphite\n", + "A = 12. ## Mass number\n", + "sigma_g = 33.5; ## The value of sigma for graphite\n", + "tau_0 = 1./(6.*sigma_g**2)*(A+2./3.)/(1.-2./(3.*A))*math.log(E_0/E); ## Age of neutron for graphite, Sq.m\n", + "L_f = math.sqrt(tau_0); ## Slowing down length of neutron through graphite, m\n", + "print'%s %.2f %s'%(\"\\nFor Graphite, A = \", A,\"\");\n", + "print'%s %.2f %s'%(\"\\nNeutron age = \",tau_0*1e+004,\" Sq.cm\");\n", + "print'%s %.2f %s'%(\"\\nSlowing down length =\",L_f,\" m\");\n", + "## For beryllium\n", + "A = 9. ## Mass number\n", + "sigma_b = 57.; ## The value of sigma for beryllium\n", + "tau_0 = 1/(6.*sigma_b**2)*(A+2./3.)/(1.-2./(3.*A))*math.log(E_0/E); ## Age of neutron for beryllium, Sq.m\n", + "L_f = math.sqrt(tau_0); ## Slowing down length of neutron through graphite, m\n", + "print'%s %.2f %s'%(\"\\n\\nFor Beryllium, A = \", A,\"\");\n", + "print'%s %.2f %s'%(\"\\nNeutron age = \",tau_0*1e+004,\" Sq.cm\");\n", + "print'%s %.2e %s'%(\"\\nSlowing down length = \",L_f,\" m\");\n", + "\n", + "## Result\n", + "## For Graphite, A = 12\n", + "## Neutron age = 362 Sq.cm\n", + "## Slowing down length = 0.190 m\n", + "\n", + "## For Beryllium, A = 9\n", + "## Neutron age = 97 Sq.cm\n", + "## Slowing down length = 9.9e-002 m " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "For Graphite, A = 12.00 \n", + "\n", + "Neutron age = 362.46 Sq.cm\n", + "\n", + "Slowing down length = 0.19 m\n", + "\n", + "\n", + "For Beryllium, A = 9.00 \n", + "\n", + "Neutron age = 97.46 Sq.cm\n", + "\n", + "Slowing down length = 9.87e-02 m\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10-pg576" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "## Exa12.10 : : Page-576 (2011)\n", + "#find enegy of the neutrons\n", + "import math\n", + "theta = 3.5*math.pi/180.; ## Reflection angle, radian\n", + "d = 2.3e-10; ## Lattice spacing, metre\n", + "n = 1.; ## For first order\n", + "h = 6.6256e-34; ## Planck's constant, joule sec\n", + "m = 1.6748e-27; ## Mass of the neutron, Kg\n", + "E = n**2*h**2/(8.*m*d**2*math.sin(theta)**2*1.6023e-19); ## Energy of the neutrons, electron volts\n", + "print'%s %.2f %s'%(\"\\nThe energy of the neutrons = \",E,\" eV\");\n", + "\n", + "## Result\n", + "## The energy of the neutrons = 1.04 eV \n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "The energy of the neutrons = 1.04 eV\n" + ] + } + ], + "prompt_number": 14 + } + ], + "metadata": {} + } + ] }
\ No newline at end of file diff --git a/Nuclear_Physics/README.txt b/Nuclear_Physics/README.txt new file mode 100755 index 00000000..cb19ed24 --- /dev/null +++ b/Nuclear_Physics/README.txt @@ -0,0 +1,10 @@ +Contributed By: harsha vardhan +Course: msc +College/Institute/Organization: iitbombay +Department/Designation: msc chem +Book Title: Nuclear Physics +Author: D. C. Tayal +Publisher: Himalaya Publishing House, Mumbai +Year of publication: 2011 +Isbn: 978-93-5024-743-3 +Edition: 5
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering/README.txt b/Principles_Of_Geotechnical_Engineering/README.txt new file mode 100755 index 00000000..10752fd1 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering/README.txt @@ -0,0 +1,10 @@ +Contributed By: jeevan lal bhukya +Course: btech +College/Institute/Organization: iitbombay +Department/Designation: computer aerospace +Book Title: Principles Of Geotechnical Engineering +Author: B. M. Das +Publisher: Cenage & learning, New Delhi +Year of publication: 2013 +Isbn: 978-1133108665 +Edition: 7
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering/screenshots/Chapter10_1.png b/Principles_Of_Geotechnical_Engineering/screenshots/Chapter10_1.png Binary files differnew file mode 100755 index 00000000..0ea4bedb --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering/screenshots/Chapter10_1.png diff --git a/Principles_Of_Geotechnical_Engineering/screenshots/Chapter11_1.png b/Principles_Of_Geotechnical_Engineering/screenshots/Chapter11_1.png Binary files differnew file mode 100755 index 00000000..692518ec --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering/screenshots/Chapter11_1.png diff --git a/Principles_Of_Geotechnical_Engineering/screenshots/Chapter15.png b/Principles_Of_Geotechnical_Engineering/screenshots/Chapter15.png Binary files differnew file mode 100755 index 00000000..f9971dba --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering/screenshots/Chapter15.png diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter10.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter10.ipynb new file mode 100755 index 00000000..003535c3 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter10.ipynb @@ -0,0 +1,160 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e88cf5fadb0380ed068b9242245f52a6fc3119add2d6c78c60f47b1c3197bfc1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10-Stresses in a Soil Mass"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#principal stress and normal stresses and shear stresses\n",
+ "##initialisation of variables\n",
+ "sx= 2000. ##lb/ft^3\n",
+ "sy= 2500. ##lb/ft^3\n",
+ "T= 800. ##lb/ft^3\n",
+ "t= 0.348##radians\n",
+ "##calculations\n",
+ "s1= (sx+sy)/2.+math.sqrt(((sy-sx)/2.)**2+T**2)\n",
+ "s2= (sx+sy)/2.-math.sqrt(((sy-sx)/2.)**2+T**2)\n",
+ "sn= (sx+sy)/2.+(sy-sx)*math.cos(2.*t)/2.-T*math.sin(2*t)\n",
+ "Tn= (sy-sx)*math.sin(2.*t)/2.+T*math.cos(2*t)\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('principle stress s1 = ',s1,' lb/ft^3 ')\n",
+ "print'%s %.2f %s'% ('principle stress s2 = ',s2,' lb/ft^3 ')\n",
+ "print'%s %.2f %s'% ('normal stress = ',sn,' lb/ft^3 ')\n",
+ "print'%s %.2f %s'% ('shear stress = ',Tn,' lb/ft^3 ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "principle stress s1 = 3088.15 lb/ft^3 \n",
+ "principle stress s2 = 1411.85 lb/ft^3 \n",
+ "normal stress = 1928.93 lb/ft^3 \n",
+ "shear stress = 774.22 lb/ft^3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate vertical stress increase\n",
+ "##initialisation of variables\n",
+ "x= 3. ##m\n",
+ "y= 4. ##m\n",
+ "P= 5. ##kN\n",
+ "z= 2. ##m\n",
+ "##calculations\n",
+ "r= math.sqrt(x**2+y**2)\n",
+ "k= r/z\n",
+ "I= 3./(2.*math.pi*((r/z)**2+1)**2.5)\n",
+ "s= P*I/z**2\n",
+ "##results\n",
+ "print'%s %.4f %s'% ('verticle stress increase at 2m = ',s,' kN/m^3 ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "verticle stress increase at 2m = 0.0042 kN/m^3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the value of pressure and plot the graph\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "from math import log\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#given\n",
+ "p=numpy.array([-9,-6,-3, 0,3,6,9])\n",
+ "e=numpy.array([0.017,0.084,0.480,0.818,0.480,0.084,0.017])\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "\n",
+ "#results\n",
+ "\n",
+ "pyplot.plot(p,e)\n",
+ "pyplot.xlabel('Pressure (ton/ft^2)')\n",
+ "pyplot.ylabel('void ratio ,e')\n",
+ "pyplot.title('Graph of pressure vs void ratio')\n",
+ "pyplot.show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEZCAYAAACXRVJOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XecFPX9x/HXOxTFXrBiIcYGFiQaxH6KUaxYIEqMKfpT\nTMReECNwaGIJ0dgrKgkqICCIEYP1VGyA9CqoKMWCKIigSPn8/vjOcutx/XZutnyej8c92Jmdnf2w\ntzef+XaZGc4559zPkg7AOedcdvCE4JxzDvCE4JxzLuIJwTnnHOAJwTnnXMQTgnPOOcATgssAScWS\n+mfoXNtJekPSt5L6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M4J3p9URTjMspPEiJUIb1aQTxlz10lSX8jVEldUc7T\nOxA+C+fW8YTgskV5d6tl6/v7EqY9Hy9pCmHlt4ZAETBR0nhCSeBOQgPqa1GVT3+ge3SOfxIaascD\nW6edv+x73QQ0ihqkpwK91wsu3Mk3VJi/H0LVUstUozJQDBwoaRJwM6Vz05d9r9TjE/hpdVH6c5OA\nNVE31MvKxlKWpJ2A64EWhM9rgsI0yCm++Ixbj09/7VwdSCoGZpjZoAyc632gTdS4HJuogf0VM/tV\nnO/jco8nBOfqQGH933+bWSbGH9QLSZcCX5vZE0nH4rKLJwTnnHOAtyE455yLeEJwzjkHeEJwzjkX\n8YTgnHMO8ITgnHMu4gnBOeccAP8P/QKt8gmEtZAAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x54c4510>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter11.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter11.ipynb new file mode 100755 index 00000000..acd23c6c --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter11.ipynb @@ -0,0 +1,666 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5a229faa6e3645196b99851feb0572545419f102708048be683493e984195c30"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11-Compressibility of Soil"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg303"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#evaluvate The elastic settlement at the centre of foundation\n",
+ "Tz=150.\n",
+ "b=1.\n",
+ "l=2.\n",
+ "z=5.*b\n",
+ "Es= (10000*2 + 8000*1 +12000*2)/5\n",
+ "a=4.\n",
+ "H=z\n",
+ "m=l/b\n",
+ "n=2.*H/b\n",
+ "F1=0.641 ##from tables 11.1 and 11.2\n",
+ "F2=0.031\n",
+ "u=0.3\n",
+ "Is= F1 + ((2.-u)/(1.-u))*F2\n",
+ "If=0.71 ##from table 11.3\n",
+ "Sef= Tz *a*b/l *(1-u**2)*Is*If/Es\n",
+ "Ser=0.93*Sef\n",
+ "print'%s %.3f %s'%('The elastic settlement at the centre of foundation =',Ser,'m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The elastic settlement at the centre of foundation = 0.012 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the value of pressure\n",
+ "#find the value of e and plot the graph\n",
+ "## one value of e is done \n",
+ "Gs=2.75\n",
+ "A=30.68\n",
+ "Ms=128.\n",
+ "p=1.\n",
+ "Hs=Ms/(A*Gs*p)\n",
+ "H=2.540\n",
+ "Hv=H-Hs\n",
+ "e=Hv/Hs\n",
+ "print'%s %.3f %s'%('the value of e for give values =',e,'')\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "from math import log\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#given\n",
+ "p=numpy.array([0,0.5,1,2,4,8,16,32])\n",
+ "e=numpy.array([0.671,0.637,0.622,0.599,0.572,0.529,0.464,0.390])\n",
+ "e1=.9\n",
+ "e2=.8\n",
+ "sig1=4.\n",
+ "sig2=2.\n",
+ "#calculations\n",
+ "Cc=(e1-e2)/log(sig1/sig2)\n",
+ "\n",
+ "#results\n",
+ "print '%s %.2f %s'%('The value of Cv (cm^2/sec) = ',Cc,'')\n",
+ "pyplot.plot(p,e)\n",
+ "pyplot.xlabel('Pressure (ton/ft^2)')\n",
+ "pyplot.ylabel('void ratio ,e')\n",
+ "pyplot.title('Graph of pressure vs void ratio')\n",
+ "pyplot.show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of e for give values = 0.674 \n",
+ "The value of Cv (cm^2/sec) = 0.14 \n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEZCAYAAACJjGL9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XecXVW5//HPlxRIiEiLAUOJSJEgJURCCcJgKKEGRapK\nUSFK9QoKKF4G8YIRKXr9URQERAVEkCAEAgQGQUIJEIophBIghZYQSIALCXl+f6x9mMNk5syZyZzZ\n58x836/XvHJ2WXs/s8/kPGettdfaigjMzMxaskLeAZiZWXVzojAzs5KcKMzMrCQnCjMzK8mJwszM\nSnKiMDOzkpworGIk1Uu6poOONUDSvyS9I+m8jjimlU/SOEnfamHbIElLJVXs80TSJZLOqNTxrbSe\neQdgnUfSIcB/AZsB7wIvAldHxCUVOmVHDtI5Bng9IlbpwGNamSJir846l6Qjge9ExJeLzv/9zjq/\nLcs1im5C0snARcAYYEBEDAC+BwyX1LuFMsv796HlLF9sfWBqRxxIUu5fkCT1yDuGPFTDtbd2iAj/\ndPEf4NPAIuCrrex3FXAJMC7b/yvA3sATwNvAy8CZRfsPApYCRwOzgTnAyUXbzwSuB64G3gGeAYaW\nOP8OwKPAAuARYPuiuD4EPgAWAl9pIfZLgTuzczUA6xVtXwocC8wAns/W7QNMBt4C/g1sXrT/qcCs\n7FjTCucEhgGTsuvxKnB+tr4OeKVJTDOLytUDfweuycp+O3tfrsiu2y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L2LYq3+DURcXEL13TVbN/i+aMeAXYC/tNcGeueXKOwatdH0hOkpxjOBP5IeuDKIxHx\nUrbP7sDh2X4PAasDG2ZljlJ6mt0W2dTWzwMbSPqtpD2AT0zX3YK7iubw2R04LTvXvcCKfHImY4D1\nSVM3F4hPPiRmOHANQETcC6yRNRcFcFtELI6IeaTZSAvPONgduKPJMYv/bZMs8V4L/CYiZhZtmgMM\nas8xretyjcKq3fvZczs+lioHvNtkv+Mj4q6mhZWe87EPcJWkCyLiGklbkppwvkd6HOd3gCU0fnFa\nqclhmp7raxExo5W4iz/Am6uptPQB/2HR64+AnpL6AqtGxKutnLMtfg9Mz5qmmsblCeDsE1yjsK5g\nPHBsocNW0sZZX8J6wBsRcTlpzv2tJa0B9IiIm4Cf0djkMxP4Uvb6662c68TCgqQhzezzElA8jfNC\n4FNFy/cD38jK12UxLqT55CFSU9Q9LcTT9NitkvQLUtPWfzWzeW3StTD7mBOFVbvmvt027U+4HJgC\nPC7padLTu3qSphKfLOlxUs3hIlLH7b1Z09E1pOm6AX5N6iB+HFij6PhNz3U20CvrCH8GOGuZ4NI3\n/55KzxqB1EQ1uNCZDdQDQyU9CZxD4zMNmp6r8HpPPtnsVLztSeCj7HbZk5rG0pSkdUhTfG9Kul5P\nSPpO0S7DSInM7GOeZtysAiTVA1Mj4voOONZjwLCsU7tiso79CRGxTSXPY7XHicKsAiT1B66OiI4Y\nP9EpJJ0IzI+IP+cdi1UXJwozMyvJfRRmZlaSE4WZmZXkRGFmZiU5UZiZWUlOFGZmVpIThZmZlfT/\nAaONSfy0Nv4aAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5b0e130>"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value compression index\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "#calculate Compression index\n",
+ "e11=0.9\n",
+ "e21=0.8\n",
+ "T2=4.\n",
+ "T1=2.\n",
+ "Cc= (e11-e21)/math.log10(T2/T1) ## from loading branch\n",
+ "e1=0.67\n",
+ "e2=0.655\n",
+ "Cs=(e1-e2)/math.log10(T2/T1)\n",
+ "k=Cs/Cc\n",
+ "T3=12.\n",
+ "e3=e11-Cc*math.log10(T3/T1)\n",
+ "print'%s %.2f %s'%('Compression index Cc= ',Cc,'')\n",
+ "print'%s %.2f %s'%(' Cs/Cc = ',k,'')\n",
+ "print'%s %.2f %s'%(' e3 = ',e3,'')\n",
+ "#calculate the value of Cv\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "import math\n",
+ "from math import log\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#given\n",
+ "p=numpy.array([.25,.5,1.,2.,4.,8.,16.,8.,4.,2.])\n",
+ "e=numpy.array([1.03,1.02,0.98,0.91,0.79,0.71,0.62,0.635,0.655,0.67])\n",
+ "e1=.9\n",
+ "e2=.8\n",
+ "sig1=4.\n",
+ "sig2=2.\n",
+ "#calculations\n",
+ "Cc=(e1-e2)/log(sig1/sig2)\n",
+ "\n",
+ "#results\n",
+ "print 'The value of Cv (cm^2/sec) = ',Cc\n",
+ "pyplot.plot(p,e)\n",
+ "pyplot.xlabel('Pressure (ton/ft^2)')\n",
+ "pyplot.ylabel('void ratio ,e')\n",
+ "pyplot.title('Graph of pressure vs void ratio')\n",
+ "pyplot.show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Compression index Cc= 0.33 \n",
+ " Cs/Cc = 0.15 \n",
+ " e3 = 0.64 \n",
+ "The value of Cv (cm^2/sec) = 0.144269504089\n"
+ ]
+ },
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dBbwbEdfnHYtVFicKMzNrkdsozMysRU4UZmbWIicKMzNrkROFmZm1yInCzMxa\n5ERhZmYt+v/jvQbqw2EtYAAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5d2cab0>"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate Primary Consolidation Sc in three parts\n",
+ "Gd=14.\n",
+ "Gss=18.\n",
+ "Gsc=19.\n",
+ "Gw=9.81\n",
+ "To= 2.*Gd+4.*(Gss-Gw)+2*(Gsc-Gw)\n",
+ "LL=40.\n",
+ "Cc=0.009*(LL-10)\n",
+ "H=4.\n",
+ "T=100.\n",
+ "e=0.8\n",
+ "Sc= Cc*H*math.log10((To+T)/To)/(1.+e)\n",
+ "print'%s %.2f %s'%('a)Primary Consolidation Sc = ',Sc,' m')\n",
+ "\n",
+ "\n",
+ "Tc=190\n",
+ "Cs=Cc/6\n",
+ "Sc= Cs*H*math.log10((To+T)/To)/(1+e)\n",
+ "print'%s %.2f %s'%(' b)Primary Consolidation Sc =',Sc,'m')\n",
+ "\n",
+ "\n",
+ "Tc=170\n",
+ "Sc= Cc*H*math.log10((To+T)/Tc)/(1+e)+ Cs*H*math.log10(Tc/To)/(1+e)\n",
+ "print'%s %.3f %s'%(' c)Primary Consolidation Sc =',Sc,' m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)Primary Consolidation Sc = 0.21 m\n",
+ " b)Primary Consolidation Sc = 0.04 m\n",
+ " c)Primary Consolidation Sc = 0.047 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate The settlement in the field Sc\n",
+ "Gs=18.\n",
+ "Gw=9.81\n",
+ "H=10.\n",
+ "eo=1.1\n",
+ "To=5.*(Gs-Gw)\n",
+ "T1=48.\n",
+ "T=To+T1\n",
+ "e1=1.045 ## void ratio corresponding to T \n",
+ "e=eo-e1\n",
+ "Sc=H*e/(1.+eo)\n",
+ "print'%s %.2f %s'%('The settlement in the field Sc = ',Sc,' m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The settlement in the field Sc = 0.26 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate Total consolidation settlement of the clay\n",
+ "T=8.5\n",
+ "eo=0.8\n",
+ "Cc=0.28\n",
+ "To=2650.\n",
+ "T1=970.\n",
+ "C1=0.02\n",
+ "t2=5.\n",
+ "t1=1.5\n",
+ "H=8.5*12\n",
+ "epr=Cc*math.log10((To+T1)/To)\n",
+ "ep=eo-epr\n",
+ "C2=C1/(1.+ep)\n",
+ "Sc=epr*H/(1.+eo)\n",
+ "Ss=C2*H*math.log10(t2/t1)\n",
+ "TS=Sc+Ss\n",
+ "print'%s %.1f %s'%('Total consolidation settlement of the clay =',TS,' in')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total consolidation settlement of the clay = 2.8 in\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate t field\n",
+ "##T50 = Cvtlab /H^2 lab = Cvtfield?H^2 fiels\n",
+ "tl=140.\n",
+ "Hf=3.\n",
+ "Hd=0.025/2.\n",
+ "tf=tl*Hf**2/Hd**2\n",
+ "k=tf/(3600.*24.)\n",
+ "print'%s %.1f %s'%('t field = ',k,' days')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "t field = 93.3 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##Tv is directly proportional to U^2\n",
+ "t1=93.333\n",
+ "U2=30.\n",
+ "U1=50.\n",
+ "t2=t1*U2**2./U1**2.\n",
+ "print'%s %.2f %s'%('t2 =',t2,' days')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "t2 = 33.60 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#evaluvate Cv\n",
+ "#intilization variable\n",
+ "t90=75.*24.*60.*60. ## time in sec\n",
+ "T90=0.848\n",
+ "Hd=1.5*100. ##in cm\n",
+ "Cv=T90*Hd**2/t90\n",
+ "print'%s %.3f %s'%('Cv =',Cv,' cm^2/sec')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cv = 0.003 cm^2/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate K and t60\n",
+ "To=3000. ## lb/ft^2\n",
+ "eo=1.1\n",
+ "e1=0.9\n",
+ "e=eo-e1\n",
+ "ea=(eo+e1)/2.\n",
+ "T1=3000. ## lb/ft^2\n",
+ "T=1. ## in\n",
+ "t = 2. ## min\n",
+ "m=(e/T1)/(1.+ea)\n",
+ "U=50.\n",
+ "Tv=0.197\n",
+ "Gw=62.4 ##lb/ft^3\n",
+ "Cv=Tv*(T/(2.*12.)**2)/t\n",
+ "k=Cv*m*Gw *10**7\n",
+ "print'%s %.3f %s'%('a)k = ',k,' x10^-7 ft/min')\n",
+ "\n",
+ "\n",
+ "U=60\n",
+ "Tv=0.286\n",
+ "H=6\n",
+ "t60=Tv*H**2/(Cv*60*24)\n",
+ "print'%s %.1f %s'%(' b)t60 =',t60,' days')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)k = 3.557 x10^-7 ft/min\n",
+ " b)t60 = 41.8 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the value of Cv\n",
+ "import math\n",
+ "#Cv\n",
+ "t50=19\n",
+ "Hd=2.24/2\n",
+ "Cv=0.197*Hd**2/t50\n",
+ "print'%s %.3f %s'%('Cv = ',Cv,' cm^2/min')\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "import math\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#given\n",
+ "t=numpy.array([.02,.1,.25,.5,1,2.,4.,8.,16.,30.,60.,120.,240.,480.,960.,1440.])\n",
+ "gauge=numpy.array([3975.,4082.,4102.,4128.,4166.,4224.,4298.,4420.,4572.,4737.,4923.,5080.,5207.,5283.,5334.,5364.])\n",
+ "Hdr=2.24\n",
+ "t50=19.\n",
+ "#calculations\n",
+ "Cv=.197*(Hdr/2)**2 /t50/60.\n",
+ "leng=len(t)\n",
+ "logt=numpy.zeros(leng)\n",
+ "for i in range(0,leng):\n",
+ "\tlogt[i]=math.log(t[i])\n",
+ "\n",
+ "#results\n",
+ "print 'The value of Cv (cm^2/sec) = ',Cv\n",
+ "pyplot.plot(logt,gauge)\n",
+ "pyplot.xlabel('Time(min) - log scale')\n",
+ "pyplot.ylabel('Dial reading (cm)')\n",
+ "pyplot.title('Graph of dial reading vs time')\n",
+ "pyplot.show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cv = 0.013 cm^2/min\n",
+ "The value of Cv (cm^2/sec) = 0.000216769122807\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEZCAYAAABmTgnDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmclXX5//HXW1zAwi2NZFGpUEEtERV3xkzEJTE3NMU1\n/SVf06+WpX4zsJLMcsFMW8yEcgk3RAMElXHJBU1UFDcqVFA0txQ3lrl+f3w+A8dxlgNzzpxZ3s/H\n4zy4z33u5boHmOt8dkUEZmZmjVml0gGYmVnr52RhZmZNcrIwM7MmOVmYmVmTnCzMzKxJThZmZtYk\nJwurKEmjJP25RNfqJuleSe9K+mURxx8j6b6C9+9J2qSI8zaRVCOpIv9/8r2/mLevkPSjSsSxsor9\nOVvrsmqlA7DWRdJhwGnAFsD7wL+BsRFxRZluWcqBPicCr0fEWisVSETXEsbSIiLipErH0Bh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prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg346"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate SC\n",
+ "LL=40.\n",
+ "Cc=0.009*(LL-10)\n",
+ "H=10.*12.\n",
+ "eo=1.0\n",
+ "Gss=120.\n",
+ "Gsc=110.\n",
+ "Gd=100.\n",
+ "To=10.*Gd +10.*(Gss-62.4)+10.*(Gsc-62.4)/2.\n",
+ "\n",
+ "Tt=0.408\n",
+ "Tm=0.232\n",
+ "Tb=0.019\n",
+ "Tav= (Tt+4.*Tm+Tb)/6.\n",
+ "Sc=Cc*H*math.log10((To+Tav*1000.)/To)/(1.+eo)\n",
+ "print'%s %.3f %s'%('Sc =',Sc,' in')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sc = 0.826 in\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#intilization variable\n",
+ "#Calculate total primary\n",
+ "import math\n",
+ "H = 6.\n",
+ "Cc = 0.28\n",
+ "eo = 0.9\n",
+ "Cv = 0.36\n",
+ "To=210.\n",
+ "Tp=115.\n",
+ "Sc= Cc*H*math.log10((To+Tp)/To)/(1+eo)\n",
+ "t2=9.\n",
+ "Hd=3.\n",
+ "Tv=Cv*t2/Hd**2\n",
+ "U=0.67\n",
+ "Tf=0.677*Tp\n",
+ "print'%s %.1f %s'%('Tf =',Tf,' kN/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tf = 77.9 kN/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter12.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter12.ipynb new file mode 100755 index 00000000..cbcbfe36 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter12.ipynb @@ -0,0 +1,325 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:72543990db7f8372d360761435a730b82b5eb7400e08be2b7657eafbc30628e4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12-Shear Strength of Soil"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg378"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Determine the relationships for peak shear strength(tf) and residual shear strength(tr).\n",
+ "D=50 ## in mm\n",
+ "A= math.pi/4. *(D/1000.)**2\n",
+ "## solving for test 1 \n",
+ "N=150.\n",
+ "Sp=157.5\n",
+ "Sr=44.2\n",
+ "Tf=Sp/A\n",
+ "Tr=Sr/A\n",
+ "## from graph\n",
+ "k=math.tan(27/57.3)\n",
+ "k1=math.tan(14.6/57.3)\n",
+ "\n",
+ "print'%s %.3f %s'%('Peak strength Tf = 40+ t*',k,'')\n",
+ "print'%s %.3f %s'%(' Residual strength Tr = t*',k1,'')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peak strength Tf = 40+ t* 0.509 \n",
+ " Residual strength Tr = t* 0.260 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Determine\n",
+ "#a.Angle of friction,f\u0004\n",
+ "#b.Angleuthat the failure plane makes with the major principal plane\n",
+ "T3=16. ## lb/in^2\n",
+ "Tf=25. ## lb/in^2\n",
+ "T1=T3+Tf\n",
+ "a= math.asin((T1-T3)/(T1+T3))*57.3 ## Mohr's circle\n",
+ "print'%s %.2f %s'%('a)Angle of friction,a = ',a,'')\n",
+ "b= 45.+ a/2.\n",
+ "print'%s %.2f %s'%(' b)Angle b that the failure plane makes with the major principal plane = ',b,'')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)Angle of friction,a = 26.02 \n",
+ " b)Angle b that the failure plane makes with the major principal plane = 58.01 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the normal stress s\u0004and the shear stress tfon the failure plane.\n",
+ "#b.Determine the effective normal stress on the plane of maximum shear stress\n",
+ "T1=41.\n",
+ "T3=16.\n",
+ "a=58.\n",
+ "T=(T1+T3)/2. + (T1-T3)*math.cos(2.*a/57.3)/2.\n",
+ "tf=(T1-T3)*math.sin(2.*a/57.3)/2\n",
+ "print'%s %.2f %s'%('a)the normal stress T = ',T,' lb/in^2')\n",
+ "print'%s %.2f %s'%('(b) and the shear stress tf = ',tf,' lb/in^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)the normal stress T = 23.02 lb/in^2\n",
+ "(b) and the shear stress tf = 11.24 lb/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#The equation of the effective stress failure envelope for normally consolidated clayey soilistf \u0001s\u0004tan 30\u0005. A drained triaxial test was conducted with the same soil at a chamberconfining pressure of 10 lb/in.2Calculate the deviator stress at failure.\n",
+ "##For normally consolidated clay, c' \u0004= 0.\n",
+ "a=30.\n",
+ "T3=10.\n",
+ "T1=T3*(math.tan(60/57.3))**2\n",
+ "Tf=T1-T3\n",
+ "print'%s %.2f %s'%('The deviator stress at failure = ',Tf,' lb/in^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The deviator stress at failure = 19.99 lb/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Determine the shear strength parameters.\n",
+ "T13=70.\n",
+ "T1f=130.\n",
+ "T11=T13+T1f\n",
+ "\n",
+ "T23=160.\n",
+ "T2f=223.5\n",
+ "T21=T23+T2f\n",
+ "\n",
+ "a= 2*(math.atan(((T11-T21)/(T13-T23))**0.5) *57.3-45)\n",
+ "c= (T11-T13*((math.tan((45+a/2.)/57.3))**2)/(2*math.tan(45+a/2.)/57.3))\n",
+ "d=c-267\n",
+ "print'%s %.2f%s'%('the shear strength parameter d = ',d,' kN/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the shear strength parameter d = 20.69 kN/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg394"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.Consolidated-undrained angle of shearing resistance,f\n",
+ "#b.Drained friction angle,f\u0004\n",
+ "T3=12.\n",
+ "Tf=9.1\n",
+ "T1=T3+Tf\n",
+ "u=6.8\n",
+ "a=math.asin((T1-T3)/(T1+T3))\n",
+ "\n",
+ "a1= math.asin((T1-T3)/(T1+T3-2*u))\n",
+ "\n",
+ "print'%s %.1f %s'%('a)Consolidated-undrained angle of shearing resistance = ',a*57.3,' degrees')\n",
+ "print'%s %.1f %s'%(' b)Drained friction angle =',a1*57.3,' degrees')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)Consolidated-undrained angle of shearing resistance = 16.0 degrees\n",
+ " b)Drained friction angle = 27.8 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg395"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#What would be the deviatorstress at failure, (\u0010sd)f, if a drained test was conducted with the same chamber allaround pressure (that is, 12 lb/in.2)?\n",
+ "T3=12.\n",
+ "a=27.8\n",
+ "T1=T3*(math.tan(59./57.3))**2\n",
+ "Tf=T1-T3\n",
+ "print'%s %.1f %s'%('the deviator stress at failure = ',Tf,' lb/in^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the deviator stress at failure = 21.2 lb/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Estimate the average undrained shear strength of the clay [that is,cu(VST)].\n",
+ "PI=28.\n",
+ "OCR=3.2\n",
+ "To=160.\n",
+ "Kn=0.11+0.0037*PI\n",
+ "Ko=OCR**0.8 * Kn\n",
+ "Cu=Ko*To\n",
+ "print'%s %.1f %s'%('the average undrained shear strength of the clay =',Cu,' kN/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the average undrained shear strength of the clay = 86.7 kN/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter13.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter13.ipynb new file mode 100755 index 00000000..20c28288 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter13.ipynb @@ -0,0 +1,434 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0e1b8f59fb3a5d8de0f3a9b8d0a65d58dfc4a0a36944d60860dc12f3ce3b3032"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter13-Lateral Earth Pressure: At-Rest, Rankine, and Coulomb"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-430"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Calculate the lateral force Poper unit length of the wall. Also, determine the location ofthe resultant force. Assume that for sand OCR\u00012\n",
+ "OCR=2.\n",
+ "a=30.\n",
+ "Ko=(1.-math.sin(a/57.3))*(OCR)**math.sin(a/57.3)\n",
+ "##at z=0\n",
+ "To1=0.\n",
+ "Th1=0.\n",
+ "u1=0.\n",
+ "##at z=10\n",
+ "To2=10.*100.\n",
+ "Th2=Ko*To2\n",
+ "u2=0.\n",
+ "##at z=15\n",
+ "To3= 10.*100.+5.*(122.4-62.4)\n",
+ "Th3=Ko*To3\n",
+ "u3=5.*62.4\n",
+ "##Lateral force Po =Area 1 +\u0007 Area 2+\u0007 Area3+\u0007 Area 4\n",
+ "Po =(1./2.)*10.*707.+5.*707.+(1./2.)*5.*212.1+(1/2.)*5.*312.\n",
+ "z=((3535.)*(5.+10./3.)+3535.*(5./2.)+530.3*(5./3.)+780.*(5./3.))/Po\n",
+ "print'%s %.1f %s'%('z = ',z,' ft')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "z = 4.8 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg449"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.Rankine active force per unit length of the wall and the location of theresultant\n",
+ "#b.Rankine passive force per unit length of the wall and the location of the resultant\n",
+ "##c=0\n",
+ "a=36.\n",
+ "G=16.\n",
+ "Ka=(1.-math.sin(a/57.3))/(1.+math.sin(a/57.3))\n",
+ "##at z=0 Tp=0\n",
+ "z=6.\n",
+ "To=G*z\n",
+ "Ta=Ka*To\n",
+ "Pa=z*Ta/2.\n",
+ "\n",
+ "print'%s %.1f %s'%('a)Rankine active force per unit length of the wall = ',Pa,' kN/m')\n",
+ "print(' and the location of the resultant is z = 2m')\n",
+ "\n",
+ "\n",
+ "p=36.\n",
+ "G=16.\n",
+ "Kp=(1+math.sin(a/57.3))/(1-math.sin(a/57.3))\n",
+ "##at z=0 Tp=0\n",
+ "z=6.\n",
+ "To=G*z\n",
+ "Tp=Kp*To\n",
+ "Pp=z*Tp/2.\n",
+ "\n",
+ "print'%s %.1f %s'%(' b)Rankine passive force per unit length of the wall = ',Pp,' kN/m')\n",
+ "print (' and the location of the resultant is z = 2m')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)Rankine active force per unit length of the wall = 74.8 kN/m\n",
+ " and the location of the resultant is z = 2m\n",
+ " b)Rankine passive force per unit length of the wall = 1109.2 kN/m\n",
+ " and the location of the resultant is z = 2m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg450"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Determine the active force Paperunit length of the wall as well as the location and direction of the resultant.\n",
+ "H=12.\n",
+ "a=20.\n",
+ "b=20.\n",
+ "G=115.\n",
+ "c=30.\n",
+ "Oa= math.asin(math.sin(a/57.3)/math.sin(c/57.3))*57.3-a+2.*b\n",
+ "Ka= (math.cos((a-b)/57.3)*math.sqrt(1.+(math.sin(c/57.3))**2.-2.*math.sin(c/57.3)*math.cos(Oa/57.3)))/((math.cos(b/57.3))**2.*(math.cos(a/57.3)+math.sqrt((math.sin(c/57.3))**2.-(math.sin(a/57.3))**2)))\n",
+ "Pa=G*H**2.*Ka/2.\n",
+ "B= math.atan((math.sin(c/57.3)*math.sin(Oa/57.3))/(1.-(math.sin(c/57.3)*math.cos(Oa/57.3))))*57.3\n",
+ "print'%s %.1f %s'%('The active force Pa per unit length of the wall = ',Pa,' lb/ft')\n",
+ "print'%s %.1f %s'%( ' The resultant will act a distance of 12/3 = 4 ft above the bottom of the wall with B = ',B,' degree')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The active force Pa per unit length of the wall = 6423.5 lb/ft\n",
+ " The resultant will act a distance of 12/3 = 4 ft above the bottom of the wall with B = 30.0 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg451"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#determine the force per unit length of the wall for Rankine\u2019s active state. Also find the location of the resultant.\n",
+ "a=30.\n",
+ "Ka1=(1.-math.sin(a/57.3))/(1.+math.sin(a/57.3))\n",
+ "a=35.\n",
+ "Ka2=(1-math.sin(a/57.3))/(1+math.sin(a/57.3))\n",
+ "##at z=0 so T0=0\n",
+ "##atz=3\n",
+ "To=3.*16.\n",
+ "Ta1=Ka1*To\n",
+ "Ta2=Ka2*To\n",
+ "\n",
+ "## At z=6\n",
+ "To=3.*16.+3.*(18.-9.81)\n",
+ "Ta2=Ka2*To\n",
+ "\n",
+ "Pa =(1/2.)*3.*16.+3.*13.0+ (1/2.)*3.*36.1\n",
+ "z= (24 *(3.+3./3.)+39.0*(3/2.)+54.15*(3/3.))/Pa\n",
+ "print'%s %.1f %s'%('The force per unit length of the wall = ',Pa,' kN/m')\n",
+ "print'%s %.1f %s'% (' The location of the resultant = ',z,'m ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force per unit length of the wall = 117.2 kN/m\n",
+ " The location of the resultant = 1.8 m \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg453"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.Maximum depth of the tensile crack\n",
+ "#b.Pabefore the tensile crack occurs\n",
+ "#c. Pa after the tensile crack occurs\n",
+ "Ka= (math.tan(1./57.3))**2.\n",
+ "G=16.5\n",
+ "cu=10.\n",
+ "H=6.\n",
+ "##at z=0\n",
+ "z=0.\n",
+ "Ta=G*z-2.*cu\n",
+ "##zt z=6\n",
+ "z=6.\n",
+ "Ta=G*z-2.*cu\n",
+ "\n",
+ "zo=2.*cu/G\n",
+ "## Before the tensile crack occurs\n",
+ "Pa= G*H**2./2. - 2.*cu*H\n",
+ "print'%s %.1f %s'%('Pa before the tensile crack occurs = ',Pa,' kN/m')\n",
+ "##After the tensile crack occurs\n",
+ "Pa=(H-zo)*Ta/2.\n",
+ "print'%s %.1f %s'%(' Pa after the tensile crack occurs = ',Pa,' kN/m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pa before the tensile crack occurs = 177.0 kN/m\n",
+ " Pa after the tensile crack occurs = 189.1 kN/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Determine the Rankine active force Paon the retaining wall after the tensile crack occurs.\n",
+ "H=15.\n",
+ "a=10.\n",
+ "G=118.\n",
+ "b=20.\n",
+ "C=250\n",
+ "Zo=2.*C*math.sqrt((1+math.sin(b/57.3))/(1.-math.sin(b/57.3)))/G\n",
+ "##at z=0 Ta=0\n",
+ "##at z=15 \n",
+ "z=15.\n",
+ "K=0.3\n",
+ "Ta=G*z*K*math.cos(a/57.3)\n",
+ "Pa=(H -Zo)*Ta/2.\n",
+ "print'%s %.1f %s'%('The Rankine active force Pa on the retaining wall after the tensile crack occurs = ',Pa,' lb/ft')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Rankine active force Pa on the retaining wall after the tensile crack occurs = 2339.8 lb/ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Estimate the active force,Pa , per unit length of the wall. Also, state the direction and location of the resultant force,Pa.\n",
+ "import math\n",
+ "c=30.\n",
+ "b=15.\n",
+ "a=10.\n",
+ "Ka=0.3872 ## from table 13.8\n",
+ "H=4.\n",
+ "G=15.\n",
+ "Pa=G*H**2.*Ka/2.\n",
+ "print'%s %.1f %s'%('The active force per unit length Pa = ',Pa,' kN/m')\n",
+ "print(' The resultant will act at a vertical distance equal to H/3 = 4/3 = 1.33 m above ' ' the bottom of the wall and will be inclined at an angle of 15\u0005to the back face of the wall.')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The active force per unit length Pa = 46.5 kN/m\n",
+ " The resultant will act at a vertical distance equal to H/3 = 4/3 = 1.33 m above the bottom of the wall and will be inclined at an angle of 15\u0005to the back face of the wall.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg478"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Determine Pae.Also determine the location of the resultant line of action of Pae\u2014that is, .\n",
+ "kh=0.2\n",
+ "kv=0.\n",
+ "H=4.\n",
+ "a=0.\n",
+ "b=0.\n",
+ "c=15.\n",
+ "d=30.\n",
+ "G=15.5\n",
+ "B= math.atan(kh/(1-kv)/57.3)\n",
+ "b1=b+B\n",
+ "a1=a+B\n",
+ "Ka=0.452\n",
+ "Pa=G*H**2.*Ka/2.\n",
+ "Pae=Pa*(1.-kv)*((math.cos(b1/57.3))**2./((math.cos(b/57.3))**2.*(math.cos(B/57.3))**2.))\n",
+ "Ka=0.3014\n",
+ "Pa=G*H**2*Ka/2.\n",
+ "P1=Pae-Pa\n",
+ "z= ((Pa*H/3)+P1*0.6*H)/Pae\n",
+ "print'%s %.1f %s'%('Pae = ',Pae,' kN/m')\n",
+ "print'%s %.1f %s'%(' Z = ',z,' m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pae = 56.0 kN/m\n",
+ " Z = 1.7 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Determine the magnitude of the active force,Pae.\n",
+ "H=28.\n",
+ "C=210.\n",
+ "b=10.\n",
+ "G=118.\n",
+ "c=20.\n",
+ "kh=0.1\n",
+ "Ka=math.tan(35./57.3)\n",
+ "zo=2.*C/(G*(Ka))\n",
+ "n=zo/(H-zo)\n",
+ "Nac=1.60\n",
+ "Nav=0.375\n",
+ "L=1.17\n",
+ "Pae= G*(H-zo)**2*(L*Nav)-C*(H-zo)*Nac\n",
+ "print'%s %.1f %s'%('The magnitude of the active force, Pae = ',Pae,' lb/ft')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnitude of the active force, Pae = 19488.8 lb/ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter14.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter14.ipynb new file mode 100755 index 00000000..b6a23eb1 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter14.ipynb @@ -0,0 +1,122 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:48c1632c9bf2565b11bcfc44de09d03ed2fce97fd897e255ae43ede2375057bf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter14-Lateral Earth Pressure: Curved Failure Surface"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-497"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.Coulomb\u2019s theory\n",
+ "#b.Terzaghi and Peck\u2019s wedge theory\n",
+ "#c. Shields and Tolunay\u2019s solution (method of slices)\n",
+ "#d.Zhu and Qian\u2019s solution (method of triangular slices)\n",
+ "G=15.7\n",
+ "a=0.\n",
+ "b=15.\n",
+ "c=30.\n",
+ "H=3.\n",
+ "Kp=4.977 ## from table 13.9\n",
+ "Pp=Kp*G*H**2./2.\n",
+ "print'%s %.1f %s'%('a)the passive force = ',Pp,' kN/m')\n",
+ "## for part b\n",
+ "Kp=4.53\n",
+ "Pp=Kp*G*H**2./2.\n",
+ "print'%s %.1f %s'%('b)the passive force = ',Pp,' kN/m')\n",
+ "## for part c\n",
+ "Kp=4.13\n",
+ "Pp=Kp*G*H**2/2.\n",
+ "print'%s %.1f %s'%('c)the passive force =',Pp,' kN/m')\n",
+ "##for part d\n",
+ "Kp=4.56\n",
+ "Pp=Kp*G*H**2/2.\n",
+ "print'%s %.1f %s'%('d)the passive force =',Pp,' kN/m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)the passive force = 351.6 kN/m\n",
+ "b)the passive force = 320.0 kN/m\n",
+ "c)the passive force = 291.8 kN/m\n",
+ "d)the passive force = 322.2 kN/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg507"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the design strut loads.\n",
+ "G=16.\n",
+ "H=7.\n",
+ "c=30.\n",
+ "Ta=0.65*G*H*(math.tan(30./57.3))**2\n",
+ "A=Ta*3.*3./4.\n",
+ "B1=Ta*3.-54.61\n",
+ "C=Ta*4.*4./4.\n",
+ "B2=Ta*4.-97.08\n",
+ "s=2.\n",
+ "As=A*s\n",
+ "Bs=(B1+B2)*s\n",
+ "Cs=C*s\n",
+ "print'%s %.1f %s'%( 'The strut loads at level A = ',As,' kN')\n",
+ "print'%s %.1f %s'%( ' The strut loads at level B = ',Bs,' kN')\n",
+ "print'%s %.1f %s'%( ' The strut loads at level C =',Cs,' kN')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The strut loads at level A = 109.2 kN\n",
+ " The strut loads at level B = 36.3 kN\n",
+ " The strut loads at level C = 194.1 kN\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter15.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter15.ipynb new file mode 100755 index 00000000..04d58e71 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter15.ipynb @@ -0,0 +1,499 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4c2cef1cd7673363b2ef6cb15cb908c88921a9f728253dd7a799bca223f736c1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter15-Slope Stability"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.The factor of safety against sliding along the soil-rock interface.\n",
+ "#b.The height,H, that will give a factor of safety (Fs) of 2 against sliding alongthe soil-rock interface.\n",
+ "Gs=17.8\n",
+ "Gw=9.81\n",
+ "C=10.\n",
+ "c=20.\n",
+ "b=15.\n",
+ "H=6.\n",
+ "G=Gs-Gw\n",
+ "Fs= C/(Gs*H*math.cos(b/57.3)*math.cos(b/57.3)*math.tan(b/57.3))+G*math.tan(c/57.3)/(Gs*math.tan(b/57.3))\n",
+ "print'%s %.2f %s'%('a)The factor of safety = ',Fs,' ')\n",
+ "Fs=2.\n",
+ "H=2.247/(Fs-0.61)\n",
+ "print'%s %.2f %s'%(' b)H= ',H,' m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)The factor of safety = 0.98 \n",
+ " b)H= 1.62 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.Determine the maximum depth up to which the excavation can be carried out.\n",
+ "#b.Find the radius,r, of the critical circle when the factor of safety is equal to 1(Part a).\n",
+ "#c. Find the distance . BC\n",
+ "Cu=40.\n",
+ "G=17.5\n",
+ "b=60.\n",
+ "a=35.\n",
+ "c=72.5\n",
+ "m=0.195\n",
+ "Hc=Cu/(G*m)\n",
+ "r=Hc/(2.*math.sin(a/57.3)*math.sin((c/2)/57.3))\n",
+ "BC=Hc*((1./math.tan(a/57.3))-(1./math.tan(b/57.3)))\n",
+ "print'%s %.1f %s'%('a)The maximum depth Hc = ',Hc,' m')\n",
+ "print'%s %.2f %s'%(' b)The radius, r = ',r,' m')\n",
+ "print'%s %.3f %s'%(' c)The distance BC.= ',BC,' m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)The maximum depth Hc = 11.7 m\n",
+ " b)The radius, r = 17.28 m\n",
+ " c)The distance BC.= 9.973 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.Determine the undrained cohesion of the clay (Figure 15.13).\n",
+ "#b.What was the nature of the critical circle?\n",
+ "#c. With reference to the toe of the slope, at what distance did the surface of sliding intersect the bottom of the excavation?\n",
+ "Gs=17.29\n",
+ "d=9.15\n",
+ "d1=6.1\n",
+ "D=d/d1\n",
+ "a=40.\n",
+ "m=0.175\n",
+ "b=40.\n",
+ "H=6.1\n",
+ "Cu=H*Gs*m\n",
+ "print'%s %.1f %s'%('a)The undrained cohesion of the clay Cu = ',Cu,' kN/m^2')\n",
+ "print(' b)The nature of the critical circle is midpointcircle')\n",
+ "d=1.5\n",
+ "b=40.\n",
+ "n=0.9\n",
+ "D1=n*H\n",
+ "print'%s %.1f %s'%(' c)Distance = ',D1,' m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)The undrained cohesion of the clay Cu = 18.5 kN/m^2\n",
+ " b)The nature of the critical circle is midpointcircle\n",
+ " c)Distance = 5.5 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg534"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.Determine the maximum depth up to which the cut could be made.\n",
+ "#b.How deep should the cut be made if a factor of safety of 2 against sliding is required\n",
+ "Fs=1.\n",
+ "b=56.\n",
+ "Kh=0.25\n",
+ "M=3.66\n",
+ "Cu=500.\n",
+ "G=100.\n",
+ "Hc=Cu*M/G\n",
+ "print'%s %.1f %s'%('a)The maximum depth =',Hc,' ft')\n",
+ "Fs=2.\n",
+ "H=Cu*M/(G*Fs)\n",
+ "print'%s %.1f %s'%(' b)H= ',H,' ft')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)The maximum depth = 18.3 ft\n",
+ " b)H= 9.2 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#a.Find the critical height of the slope.\n",
+ "#b.If the height of the slope is 10 m, determine the factor of safety with respect to strength.\n",
+ "b=45.\n",
+ "c=20.\n",
+ "C=24.\n",
+ "G=18.9\n",
+ "m=0.06\n",
+ "Hc=C/(G*m)\n",
+ "Cd=G*Hc*m\n",
+ "Fc=C/Cd\n",
+ "print'%s %.1f %s'%('a)Critical height of slope = ',Hc,'')\n",
+ "#calculate the factor of safety using spencers solution\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "phid=numpy.array([20,15,10,5])*math.pi/180.\n",
+ "mx=numpy.array([.06,.083,.105,.136])\n",
+ "cdx=numpy.array([11.34,15.69,19.85,25.7])\n",
+ "m=.06\n",
+ "g=18.9\n",
+ "cd=24.\n",
+ "#calculations\n",
+ "Hcr=cd/g/m\n",
+ "leng=len(phid)\n",
+ "Fcd=numpy.zeros(leng)\n",
+ "Fphi=numpy.zeros(leng)\n",
+ "tanphid=numpy.zeros(leng)\n",
+ "for i in range(0,leng):\n",
+ "\ttanphid[i]=math.tan(phid[i])\n",
+ "\tFphi[i]= tan(phid[0])/tan(phid[i])\n",
+ "\tFcd[i]=cd/cdx[i]\n",
+ "\n",
+ "\n",
+ "#results\n",
+ "print'%s %.2f %s'%('The value of Hcr (in m) = ',Hcr,'')\n",
+ "print 'from graph, Fss=1.4'\n",
+ "pyplot.plot(Fcd,Fphi)\n",
+ "pyplot.xlabel('Fc assumed')\n",
+ "pyplot.ylabel('Fc calculated')\n",
+ "pyplot.title('Graph of Fc assumed vs Fc calculated')\n",
+ "pyplot.show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)Critical height of slope = 21.2 \n",
+ "The value of Hcr (in m) = 21.16 \n",
+ "from graph, Fss=1.4\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEZCAYAAACTsIJzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8lHXd//HXm01AXHBJU3EFBVwQTVSSm6O2SUrdmWlp\n6l2pueeSJWmipubPSlNLzSW1O7VS71wyM6tjlkaZgOwKLmApauCC4AJ8fn98rwNzhjnnzFnmXDPn\nvJ+PxzzOtc11feY6M/OZ73J9L0UEZmZmDXrkHYCZmVUXJwYzM2vEicHMzBpxYjAzs0acGMzMrBEn\nBjMza8SJoRuSNFHSzzpoX5tI+rOkNyVd1hH77Mok1UlakHccldJR7y1JKyVt2xExlXGseklf7oxj\n1Qonhiog6TBJkyQtkbRQ0t8kHV/BQ3bkxSvHAq9ExLoR8fXilZJulvSupLcKHod04PGtSM7nvFMv\njJK0dZZE2vNdFnRy3NXOiSFnks4ArgAuBTaJiE2ArwIfltSniee09/+mdj6/0FbArGbWB3BpRKxT\n8PhVBx7f1pTnOe/I91YtHLdLcmLIkaT1gPOB4yP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9m++gIvk25gVZ+NqoqkXwDbt3gWzNrBJQbrLlq6\nB8PNwAkRsQtwPtAPICKOB84hDbn8T0kbRMTtpNLDMuCBbIz75TT+PPWj8S/7d7O/KwumG+YbfqDd\nEhEjs8ewiLigDa/DrN2cGKw7+D1wnKSeAJIGlthmAPByNq79EQ0LJW0XEX+PiPNItwXdQtI2wPMR\ncRWpWmhn0q/7D0jaQNJawIGtiC+APwCflbRxdtwNsh5Vk4Cx2Xxv4JDWvXSz1nNisK6mVP37DcB8\n0rDEU4DPl9jmXNKX8F9IbQwN+/l/kp7KGpb/GhFPkdoCpmVDHO8I3Jrdw/gC4O/AQzR9v4TCtofV\nCyNmkUomD2XDUz8EbBoRL5PaGB7PYpvRxGs06zAedtvMzBpxicHMzBpxYjAzs0acGMzMrBEnBjMz\na8SJwczMGnFiMDOzRpwYzMysEScGMzNr5P8DAZc/1V8RUsUAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2d2ff30>"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# using Michalowski\u2019s solution.\n",
+ "import math\n",
+ "FSs=1.\n",
+ "c=20.\n",
+ "G=18.9\n",
+ "C=24.\n",
+ "Hcr=C/(G*math.tan(c/57.3)*0.17)\n",
+ "print'%s %.1f %s'%('a)Critical height Hc = ',Hcr,' m')\n",
+ "H=10.\n",
+ "k=C/(G*H*math.tan(c/57.3))\n",
+ "Fs=4.*math.tan(c/57.3)\n",
+ "print'%s %.1f %s'%(' b)Fs = ',Fs,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)Critical height Hc = 20.5 m\n",
+ " b)Fs = 1.5 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg560"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# Determine the factor ofsafety,Fs . Use Table 15.3.\n",
+ "W=22.4\n",
+ "C=20.\n",
+ "a=70.\n",
+ "s=math.sin(a/57.3)\n",
+ "c=math.cos(a/57.3)\n",
+ "l=2.924\n",
+ "Wn=W*s\n",
+ "Wn1=W*c\n",
+ "##doing this to all values\n",
+ "F1=30.501\n",
+ "F2=776.75\n",
+ "F3=1638.\n",
+ "Fs=(F1*C+F3*math.tan(C/57.3))/F2\n",
+ "print'%s %.2f %s'%('Fs = ',Fs,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fs = 1.55 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg560"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#using Michalowski\u2019s solution\n",
+ "C=20.\n",
+ "G=18.5\n",
+ "r=0.25\n",
+ "H=21.62\n",
+ "C=25.\n",
+ "b= math.atan(0.5)\n",
+ "##from table 15.3 \n",
+ "m=1.624\n",
+ "n=1.338\n",
+ "Fs=m-n*r\n",
+ "print'%s %.1f %s'%(' The value of Fs for D= 1 is',Fs,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of Fs for D= 1 is 1.3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg561"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the factor of safety using spencers solution\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "beta=numpy.array([26.57,26.57,26.57,26.57])\n",
+ "Fs=numpy.array([1.1,1.2,1.3,1.4])\n",
+ "phid=25*math.pi/180. #degrees\n",
+ "#calculations\n",
+ "print 'From spencers graphs,'\n",
+ "cd=numpy.array([0.0455,0.0417,0.0385,0.0357])\n",
+ "phia=numpy.array([18.,19.,20.,21.])*math.pi/180.\n",
+ "leng=len(phia)\n",
+ "Fss=numpy.zeros(leng)\n",
+ "for i in range(0,leng):\n",
+ "\tFss[i]= tan(phid)/tan(phia[i])\n",
+ "\n",
+ "#results\n",
+ "print 'From graph, a footing of dimensions Fs=1.3'\n",
+ "pyplot.plot(Fs,Fss)\n",
+ "pyplot.xlabel('Fs assumed')\n",
+ "pyplot.ylabel('Fs calculated')\n",
+ "pyplot.title('Graph of Fs assumed vs Fs calculated')\n",
+ "pyplot.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From spencers graphs,\n",
+ "From graph, a footing of dimensions Fs=1.3\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEZCAYAAACAZ8KHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8lHX5//HXG1BQBMQltzQUBREB0cQt8aSFlJp+3c2y\nvhohP7dvmWamQq65W5aWqGQumGu5K2ZHSRQ3ZBEw19y3RBSXVLh+f3zuo+PhLDPnzJxZzvv5eMyD\nmfueue/rnvtwrvPZFRGYmZnlq0u5AzAzs+rixGFmZgVx4jAzs4I4cZiZWUGcOMzMrCBOHGZmVhAn\nDvuMpAmSLi/Ss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rnAR5IuIa2kdkv23vuByyRdQ5rosDUfR8Sd2fPZwEcRsVjSHNJq\nbJAm0xsiac/sdW9gA9Jqb1dFmjPoVUn35HE+s6JwVZV1WhExGdgF+BC4TWkNjc9IWhc4Etg+IoYB\ntwLLRcRi0pTa1wE7A3dkxxsHHEealvpRSSsBn/LF/2c9cp7nrvK4BPg4O84SvvhH3aERMTx79I+I\nKQ0htvnizdrBicM6LUnrRsRzEXE+8DfSGtO5egPvA+9KWg34FhDZtNorRsTtwE+BYdnx+kfEQxEx\nnrQ055eB54FNsjaJtSl8DYc7gf+XVaUhaYCk5YH7SKWhLpLWAL7e0kHMislVVdZZNNXjaG9J3yf9\n5f8qcMoXPhAxM2sXmU9aWvOf2a5ewN8k9SD91f+TbPsZkjbItt0dEbMAlBbOmQvMAx5tIaZo4vnF\npGqrx7J1It4gta/cKGn77LgvkKrdzDqEp1U3M7OCuKrKzMwK4sRhZmYFceIwM7OCOHGYmVlBnDjM\nzKwgThxmZlYQJw4zMyuIE4eZmRXk/wN5SXo27nRWHQAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5567810>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg561"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#using Michalowski\u2019s solution\n",
+ "C=20.\n",
+ "G=18.5\n",
+ "H=21.62\n",
+ "c=25.\n",
+ "r=0.25\n",
+ "Fs=3.1*math.tan(c/57.3)\n",
+ "print'%s %.1f %s'%('Fs = ',Fs,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fs = 1.4 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter16.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter16.ipynb new file mode 100755 index 00000000..892e5d4d --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter16.ipynb @@ -0,0 +1,355 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f8ccaea2f8e2185eadf01a8580109480d61ddd5c9965256b8487bceaf5d3f50f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter16-Soil-Bearing Capacity for Shallow Foundations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg587"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the gross allowable load per unit area (qall) that the foundation can carry.\n",
+ "import math\n",
+ "c=20.\n",
+ "## from table 16.1\n",
+ "Nc=17.69\n",
+ "Nq=7.44\n",
+ "Ng=3.64\n",
+ "\n",
+ "Df=3.\n",
+ "G=110.\n",
+ "q=G*Df\n",
+ "\n",
+ "C=200.\n",
+ "B=4.\n",
+ "\n",
+ "Qu= C*Nc+q*Nq+G*B*Ng/2.\n",
+ "\n",
+ "Fs=3.\n",
+ "Qall=Qu/Fs\n",
+ "print'%s %.1f %s'%('Qa = ',Qall,' lb/ft^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Qa = 2264.7 lb/ft^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg588"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#determine the size of the footing\u2014that is, the size of B.\n",
+ "G=18.15\n",
+ "qa=30000.*9.81/1000.\n",
+ "\n",
+ "Nc=57.75\n",
+ "Nq=41.44\n",
+ "Ng=45.41\n",
+ "C=0.\n",
+ "q=G*1.\n",
+ "B=1.\n",
+ "(1.3*C*Nc+q*Nq+0.4*G*B*Ng)*B**2/3. == qa\n",
+ "B= math.sqrt(294.3/(250.7+109.9))\n",
+ "print'%s %.1f %s'%(' B = ',B,' m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " B = 0.9 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg595"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# Determine the safe gross load (factor of safety of 3) that the footing can carry\n",
+ "B=1.2\n",
+ "L=1.2\n",
+ "c=32.\n",
+ "C=0.\n",
+ "Df=1.\n",
+ "G=16.\n",
+ "Nq=23.18\n",
+ "Ng=22.02\n",
+ "Nc=1.\n",
+ "Lqs=1.+0.1*B*(math.tan(61./57.3)**2.)/L\n",
+ "Lgs=Lqs\n",
+ "Lqd=1.+0.1*Df*math.tan(61./57.3)/B\n",
+ "Lgd=Lqd\n",
+ "Lcs=1.\n",
+ "Lcd=1.\n",
+ "Gs=19.5\n",
+ "q=0.5*G+0.5*(Gs-9.81)\n",
+ "Qu= C*Lcs*Lcd*Nc+q*Lqs*Lqd*Nq+(Gs-9.81)*Lgs*Lgd*B*Ng/2.\n",
+ "Qa=Qu/3.\n",
+ "Q=Qa*B**2.\n",
+ "print'%s %.1f %s'%('the gross load = ',Q,' kN')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the gross load = 311.6 kN\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg601"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Determine the magnitude of the gross ultimate load applied eccentrically for bearing capacity failure in soil.\n",
+ "e=0.1\n",
+ "B=1.\n",
+ "X=B-2.*e\n",
+ "Y=1.5\n",
+ "B1=0.8\n",
+ "L1=1.5\n",
+ "c=30.\n",
+ "Df=1.\n",
+ "Nq=18.4\n",
+ "Ng=15.668\n",
+ "q=1.*18.\n",
+ "G=18.\n",
+ "Lqs=1.+e*(B1/L1)*math.tan(60./57.3)**2.\n",
+ "Lgs=Lqs\n",
+ "Lqd=1.+e*(Df/B1)*math.tan(60./57.3)\n",
+ "Lgd=Lqd\n",
+ "qu=q*Lqs*Lqd*Nq+Lgs*Lgd*G*B1*Ng/2.\n",
+ "Qu=qu*B1*L1\n",
+ "print'%s %.1f %s'%('The magnitude of the gross ultimate load =',Qu,' kN')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnitude of the gross ultimate load = 751.8 kN\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg601"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the gross ultimate load per unit length that the foundation can carry.\n",
+ "import math\n",
+ "B=1.5\n",
+ "Df=0.75\n",
+ "e=0.1*B\n",
+ "G=17.5\n",
+ "c=30.\n",
+ "C=0.\n",
+ "q=G*Df\n",
+ "Nq=18.4\n",
+ "Ng=15.668\n",
+ "Lqd=1.+0.1*(Df/B)*math.tan(60./57.3)\n",
+ "Lgd=Lqd\n",
+ "Quc=q*Nq*Lqd+Lgd*B*Ng/2.\n",
+ "k=0.8\n",
+ "a=1.754\n",
+ "Qua=Quc*(1.-a*(e/B)**k)\n",
+ "print'%s %.1f %s'%('The gross ultimate load per unit length = ',Qua,' kN')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gross ultimate load per unit length = 198.7 kN\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Estimate the ultimate bearing capacity of a circular footing with a diameter of 1.5 m. The soil is sandy.\n",
+ "Qup=280.\n",
+ "Bp=0.7 ## in m\n",
+ "Bf=1.5\n",
+ "Quf=Qup*Bf/Bp\n",
+ "print'%s %.1f %s'%('The ultimate bearing capacity = ',Quf,' kN/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ultimate bearing capacity = 600.0 kN/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the value of Cv\n",
+ "import math\n",
+ "#Determine the size of a square column foundation that should carry a load of 2500 kN with a maximum settlement of 25 mm.\n",
+ "a=2500.\n",
+ "##doing for the first values only\n",
+ "Bf=4.\n",
+ "Bp=0.305\n",
+ "q=a/Bf**2.\n",
+ "Sep=4.\n",
+ "Sef=Sep*(2.*Bf/(Bf+Bp))**2\n",
+ "print'%s %.1f %s'%('Sef = ',Sef,' mm')\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#given\n",
+ "t=numpy.array([.02,.1,.25,.5,1,2.,4.,8.,16.,30.,60.,120.,240.,480.,960.,1440.])\n",
+ "gauge=numpy.array([3975.,4082.,4102.,4128.,4166.,4224.,4298.,4420.,4572.,4737.,4923.,5080.,5207.,5283.,5334.,5364.])\n",
+ "Hdr=2.24\n",
+ "t50=19.\n",
+ "#calculations\n",
+ "Cv=.197*(Hdr/2)**2 /t50/60.\n",
+ "leng=len(t)\n",
+ "logt=numpy.zeros(leng)\n",
+ "for i in range(0,leng):\n",
+ "\tlogt[i]=math.log(t[i])\n",
+ "\n",
+ "#results\n",
+ "print'%s %.4f %s'%('The value of Cv (cm^2/sec) = ',Cv,'')\n",
+ "pyplot.plot(logt,gauge)\n",
+ "pyplot.xlabel('Time(min) - log scale')\n",
+ "pyplot.ylabel('Dial reading (cm)')\n",
+ "pyplot.title('Graph of dial reading vs time')\n",
+ "pyplot.show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sef = 13.8 mm\n",
+ "The value of Cv (cm^2/sec) = 0.0002 \n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEZCAYAAABmTgnDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmclXX5//HXW1zAwi2NZFGpUEEtERV3xkzEJTE3NMU1\n/SVf06+WpX4zsJLMcsFMW8yEcgk3RAMElXHJBU1UFDcqVFA0txQ3lrl+f3w+A8dxlgNzzpxZ3s/H\n4zy4z33u5boHmOt8dkUEZmZmjVml0gGYmVnr52RhZmZNcrIwM7MmOVmYmVmTnCzMzKxJThZmZtYk\nJwurKEmjJP25RNfqJuleSe9K+mURxx8j6b6C9+9J2qSI8zaRVCOpIv9/8r2/mLevkPSjSsSxsor9\nOVvrsmqlA7DWRdJhwGnAFsD7w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otlib.figure.Figure at 0x54c9290>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter18.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter18.ipynb new file mode 100755 index 00000000..9672dd94 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter18.ipynb @@ -0,0 +1,124 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:bd1dfbb2f3a2374bd2f13d65956d903f168b0ff4075bd14d19db0d9e2d866f17"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter18-Subsoil Exploration"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg642"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the correctedstandard penetration numbers, (N1)60, at various depths\n",
+ "import math\n",
+ "##solving for z=5 only\n",
+ "To=0.275\n",
+ "Cn=To**(-0.5)\n",
+ "N60=8\n",
+ "N160=Cn*N60\n",
+ "print'%s %.1f %s'%('(N1)60 = ',N160,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(N1)60 = 15.3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg643"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#estimate the average soil friction angle,f\u0003, from z\u00020 to z\u000225 ft\n",
+ "#import math\n",
+ "z=5.\n",
+ "To=0.275\n",
+ "Cn=2./(1.+To)\n",
+ "N60=8.\n",
+ "N160=Cn*N60\n",
+ "print'%s %.1f %s'%('(N1)60 = ',N160,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(N1)60 = 12.5 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg643"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#estimate the average soil friction angle, f\u0003, from z\u00020 to z\u000225 ft\n",
+ "import math\n",
+ "pa=1. ## 14.7 lb/in**2 = 1ton/ft**2\n",
+ "To=0.275 ## ton/ ft**2\n",
+ "N60=8.\n",
+ "c= math.atan((N60/12.2+20.3*(To/pa))*57.3)**0.34\n",
+ "print'%s %.1f %s'%('The average soil friction angle = ',c,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average soil friction angle = 1.2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter2.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter2.ipynb new file mode 100755 index 00000000..57ee4839 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter2.ipynb @@ -0,0 +1,122 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5e11f0622a3e8a49d45f7bf47ce2fb320225cef1a5e74b45071c152843296e82"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2-Origin of Soil and Grain Size"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the values and plot the graph\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "import math\n",
+ "\n",
+ "from math import log\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#given\n",
+ "e=numpy.array([100,94.5,86.3,74.1,54.9,38.1,9.3,1.7,0])\n",
+ "p=numpy.array([4.75,2.00,0.850,0.425,0.250,0.180,0.150,0.075,0])\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "\n",
+ "#results\n",
+ "\n",
+ "pyplot.plot(p,e)\n",
+ "pyplot.xlabel('Particle size ')\n",
+ "pyplot.ylabel('percent finer ,e')\n",
+ "pyplot.title('Graph of particle size vs percent finer')\n",
+ "pyplot.show()\n",
+ "print('look at the axis reverse in text book')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEZCAYAAAB1mUk3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYXFW57/HvLwkEkhABkRASSCSIDMooBIFoy2QAjXhV\nEEHBAfXKFVBQAT3aR+9BOZ5zROE6HIMMKpOoiKiYgDQEZCZgJIDKoQkEkkBISEKCSej3/rF2pasr\nXd3V3VW9q7p+n+epp2vXnt7aVb3evddae5UiAjMza27D8g7AzMzy52RgZmZOBmZm5mRgZmY4GZiZ\nGU4GZmaGk0FTk9Qq6adV2tY4SbdLWiHp29XYZj9i+L2kD1ewXLukw6q8779Kels1t2mdSr5f/yHp\nXEk/zjuuoWRE3gFYJ0kfBD4H7AG8DDwJXB4RP6jRLqt5k8kngSURMbaK2yxLUiswJSI2FP4RcXSF\nqwfVfe9ExJuq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SuBu7JlrqWkXYH0k623ZlVJ\nPwXOLZk/A9gRmJnF8GD2+onAx7PhiP+aLWdWFe5aamZmvjIwMzMnAzMzw8nAzMxwMjAzM5wMzMwM\nJwMzM8PJwMzMcDIwMzPg/wPeMGYYyyrVSwAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5464ab0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "look at the axis reverse in text book\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate uniformity coefficient and coefficient of gradation\n",
+ "##initialisation of variables\n",
+ "##from graph\n",
+ "d= 0.15 ##mm\n",
+ "w= 0.17 ##mm\n",
+ "a= 0.27 ##mm\n",
+ "##calculations\n",
+ "C= a/d\n",
+ "c= w**2/(a*d)\n",
+ "##results\n",
+ "print'%s %.1f %s'%('uniformity coefficient = ',C,\"\")\n",
+ "print'%s %.2f %s'% ('coefficient of gradation = ',c,' ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "uniformity coefficient = 1.8 \n",
+ "coefficient of gradation = 0.71 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter3.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter3.ipynb new file mode 100755 index 00000000..d0ebca76 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter3.ipynb @@ -0,0 +1,199 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:60c2fa50959c5a4dba9df5cf01a73aa3b32e4e232661901abd9e03f25b058fca"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3-Weight\u2013Volume Relationships"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#evaluvate moist and dry density and void ratio and porosity and degree of saturation and volume of water in soil sample\n",
+ "##initialisation of variables\n",
+ "V= 1.2 ##m**3\n",
+ "M= 2350. ##Kg\n",
+ "w= 0.086\n",
+ "G= 2.71\n",
+ "W= 1000. ##kg/m**3\n",
+ "##calculations\n",
+ "R= M/V\n",
+ "D= M/((1.+w)*V)\n",
+ "e= (G*W/D)-1.\n",
+ "n= e/(e+1.)\n",
+ "S= (w*G/e)*100.\n",
+ "v= (M-(M/(1.+w)))/W\n",
+ "##results\n",
+ "print'%s %.1f %s'% ('moist density = ',R,' kg/m^3 ')\n",
+ "print'%s %.1f %s'% ('dry density = ',D,' kg/m^3 ')\n",
+ "print'%s %.3f %s'% ('void ratio = ',e,' ')\n",
+ "print'%s %.3f %s'% ('porosity = ',n,'')\n",
+ "print'%s %.3f %s'% ('Degree of saturation = ',S,' ')\n",
+ "print'%s %.3f %s'% ('volume of water in soil sample = ',v,' m^3 ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "moist density = 1958.3 kg/m^3 \n",
+ "dry density = 1803.3 kg/m^3 \n",
+ "void ratio = 0.503 \n",
+ "porosity = 0.335 \n",
+ "Degree of saturation = 46.349 \n",
+ "volume of water in soil sample = 0.186 m^3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calcualte mass of water to be added for full saturation\n",
+ "##initialisation of variables\n",
+ "n= 0.4\n",
+ "G= 2.68\n",
+ "w= 0.12\n",
+ "R= 1000. ##kg/m**3\n",
+ "V= 10. ##m**3\n",
+ "##calculations\n",
+ "d= G*R*(1.-n)*(1.+w)\n",
+ "s= ((1.-n)*G+n)*R\n",
+ "M= s-d\n",
+ "m= M*V\n",
+ "##results\n",
+ "print'%s %.1f %s'%('mass of water to be added for full saturation = ',m,' kg ')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass of water to be added for full saturation = 2070.4 kg \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculatesatuarated unit weight and specific gravity and void ratio \n",
+ "##initialisation of variables\n",
+ "d= 16.19 ##kN/m**3\n",
+ "w= 0.23\n",
+ "W= 9.81 ##kN/m**3\n",
+ "##calculations\n",
+ "R= d*(1.+w)\n",
+ "G= d/(W-d*w)\n",
+ "e= w*G\n",
+ "##results\n",
+ "print'%s %.2f %s'%('satuarated unit weight = ',R,' kN/m^3 ')\n",
+ "print '%s %.2f %s'%('specific gravity = ',G,' ')\n",
+ "print'%s %.2f %s'% ('void ratio = ',e,' ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "satuarated unit weight = 19.91 kN/m^3 \n",
+ "specific gravity = 2.66 \n",
+ "void ratio = 0.61 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate relative density of compaction in percentage\n",
+ "##initialisation of variables\n",
+ "G= 2.68\n",
+ "w= 0.12\n",
+ "d= 1794.4 ##kg/m**3\n",
+ "W= 1000. ##kg/m**3\n",
+ "emax= 0.75\n",
+ "emin= 0.4\n",
+ "##calculation\n",
+ "e= (G*W*(1.+w)/d)-1.\n",
+ "D= ((emax-e)/(emax-emin))*100.\n",
+ "##results\n",
+ "print'%s %.1f %s'% ('relative density of compaction in percentage = ',D,' ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "relative density of compaction in percentage = 22.1 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter4.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter4.ipynb new file mode 100755 index 00000000..fba0d3fa --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter4.ipynb @@ -0,0 +1,61 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:45b6913d14d2cf9c4faefd4baea5e7b623551c1775a96697aceb0fea3463da05"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter4-Plasticity and Structure of Soil"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate shrinkage limit of the soil \n",
+ "##initialisation of variables\n",
+ "V1= 24.6 ##cm^3\n",
+ "V2= 15.9 ##cm^3\n",
+ "M1= 44 ##g\n",
+ "M2= 30.1 ##g\n",
+ "W= 1 ##g/cm^3\n",
+ "##calculations\n",
+ "SL= (((M1-M2)/M2)*100)-(((V1-V2)/M2)*W*100.)\n",
+ "##results\n",
+ "print'%s %.1f %s'%('shrinkage limit of the soil = ',SL,' ')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "shrinkage limit of the soil = 17.3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter6.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter6.ipynb new file mode 100755 index 00000000..965ec97d --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter6.ipynb @@ -0,0 +1,188 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9e373112e48f07ee80b6b4af3f674669c699f5259766125b19738d8e5f5cd0b1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6-Soil Compaction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate maximum dry density and optimum moisture content\n",
+ "##initialisation of variables\n",
+ "G= 2.6\n",
+ "LL= 20.\n",
+ "P= 20.\n",
+ "##calclations\n",
+ "R= (4804574.*G-195.55*(LL)**2+156971*(P)**0.5-9527830)**0.5\n",
+ "n= (1.195e-4)*((LL)**2)-1.964*G-(6.617e-5)*(P)+7.651\n",
+ "w= math.e**n\n",
+ "##results\n",
+ "print'%s %.1f %s'% ('maximum dry density = ',R,' kg/m^3 ')\n",
+ "print'%s %.2f %s'%('optimum moisture content = ',w,' ')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum dry density = 1894.2 kg/m^3 \n",
+ "optimum moisture content = 13.34 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate dry unit weight of compaction in the field and dry unit weight of compaction in the field\n",
+ "##initialisation of variables\n",
+ "do= 1570. ##kg/m^3\n",
+ "mo= 0.545 ##kg\n",
+ "M1= 7.59 ##kg\n",
+ "M2= 4.78 ##kg\n",
+ "M3= 3.007 ##kg\n",
+ "w= 0.102 ##\n",
+ "dmax= 19. ##KN/m^3\n",
+ "##calculations\n",
+ "Ms= M1-M2\n",
+ "Mc= Ms-mo\n",
+ "Vh= Mc/do\n",
+ "Dc= M3/Vh\n",
+ "Du= Dc*9.81/1000.\n",
+ "f= Du/(1.+w)\n",
+ "Rc= f*100./dmax\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('dry unit weight of compaction in the field = ',f,' kN/m^3 ')\n",
+ "print'%s %.1f %s'% ('relative compaction in the field = ',Rc,'')\n",
+ "#calculate the value of gamma and plot the graph\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "import math\n",
+ "from math import log\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#given\n",
+ "p=numpy.array([6,8,9,11,12,14])\n",
+ "e=numpy.array([14.80,17.45,18.52,18.9,18.5,16.9])\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "\n",
+ "#results\n",
+ "\n",
+ "pyplot.plot(p,e)\n",
+ "pyplot.xlabel('gamma')\n",
+ "pyplot.ylabel('weight ,w')\n",
+ "pyplot.title('Graph of gamma vs w')\n",
+ "pyplot.show()\n",
+ "print('look at the axis reverse in text book')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dry unit weight of compaction in the field = 18.55 kN/m^3 \n",
+ "relative compaction in the field = 97.7 \n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEZCAYAAACJjGL9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xmc3eP5//HXu4k9QdXW6JIuRG2xRERUDVVNG6WoWn6+\naoudVimNfiuxlKJKLaHfEK2W2LfQklATaRMkhEQIVVtCUAQJIdv1++P+jJxMzqw553zOmXk/H495\n5Cyf5ZpkMte5t+tWRGBmZtaUz+QdgJmZVTcnCjMza5YThZmZNcuJwszMmuVEYWZmzXKiMDOzZjlR\nWIcgaaikv5ToWutJeljSB5IuLMU1zWqZE4WVhaT9JT0qaa6kNyU9IumYMt6ylAuCjgTeiojVI+IX\nJbyuWU1yorCSk3QycAlwPrBeRKwHHA3sIGnFJs5Z3p9FLef5hb4MPFvC65nVNCcKKylJawBnAsdE\nxO0R8SFARDwZEQdFxPzsuD9JulLS3yTNBeokDZQ0WdL7kl6VNKTguj0lLZY0SNJrkl7PElKDAFaU\n9Oesy+hpSds0E2d/SRMlvSfpMUnbN8QFHAycKmmOpF2KnPs5SaOyOB+TdI6kcQXv/yGL/31JkyR9\ns+C9oZJukfSXLM4pkjaUNDhreb0i6TsFx9dLOlvSv7J47pa0tqTrC+7/5dbcu9H3sJ2kWZJU8Npe\nkp7KHvfNzn9f0huSLmriOmMl7Z093iH7N/p+9vzbkiY39W9gtcOJwkpte2Al4K5WHHsAcHZEdAP+\nBcwFDoqINYCBwDGS9mx0Th3wdWA34DRJ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AUd+5Aqv94eEX0jbUrzLHB4dkqQynNsD5xEqvF0AbApsLmkLbLj\nVgUejIjNgDnAWcAupJpVZ2XHvAl8JyK2IZWmv7Sc36tZa3XNOwCzKrMDcGdEzAfmSxpFKpa3uaRz\ngDVIm9LcV3DOqOzPp4E3ImIagKRppEqdU0jlse/PjpsKfBwRiyQ9nR0DsCJwuaTewCKgofClWa7c\nojBbWlC8iuq1wLERsQVwJrBKwXvzsz8Xk4qvUfC84cPYgkavzweItHNbwzEnAbOye/QhJQ6z3DlR\nmC3tX8APJK0kqRuwe/Z6d+ANSSsAB1GejYhWJ1VwBTiYtH+5We6cKMwKRMQk0jjDFNKWm1OB94Ff\nk/Zr/idpjGKp05p43NQxTZ0zDPiJpCeBXsDctsZvVg4uM27WiKTVIuLDbNvIscCgiHgy77jM8uLB\nbLNl/Z+kTYCVgT85SVhn5xaFmZk1y2MUZmbWLCcKMzNrlhOFmZk1y4nCzMya5URhZmbNcqIwM7Nm\n/X/kMsqaulAsNgAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x566c2f0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "look at the axis reverse in text book\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate sustainabilty number\n",
+ "##initialisation of variables\n",
+ "D1= 0.36 ##mm\n",
+ "D2= 0.52 ##mm\n",
+ "D5= 1.42 ##mm\n",
+ "##calculations\n",
+ "Sn= 1.7*(math.sqrt((3./(D5)**2)+(1./(D2)**2)+(1./(D1)**2)))\n",
+ "##results\n",
+ "print'%s %.1f %s'% ('sustainabilty number = ',Sn,' ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sustainabilty number = 6.1 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter7.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter7.ipynb new file mode 100755 index 00000000..2f2c2988 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter7.ipynb @@ -0,0 +1,503 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:386718b63e6b6f21bd32a3120a143f6e224e0278ef555853cf557429a2d7f4f2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7- Permeability"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the hydraulic conductivity in cm/sec.\n",
+ "import math\n",
+ "##initialisation of variables\n",
+ "L= 30. ##cm\n",
+ "A= 177. ##cm^2\n",
+ "h= 50. ##cm\n",
+ "Q= 350. ##cm^3\n",
+ "t= 300. ##sec\n",
+ "##claculations\n",
+ "k=Q*L/(A*h*t)\n",
+ "##results\n",
+ "print'%s %.4f %s'% ('hydraulic conductivity = ',k,' cm/sec ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hydraulic conductivity = 0.0040 cm/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg169\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the hydraulic conductivity of the soil in in./sec.\n",
+ "import math\n",
+ "##initialisation of variables\n",
+ "L= 203. ##mm\n",
+ "A= 10.3 ##cm^2\n",
+ "a= 0.39 ##cm^2\n",
+ "h0= 508. ##mm\n",
+ "h180= 305. ##mm\n",
+ "t= 180. ##sec\n",
+ "##calculations\n",
+ "k= 2.303*a*L*math.log10(h0/h180)/(A*t)\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('hydraulic conductivity of sand = ',k,' in/sec ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hydraulic conductivity of sand = 0.02 in/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#The hydraulic conductivity of a clayey soil is 3 107 cm/sec. The viscosity of water at 25\u00b0C is 0.0911 104 g # sec/cm2 \n",
+ "#Calculate the absolute permeability of the soil.\n",
+ "import math\n",
+ "##initialisation of varilables\n",
+ "k= 3e-7 ##cm/sec\n",
+ "n= 0.0911e-4 ##g*sec/cm^2\n",
+ "dw= 1. ##g/cc\n",
+ "##calculations\n",
+ "K= k*n/dw\n",
+ "##results\n",
+ "print'%s %.2e %s'% ('absolute premeability = ',K,' cm^2 ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "absolute premeability = 2.73e-12 cm^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#With k 5.3 105 m/sec for the permeable layer, calculate the rate of seepage through it in m3 /hr/m width if H 3 m and a 8\u00b0.\n",
+ "\n",
+ "import math\n",
+ "##initialisation of variables\n",
+ "k= 5.3e-5 ##m/sec\n",
+ "H= 3 ##m\n",
+ "a= 0.139 ##radians\n",
+ "##calculations\n",
+ "A= H*math.cos(a)\n",
+ "i= math.sin(a)\n",
+ "q= k*i*A*3600\n",
+ "##results\n",
+ "print'%s %.4f %s'% ('rate of seepage = ',q,' m^3/hr/m ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rate of seepage = 0.0785 m^3/hr/m \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate flow rate\n",
+ "##initialisation of variables\n",
+ "L= 50. ##m\n",
+ "k= 0.08e-2##m/sec\n",
+ "h= 4. ##m\n",
+ "H1= 3. ##m\n",
+ "H= 8. ##m\n",
+ "a= 0.139 ##radians\n",
+ "##calculations\n",
+ "i= h*math.cos(a)/L\n",
+ "A= H1*math.cos(a)\n",
+ "q= k*i*A\n",
+ "##results\n",
+ "print'%s %.5f %s'% ('flow rate = ',q,' m^3/sec/m ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "flow rate = 0.00019 m^3/sec/m \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate hydraulic conductivity at void ratio of 0.65\n",
+ "##initialisation of variables\n",
+ "k1= 0.02 ##cm/sec\n",
+ "e1= 0.5 \n",
+ "e2= 0.65\n",
+ "##calculations\n",
+ "k2= k1*(e2**3/(1.+e2))/(e1**3/(1.+e1))\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('hydraulic conductivity at void ratio of 0.65 =',k2,'cm/sec ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hydraulic conductivity at void ratio of 0.65 = 0.04 cm/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the value of grain size and plot the graph\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "from math import log\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#given\n",
+ "e=numpy.array([100,96,84,50,0])\n",
+ "p=numpy.array([0.06,0.0425,0.02,0.015,0.0075])\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "\n",
+ "#results\n",
+ "\n",
+ "pyplot.plot(p,e)\n",
+ "pyplot.xlabel('Percent passing')\n",
+ "pyplot.ylabel('grain size,mm')\n",
+ "pyplot.title('Graph of percent passinge vs grain size')\n",
+ "pyplot.show()\n",
+ "print('look at the axis reverse in text book')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEZCAYAAACEkhK6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcXFWd9/HPl52wBQgkhLCJsgQCBDRhWFtABgRBGWUR\nFFwYHfVhRETgGZcecUZRRx11dBQVCLLIJrI6BB4aGISwhS3shC2BJJAQIEa25Pf8cU6T6kov1V3L\nrar+vl+venXVXX+nq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Vcw3DWtHfIt2j4B2SAA6LiMfLpk8m\nXee/x+Retjk1Ij7ex/7eyH+XMPT/mQCOIV3BdueIWJIvC75aRDye77N8EPAdSTdExOmSJpES3EeB\nL+XnlcbWrPensBbmGoa1i/8BTuh+oWU3ui8/cE4Fvliy3EjSvbZ3l7RlnraGpPcMsL/XgLX6mCfg\nUEmr5qalDuAOYG3SDYeWSHo/sFne30bA6xFxHvBDYOfchzIyIq4lNY/tWLLtgZLBrcDhedvjSVfN\nNauaE4a1ot7a408HVs6dyQ8C/1qybOny3wHWzZ3L9wIdEfEScBxwQW4u+guwdR/77d7WlcBHcqf3\n7r0sdz+pKeo24NsRMQc4D3ivpPuBT5DuXw7pgD4tN4d9M5dlLeDKHM8twIl9lKe39+UXwAaSZuRt\nzSA1cZlVxZc3N6sxSd8CFkXEfxS0/xWAlSPijVxrmkq6Sc7bRcRj7cN9GGb1UeQvsTWA/5dvfSvg\nn5wsrBZcwzAzs4q4D8PMzCrihGFmZhVxwjAzs4o4YZiZWUWcMMzMrCJOGGZmVpH/DwmMbeQUgeRM\nAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x542d930>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "look at the axis reverse in text book\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate hydraulic conductivity\n",
+ "##initialisation of variables\n",
+ "e= 0.6\n",
+ "D10= 0.09 ##mm\n",
+ "##calculations\n",
+ "k= 2.4622*(D10**2*(e**3/(1+e)))**0.7825\n",
+ "##results\n",
+ "print'%s %.4f %s'% ('hydraulic conductivity = ',k,' cm/sec ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hydraulic conductivity = 0.0119 cm/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate hydraulic conductivity\n",
+ "##initialisation of variables\n",
+ "e= 0.6\n",
+ "D10= 0.09 ##mm\n",
+ "D60= 0.16 ##mm\n",
+ "##calculations\n",
+ "Cu=D60/D10\n",
+ "k= 35*(e**3/(1+e))*(Cu**0.6)*(D10**2.32)\n",
+ "##results\n",
+ "print'%s %.3f %s'% ('hydraulic conductivity =',k,'cm/sec ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hydraulic conductivity = 0.025 cm/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate hydraulic conductivity\n",
+ "##initialisation of variables\n",
+ "k1= 0.302e-7 ##cm/sec\n",
+ "k2= 0.12e-7 ##cm/sec\n",
+ "e1= 1.1\n",
+ "e2= 0.9\n",
+ "e= 0.75\n",
+ "##calcualtions\n",
+ "n= (math.log10((k1/k2)*((1+e1)/(1+e2))))/math.log10(e1/e2)\n",
+ "C= k1/(e1**n/(1+e1))\n",
+ "k= C*(e**n/(1+e))\n",
+ "##results\n",
+ "print'%s %.e %s'% ('hydraulic conductivity =',k,'cm/sec')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hydraulic conductivity = 5e-09 cm/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ration of equivalent hydraulic conductivity\n",
+ "##initialisation of variables\n",
+ "H1= 2. ##m\n",
+ "H2= 3. ##m\n",
+ "H3= 4. ##m\n",
+ "k1= 1e-4 ##cm/sec\n",
+ "k2= 3.2e-2 ##cm/sec\n",
+ "k3= 4.1e-5 ##cm/sec\n",
+ "##calculations\n",
+ "H= H1+H2+H3\n",
+ "Kh= (1./H)*((k1*H1)+(k2*H2)+(k3*H3))\n",
+ "Kv= H/((H1/k1)+(H2/k2)+(H3/k3))\n",
+ "P= Kh/Kv\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('ration of equivalent hydraulic conductivity =',P,' ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ration of equivalent hydraulic conductivity = 139.97 \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate rate of water supply\n",
+ "##initialisation of variables\n",
+ "H= 450. ##mm\n",
+ "h= 150. ##mm\n",
+ "k1= 1e-2 ##cm/sec\n",
+ "k2= 3e-3 ##cm/sec\n",
+ "k3= 4.9e-4 ##cm/sec\n",
+ "h1= 300. ##mm\n",
+ "##calculations\n",
+ "Kv= H/(h*(1./k1+1./k2+1./k3))\n",
+ "i= h1/H\n",
+ "q= Kv*i*100.*3600.\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('rate of water supply =',q,' cm/hr ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rate of water supply = 291.01 cm/hr \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter8.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter8.ipynb new file mode 100755 index 00000000..29871da0 --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter8.ipynb @@ -0,0 +1,241 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:61bb09563c68b30d1e4461dec41e802a02b539da836a09cb7d1de16a382cc82d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter8-Seepage"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate rate of water flow\n",
+ "##initialisation of variables\n",
+ "H1= 12. ##in\n",
+ "H2= 20. ##in\n",
+ "z= 8. ##in\n",
+ "h1= 24. ##in\n",
+ "h= 20. ##in\n",
+ "k1= 0.026 ##in/sec\n",
+ "D= 3. ##in\n",
+ "##calculations\n",
+ "k2= H2*k1/((z/(1.-h/h1))-H1)\n",
+ "i= h1/(H1+H2)\n",
+ "A= math.pi/4.*D**2\n",
+ "keq= (H1+H2)/((H1/k1)+(H2/k2))\n",
+ "q= keq*A*i*3600.\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('rate of water flow = ',q,' in^3/hr ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rate of water flow = 330.81 in^3/hr \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate a)How high (above the ground surface) the water will rise if piezometers are placed at points aandb.\n",
+ "#b.The total rate of seepage through the permeable layer per unit length\n",
+ "#c. The approximate average hydraulic gradient at c.\n",
+ "##initialisation of variables\n",
+ "Nd= 6.\n",
+ "H1= 5.6 ##m\n",
+ "H2= 2.2 ##m\n",
+ "k= 5e-5 ##cm/sec\n",
+ "dL= 4.1 ##m\n",
+ "##calculations\n",
+ "H= (H1-H2)/Nd\n",
+ "h1= 5.61-H\n",
+ "h2= 5.61-5.*H\n",
+ "q= 2.38*(H1-H2)*k/Nd\n",
+ "i= H/dL\n",
+ "##results\n",
+ "print'%s %.3f %s'% ('at point a,water will rise to height of = ',h1,' m ')\n",
+ "print'%s %.3f %s'% ('at point b,water will rise to height of =',h2,' m ')\n",
+ "print'%s %.e %s'% ('total rate of seepage per unit lenghth = ',q,' m^3/sec/m ')\n",
+ "print'%s %.3f %s'% ('average hydraulic gradient at c = ',i,' ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "at point a,water will rise to height of = 5.043 m \n",
+ "at point b,water will rise to height of = 2.777 m \n",
+ "total rate of seepage per unit lenghth = 7e-05 m^3/sec/m \n",
+ "average hydraulic gradient at c = 0.138 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate average rate of flow\n",
+ "##initialisation of variables\n",
+ "k1= 5.67 ##ft/day\n",
+ "k2= 11.34 ##ft/day\n",
+ "##from graph\n",
+ "Nd= 8\n",
+ "Nf= 2.5\n",
+ "H= 20\n",
+ "##calculations\n",
+ "q= math.sqrt(k1*k2)*H*Nf/Nd\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('average rate of flow = ',q,' ft^3/day/ft ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average rate of flow = 50.12 ft^3/day/ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg 212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate seepage under the dam \n",
+ "##initialisation of variables\n",
+ "B= 6. ##m\n",
+ "L= 120. ##m\n",
+ "s= 3. ##m\n",
+ "T= 6. ##m\n",
+ "x= 2.4 ##m\n",
+ "H= 5. ##m\n",
+ "k= 0.008 ##cm/sec\n",
+ "##calculations\n",
+ "b=B/2.\n",
+ "a1= b/T\n",
+ "a2= s/T\n",
+ "a3= x/b\n",
+ "Q= 0.378*k*H*L*36*24\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('seepage under the dam = ',Q,' m^3/day ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "seepage under the dam = 1567.64 m^3/day \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate seepage rate\n",
+ "##initialisation of variables\n",
+ "b= math.pi/4. ##degrees\n",
+ "a= math.pi/6.##degrees\n",
+ "B= 10. ##ft\n",
+ "H= 20. ##ft\n",
+ "h= 25. ##ft\n",
+ "k= 2e-4 ##ft/min\n",
+ "##calculations\n",
+ "r= H/math.tan(b)\n",
+ "d= 0.3*r+(h-H)/math.tan(b)+B+h/math.tan(a)\n",
+ "L= d/math.cos(a)-math.sqrt((d/math.cos(a))**2-(H/math.sin(a))**2)\n",
+ "q= k*L*math.tan(a)*math.sin(a)*24.*60\n",
+ "##results\n",
+ "print'%s %.4f %s'% ('seepage rate = ',q,' ft^3/day/ft ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "seepage rate = 0.9724 ft^3/day/ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter9.ipynb b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter9.ipynb new file mode 100755 index 00000000..005e638c --- /dev/null +++ b/Principles_Of_Geotechnical_Engineering_by_B._M._Das/Chapter9.ipynb @@ -0,0 +1,205 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c82d7ef2a69a4d72efc2edfc8621bdf4ff77be194f7e8e01b4cf1b42672764ab"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter9-In Situ Stresses"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate total pressure and pore water pressure and effective stress at point\n",
+ "##initialisation of variables\n",
+ "Ds= 16.5 ##kN/m**3\n",
+ "S= 19.25 ##kN/m**3\n",
+ "g= 9.8 ##kN/m**3\n",
+ "h1= 6. ##m\n",
+ "h2= 13. ##m\n",
+ "##at point A\n",
+ "Sa= 0.\n",
+ "Ua= 0.\n",
+ "Sa1= 0.\n",
+ "##at point B\n",
+ "Sb= h1*Ds\n",
+ "Ub= 0.\n",
+ "Sb1= Sb-Ub\n",
+ "##at point C\n",
+ "Sc= h1*Ds+h2*S\n",
+ "Uc= h2*g\n",
+ "Sc1= Sc-Uc\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('total pressure at C= ',Sc,' kN/m^3 ')\n",
+ "print'%s %.2f %s'% ('pore water pressure at C = ',Uc,' kN/m^3 ')\n",
+ "print'%s %.2f %s'% ('effective stress at point C=',Sc1,' kN/m^3 ')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total pressure at C= 349.25 kN/m^3 \n",
+ "pore water pressure at C = 127.40 kN/m^3 \n",
+ "effective stress at point C= 221.85 kN/m^3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate maximu depth that can be made in clay\n",
+ "##initialisation of variables\n",
+ "h= 20. ##ft\n",
+ "g= 120. ##kg/ft**3\n",
+ "h1= 12. ##ft\n",
+ "w= 62.4 ##kg/ft**3\n",
+ "##calculations\n",
+ "H= h-(h1*w/g)\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('maximu depth that can be made in clay = ',H,' ft ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximu depth that can be made in clay = 13.76 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate effective stress at point a and b and see page force per unit voume\n",
+ "##initialisation of variables\n",
+ "G= 2.68\n",
+ "e= 0.52\n",
+ "g= 9.81 ##kN/m^3\n",
+ "h1= 0.7 ##m\n",
+ "h2= 1 ##m\n",
+ "h3= 1.5 ##m\n",
+ "h4= 2 ##m\n",
+ "##calculations\n",
+ "##for soil A\n",
+ "sa= (G+e)*g/(1.+e)\n",
+ "##point a\n",
+ "Sa= h1*g+h2*sa\n",
+ "u= (h2+h1+h3/2.)*g\n",
+ "Es= Sa-u\n",
+ "##point b\n",
+ "sb= h1*g+h4*sa\n",
+ "ub= (h4+h1+h3)*g\n",
+ "Eb= sb-ub\n",
+ "i= h3/2.\n",
+ "s= i*g\n",
+ "##results\n",
+ "print'%s %.2f %s'% ('effective stress at point a=',Es,' kN/m^2 ')\n",
+ "print'%s %.2f %s'% ('effective stress at point b= ',Eb,'kN/m^2 ')\n",
+ "print'%s %.2f %s'% ('seepage force per unit voume = ',s,' kN/m^3 ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "effective stress at point a= 3.49 kN/m^2 \n",
+ "effective stress at point b= 6.97 kN/m^2 \n",
+ "seepage force per unit voume = 7.36 kN/m^3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate safety factor\n",
+ "##initialisation of variables\n",
+ "C0= 0.357\n",
+ "H1= 30.5 ##ft\n",
+ "H2= 5. ##ft\n",
+ "w= 62.4 ## lb/ft^3\n",
+ "D= 20.\n",
+ "g= 112. ## lb/ft^3\n",
+ "##calculations\n",
+ "G= g-w\n",
+ "FS= D*G/(C0*w*(H1-H2))\n",
+ "##results\n",
+ "print'%s %.1f %s'% ('safety factor =',FS,' ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "safety factor = 1.7 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Quantum_Physics_Of_Atoms,_Molecules,_Solids,_Nuclei_And_Particles/README.txt b/Quantum_Physics_Of_Atoms,_Molecules,_Solids,_Nuclei_And_Particles/README.txt new file mode 100755 index 00000000..98060672 --- /dev/null +++ b/Quantum_Physics_Of_Atoms,_Molecules,_Solids,_Nuclei_And_Particles/README.txt @@ -0,0 +1,10 @@ +Contributed By: Niren Negandhi +Course: be +College/Institute/Organization: Avaya India Pvt. Ltd. +Department/Designation: Senior Technical Specialist +Book Title: Quantum Physics Of Atoms, Molecules, Solids, Nuclei And Particles +Author: Eisberg And R. Resnick +Publisher: John Wiley +Year of publication: 1985 +Isbn: 0-471-87373-X +Edition: 2nd
\ No newline at end of file diff --git a/Solid_Mechanics/README.txt b/Solid_Mechanics/README.txt new file mode 100755 index 00000000..b5a66f2c --- /dev/null +++ b/Solid_Mechanics/README.txt @@ -0,0 +1,10 @@ +Contributed By: prashanth kumar +Course: btech +College/Institute/Organization: iitbombay +Department/Designation: aerospace engnieering +Book Title: Solid Mechanics +Author: S. M. A. Kazimi +Publisher: Tata McGraw-Hill, New Delhi +Year of publication: 1976 +Isbn: 0070964742 +Edition: 1
\ No newline at end of file diff --git a/Solid_Mechanics/screenshots/Chapter7_1.png b/Solid_Mechanics/screenshots/Chapter7_1.png Binary files differnew file mode 100755 index 00000000..1ae3420c --- /dev/null +++ b/Solid_Mechanics/screenshots/Chapter7_1.png diff --git a/Solid_Mechanics/screenshots/Chapter8_1.png b/Solid_Mechanics/screenshots/Chapter8_1.png Binary files differnew file mode 100755 index 00000000..0afad75a --- /dev/null +++ b/Solid_Mechanics/screenshots/Chapter8_1.png diff --git a/Solid_Mechanics/screenshots/Chapter9_1.png b/Solid_Mechanics/screenshots/Chapter9_1.png Binary files differnew file mode 100755 index 00000000..157b5b6a --- /dev/null +++ b/Solid_Mechanics/screenshots/Chapter9_1.png diff --git a/Solid_Mechanics_by_S._M._A._Kazimi/Chapter10.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter10.ipynb new file mode 100755 index 00000000..fd1157a7 --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter10.ipynb @@ -0,0 +1,380 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a601aeb14df4da407d21840979065e013c6625898ebb94e4912790652153bf88"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10-Introduction To Energy Methods"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate lift using Energy method\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "L=6000. ##cm\n",
+ "L1=150. ##cm\n",
+ "T=90. ##W\n",
+ "Ip=math.pi*10**4./32.\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "G=E/2.5\n",
+ "A=3. ##cm^2\n",
+ "delta=0.5\n",
+ "##calculations\n",
+ "U=L/(2.*E*A)+(T*T*L1/(2.*G*Ip))\n",
+ "## U=0.5*W*delta\n",
+ "W=0.25/U\n",
+ "##results\n",
+ "print'%s %.2f %s'%('W = ',W,' kg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W = 196.31 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find deflection under a load of one tonne at end\n",
+ "##initialization of variabes\n",
+ "import math\n",
+ "cA=10. ##cm^2\n",
+ "wA=5. ##cm^2\n",
+ "P=1. ##tonne\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "P=P*1000. ##kg\n",
+ "## calculations\n",
+ "U_up=P**2*200./(2.*E*cA)*1./math.sqrt(3)*(2.+4.+6.+8.+10.+12.)\n",
+ "U_do=P**2*200./(2.*E*cA)*1./math.sqrt(3)*(1.+3.+5.+7.+9.+11.+13./2.)\n",
+ "U_web=P**2*200./(2.*E*wA)*1./math.sqrt(3)*(2.*13.)\n",
+ "U=U_up+U_do+U_web\n",
+ "delta=U*2./(P)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('deflection = ',delta,' cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "deflection = 0.79 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate deflection of loaded end due to same load of one tonne\n",
+ "a=2*10**8\n",
+ "b=69282032.302\n",
+ "c=136.5\n",
+ "d=28\n",
+ "aa=5\n",
+ "bb=15\n",
+ "BC=16.77\n",
+ "cc=56000\n",
+ "dd=1300\n",
+ "ee=20*10**6\n",
+ "\n",
+ "\n",
+ "#part(a)\n",
+ "AB=a*c/(b) #\n",
+ "print'%s %.2f %s'%('energy stored in Bd due to axial force ',AB,'kg-cm')\n",
+ "\n",
+ "#Part(b)\n",
+ "Ubc=(b*b*aa)/(bb*bb)\n",
+ "UB=BC*100./(4.*10.)\n",
+ "UBC=Ubc*UB\n",
+ "Bc=730 \n",
+ "print'%s %.2f %s'%('energy stored in Bd due to axial force ',Bc,'kg-cm')\n",
+ "\n",
+ "#part(c)\n",
+ "AB=394 #\n",
+ "print'%s %.2f %s'%('energy stored in Bd due to axial force ',AB,'kg-cm')\n",
+ "\n",
+ "\n",
+ "#part(d)\n",
+ "Ebc=d*2/bb\n",
+ "\n",
+ "\n",
+ "#assuming that only chord memeber are taking axial stress then\n",
+ "\n",
+ "BD=(cc/bb)**2*(dd/4*ee)\n",
+ "BD1=227 \n",
+ "print'%s %.2f %s'%('energy stored in Bd due to axial force ',BD1,'kg-cm')\n",
+ "#total energy\n",
+ "TE=BD1+AB+Bc+AB\n",
+ "delta=(2*TE)/(1000.)\n",
+ "print'%s %.2f %s'%('total energy stored in Bd due to axial force ',delta,'kg-cm')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "energy stored in Bd due to axial force 394.04 kg-cm\n",
+ "energy stored in Bd due to axial force 730.00 kg-cm\n",
+ "energy stored in Bd due to axial force 394.00 kg-cm\n",
+ "energy stored in Bd due to axial force 227.00 kg-cm\n",
+ "total energy stored in Bd due to axial force 3.49 kg-cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate stresses in steel and stress in cloth laminate\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "L=1. ##m\n",
+ "w=10. ##kg\n",
+ "h=50. ##cm\n",
+ "A=1. ##cm^2\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "Ar=1 ##cm^2\n",
+ "Ec=3*10**4 ##kg/cm^2\n",
+ "## For steel\n",
+ "D=w*L*100./(A*E)\n",
+ "P=w*(1+math.sqrt(1.+(2.*h/D)))\n",
+ "print'%s %.2f %s'%('Stress in steeel = ',P,' kg/cm^2 ')\n",
+ "\n",
+ "## for cloth laminate\n",
+ "D=w*L*100./(A*Ec)\n",
+ "P=w*(1+math.sqrt(1.+(2.*h/D)))\n",
+ "print'%s %.2f %s'%('\\n Stress in cloth laminate = ',P,' kg/cm^2 ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Stress in steeel = 4482.15 kg/cm^2 \n",
+ "\n",
+ " Stress in cloth laminate = 557.81 kg/cm^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg407"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate maximum stress in wood and divers feet in all parts\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "w=64. ##kg\n",
+ "H=60. ##cm\n",
+ "b=40. ##cm\n",
+ "h=5. ##cm\n",
+ "E=0.12*10**6 ##kg/cm^2\n",
+ "Es=2*10**6 ##kg/cm^2\n",
+ "## for part (a) and (b)\n",
+ "I=b*h**3./12.\n",
+ "D=4.*w*120**3/(E*I)\n",
+ "P=w*(1+math.sqrt(1.+(2.*H/D)))\n",
+ "str=P*240.*6./(b*h**2.)\n",
+ "print('part (a) and (b)')\n",
+ "print'%s %.2f %s'%('\\n Maximum stress in wood = ',str,' kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n Max. force on divers feet =',P,' kg')\n",
+ "\n",
+ "##for part (c)\n",
+ "Ixx=I*E/Es\n",
+ "Zxx=19.4 ##cm^2\n",
+ "Ixx=72.7 ##cm^4\n",
+ "D=4*w*120**3/(Es*Ixx)\n",
+ "P=w*(1+math.sqrt(1.+(2.*H/D)))\n",
+ "str=P*240./Zxx\n",
+ "## results\n",
+ "print('\\n part (c)')\n",
+ "print'%s %.2f %s'%('\\n Maximum stress in steel = ',str,' kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n Max. force on divers feet =',P,' kg')\n",
+ "print('\\n Hence wood is better than steel')\n",
+ "\n",
+ "print('wrong calculations in some parts')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part (a) and (b)\n",
+ "\n",
+ " Maximum stress in wood = 443.86 kg/cm^2\n",
+ "\n",
+ " Max. force on divers feet = 308.24 kg\n",
+ "\n",
+ " part (c)\n",
+ "\n",
+ " Maximum stress in steel = 5826.84 kg/cm^2\n",
+ "\n",
+ " Max. force on divers feet = 471.00 kg\n",
+ "\n",
+ " Hence wood is better than steel\n",
+ "wrong calculations in some parts\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate central deflection\n",
+ "##initialization of variables\n",
+ "\n",
+ "A=100. ##cm^2\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "## calculations\n",
+ "D=1093.5*10**6/(E*A)\n",
+ "## 1093.5 from the table\n",
+ "## results\n",
+ "print'%s %.2f %s'%('Central deflection = ',D,' mm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Central deflection = 5.47 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg415"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate deflection\n",
+ "##initialization of variables\n",
+ "T=30. ##degree celcius\n",
+ "alpha=0.0000117 ## per degree celcius\n",
+ "##AB\n",
+ "L=6. ##m\n",
+ "dl=T*alpha*L\n",
+ "df=0.375 ##kg\n",
+ "tot=dl*df\n",
+ "##BC\n",
+ "dl=T*alpha*L\n",
+ "df=0.375 ##kg\n",
+ "tot=tot+dl*df\n",
+ "##CD\n",
+ "dl=T*alpha*L\n",
+ "df=0.75 ##kg\n",
+ "tot=tot+dl*df\n",
+ "tot=tot*100.*2.\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The deflection is ',tot,' cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The deflection is 0.63 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Solid_Mechanics_by_S._M._A._Kazimi/Chapter2.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter2.ipynb new file mode 100755 index 00000000..656a8597 --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter2.ipynb @@ -0,0 +1,389 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7ce3350f5dcc3b0641adb55040e49ecdbd34a727a892086466c616c0ec4732d8"
+ },
+ "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\n",
+ "from numpy import 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. ]]"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "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\n",
+ "from numpy import 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": 2
+ },
+ {
+ "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) (c)\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": 1
+ },
+ {
+ "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/Solid_Mechanics_by_S._M._A._Kazimi/Chapter3.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter3.ipynb new file mode 100755 index 00000000..84972e67 --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter3.ipynb @@ -0,0 +1,315 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:06d678b0a78daa39d2ccf83b1f54b7f750b3218b6d64413136cd6df094ffadaf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3-Analysis of Strain"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given matrix \n",
+ "import math\n",
+ "#find all the strains\n",
+ "#by strain components\n",
+ "Ex=0.06\n",
+ "Ey=0.01\n",
+ "Ez=0.01\n",
+ "Exy=0.05\n",
+ "Eyx=0.03\n",
+ "Eyz=0\n",
+ "Ezy=0\n",
+ "Exz=0.02\n",
+ "Ezx=0.01\n",
+ "gammaxy=Exy-Eyx\n",
+ "gammayz=Eyz-Ezy\n",
+ "gammazx=Exz+Ezx\n",
+ "print'%s %.2f %s'%('gammaxy',gammaxy,'')\n",
+ "print'%s %.2f %s'%('gammayz',gammayz,'')\n",
+ "print'%s %.2f %s'%('gammazx',gammazx,'')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gammaxy 0.02 \n",
+ "gammayz 0.00 \n",
+ "gammazx 0.03 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#show that they equal\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "## initialization of variables\n",
+ "\n",
+ "epsillon=numpy.matrix([[0.01, 0, 0],[0, 0.02, 0.02],[0, 0.02, 0.01]]) ## dimensionless\n",
+ "theta=30. ## 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",
+ "\n",
+ "b=numpy.transpose(a)\n",
+ "epsillon_new=numpy.dot(epsillon,b)\n",
+ "epsillon1=numpy.dot(a,epsillon)\n",
+ "## calculation of strain invariants\n",
+ "## for epsillon\n",
+ "J1=epsillon[0,0]+epsillon[1,1]+epsillon[2,2]\n",
+ "J2=epsillon[0,0]*epsillon[1,1]+epsillon[1,1]*epsillon[2,2]+epsillon[2,2]*epsillon[0,0]-2*(epsillon[0,1]**2+epsillon[1,2]**2+epsillon[2,0]**2)\n",
+ "J3=epsillon[0,0]*epsillon[1,1]*epsillon[2,2]+2*epsillon[0,1]*epsillon[1,2]*epsillon[2,0]-(epsillon[0,0]*epsillon[1,2]**2+epsillon[1,1]*epsillon[2,0]**2+epsillon[2,2]*epsillon[0,1]**2)\n",
+ "\n",
+ "## for epsillon_new\n",
+ "J11=epsillon_new[0,0]+epsillon_new[1,1]+epsillon_new[2,2]\n",
+ "J22=epsillon_new[0,0]*epsillon_new[1,1]+epsillon_new[1,1]*epsillon_new[2,2]+epsillon_new[2,2]*epsillon_new[0,0]-2*(epsillon_new[0,1]**2+epsillon_new[1,2]**2+epsillon_new[2,0]**2)\n",
+ "J33=epsillon_new[0,0]*epsillon_new[1,1]*epsillon_new[2,2]+2*epsillon_new[0,1]*epsillon_new[1,2]*epsillon_new[2,0]-(epsillon_new[0,0]*epsillon_new[1,2]**2+epsillon_new[1,1]*epsillon_new[2,0]**2+epsillon_new[2,2]*epsillon_new[0,1]**2)\n",
+ "\n",
+ "## results\n",
+ "print('The new strain tensor is');\n",
+ "print(epsillon_new);\n",
+ "print'%s %.2f %s %.2e %s %.2e %s %.2f %s %.2e %s %.2e' %('The Strain invariants of old strain tensor are J1=',J1,' J2=',J2,' J3=',J3,' \\n and that of the new stress tensor are J1=',J11,' J2=',J22,' J3=',J33)\n",
+ "\n",
+ "print('\\n Hence the same strain invariants')\n",
+ "\n",
+ "print('because of rounding error ans is not matching')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The new strain tensor is\n",
+ "[[ 0.00866025 -0.005 0. ]\n",
+ " [ 0.01 0.01732051 0.02 ]\n",
+ " [ 0.01 0.01732051 0.01 ]]\n",
+ "The Strain invariants of old strain tensor are J1= 0.04 J2= -3.00e-04 J3= -2.00e-06 \n",
+ " and that of the new stress tensor are J1= 0.04 J2= -6.40e-04 J3= -5.95e-06\n",
+ "\n",
+ " Hence the same strain invariants\n",
+ "because of rounding error ans is not matching\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "#find all the componetns of epsillon and the invariants of epsillon new\n",
+ "## initialization of variables\n",
+ "\n",
+ "epsillon=numpy.matrix([[0.01, -0.02, 0],\n",
+ " [-0.02, 0.03, -0.01],\n",
+ " [0, -0.01, 0]]) # dimensionless\n",
+ "a_xx=0.6 \n",
+ "theta=math.acos(a_xx) # radians\n",
+ "#calculations\n",
+ "theta1=theta*math.pi/180\n",
+ "a=numpy.matrix([[math.cos(theta1), 0 ,-math.sin(theta1)], [ 0 , 1, 0],[math.sin(theta1), 0 ,math.cos(theta1)]])\n",
+ "b=numpy.transpose(a)\n",
+ "epsillon1=numpy.dot(a,epsillon)\n",
+ "epsillon_new=numpy.dot(a,b)\n",
+ "\n",
+ "# calculation of strain invariants\n",
+ "#for epsillon\n",
+ "J1=epsillon[0,0]+epsillon[1,1]+epsillon[2,2]\n",
+ "J2=epsillon[0,0]*epsillon[1,1]+epsillon[1,1]*epsillon[2,2]+epsillon[2,2]*epsillon[0,0]-2*(epsillon[0,1]**2+epsillon[1,2]**2+epsillon[2,0]**2)\n",
+ "J3=epsillon[0,0]*epsillon[1,1]*epsillon[2,2]+2*epsillon[0,1]*epsillon[1,2]*epsillon[2,0]-(epsillon[0,0]*epsillon[1,2]**2+epsillon[1,1]*epsillon[2,0]**2+epsillon[2,2]*epsillon[0,1]**2)\n",
+ "\n",
+ "# for epsillon_new\n",
+ "J11=epsillon_new[0,0]+epsillon_new[1,1]+epsillon_new[2,2]\n",
+ "J22=epsillon_new[0,0]*epsillon_new[1,1]+epsillon_new[1,1]*epsillon_new[2,2]+epsillon_new[2,2]*epsillon_new[0,0]-2*(epsillon_new[0,1]**2+epsillon_new[1,2]**2+epsillon_new[2,0]**2)\n",
+ "J33=epsillon_new[0,0]*epsillon_new[1,1]*epsillon_new[2,2]+2*epsillon_new[0,1]*epsillon_new[1,2]*epsillon_new[2,0]-(epsillon_new[0,0]*epsillon_new[1,2]**2+epsillon_new[1,1]*epsillon_new[2,0]**2+epsillon_new[2,2]*epsillon_new[0,1]**2)\n",
+ "# Results\n",
+ "print('The new strain tensor is');\n",
+ "print(epsillon_new);\n",
+ "print'%s %.2e %s %.2e %s %.2e %s %.2e %s %.2e %s %.2e' %('The Strain invariants of old strain tensor are J1=',J1,' J2=',J2,' J3=',J3,' \\n and that of the new stress tensor are J1=',J11,' J2=',J22,' J3=',J33)\n",
+ "print('because of rounding error ans is not matching')\n",
+ "print('\\n Hence the same strain invariants')\n",
+ "print(\"in book calculations are done wrong\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The new strain tensor is\n",
+ "[[ 1. 0. 0.]\n",
+ " [ 0. 1. 0.]\n",
+ " [ 0. 0. 1.]]\n",
+ "The Strain invariants of old strain tensor are J1= 4.00e-02 J2= -7.00e-04 J3= -1.00e-06 \n",
+ " and that of the new stress tensor are J1= 3.00e+00 J2= 3.00e+00 J3= 1.00e+00\n",
+ "because of rounding error ans is not matching\n",
+ "\n",
+ " Hence the same strain invariants\n",
+ "in book calculations are done wrong\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the principal strains by using transformation equations\n",
+ "epsillon_A= 700.*10**-6 \n",
+ "epsillon_B= 300.*10**-6 \n",
+ "epsillon_C= 300.*10**-6 \n",
+ "theta=45. ## degrees\n",
+ "theta=theta*math.pi/180 ## radians\n",
+ "## calculations\n",
+ "epsillon_x=epsillon_A\n",
+ "epsillon_y=epsillon_C\n",
+ "gamma_xy=(epsillon_B-(epsillon_x*math.cos(theta)**2+epsillon_y*math.sin(theta)**2))/(math.sin(theta)*math.cos(theta))\n",
+ "epsillon_1=1/2.*(epsillon_x+epsillon_y)+(1/2.)*math.sqrt((epsillon_x-epsillon_y)**2+gamma_xy**2)\n",
+ "epsillon_2=1/2.*(epsillon_x+epsillon_y)-(1/2.)*math.sqrt((epsillon_x-epsillon_y)**2+gamma_xy**2)\n",
+ "phi=0.5*math.atan(gamma_xy/(epsillon_x-epsillon_y))\n",
+ "phi=phi*180./math.pi\n",
+ "##results\n",
+ "print'%s %.2e %s %.2e %s'%('The principal strains are ',epsillon_1,''and '',epsillon_2,'')\n",
+ "print'%s %.2f %s'%('\\n phi = ',phi,'degrees')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The principal strains are 7.83e-04 2.17e-04 \n",
+ "\n",
+ " phi = -22.50 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "#find the principal strains\n",
+ "\n",
+ "## initialization of variables\n",
+ "epsillon_A= 1000*10**-6 \n",
+ "epsillon_B= 720*10**-6 \n",
+ "epsillon_C= 600*10**-6 \n",
+ "th_B=120 # degrees\n",
+ "th_C=240 # degrees\n",
+ "##calculations\n",
+ "th_B=th_B*math.pi/180.\n",
+ "th_C=th_C*math.pi/180.\n",
+ "## we need to solve for epsillon_y and gamma_xy\n",
+ "# Ax=B\n",
+ "ep_x=epsillon_A\n",
+ "A=numpy.matrix([[math.sin(th_B)**2, math.sin(th_B)*math.cos(th_B)],\n",
+ " [ math.sin(th_C)**2, math.sin(th_C)*math.cos(th_C)]])\n",
+ "C=numpy.matrix([[epsillon_B-ep_x*math.cos(th_B)**2], [epsillon_C-ep_x*math.cos(th_C)**2]]) \n",
+ "\n",
+ "x=numpy.dot(numpy.linalg.inv(A),C)\n",
+ "\n",
+ "ep_y=x[0,0]\n",
+ "gam_xy=x[1,0]\n",
+ "epsillon_x=ep_x\n",
+ "epsillon_y=ep_y\n",
+ "gamma_xy=gam_xy\n",
+ "epsillon_1=1/2.*(epsillon_x+epsillon_y)+(1./2.)*math.sqrt((epsillon_x-epsillon_y)**2+gamma_xy**2)\n",
+ "epsillon_2=1/2.*(epsillon_x+epsillon_y)-(1./2.)*math.sqrt((epsillon_x-epsillon_y)**2+gamma_xy**2)\n",
+ "## Results\n",
+ "print'%s %.3e %s %.3e %s '%('The principal strains are ',epsillon_1,''and '',epsillon_2,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The principal strains are 1.010e-03 5.363e-04 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Solid_Mechanics_by_S._M._A._Kazimi/Chapter4.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter4.ipynb new file mode 100755 index 00000000..27418162 --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter4.ipynb @@ -0,0 +1,242 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8153891fd31915fc027b9835e482fe359e89a7a1a683b21a2334c8771f72e58d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter4-Stress-Strain Relations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "import numpy\n",
+ "E=2.*10**6. ## kg/cm^2\n",
+ "G=8.*10**5. ## kg/cm^2\n",
+ "ep=numpy.matrix([[0.001, 0, -0.002],\n",
+ " [0 ,-0.003, 0.0005],\n",
+ " [-0.002, 0.0005, 0]])\n",
+ "## calculations\n",
+ "nu=E/(2.*G)-1.\n",
+ "D=E*nu/((1.+nu)*(1.-2.*nu))\n",
+ "mu=G\n",
+ "sigma=2.*mu*ep[0,0]+D*(ep[0,0]+ep[1,1]+ep[2,2])\n",
+ "sigma=2.*mu*ep[1,1]+D*(ep[0,0]+ep[1,1]+ep[2,2])\n",
+ "sigma=2.*mu*ep[2,2]+D*(ep[0,0]+ep[1,1]+ep[2,2])\n",
+ "tau=2.*mu*ep[0,1]\n",
+ "tau=2.*mu*ep[0,2]\n",
+ "tau=2.*mu*ep[1,2]\n",
+ "tau=numpy.matrix([[sigma, tau, tau],\n",
+ " [tau, sigma, tau],\n",
+ " [tau, tau, sigma]])\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s'%('The lames constants are ',D,' and ',mu,'kg/cm^2')\n",
+ "print('\\n The stres tensor is')\n",
+ "print(tau)\n",
+ "print('in text book calculations are done wrong')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The lames constants are 800000.00 and 800000.00 kg/cm^2\n",
+ "\n",
+ " The stres tensor is\n",
+ "[[-1600. 800. 800.]\n",
+ " [ 800. -1600. 800.]\n",
+ " [ 800. 800. -1600.]]\n",
+ "in text book calculations are donw wrong\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the magnitude and direction of all the principal strains\n",
+ "sigma_x=1000. ##kg/cm^2\n",
+ "sigma_y=-500. ##kg/cm^2\n",
+ "sigma_z=0. ##kg/cm^2\n",
+ "tau_xy=500. ##kg/cm^2\n",
+ "E=2.*10**6 ## kg/cm^2\n",
+ "nu=0.25\n",
+ "##calculations\n",
+ "ep_x=1./E*(sigma_x-nu*(sigma_y+sigma_z))\n",
+ "ep_y=1./E*(sigma_y-nu*(sigma_x+sigma_z))\n",
+ "ep_z=1./E*(sigma_z-nu*(sigma_y+sigma_x))\n",
+ "J1=ep_x+ep_y+ep_z\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1/2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1/2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "th=1/2.*math.atan(2.*tau_xy/(sigma_x-sigma_y))\n",
+ "th=th*180/math.pi\n",
+ "ep_1=1./E*(sigma_1-nu*sigma_2)\n",
+ "ep_2=1./E*(sigma_2-nu*sigma_1)\n",
+ "ep_3=-1./E*nu*(sigma_1+sigma_2)\n",
+ "##results\n",
+ "print'%s %.5f %s'%('The magnitude of principal strain are ',abs(ep_1),'')\n",
+ "print'%s %.5f %s'%('The magnitude of principal strain are ',abs(ep_2),'')\n",
+ "print'%s %.5f %s'%('The magnitude of principal strain are ',abs(ep_3),'')\n",
+ "print'%s %.2f %s'%('\\n and the diection is given by theta=',th,' degrees')\n",
+ "print'%s %.8f %s'%('\\n J1 is ',J1,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnitude of principal strain are 0.00066 \n",
+ "The magnitude of principal strain are 0.00047 \n",
+ "The magnitude of principal strain are 0.00006 \n",
+ "\n",
+ " and the diection is given by theta= 16.85 degrees\n",
+ "\n",
+ " J1 is 0.00012500 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#findd the value of sigma y and principal stress\n",
+ "# initialization of variables\n",
+ "\n",
+ "sigma_x=1400. ##kg/cm^2\n",
+ "tau_xy=400.## kg/cm^2\n",
+ "ep_z=-3.6*10**-6\n",
+ "nu=1/4.\n",
+ "E=2*10**8 ##kg/cm^2\n",
+ "## calculations\n",
+ "sigma_y=(-ep_z*E/nu)-sigma_x\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1/2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2-math.sqrt((1/2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "th=0.5*math.atan(2*tau_xy/(sigma_x-sigma_y))\n",
+ "th=th*180/math.pi\n",
+ "print'%s %.2f %s'%('sigma_y is ',sigma_y,' kg/cm^2')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n The principal stresses are',sigma_1,'kg/cm^2 'and '',sigma_2,'kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n The direction is given by theta = ',-th,' degrees')\n",
+ "\n",
+ "## angle was given wrong in the text\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sigma_y is 1480.00 kg/cm^2\n",
+ "\n",
+ " The principal stresses are 1842.00 1038.00 kg/cm^2 \n",
+ "\n",
+ " The direction is given by theta = 42.14 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#detemine wheather there is yielding according to tresca and von moises conditions or not\n",
+ "C=1000./3. ##kg/cm^2\n",
+ "sigma_x=2.*C\n",
+ "sigma_y=4.*C\n",
+ "tau_xy=4.*C\n",
+ "sigma_0=4.*C\n",
+ "sigma_1=3.+C*math.sqrt(2.)\n",
+ "sigma_2=3.-C*math.sqrt(2.)\n",
+ "sigma_3=0.\n",
+ "tau_oct=1/3.*math.sqrt((sigma_1-sigma_2)**2+(sigma_2-sigma_3)**2+(sigma_3-sigma_1)**2)\n",
+ "tau_max=sigma_1/2.\n",
+ "taU=1.885*C\n",
+ "tau_y=2.*C\n",
+ "print'%s %.2f %s'%('Actual tau is ',taU,'')\n",
+ "print'%s %.2f %s'%('\\n tau_max at yield is ',tau_y,'')\n",
+ "print('\\n Hence yielding doesn not occur according to Von-Miles condition \\n but it occurs due to Tresca condition')\n",
+ "print('\\n In text book C is not multiplied' )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Actual tau is 628.33 \n",
+ "\n",
+ " tau_max at yield is 666.67 \n",
+ "\n",
+ " Hence yielding doesn not occur according to Von-Miles condition \n",
+ " but it occurs due to Tresca condition\n",
+ "\n",
+ " In text book C is not multiplied\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Solid_Mechanics_by_S._M._A._Kazimi/Chapter5.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter5.ipynb new file mode 100755 index 00000000..ce308344 --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter5.ipynb @@ -0,0 +1,558 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:768e5620d31d4b5603faf8e19db8db3178570776ab6e28491caaf3d036876dc4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter5-Uniaxial Deformations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the depth of clay bed \n",
+ "l=20. ##cm\n",
+ "dL=1. ##m\n",
+ "dl=0.004 ##cm\n",
+ "##calculations\n",
+ "L=l*dL/dl ##m\n",
+ "##results\n",
+ "print'%s %.2f %s'%('The depth of the clay bed is ',L,' m')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The depth of the clay bed is 5000.00 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the total extension of the rod and draw the force and extension diagrams\n",
+ "A=1. ##unit area\n",
+ "E=2.*10**6 ##kg/cm^2\n",
+ "## calculations\n",
+ "db=3000.*90./(A*E)\n",
+ "dc=db+5000.*60./(A*E)\n",
+ "dd=dc+4000.*30./(A*E)\n",
+ "##results\n",
+ "print'%s %.2e %s %.2e %s %.2e %s '%('The extension of the rod in part AB is ',db,' cm'and'in part BC is ',dc,' cm'and' \\n and in part CD is ',dd,' cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The extension of the rod in part AB is 1.35e-01 in part BC is 2.85e-01 \n",
+ " and in part CD is 3.45e-01 cm \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#findthe extension under its own weight\n",
+ "A=3. ##cm^2\n",
+ "L=18. ##m\n",
+ "E= 2*10**6 ##kg/cm^2\n",
+ "r=7833. ##kg/m^3\n",
+ "##calculations\n",
+ "e=r*(L*100)**2./(2*E*10**6)\n",
+ "## results\n",
+ "print'%s %.4f %s'%('The elongation is ',e,' cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The elongation is 0.0063 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the extension under a concertrated load of 3 tonne at the bottom\n",
+ "## linked to 5_3\n",
+ "P=3 ##tonne\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "d_0= 1. ##cm\n",
+ "d_l=2.8 ##cm\n",
+ "## calculations\n",
+ "e=4*P*1000.*d_l*10**3/(d_l**2*math.pi*E*(1-((d_l-d_0)/d_l)))\n",
+ "##results\n",
+ "print'%s %.2f %s'%('The total elongation is ',e,' cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total elongation is 1.91 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "import scipy as Sci\n",
+ "from scipy import linalg\n",
+ "P=10 ##tonne\n",
+ "import numpy as np\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "## calculations\n",
+ "## We have to solve linear system Ax=B\n",
+ "A=numpy.matrix([[1, 1, 1, 0], [3, 1, -3, 0],[-2, 2, 0, -E],[0, -1, 2, -E]])\n",
+ "B=numpy.matrix([[P*10**3],[0],[0],[0]])\n",
+ "x=numpy.dot(np.linalg.inv(A),B)\n",
+ "W1=x[0,0]/1000.\n",
+ "W2=x[1,0]/1000.\n",
+ "W3=x[2,0]/1000.\n",
+ "th=x[3,0]\n",
+ "##results\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%('The load taken by each rod is',W1,' tonne'and'',W2,' tonne'and'',W3,'tonne')\n",
+ "print'%s %.3e %s'%('\\n and the slope is theta = ',th,' radians') \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The load taken by each rod is 2.33 4.00 3.67 tonne \n",
+ "\n",
+ " and the slope is theta = 1.667e-03 radians\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#calculate the safe load taken by the column\n",
+ "b=30. ## cm\n",
+ "h=30. ##cm\n",
+ "n=6.\n",
+ "A=36. ##cm^2\n",
+ "ss_s=1500. ##kg/cm^2\n",
+ "ss_c=60. ##kg/cm^2\n",
+ "Er=15. ## Elasticity ratio\n",
+ "## calculations\n",
+ "L=A*Er*ss_c+(b*h-A)*ss_c\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The safe load is ',L,'.kg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The safe load is 84240.00 .kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the stress in steel and concerete after redisturbution of stress in steel and cncerete\n",
+ "## initiaization of variables\n",
+ "import math\n",
+ "gs_b=10. ##cm\n",
+ "gs_h=10. ##cm\n",
+ "d_b=2. ##cm\n",
+ "d_h=2. ##cm\n",
+ "As= 1. ##cm^2\n",
+ "s=10000. ##kg/cm^2\n",
+ "## part (a)\n",
+ "Es=2*10**6 ##kg/cm^2\n",
+ "Ec=2*10**5 ##kg/cm^2\n",
+ "## calculations\n",
+ "e=s/Es\n",
+ "Ac=gs_b*gs_h-(d_b*d_h)\n",
+ "e_c=e*Es*As/(Ec*Ac+Es*As)\n",
+ "s_c=Ec*e_c\n",
+ "e_s=e-e_c\n",
+ "s_s=Es*e_s\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('part (a) \\n The stress in steel and concrete are respectively ',s_s,''and '',s_c,' kg/cm^2')\n",
+ "## part(b)\n",
+ "P=8000. ##kg\n",
+ "## calculations\n",
+ "e_c=(e*Es*As-P)/(Ec*Ac+Es*As)\n",
+ "e_s=e-e_c\n",
+ "s_c=Ec*e_c\n",
+ "s_s=Es*e_s\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s'%('\\n part (b) \\n The stress in steel and concrete are respectively ',s_s,''and '',s_c,'kg/cm^2')\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part (a) \n",
+ " The stress in steel and concrete are respectively 9056.60 94.34 kg/cm^2 \n",
+ "\n",
+ " part (b) \n",
+ " The stress in steel and concrete are respectively 9811.32 18.87 kg/cm^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##calculate temperature which sleeve must be heated if the room temperature is 10c\n",
+ "#and pressure and find axial force necessary to separate the two room temperature and the temperature at which sleeve will easily come off\n",
+ "## initialization\n",
+ "import math\n",
+ "d=10 ##cm\n",
+ "D=9.99 ##cm\n",
+ "t=3 ##mm\n",
+ "E=1.0*10**6 ##kg/cm^2\n",
+ "a=2.02*10**-5 ## degree/celcius\n",
+ "## part(a)\n",
+ "Tr=10. ##degree C\n",
+ "T=(d-D)/D*1/a\n",
+ "print'%s %.2f %s'%('part(a) \\n The sleeve must be heated to ',T+Tr,' degree C or more for this purpose')\n",
+ "\n",
+ "##part(b)\n",
+ "s_th=a*T*E\n",
+ "p=s_th*t*2./(d*10.)\n",
+ "print'%s %.2f %s'%('\\n part(b) \\n The pressure developed between the rod and sleeve is',p,' kg/cm^2')\n",
+ "\n",
+ "## part(c)\n",
+ "f=0.2\n",
+ "o=10. ## overlap: cm\n",
+ "A=math.pi*d*o\n",
+ "F=f*p*A\n",
+ "print'%s %.2f %s'%('\\n part (c) \\n The axial force required is ',F,' kg')\n",
+ "\n",
+ "##part (d)\n",
+ "## linked to part c\n",
+ "T2=20. ##degree C\n",
+ "a2=1.17*10**-5 ## /degree C\n",
+ "Ts=(a-a2)*(T2-Tr)*E\n",
+ "Ts=s_th-Ts\n",
+ "p2=p*Ts/s_th\n",
+ "F2=F*Ts/s_th\n",
+ "print'%s %.2f %s'%('\\n part(d)\\n The pressure developed between the rod and sleeve is',p2,' kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n The axial force required is ',F2,' kg')\n",
+ "##part(e)\n",
+ "T3=Tr+(s_th/((a-a2)*10**6))\n",
+ "print'%s %.2f %s'%('\\n part(e) \\n The temperature at which the sleeve comes off easily is ',T3,' C')\n",
+ "\n",
+ "print('calculations in the text: rounding off errors')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part(a) \n",
+ " The sleeve must be heated to 59.55 degree C or more for this purpose\n",
+ "\n",
+ " part(b) \n",
+ " The pressure developed between the rod and sleeve is 60.06 kg/cm^2\n",
+ "\n",
+ " part (c) \n",
+ " The axial force required is 3773.68 kg\n",
+ "\n",
+ " part(d)\n",
+ " The pressure developed between the rod and sleeve is 54.96 kg/cm^2\n",
+ "\n",
+ " The axial force required is 3453.24 kg\n",
+ "\n",
+ " part(e) \n",
+ " The temperature at which the sleeve comes off easily is 127.76 C\n",
+ "calculations in the text: rounding off errors\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#calculate the radius of curvature of this strip at temperautre of 93.3\n",
+ "T1=37.8 ## degre C\n",
+ "t=0.355 ##mm\n",
+ "T2=93.3 ## degree C\n",
+ "L=2 ##cm\n",
+ "m=1\n",
+ "n=1.53\n",
+ "a=1.86*10**-5\n",
+ "##calculations\n",
+ "R=2*t*(3*(1+m)**2.+(1+m*n)*(m**2+(m*n)**-1))\n",
+ "R=R/(6.*a*(T2-T1)*(1+m**2)) ## mm\n",
+ "R=R/10.\n",
+ "D=L**2./(8.*R)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The radius of curvature is ',R,' cm')\n",
+ "print'%s %.4f %s'%('\\n The deflection is',D ,' cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The radius of curvature is 92.76 cm\n",
+ "\n",
+ " The deflection is 0.0054 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the energy stored in bolt\n",
+ "L=5. ##cm\n",
+ "D=1.8 ##cm\n",
+ "l=2.5 ##cm\n",
+ "d=1.5 ##cm\n",
+ "F=1 ##tonne\n",
+ "E=2.1*10**6 ##kg/cm^2\n",
+ "## calculations\n",
+ "s1=F*1000.*4./(D**2*math.pi)\n",
+ "s2=F*1000.*4./(d**2*math.pi)\n",
+ "U1=1/2.*s1**2./E\n",
+ "U1=U1*L*D**2*math.pi/4.\n",
+ "U2=1/2.*s2**2./E\n",
+ "U2=U2*l*d**2*math.pi/4.\n",
+ "U=U1+U2\n",
+ "## results\n",
+ "print'%s %.1f %s'%('The energy stored in the bolt is ',U,' kg-cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy stored in the bolt is 0.8 kg-cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#calculate which of the two ways will give stronger joint\n",
+ "t=16. ##mm\n",
+ "Pt=1500. ##kg/cm^2\n",
+ "Ps=1025. ##kg/cm^2\n",
+ "Pb=2360. ##kg/cm^2\n",
+ "\n",
+ "##part (a)\n",
+ "p=6. ##cm\n",
+ "r=24. ##mm\n",
+ "d=r/10.+0.15\n",
+ "Ft=t*(p-d)*Pt/10.\n",
+ "Fs=math.pi*d**2*Ps/4.\n",
+ "Fb=d*t*Pb\n",
+ "x=min(Ft,Fs,Fb)\n",
+ "effA=x*100./(p*t/10.*Pt)\n",
+ "\n",
+ "##part (b)\n",
+ "p=9. ##cm\n",
+ "r=30. ##mm\n",
+ "d=r/10.+0.2\n",
+ "Ft=t*(p-d)*Pt/10.\n",
+ "Fs=math.pi*d**2*Ps/4.\n",
+ "Fb=d*t*Pb\n",
+ "x=min(Ft,Fs,Fb)\n",
+ "effB=x*100./(p*t/10.*Pt)\n",
+ "\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('The efficiencies corresponding to cases a and b are ',effA,'' and '',effB,'')\n",
+ "print('\\n Hence part b is better than part a')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiencies corresponding to cases a and b are 36.35 38.16 \n",
+ "\n",
+ " Hence part b is better than part a\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Solid_Mechanics_by_S._M._A._Kazimi/Chapter6.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter6.ipynb new file mode 100755 index 00000000..cb63940e --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter6.ipynb @@ -0,0 +1,813 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32b849ce2b6f77e54947c1d30daf4cb67054a775f92b165f8c389aea69b70715"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6-Torision;Including Non-Circular Sections"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization o variables\n",
+ "#find the shear force on each rivet and suitable diameter of rivets\n",
+ "p=5. ##cm\n",
+ "D=10. ##cm\n",
+ "d=2. ##mm\n",
+ "T= 10. ##kgm\n",
+ "ss= 785. ##kg/cm^2\n",
+ "## calculations\n",
+ "P= 2.*T/(math.pi*D**2)\n",
+ "P=P*5*100.\n",
+ "## results\n",
+ "print'%s %.2f %s'%('Force per rivet is ',P,' kg')\n",
+ "print'%s %.2f %s'%('\\n The diameter of rivet, using a permissible stress of',ss,' kg/cm^2 = 0.227 cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force per rivet is 31.83 kg\n",
+ "\n",
+ " The diameter of rivet, using a permissible stress of 785.00 kg/cm^2 = 0.227 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#what is maximum torque\n",
+ "D=5. ##cm\n",
+ "Y=3500. ##kg/cm^2\n",
+ "\n",
+ "##part (a)\n",
+ "Ta=350. ##kg-m\n",
+ "tau=Y/2.\n",
+ "Ip=Ta*D*100./(2.*tau)\n",
+ "d1=Ip*32./math.pi\n",
+ "d1=(D**4-d1)**(1/4.)\n",
+ "\n",
+ "##part (b)\n",
+ "Tb= 700. ##kg-m\n",
+ "Ip=Tb*D*100./(2.*tau)\n",
+ "d2=Ip*32./math.pi\n",
+ "d2=(D**4-d2)\n",
+ "T=tau*math.pi*(D**4)*2./(32.*D)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximum diameter corresponding to the case a is ',d1,' cm')\n",
+ "print'%s %.2f %s'%('\\n Since the daimeter for the case (b) is coming out to be negative, \\n The maximum torque transmitted is ',T/100,' kg-m')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum diameter corresponding to the case a is 3.28 cm\n",
+ "\n",
+ " Since the daimeter for the case (b) is coming out to be negative, \n",
+ " The maximum torque transmitted is 429.51 kg-m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the weight of students\n",
+ "A=3 ##cm^2\n",
+ "E= 2*10**6 ##kg/cm^2\n",
+ "nu= 0.25\n",
+ "l= 60. ##m\n",
+ "L=150. ##cm\n",
+ "d=0.5 ##cm\n",
+ "dd=10 ##cm\n",
+ "D=180 ##cm\n",
+ "##calculations\n",
+ "K=(l*100./(A*E))+(L*D/2.*D*32.*2.*(1.+nu)/(E*math.pi*dd**4*2))\n",
+ "P=d/K\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The weight of the students that entered the length is',P,' kg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The weight of the students that entered the length is 196.31 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the stress in the cable and the shaft\n",
+ "## linked to 6_5\n",
+ "A=3. ##cm^2\n",
+ "E= 2.*10**6 ##kg/cm^2\n",
+ "nu= 0.25\n",
+ "l= 60. ##m\n",
+ "L=150. ##cm\n",
+ "d=0.5 ##cm\n",
+ "dd=10 ##cm\n",
+ "D=180. ##cm\n",
+ "##calculations\n",
+ "K=(l*100./(A*E))+(L*D/2.*D*32.*2.*(1+nu)/(E*math.pi*dd**4*2.))\n",
+ "P=d/K\n",
+ "Ts=P/A\n",
+ "fs=dd*D*P*32./(math.pi*4.*dd**4)\n",
+ "\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The tensile stress is ',Ts,'kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n Maximum shear stress is ',fs,' kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The tensile stress is 65.44 kg/cm^2\n",
+ "\n",
+ " Maximum shear stress is 89.98 kg/cm^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the value of x and length of the suspension arm and D\n",
+ "F=500. ##kg\n",
+ "k=25. ##kg/cm\n",
+ "dd=15. ##cm\n",
+ "ss=3500. ##kg/cm^2\n",
+ "L=2. ##m\n",
+ "G=8.*10**5 ##kg/cm^2\n",
+ "## calculations\n",
+ "x=math.sqrt(math.pi*G/(25.*L*32.*100.))\n",
+ "d=x*16.*(F+dd*k)/(ss*math.pi)\n",
+ "x2=x*d**2.\n",
+ "## results\n",
+ "print'%s %.2f %s'%('d=',d,' cm')\n",
+ "print'%s %.2f %s'%('\\n x=',x,' cm')\n",
+ "\n",
+ "## Text: not exact\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "d= 5.05 cm\n",
+ "\n",
+ " x= 3.96 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the horse power\n",
+ "d=5. ##cm\n",
+ "rpm1=300. ##rpm\n",
+ "rpm2=30000. ##rpm\n",
+ "s=1000. ##kg/cm^2\n",
+ "##calcuations\n",
+ "T=(d/2.)*math.pi*10**2*s/32.\n",
+ "hp1= 2*math.pi*rpm1*T/4500.\n",
+ "hp2=hp1*100.\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s'%('Horse power at 300 rpm and 30000 rpm are respecively ',hp1/10,''and '',hp2/10,' h.p.')\n",
+ "\n",
+ "print('wrong/approximate answers in the text')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Horse power at 300 rpm and 30000 rpm are respecively 1028.08 102808.38 h.p.\n",
+ "wrong/approximate answers in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#selct solid transmits and diameter required find\n",
+ "hp=300. ##h.p.\n",
+ "N1=30. ##rpm\n",
+ "N2=30000. ##rpm\n",
+ "fs=600. ##kg/cm^2\n",
+ "## calculations\n",
+ "T1=4500.*hp*100./(2.*math.pi*N1)\n",
+ "T2=T1/1000.\n",
+ "D1=16.*T1/(math.pi*fs)\n",
+ "D1=D1**(1/3.)\n",
+ "D2=16.*T2/(math.pi*fs)\n",
+ "D2=D2**(1/3.)\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('Diameters required are ',D1,''and '',D2,'cm')\n",
+ "\n",
+ "print('wrong calculations in the text')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameters required are 18.25 1.83 cm \n",
+ "wrong calculations in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the strain energy per unit volume stored and the energy if the lenght 5cm \n",
+ "d=10. ##cm\n",
+ "t =1. ##mm\n",
+ "T= 100. ##kg-m\n",
+ "L=5. ##m\n",
+ "G=8*10**5 ##kg/cm^2\n",
+ "\n",
+ "##calculations\n",
+ "r=d/2.\n",
+ "fs=T*r*100./(r**2*2*math.pi*L*t*10**-1)\n",
+ "U=fs**2/(2*G)\n",
+ "U1=U*(math.pi*L*100.)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('Energy per unit volume = ',U,' kg-cm/cm^3')\n",
+ "print'%s %.2f %s'%('\\n Total strain energy= ',U1,' kg-cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy per unit volume = 0.25 kg-cm/cm^3\n",
+ "\n",
+ " Total strain energy= 397.89 kg-cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the actual deflection of closely coiled comperssion spring\n",
+ "D=10. ##cm\n",
+ "d= 1. ##cm\n",
+ "n=20.\n",
+ "P=60. ##kg\n",
+ "G=8*10**5 ##kg/cm^2\n",
+ "##calculations\n",
+ "n=n-0.75*2\n",
+ "delta=P*n*math.pi*D**3*32./(4.*math.pi*G)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The deflection is ',delta,' cm')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The deflection is 11.10 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the shear stress in the wire\n",
+ "## linked to 6_14\n",
+ "D=10. ##cm\n",
+ "d= 1. ##cm\n",
+ "n=20.\n",
+ "P=60. ##kg\n",
+ "G=8*10**5 ##kg/cm^2\n",
+ "## calculations\n",
+ "m=D/d\n",
+ "fs=8.*P*D/(d**3*math.pi)\n",
+ "fs1=fs*(1+0.615/m+3./(4.*m-4.))\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('The shear stress with and without correction facor are \\n respectively ',fs,''and '',fs1,'kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The shear stress with and without correction facor are \n",
+ " respectively 1527.89 1749.18 kg/cm^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find their angles of twist and maximum stresses\n",
+ "\n",
+ "## circle\n",
+ "D=1. ##unit diameter\n",
+ "Ip=D**4/32.\n",
+ "Zp=D**3/16.\n",
+ "\n",
+ "##Square\n",
+ "s=math.sqrt(math.pi/4.)*D\n",
+ "Is=0.886*D**4/32.\n",
+ "Zs=0.7383*D**3/16.\n",
+ "\n",
+ "##Rectangle\n",
+ "a=math.sqrt(math.pi/2.)*D\n",
+ "b=math.sqrt(math.pi/8.)*D\n",
+ "Ir=0.719*D**4/32.\n",
+ "Zr=0.616*D**3/16.\n",
+ "\n",
+ "## Trianle\n",
+ "t=math.sqrt(math.pi/math.sqrt(3))*D\n",
+ "It=0.725*D**4/32.\n",
+ "Zt=0.622*D**3/16.\n",
+ "\n",
+ "##Ellipse\n",
+ "A=D/math.sqrt(2)\n",
+ "B=D/math.sqrt(8)\n",
+ "Ie=A**3*B**3/(A**2+B**2)\n",
+ "Ze=A*B**2/2.\n",
+ "\n",
+ "##Normalization\n",
+ "Is=Is/Ip\n",
+ "Ie=Ie/Ip\n",
+ "It=It/Ip\n",
+ "Ir=Ir/Ip\n",
+ "\n",
+ "Zs=Zs/Zp\n",
+ "Ze=Ze/Zp\n",
+ "Zt=Zt/Zp\n",
+ "Zr=Zr/Zp\n",
+ "Ip=1.\n",
+ "Zp=1.\n",
+ "##results\n",
+ "print'%s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s '%('Z:: Circle:Square:Ellipse:Triangle:Rectangle = ',Zp,'' and '',Zs,'' and '',Ze,'' and '',Zt,' 'and '',Zr,'')\n",
+ "\n",
+ "print'%s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s '%('\\n I:: Circle:Square:Ellipse:Triangle:Rectangle = ',Ip,'' and '',Is,'' and '',Ie,'' and '',It,'' and '',Ir,'')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Z:: Circle:Square:Ellipse:Triangle:Rectangle = 1.00 0.74 0.71 0.62 0.62 \n",
+ "\n",
+ " I:: Circle:Square:Ellipse:Triangle:Rectangle = 1.00 0.89 0.80 0.72 0.72 \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the maximum torque that can be transmitted without yeilding\n",
+ "\n",
+ "yp=2450. ##kg/cm^2\n",
+ "d=0.4 ##cm\n",
+ "ys=4200. ##kg/cm^2\n",
+ "sa=1.6 ##mm\n",
+ "sb=7. ##mm\n",
+ "## calculations\n",
+ "sa=sa/10.\n",
+ "sb=sb/10.\n",
+ "T1=yp*math.pi*d**3/16.\n",
+ "T2=ys*0.303*sa**2*sb\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximum torque that can be transitted by the screw-driver is ',T2,' kg-cm')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum torque that can be transitted by the screw-driver is 22.80 kg-cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex18-pg216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the maximum stress in the walls \n",
+ "b=5. ##cm\n",
+ "h=10. ##cm\n",
+ "tL=3. ##mm\n",
+ "tl=1.5 ##mm\n",
+ "T=100. ##kg-cm\n",
+ "## calculations\n",
+ "tl=tl/10.\n",
+ "fs=T*100./(2.*b*h*tl)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximum stress is ',fs,' kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum stress is 666.67 kg/cm^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#compare its strength with hollow circular shaft of same thickness\n",
+ "b=5. ##cm\n",
+ "h=10. ##cm\n",
+ "tL=3. ##mm\n",
+ "tl=1.5 ##mm\n",
+ "T=100. ##kg-cm\n",
+ "## calculations\n",
+ "D=2.*(b+h)/math.pi\n",
+ "AR=b*h\n",
+ "AC=math.pi*D**2/4.\n",
+ "r=AC/AR\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The ratio is 1:',r,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio is 1: 1.43 \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the value of maximum shear stress and angle of twist\n",
+ "G=8*10**5 ##kg/cm^2\n",
+ "##part (a)\n",
+ "T =20. ##kg-m\n",
+ "t1=0.9 ##cm\n",
+ "t2=0.5 ##cm\n",
+ "b1=6.8 ##cm\n",
+ "b2=14.2 ##cm\n",
+ "I0=1/3.*(2.*b1*t1**3+b2*t2**3)\n",
+ "Zt=I0/max(t1,t2)\n",
+ "fs=T*100./Zt\n",
+ "Phi=T*100./(G*I0)\n",
+ "print('part (a)')\n",
+ "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and'',Phi, ' radians/cm ')\n",
+ "\n",
+ "##part (b)\n",
+ "t1=1. ##cm\n",
+ "t2=1. ##cm\n",
+ "b1=10. ##cm\n",
+ "b2=9. ##cm\n",
+ "I0=1/3.*(b1*t1**3+b2*t2**3)\n",
+ "Zt=I0/max(t1,t2)\n",
+ "fs=T*100./Zt\n",
+ "Phi=T*100/(G*I0)\n",
+ "print('\\n part (b)')\n",
+ "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,'kg/cm^2'and '',Phi,'radians/cm ')\n",
+ "\n",
+ "##part (c)\n",
+ "t1=0.76 ##cm \n",
+ "t2=0.48 ##cm\n",
+ "b1=8. ##cm\n",
+ "b2=14.04 ##cm\n",
+ "I0=(1/3.)*(2*b1*t1**3+b2*t2**3)\n",
+ "Zt=I0/max(t1,t2)\n",
+ "fs=T*100./Zt\n",
+ "Phi=T*100./(G*I0)\n",
+ "print('\\n part (c)')\n",
+ "print'%s %.2f %s %.5f %s ' %('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and '',Phi,'radians/cm ')\n",
+ "\n",
+ "##part(d)\n",
+ "t=1 ##cm \n",
+ "b=19 ##cm\n",
+ "I0=1/3.*t**3*b\n",
+ "Zt=I0/t\n",
+ "fs=T*100./Zt\n",
+ "Phi=T*100./(G*I0)\n",
+ "print('\\n part (d)')\n",
+ "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and '',Phi,'radians/cm ')\n",
+ "\n",
+ "print('Twist rate: answers differ by a scale of 10. wrong answers in the text')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part (a)\n",
+ "\n",
+ " The maximum shear stress and twist rate are respectively \n",
+ " 461.96 0.00064 radians/cm \n",
+ "\n",
+ " part (b)\n",
+ "\n",
+ " The maximum shear stress and twist rate are respectively \n",
+ " 315.79 0.00039 radians/cm \n",
+ "\n",
+ " part (c)\n",
+ "\n",
+ " The maximum shear stress and twist rate are respectively \n",
+ " 531.70 0.00087 radians/cm \n",
+ "\n",
+ " part (d)\n",
+ "\n",
+ " The maximum shear stress and twist rate are respectively \n",
+ " 315.79 0.00039 radians/cm \n",
+ "Twist rate: answers differ by a scale of 10. wrong answers in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex21-pg221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#caclualte Maximum +ve residual stress occurs at r and'radius\n",
+ "D=5. ##cm\n",
+ "d=2. ##cm\n",
+ "t_y=3000. ##kg/cm^2\n",
+ "## calculations\n",
+ "R=D/2. \n",
+ "r=d/2. \n",
+ "Tep=2.*math.pi*R**3*t_y/3.-math.pi*r**3.*t_y/6.\n",
+ "t_er=2*Tep/(math.pi*R**3)\n",
+ "t_er1=t_er*r/R\n",
+ "prs=t_y-t_er1\n",
+ "nrs=t_er-t_y\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('Maximum +ve residual stress occurs at ',r,' cm' and'radius and is equal to \\n ',prs,' kg/cm^2')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n Maximum -ve residual stress occurs at ',R,' cm'and' radius and is equal to \\n ',-nrs,' kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum +ve residual stress occurs at 1.00 radius and is equal to \n",
+ " 1425.60 kg/cm^2 \n",
+ "\n",
+ " Maximum -ve residual stress occurs at 2.50 radius and is equal to \n",
+ " -936.00 kg/cm^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Solid_Mechanics_by_S._M._A._Kazimi/Chapter7.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter7.ipynb new file mode 100755 index 00000000..b24f124a --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter7.ipynb @@ -0,0 +1,798 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:49fb320e4e9f8bda8c482a6df5a6d862902fe6b1b70d63f85fdebe1d70bf5a2c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7-Beams and Bendings"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "#calculate sf and Bm\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "%matplotlib inline\n",
+ "#initialization of variables\n",
+ "s=3. #m\n",
+ "n=60.\n",
+ "p=50. #kg\n",
+ "## calculations\n",
+ "W=n*p\n",
+ "Rc=W*2./s\n",
+ "Rb=W-Rc\n",
+ "dx = 0.001;\n",
+ "x = numpy.linspace(0,s,3001)\n",
+ "n = round(s/dx +1);\n",
+ "n=int(n)\n",
+ "Sx=numpy.zeros(n)\n",
+ "Mx=numpy.zeros(n)\n",
+ "i=0;\n",
+ "for i in range (0,n):\n",
+ " Sx[i] = -Rb + Rc*x[i]**2./6.;\n",
+ " Mx[i] = Rb*x[i] - Rc*x[i]**3 /18.;\n",
+ "\n",
+ "##Results\n",
+ "pyplot.plot(x,Sx);pyplot.title(\"Shear force diagram\");pyplot.xlabel(\"X (in m)\");pyplot.ylabel(\"Shear force (in kg)\");\n",
+ "pyplot.show()\n",
+ "pyplot.plot(x,Mx);pyplot.title(\"Bending Moment diagram\");pyplot.xlabel(\"X (in m)\");pyplot.ylabel(\"Bending Moment (in kg-m)\");\n",
+ "pyplot.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+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5h+SPlu4ueDfpiWN5koe0WS9\n6edG/YG/Fxe+WXl5yH2zMpN0ErBpRDTbGqyE17kZ+N+IaDrJk1mnc8nFrPxuAQ5qnKWwHCRtAvRw\nYrFK4ZKLmZmVnEsuZmZWck4uZmZWck4uZmZWck4uZmZWck4uZmZWck4uZmZWcv8/Kswf/PLRgsIA\nAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x1d2b1f0>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEZCAYAAABvpam5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xnc1PP+//HHU2kl2U4lS6KQNUtycFzH7lhCdsfu8LVm\nOyrn/JTt2Dq2Y8+WFHLCsSRluRIhKZQkoVQURQrt1+v3x/tzaVyuZea65jOfmble99ttbtfMZz7z\n+bw+MzWvee8yM5xzzrlMrJZ0AM455wqPJw/nnHMZ8+ThnHMuY548nHPOZcyTh3POuYx58nDOOZcx\nTx4ub0k6VdLolMeLJLVLLqLC5e+lyzZPHi4jkqZL+iX68vle0guSNszFuc1sTTObnu3jSuorqUzS\nhRW294i298n2OetCUomkmXU5Rlzvpas/PHm4TBlwiJmtCbQB5gL/STakOjNgKnByhe2nAJ9Gz7s0\nSGqQdAwuNzx5uFozs6XAUKBT+TZJjSX1kzRD0hxJ90hqEj1XImmWpEskzZX0taRTU167rqTnJP0o\n6V1gs9TzRaWA9tH9RyTdFZV8Fkp6p/y56Pn9JX0qaUG03yhJZ1RzOe8BzSR1il6/NdAYGAco5bh/\nk/SZpPmS/iepTYX4zomeXyjpakmbSXo7iuMJSaun7H+IpA8k/SDpLUnbpjw3XdKlkj5MeW1jSc2B\nl4ANotLfQkmtK15Mhu/lwZImRPt+VbGkJenk6POcJ+mfUWx7R8/1lfRfSQMl/QicImmX6Jp/iD7j\n/1S47ozeJ5efPHm42hCApGb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PrLOkW4BFgN6ApMAm4L9pvLHBJHS/L\nuazwkodz1TsI+BrYtorn1wMWVfP6V6PZWJcCkwkrRVamfBLMicDbZvazmc0DlkpqET33TTWvdy6n\nPHk4VwVJOwD7EkoBF0tqXdWu1Rxmacr9lYRJL6vbr4xQSiHlcXkNgSiw9TFc8fLk4Vwloqm37yEs\nCjQTuJnK2zzmEda8TvvQdXi+DTAjg3M5FxtPHs5V7m/AdDN7NXp8N7CVpD1Td4raQSZJ2iJ1c8rf\niiWFykoOVuF+xcflugBvpBe+c/HyKdmdqyNJpwKtzKzS3lRZPM8goJ+ZVVzIx7mc85KHc3U3GDi4\nfJW5OEj6A9DSE4fLF17ycM45lzEveTjnnMuYJw/nnHMZ8+ThnHMuY548nHPOZcyTh3POuYx58nDO\nOZex/w8lkRYwINnARQAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5910590>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#centriod of the section and momets of inertia and product of inertia about xx and yy axes and direction of principal axes and value of maximum and minimum\n",
+ "b=10075 ##mm\n",
+ "h=10 ##mm\n",
+ "p1=7.5\n",
+ "p2=9\n",
+ "##part (a)\n",
+ "ybar=1*p1*0.5+1*p2*5.5\n",
+ "ybar=ybar/16.5\n",
+ "xbar=1*p1*0.5+1*p1*4.75\n",
+ "xbar=xbar/16.5\n",
+ "print('part (a)')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n Centroid coordinates (x,y) = ',xbar,''and '',ybar,'cm')\n",
+ "\n",
+ "##part (b)\n",
+ "Ixx=p1*1**3/12.+p1*1*(3.23-0.5)**2+1*p2**3/12.+p2*1*(5.5-3.23)**2\n",
+ "Iyy=1*p1**3/12.+p1*1*(3.75-2.43)**2+p2*1**3/12.+p2*1*(2.43-0.5)**2\n",
+ "Ixy=p1*1.32*2.73+9*(-1.93)*(-2.27)\n",
+ "print('\\n part (b)')\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%('\\n Moment of Areas: \\n Ixx = ',Ixx,' cm^4 \\n Iyy = ',Iyy,' cm^4' and'Ixy=',Ixy,'cm^4')\n",
+ "\n",
+ "##part (c)\n",
+ "alpha=0.5*math.atan(2*Ixy/(Iyy-Ixx))\n",
+ "alpha=alpha*180/math.pi\n",
+ "print('\\n part (c)')\n",
+ "print('\\n Direction of principal axes:')\n",
+ "print'%s %.2f %s'%('\\n alpha = ',alpha,' degrees')\n",
+ "\n",
+ "##part (d)\n",
+ "Iuu=(Ixx+Iyy)/2+math.sqrt((Iyy-Ixx)**2/4.+Ixy**2)\n",
+ "Ivv=(Ixx+Iyy)/2-math.sqrt((Iyy-Ixx)**2/4.+Ixy**2)\n",
+ "print('\\n part (d)')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n Iuu = ',Iuu,' cm^4 \\n Ivv = ',Ivv,' cm^4')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part (a)\n",
+ "\n",
+ " Centroid coordinates (x,y) = 2.39 3.23 cm \n",
+ "\n",
+ " part (b)\n",
+ "\n",
+ " Moment of Areas: \n",
+ " Ixx = 163.65 cm^4 \n",
+ " Iyy = 82.50 Ixy= 66.46 cm^4 \n",
+ "\n",
+ " part (c)\n",
+ "\n",
+ " Direction of principal axes:\n",
+ "\n",
+ " alpha = -29.30 degrees\n",
+ "\n",
+ " part (d)\n",
+ "\n",
+ " Iuu = 200.94 cm^4 \n",
+ " Ivv = 45.21 cm^4 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#determine bending stress and find the minimum radius \n",
+ "Ys=17000. ##kg/cm^2\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "d1=1. ##mm\n",
+ "d=1. ##cm\n",
+ "##calculations: 1 cm\n",
+ "R=E*d/(2*Ys)\n",
+ "M=Ys*math.pi*d**3/32.\n",
+ "## results\n",
+ "print'%s %.2f %s'%(' daimeter wire:',d,'cm')\n",
+ "print'%s %.2f %s'%('\\n Minimum radius = ',R,' cm')\n",
+ "print'%s %.2f %s'%('\\n Bending Moment = ',M,' kg-cm')\n",
+ "## calculations: 1 mm\n",
+ "R1=R/(d1*10.)\n",
+ "M1=M/(d1*1000.)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('\\n daimeter wire:',d1,'mm')\n",
+ "print'%s %.2f %s'%('\\n Minimum radius = ',R1,' cm')\n",
+ "print'%s %.2f %s'%('\\n Bending Moment = ',M1,' kg-cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " daimeter wire: 1.00 cm\n",
+ "\n",
+ " Minimum radius = 58.82 cm\n",
+ "\n",
+ " Bending Moment = 1668.97 kg-cm\n",
+ "\n",
+ " daimeter wire: 1.00 mm\n",
+ "\n",
+ " Minimum radius = 5.88 cm\n",
+ "\n",
+ " Bending Moment = 1.67 kg-cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the section modulus per meter width of plate \n",
+ "##initialization of variables\n",
+ "import math\n",
+ "t=0.5 ##cm\n",
+ "s=2. ##m\n",
+ "p1=7.5 ##cm\n",
+ "p2=10. ##cm\n",
+ "d=p2/2.\n",
+ "D=1650. ##kg/cm**2\n",
+ "## calculations\n",
+ "## ab\n",
+ "IxX=p1*t**3./12.+t*p1*d**2.\n",
+ "## bc\n",
+ "alpha=math.atan(3/4.)*57.3\n",
+ "Ixx=t*(p1+d)**3./12.\n",
+ "Iyy=0.\n",
+ "Ixy=0.\n",
+ "Iuu=Ixx*math.cos(alpha)**2+Iyy*math.sin(alpha)**2-Ixy*math.sin(2.*alpha)\n",
+ "Ixx=Iuu+IxX\n",
+ "IXX=Ixx*100./(2.*p1)\n",
+ "Z=IXX/(d+t/2.)\n",
+ "w=D*Z*8./(s**2*100.)\n",
+ "w=w/1000.\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('w = ',w,' tonne/m')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w = 5.50 tonne/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the total u.d load that can be supported \n",
+ "##initialization of variables\n",
+ "import math\n",
+ "wb=10. ##cm\n",
+ "wh=20. ##cm\n",
+ "sb=0.5 ##cm\n",
+ "sh=10. ##cm\n",
+ "s=6. ##m\n",
+ "fs=1650. ##kg/cm^2\n",
+ "fw=150. ##kg/cm^2\n",
+ "Es=2*10**6 ##kg/cm^2\n",
+ "Ew=12*10**4 ##kg/cm^2\n",
+ "\n",
+ "##calculations\n",
+ "## Method 1\n",
+ "A=2*fs/(21.*Es)\n",
+ "aw=2.*fw/(20.*Ew)\n",
+ "a=min(A,aw)\n",
+ "ss=a*Ew*wh/2.\n",
+ "##Moment resistance of steel portion\n",
+ "F=(fs+1573.)/2.*sb*sh\n",
+ "k=sb/3*(fs+2*1573.)/(fs+1573.)\n",
+ "Ms=2*F*(10.5-k)\n",
+ "##Moment resistance of wooden portion\n",
+ "F=ss*wb*wb/2.\n",
+ "Mw=2*(F*(wb-wb/3.))\n",
+ "M=Ms+Mw\n",
+ "##Total udl supported\n",
+ "W=M*8./(s*100.)\n",
+ "\n",
+ "##Results\n",
+ "print('Using method 1')\n",
+ "print'%s %.2f %s'%('\\n W = ',W,' kg')\n",
+ "\n",
+ "##Method 2\n",
+ "nE=Es/Ew\n",
+ "nf=fs/fw\n",
+ "Is=2*(0+sb*sh*10.25**2)\n",
+ "Iw=0.6*wh**3/12.\n",
+ "I=Is+Iw\n",
+ "W=fs*I*8./(s*100*10.5)\n",
+ "\n",
+ "##Results\n",
+ "print('\\n Using method 2')\n",
+ "print'%s %.2f %s'%('\\n W = ',W,' kg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Using method 1\n",
+ "\n",
+ " W = 3040.91 kg\n",
+ "\n",
+ " Using method 2\n",
+ "\n",
+ " W = 3039.40 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate stiffness ratio \n",
+ "##initialization of variables\n",
+ "import math\n",
+ "p=6. ##mm\n",
+ "Ixx=2375. ##cm**4\n",
+ "Es=2*10**6. ##kg/cm**2\n",
+ "EAl=0.667*10**6 ##kg/cm**2\n",
+ "d1=10.6 ##cm\n",
+ "d2=10. ##cm\n",
+ "## calculations\n",
+ "I1=2.*(0.+p/10*10*10.3**2)\n",
+ "I2=Ixx*EAl/Es\n",
+ "I=I1+I2\n",
+ "n=I/I2\n",
+ "## results\n",
+ "print'%s %.2f %s'%('stiffness ratio = ',n,'')\n",
+ "n1=Es*d1/(d2*EAl)\n",
+ "print'%s %.2f %s'%('\\n Stress ration = ',n1,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "stiffness ratio = 2.61 \n",
+ "\n",
+ " Stress ration = 3.18 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate shape factor \n",
+ "##initilization of new variables\n",
+ "import math\n",
+ "wt=0.8 ##cm\n",
+ "ft=1.4 ##cm\n",
+ "w=10. ##cm\n",
+ "y=20. ##cm\n",
+ "## Sigma_y: yield stress is not given explicitly\n",
+ "k1=wt*(40.-2*ft)/2.\n",
+ "Zp=(14*19.3+k1*9.3)*2\n",
+ "If=2*(w*ft**3/12+w*ft*19.3**2)\n",
+ "Iw=wt*(40-2*ft)**3/12.\n",
+ "I=Iw+If\n",
+ "Z=I/y\n",
+ "sf=Zp/Z\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('shape factor = ',sf,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "shape factor = 1.18 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate elastic core \n",
+ "##initilization of new variables\n",
+ "import math\n",
+ "wt=0.8 ##cm\n",
+ "ft=1.4 ##cm\n",
+ "w=10. ##cm\n",
+ "y=20. ##cm\n",
+ "T=750. ##T==750*sigma_y\n",
+ "## calculations\n",
+ "MpF=ft*w*(40-2*ft)\n",
+ "c1=((40.-2*ft)/2)**2-(T-MpF)/wt\n",
+ "c=math.sqrt(3*c1)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('Elastic core of ',2*c,' cm depth is present')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Elastic core of 26.71 cm depth is present\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg274"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find stress at the inner side of the hook \n",
+ "##initialization of new variables\n",
+ "P=2000. ##kg\n",
+ "a=4. ##cm\n",
+ "b=1. ##cm\n",
+ "d=7. ##cm\n",
+ "r=3. ##cm\n",
+ "## calculations\n",
+ "A=(a+b)/2*d\n",
+ "xbar=(a+b*2.)*d/(r*(a+b))\n",
+ "rbar=r+xbar\n",
+ "I=b*d**3/12.+r*d**3/12.\n",
+ "Ixx=I-A*2.8**2\n",
+ "e=Ixx/(rbar*A)\n",
+ "f1=P*5.8*(xbar-0.62)/(A*0.62*r)\n",
+ "f2=P*5.8*(-d+2.18)/(A*0.62*(5.18+d-2.18))\n",
+ "str=P/A\n",
+ "Str_i=f1+str\n",
+ "Str_o=-f2-str\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('stress at the inner side of the hook =',Str_i,' kg/cm^2 (tensile)')\n",
+ "print'%s %.2f %s'%('\\n stress at the outer side of the hook = ',Str_o,' kg/cm^2 (compressive)')\n",
+ "## approximations involved in the text\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "stress at the inner side of the hook = 891.18 kg/cm^2 (tensile)\n",
+ "\n",
+ " stress at the outer side of the hook = 401.03 kg/cm^2 (compressive)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Ratio of maximum bending stress in the stem and flange at various point\n",
+ "##initialization of new variables\n",
+ "import math\n",
+ "t=1. ##cm\n",
+ "a=40. ##cm\n",
+ "A=236.\n",
+ "## calculations\n",
+ "ybar=a*t*0.5+(50-1)*4*0.5/(a*t+(50-1)*4)\n",
+ "y1bar=1.25*a-ybar\n",
+ "IAA=a*t**3/3.+(50-1)**3*4/12.+(50-1)*4*25.5**2\n",
+ "Io=IAA-A*ybar**2.\n",
+ "##part (1)\n",
+ "r=y1bar/ybar\n",
+ "## results\n",
+ "print('Ratio of maximum bending stress in the stem and flange')\n",
+ "print'%s %.2f %s'%('\\n Ratio = ',r,'')\n",
+ "##part(2)\n",
+ "## calculations\n",
+ "r=(2/3.*388*29.56)-(2/3.*160*20.44)-(228*20.44)\n",
+ "r=r/(2*2/3.*388*29.56)\n",
+ "## results\n",
+ "print('\\n Ratio of S.F in flange to total S.F')\n",
+ "print'%s %.2f %s'%('\\n Ratio = ',r*100,' percent')\n",
+ "## part (3)\n",
+ "## calculations\n",
+ "r=359.*200./Io\n",
+ "## results\n",
+ "print('\\n Ratio of maximum shear stress in the flange to average sher stress in the stem')\n",
+ "print'%s %.2f %s'%('\\n Ratio = ',r,'')\n",
+ "##part (4)\n",
+ "## calculations\n",
+ "s=10 ##m\n",
+ "r=r/0.922\n",
+ "sigma=1650 ##kg/cm**2\n",
+ "shear=945 ##kg/cm**2\n",
+ "wsh=2*200*shear/(r*s)\n",
+ "wsi=8*Io*sigma/(s**2*10*29.56)\n",
+ "w=min(wsh,wsi)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('\\n Maximum u.d.l. = ',w,' kg/m ')\n",
+ "\n",
+ "print('wrong moment of Inertia (Io) in the text and hence part (3) and part (4) are wrong')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of maximum bending stress in the stem and flange\n",
+ "\n",
+ " Ratio = 1.45 \n",
+ "\n",
+ " Ratio of S.F in flange to total S.F\n",
+ "\n",
+ " Ratio = 5.27 percent\n",
+ "\n",
+ " Ratio of maximum shear stress in the flange to average sher stress in the stem\n",
+ "\n",
+ " Ratio = 1.05 \n",
+ "\n",
+ " Maximum u.d.l. = 30507.35 kg/m \n",
+ "wrong moment of Inertia (Io) in the text and hence part (3) and part (4) are wrong\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex21-pg284"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the design force two cases\n",
+ "##initialization of new variables\n",
+ "import math\n",
+ "a=30. ##cm\n",
+ "t=2.5 ##cm\n",
+ "S=15. ##cm\n",
+ "s=5. ##Tonne\n",
+ "## calculations\n",
+ "I=a*a**3-25*25**3\n",
+ "I=I/12.\n",
+ "tau_zx=s*1000.*27.5*t*25/(4*35000.*t)\n",
+ "FA=S*t*tau_zx\n",
+ "tau_xy=s*1000.*a*t*27.5/(4.*35000.*t)\n",
+ "FB=tau_xy*t*S\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('case A \\n F = ',FA,' kg')\n",
+ "print'%s %.2f %s'%('\\n case B \\n F= ',FB,' kg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "case A \n",
+ " F = 920.76 kg\n",
+ "\n",
+ " case B \n",
+ " F= 1104.91 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex23-pg288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate shear centre\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "h=40. ##cm\n",
+ "b=10. ##cm\n",
+ "t1=1.4 ##cm\n",
+ "t2=0.8 ##cm\n",
+ "Ixx=13989.5 ##cm^4\n",
+ "##calculations\n",
+ "e=b**2*h**2*t1/(4.*Ixx)*(1-t1/h-t1/b+t1**2/(b*h))*(1-t1/h)\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('Shear center: \\n e = ',e,' cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shear center: \n",
+ " e = 3.21 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex33-pg303"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate deflection\n",
+ "##initialization of new variables\n",
+ "import math\n",
+ "L=50. ##cm\n",
+ "k=15. ##cm\n",
+ "I=200. ##cm^4\n",
+ "II=40. ##cm^4\n",
+ "d=30. ##cm\n",
+ "Pd=40. ##cm\n",
+ "E=0.6667*10**6 ##kg/cm^2\n",
+ "##calculations\n",
+ "delta=(100.*10./2*16.33+L*d*35+L*k/2.*25+d*k/2.*45)\n",
+ "delta1=delta/E\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('deflection = ',delta1*10**1,'mm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "deflection = 1.20 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex39-pg312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#design suitable I design section\n",
+ "W=1\n",
+ "L=6\n",
+ "f=1650\n",
+ "Z=305.9\n",
+ "w=31.2\n",
+ "z=8\n",
+ "t=0.65\n",
+ "d=22.5\n",
+ "M=4.5*10**5\n",
+ "##part(i)\n",
+ "#maximum B.M\n",
+ "BM= W*L**2/(z)\n",
+ "SF=W*L/2\n",
+ "print'%s %.2f %s %.2f %s '%('Bm=',Bm,''and '',SF,'')\n",
+ "#part(ii)\n",
+ "Z=M/f\n",
+ "#part(iii)\n",
+ "#for ISMB 225 having weight 31.2\n",
+ "Z1=305.9\n",
+ "print'%s %.2f %s'%('z=',Z1,'')\n",
+ "#Additional Beam\n",
+ "Bm=w*12/z\n",
+ "Z2=Bm/f\n",
+ "TZ=Z+Z2\n",
+ "print'%s %.2f %s'%('TZ=',TZ,'')\n",
+ "#thickness\n",
+ "WA=t*d\n",
+ "print'%s %.2f %s'%('WA=',WA,'')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bm= 4.00 3.00 \n",
+ "z= 305.90 \n",
+ "TZ= 272.76 \n",
+ "WA= 14.62 \n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Solid_Mechanics_by_S._M._A._Kazimi/Chapter8.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter8.ipynb new file mode 100755 index 00000000..30240f7a --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter8.ipynb @@ -0,0 +1,343 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d68e0c119bd3bfe882788d74028fcc8cbbdbb80bd702bb1bf7bdb0ffe972f8d9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter8-Stability of Equlibrium-Columns"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate maximum axial load and for both ends and and fixed and one fix and one pinned\n",
+ "## initialization of variables\n",
+ "import math\n",
+ "L=5. ##m\n",
+ "D=20. ##cm\n",
+ "t=1. ##cm\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "I=2502. ##cm^4\n",
+ "L=5*100. ##cm\n",
+ "## calculations\n",
+ "P=E*I/(4.*L**2)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximal axial load taken is ',P/100,' Tonne')\n",
+ "print'%s %.2f %s'%('\\n for both ends pinned, P=',P*4/100,' Tonne',)\n",
+ "print'%s %.2f %s'%('\\n for both ends fixed, P=',P*16/100,' Tonne')\n",
+ "print'%s %.2f %s'%('\\n for one end fixed, one pinned, P=',P*4*2.13/100,' Tonne')\n",
+ "\n",
+ "## Evaluation of critical load (P) in the text is wrong\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximal axial load taken is 50.04 Tonne\n",
+ "\n",
+ " for both ends pinned, P= 200.16 Tonne\n",
+ "\n",
+ " for both ends fixed, P= 800.64 Tonne\n",
+ "\n",
+ " for one end fixed, one pinned, P= 426.34 Tonne\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate actual critical length ratio and critical length ratio \n",
+ "##initialization of variables\n",
+ "import math\n",
+ "E=2*10**6. ##kg/cm**2\n",
+ "sigma_y=2600. ##kg/cm**2\n",
+ "I=2502. ##cm**4\n",
+ "L=500. ##cm\n",
+ "A=59.7 ##cm**2\n",
+ "L_tcr=L/math.sqrt(I/A)\n",
+ "\n",
+ "print'%s %.2f %s'%('The actual critical length ratio is',L_tcr,'')\n",
+ "##case (b)\n",
+ "L_cr=math.sqrt(E*math.pi**2/sigma_y)\n",
+ "print('\\n case (b)')\n",
+ "print'%s %.2f %s'%('\\n The critical length ratio is ',L_cr,'')\n",
+ "\n",
+ "##case (a)\n",
+ "L_cr=math.sqrt(E*math.pi**2/(4.*sigma_y))\n",
+ "print('\\n case (a)')\n",
+ "print'%s %.2f %s'%('\\n The critical length ratio is ',L_cr,'')\n",
+ "\n",
+ "##case (c)\n",
+ "L_cr=math.sqrt(4.*E*math.pi**2./sigma_y)\n",
+ "print('\\n case (c)')\n",
+ "print'%s %.2f %s'%('\\n The critical length ratio is',L_cr,'')\n",
+ "\n",
+ "## case (d)\n",
+ "L_cr=math.sqrt(2.05*E*math.pi**2/sigma_y)\n",
+ "## Results\n",
+ "print('\\n case (d)')\n",
+ "print'%s %.2f %s'%('\\n The critical length ratio is ',L_cr,'')\n",
+ "print('\\n Only in case (a) actual ratio is more than critical ratio and material \\n remains elastic For cases (b), (c) and (d) critical length ratio is \\n much higher and hence the material yelds before crippling loads are reached')\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The actual critical length ratio is 77.23 \n",
+ "\n",
+ " case (b)\n",
+ "\n",
+ " The critical length ratio is 87.13 \n",
+ "\n",
+ " case (a)\n",
+ "\n",
+ " The critical length ratio is 43.57 \n",
+ "\n",
+ " case (c)\n",
+ "\n",
+ " The critical length ratio is 174.26 \n",
+ "\n",
+ " case (d)\n",
+ "\n",
+ " The critical length ratio is 124.75 \n",
+ "\n",
+ " Only in case (a) actual ratio is more than critical ratio and material \n",
+ " remains elastic For cases (b), (c) and (d) critical length ratio is \n",
+ " much higher and hence the material yelds before crippling loads are reached\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate crtical stress \n",
+ "##initialzation of variables\n",
+ "import math\n",
+ "h=3.5 ##m\n",
+ "A=22.4 ##cm**2\n",
+ "r=7.08 ##cm\n",
+ "E=2*10**6 ##kg/cm**2\n",
+ "Q=1/2.\n",
+ "## calculations\n",
+ "h=h*100.\n",
+ "Q1=(Q*h/r)**2\n",
+ "s_cr=E*math.pi**2/Q1\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The critical stress is ',s_cr,' kg/cm**2')\n",
+ "print('\\n This is much higher than yield stress for the material, \\n so the column will fail by yielding')\n",
+ "\n",
+ "print('rounding off errors in the text')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The critical stress is 32308.75 kg/cm**2\n",
+ "\n",
+ " This is much higher than yield stress for the material, \n",
+ " so the column will fail by yielding\n",
+ "rounding off errors in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find crippling load\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "r_min=1.17 ##cm\n",
+ "A=17.21 ##cm^2\n",
+ "Q=1/2.\n",
+ "h=3.5 ##m\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "h=h*100.\n",
+ "## calculations\n",
+ "Q1=(Q*h/r_min)**2\n",
+ "s_cr=E*math.pi**2/Q1\n",
+ "P_cr=s_cr*A\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The crippling load is ',P_cr,' kg')\n",
+ "\n",
+ "## wrong calculations given in the text\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The crippling load is 15184.70 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find safe load\n",
+ "L=2.5 ##m\n",
+ "A=6.02 ##cm^2\n",
+ "Q1=105.\n",
+ "s=796.5 ##kg/cm^2\n",
+ "## calculations\n",
+ "P=2*A*s\n",
+ "print'%s %.2f %s'%('The safe load is ',P,' kg')\n",
+ "## Results\n",
+ "## wrong calculations in the text\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The safe load is 9589.86 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Permissible load by secent and rankine gordon and parabolic formula\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "h=3.5 ##m\n",
+ "r_xx=7.08 ##cm\n",
+ "A=24.38 ##cm^2\n",
+ "Q=0.5\n",
+ "Q1=Q*h*100./r_xx\n",
+ "\n",
+ "##Permissible load by secent formula\n",
+ "P=1231.28*2*A\n",
+ "print'%s %.2f %s'%('Permissible load by secent formula: ',P,' kg')\n",
+ "\n",
+ "##Permissible load by Rankine-Gordon formula\n",
+ "P=1260./(1.+(24.75**2/18000.))*2*A\n",
+ "print'%s %.2f %s'%('\\n Permissible load by Rankine-Gordon formula: ',P,' kg')\n",
+ "\n",
+ "##Permissible load by parabolic formula\n",
+ "P=(1050-0.0233*Q1**2)*2*A\n",
+ "print'%s %.2f %s'%('\\n Permissible load by parabolic formula: ',P,' kg')\n",
+ "\n",
+ "##Permissible load by straight-line formula\n",
+ "P=(1120-Q1*4.8)*2*A\n",
+ "print'%s %.2f %s'%('\\n Permissible load by parabolic formula: ',P,' kg')\n",
+ "\n",
+ "print('Rounding off errors in the text')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Permissible load by secent formula: 60037.21 kg\n",
+ "\n",
+ " Permissible load by Rankine-Gordon formula: 59415.61 kg\n",
+ "\n",
+ " Permissible load by parabolic formula: 50503.89 kg\n",
+ "\n",
+ " Permissible load by parabolic formula: 48826.12 kg\n",
+ "Rounding off errors in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Solid_Mechanics_by_S._M._A._Kazimi/Chapter9.ipynb b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter9.ipynb new file mode 100755 index 00000000..ff92969f --- /dev/null +++ b/Solid_Mechanics_by_S._M._A._Kazimi/Chapter9.ipynb @@ -0,0 +1,895 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9a9db8433ab57f1254bcf525f290f9e1ef0d063ac15516708405e3ee93106db3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter9-Combined Stresses"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate values of R at A,B,C\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "##case (a)\n",
+ "A=72.9 ##cm^2\n",
+ "Iy=633 ##cm^4\n",
+ "Ix=1199. ##cm^4\n",
+ "t=24./(5.*Ix)+13.5/(5.*Iy)\n",
+ "r=1/(A*t)\n",
+ "print'%s %.2f %s'%('case (a) \\n r = ',r,' cm')\n",
+ "## case (b)\n",
+ "t=24./(5.*Ix)-13.5/(5.*Iy)\n",
+ "r=1/(A*t)\n",
+ "print'%s %.2f %s'%('\\n case (b) \\n r = ',r,' cm')\n",
+ "##case (c)\n",
+ "t=-24./(5.*Ix)+13.5/(5.*Iy)\n",
+ "r=1./(A*t)\n",
+ "print'%s %.2f %s'%('\\n case (a) \\n r =',r,' cm')\n",
+ "print'%s %.2f %s'%('\\n So the load is to be placed on the leg OD, at a distance of ',r,' cm from O' )\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "case (a) \n",
+ " r = 1.66 cm\n",
+ "\n",
+ " case (b) \n",
+ " r = -52.34 cm\n",
+ "\n",
+ " case (a) \n",
+ " r = 52.34 cm\n",
+ "\n",
+ " So the load is to be placed on the leg OD, at a distance of 52.34 cm from O\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate steel height and Width\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "b=14. ##cm\n",
+ "d=20. ##cm\n",
+ "rx=8.46 ##cm\n",
+ "ry=2.99 ##cm\n",
+ "## calculations\n",
+ "ex=2.*rx**2/d\n",
+ "ey=2*ry**2/b\n",
+ "h=2*ex\n",
+ "w=2*ey\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('for steel height=',h,' cm and width=',w,' cm')\n",
+ "## ISHB 225\n",
+ "b=22.5 ##cm\n",
+ "d=22.5 ##cm\n",
+ "rx=9.8 ##cm\n",
+ "ry=4.96 ##cm\n",
+ "## calculations\n",
+ "ex=2*rx**2/d\n",
+ "ey=2*ry**2/b\n",
+ "h=2*ex\n",
+ "w=2*ey\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('\\n for an ISHB height=',h,' cm and width=',w,' cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for steel height= 14.31 cm and width= 2.55 cm \n",
+ "\n",
+ " for an ISHB height= 17.07 cm and width= 4.37 cm \n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Safe load\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "t=280. ##kg/cm^2\n",
+ "c=840. ##kg/cm^2\n",
+ "xbar=7.5 ##cm from AB\n",
+ "A=210. ##cm^2\n",
+ "## calculations\n",
+ "e=50.+xbar ##cm\n",
+ "Iyy=7433. ##cm^2\n",
+ "k=(1./210.+e*xbar/Iyy)\n",
+ "P=t/k\n",
+ "k1=(-1./210.+e*(xbar+5.)/Iyy)\n",
+ "P1=c/k1\n",
+ "P_safe=min(P1,P)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The safe load is ',P_safe,' kg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The safe load is 4460.00 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calcualte compression and tension\n",
+ "##initialization of the variables\n",
+ "import math\n",
+ "s=1.6 ##m\n",
+ "s1=4. ##m\n",
+ "pi=28. ##degrees\n",
+ "w=16. ##kg/m^2\n",
+ "p=100. ##kg/m^2\n",
+ "pl=20. ##cm\n",
+ "pb=10. ##cm\n",
+ "r=500. ##kg/m^3\n",
+ "## calculations\n",
+ "pi=pi*math.pi/180 ##radians\n",
+ "W=w*s+(r*pl*pb/(100.*100.))\n",
+ "P=p*s\n",
+ "L=P+W*math.cos(pi)\n",
+ "Mx=L*s1**2*100./8.\n",
+ "sigma_1=Mx*6./(pb*pl**2)\n",
+ "My=W*math.sin(pi)*s1**2*100./8.\n",
+ "sigma_2=My*6./(pl*pb**2)\n",
+ "sigma1=sigma_1+sigma_2\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('Due to bending in the noth the planes, D experiences maximum \\n compression of ',sigma1,' kg/cm^2 and B has maximum tension of ',sigma1,' kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Due to bending in the noth the planes, D experiences maximum \n",
+ " compression of 67.46 kg/cm^2 and B has maximum tension of 67.46 kg/cm^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate maximum stresses\n",
+ "##initialization of the problems\n",
+ "import math\n",
+ "s=1.6 ##m\n",
+ "s1=4. ##m\n",
+ "pi=28. ##degrees\n",
+ "w=16. ##kg/m^2\n",
+ "p=100. ##kg/m^2\n",
+ "pl=20. ##cm\n",
+ "pb=10. ##cm\n",
+ "r=500. ##kg/m^3\n",
+ "Zx=54.8 ##cm^3\n",
+ "Zy=3.9 ##cm^3\n",
+ "## calculations\n",
+ "pi=pi*math.pi/180. ##radians\n",
+ "W=w*s+8.1\n",
+ "P=p*s\n",
+ "L=P+W*math.cos(pi)\n",
+ "Mx=L*s1**2*100./8.\n",
+ "sigma_1=Mx/Zx\n",
+ "My=W*math.sin(pi)*s1**2*100./8.\n",
+ "sigma_2=My/Zy\n",
+ "sigma=sigma_1+sigma_2\n",
+ "## results\n",
+ "print'%s %.2f %s'%('Maximum stresses are ',sigma,' kg/cm^2, tension or compression')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum stresses are 1503.88 kg/cm^2, tension or compression\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate strain gauge \n",
+ "##initialization of variables\n",
+ "import math\n",
+ "s=1.6 ##m\n",
+ "s1=4. ##m\n",
+ "pi=28. ##degrees\n",
+ "w=16. ##kg/m^2\n",
+ "p=100. ##kg/m^2\n",
+ "pl=20. ##cm\n",
+ "pb=10. ##cm\n",
+ "r=500. ##kg/m^3\n",
+ "sg=5. ##cm\n",
+ "E=12*10**4\n",
+ "pi=pi*math.pi/180 ##radians\n",
+ "## calculations\n",
+ "W=w*s+(r*pl*pb/(100.*100.))\n",
+ "P=p*s\n",
+ "L=P+W*math.cos(pi)\n",
+ "Mx=L*s1**2*100/8.\n",
+ "sigma_1=Mx*6./(pb*pl**2)\n",
+ "My=W*math.sin(pi)*s1**2*100/8.\n",
+ "sigma_2=My*6./(pl*pb**2)\n",
+ "st=sigma_1*sg/10.\n",
+ "Ts=st-sigma_2\n",
+ "ez=Ts/E\n",
+ "## results\n",
+ "print'%s %.2e %s'%('The strain gauge, aligned to the z axis will give compression strain of ',ez,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The strain gauge, aligned to the z axis will give compression strain of 1.56e-04 \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calcualte bending stress and shearing stress\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "P=3. ##tonne/m\n",
+ "s=6. ##m\n",
+ "l=50. ##cm\n",
+ "b=20. ##cm\n",
+ "k=0.5 ##m\n",
+ "##calculations\n",
+ "R=P*s/2.\n",
+ "sf=R-k*P\n",
+ "bm=R*k-P*k**2/2.\n",
+ "tau_xy=1.5*sf*1000./(l*b)\n",
+ "tau_max=tau_xy\n",
+ "str=bm*s*10**5/(b*l*l)\n",
+ "\n",
+ "## consider the line a-a\n",
+ "\n",
+ "sigma_x=str*12.5/25.\n",
+ "sigma_y=0.\n",
+ "tau_xy=tau_xy*(1.-(12.5/25.)**2)\n",
+ "\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1/2*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1/2*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "\n",
+ "print'%s %.2f %s %.2f %s '%('For the line a-a the bending stress and shearing stress are \\n respectively ',sigma_x,' kg/cm^2'and'',tau_xy,'kg/cm^2 ')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n The principal stresses are ',sigma_1,' kg/cm^2 (tension)' and '',sigma_2,'kg/cm^2 (compression) ')\n",
+ "\n",
+ "##consider the line c-c\n",
+ "print'%s %.2f %s %.2f %s '%('\\n For the line c-c the bending stress and shearing stress are \\n respectively ',sigma_x,' kg/cm^2'and '',tau_xy,' kg/cm^2 ')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n The principal stresses are ',sigma_2,' kg/cm^2 (compression)'and '',sigma_1,' kg/cm^2 (tension) ')\n",
+ "\n",
+ "##for the line b-b\n",
+ "tau_xy=tau_max\n",
+ "sigma_x=0.\n",
+ "sigma_y=0.\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "## results\n",
+ "print'%s %.7f %s %.2f %s '%('\\n For the line b-b the bending stress and shearing stress are \\n respectively ',sigma_x,' kg/cm^2'and '',tau_xy,' kg/cm^2 ')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n The principal stresses are ',sigma_1,' kg/cm^2 (tension)'and'',sigma_2,' kg/cm^2 (compression) ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For the line a-a the bending stress and shearing stress are \n",
+ " respectively 24.75 8.44 kg/cm^2 \n",
+ "\n",
+ " The principal stresses are 20.81 3.94 kg/cm^2 (compression) \n",
+ "\n",
+ " For the line c-c the bending stress and shearing stress are \n",
+ " respectively 24.75 8.44 kg/cm^2 \n",
+ "\n",
+ " The principal stresses are 3.94 20.81 kg/cm^2 (tension) \n",
+ "\n",
+ " For the line b-b the bending stress and shearing stress are \n",
+ " respectively 0.0000000 11.25 kg/cm^2 \n",
+ "\n",
+ " The principal stresses are 11.25 -11.25 kg/cm^2 (compression) \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate tension and principal stress\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "P=3. ##tonne/m\n",
+ "s=6. ##m\n",
+ "l=50. ##cm\n",
+ "b=20. ##cm\n",
+ "k=0.5 ##m\n",
+ "##calculations\n",
+ "R=P*s/2.\n",
+ "sf=R-k*P\n",
+ "bm=R*k-P*k**2/2.\n",
+ "tau_xy=1.5*sf*1000./(l*b) ##max shear stress\n",
+ "tau_max=tau_xy \n",
+ "str=bm*s*10**5/(b*l*l) ##max bending stress\n",
+ "\n",
+ "## consider the line a-a\n",
+ "\n",
+ "sigma_x=str*12.5/25.\n",
+ "sigma_y=0.\n",
+ "tau_xy=tau_xy*(1.-(12.5/25.)**2)\n",
+ "\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1/2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2-math.sqrt((1/2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "\n",
+ "theta=1/2.*math.atan(2.*tau_xy/(sigma_x-sigma_y))*57.3\n",
+ "sigma_p=sigma_1/math.cos(theta)\n",
+ "P=sigma_p*2.*l*b/(3.*1000.)\n",
+ "print'%s %.2f %s'%('A prestressing force of ',P,' Tonne must be applied to balance the tension at a-a')\n",
+ "\n",
+ "##At bottom point D or C\n",
+ "pre_str=P*2.*1000./(l*b)\n",
+ "net=str-pre_str\n",
+ "print('\\n At bottom point D or C')\n",
+ "print'%s %.2f %s'%('\\n Net tension = ',net,' kg/cm^2 ')\n",
+ "\n",
+ "##consider the line b-b\n",
+ "pre_str=P\n",
+ "sigma_x=pre_str\n",
+ "sigma_y=0.\n",
+ "tau_xy=tau_max\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "print('\\n At section b-b')\n",
+ "print'%s %.2f %s '%('\\n pre-stress=',pre_str,' kg/cm^2')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n principal stresses are ',sigma_1,''and'',sigma_2,' kg/cm^2 ')\n",
+ "\n",
+ "##for the line c-c\n",
+ "sigma_x=str*12.5/25.\n",
+ "sigma_y=0.\n",
+ "tau_xy=tau_xy*(1-(12.5/25.)**2)\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "pre_str=pre_str/2.\n",
+ "net=sigma_1+pre_str\n",
+ "sigma_x=net\n",
+ "sigma_y=0.\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "## results\n",
+ "print('\\n At section c-c')\n",
+ "print'%s %.2f %s'%('\\n the direct stress is ',net,' kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n pre-stress =',pre_str,' kg/cm^2')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n principal stresses are',sigma_1,'kg/cm^2'and '',sigma_2,'kg/cm^2')\n",
+ "print('wrong calculations in the thext for some parts')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A prestressing force of -136.43 Tonne must be applied to balance the tension at a-a\n",
+ "\n",
+ " At bottom point D or C\n",
+ "\n",
+ " Net tension = 322.36 kg/cm^2 \n",
+ "\n",
+ " At section b-b\n",
+ "\n",
+ " pre-stress= -136.43 kg/cm^2 \n",
+ "\n",
+ " principal stresses are 0.92 -137.35 kg/cm^2 \n",
+ "\n",
+ " At section c-c\n",
+ "\n",
+ " the direct stress is -40.86 kg/cm^2\n",
+ "\n",
+ " pre-stress = -68.22 kg/cm^2\n",
+ "\n",
+ " principal stresses are 1.67 -42.54 kg/cm^2 \n",
+ "wrong calculations in the thext for some parts\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate sigma and Tau\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "b=2. ##cm\n",
+ "h=2. ##cm\n",
+ "T=2000. ##kg-cm\n",
+ "V=250. ##kg\n",
+ "M=2000. ##kg-cm\n",
+ "## calculations\n",
+ "Mmax=M*6./(b*h*b)\n",
+ "Vmax=3.*V/(2.*b*h)\n",
+ "Zt=0.208*b**2*h\n",
+ "Tmax=T/(Zt)\n",
+ "\n",
+ "sigma=Mmax\n",
+ "print('points A,B,')\n",
+ "print'%s %.2f %s'%('\\n sigma=',sigma,' kg/cm^2 (tension)')\n",
+ "print('\\n points C,D,')\n",
+ "print'%s %.2f %s'%('\\n sigma=',sigma,' kg/cm^2 (cmpression)')\n",
+ "tau=Vmax+Tmax\n",
+ "print('\\n point E')\n",
+ "print'%s %.2f %s'%('\\n tau=',tau,'kg/cm^2 shear')\n",
+ "tau=Vmax-Tmax\n",
+ "print'%s %.2f %s'%('\\n tau=',tau,' kg/cm^2 shear')\n",
+ "## at G\n",
+ "sigma_x=sigma\n",
+ "sigma_y=0.\n",
+ "tau_xy=Tmax\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "## results\n",
+ "print('\\n at point G')\n",
+ "print'%s %.2f %s'%('\\n sigma_1 = ',sigma_1,' kg/cm^2 (tension)')\n",
+ "print'%s %.2f %s'%('\\n sigma_2 = ',sigma_2,' kg/cm^2 (compression)')\n",
+ "\n",
+ "print('Question was asked only to find out at A,B,C,D,E,F and G')\n",
+ "print(' And in book Ans worng')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "points A,B,\n",
+ "\n",
+ " sigma= 1500.00 kg/cm^2 (tension)\n",
+ "\n",
+ " points C,D,\n",
+ "\n",
+ " sigma= 1500.00 kg/cm^2 (cmpression)\n",
+ "\n",
+ " point E\n",
+ "\n",
+ " tau= 1295.67 kg/cm^2 shear\n",
+ "\n",
+ " tau= -1108.17 kg/cm^2 shear\n",
+ "\n",
+ " at point G\n",
+ "\n",
+ " sigma_1 = 2166.73 kg/cm^2 (tension)\n",
+ "\n",
+ " sigma_2 = -666.73 kg/cm^2 (compression)\n",
+ "Question was asked only to find out at A,B,C,D,E,F and G\n",
+ " And in book Ans worng\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate total shear and bending stress and principal stress\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "w=10. ##cm\n",
+ "s=2.8 ##m\n",
+ "P=1. ##tonne\n",
+ "Ft=1.4 ##cm\n",
+ "Wt=0.8 ##cm\n",
+ "Ix=13989.5 ##cm^4\n",
+ "Z=699.5 ##cm^3\n",
+ "## calculations\n",
+ "BM= 2.8 \n",
+ "T=P*1000*8.21\n",
+ "SF=P*1000.\n",
+ "BS=BM*10**5/(Z)\n",
+ "sigmaXA=BS*18.6/20.\n",
+ "K=w*Ft*19.3+18.6*Wt*9.3\n",
+ "tau_xy_C=SF/(Ix*Wt)*K\n",
+ "tau_xy_A=tau_xy_C*(w*Ft*19.3)/K \n",
+ "tau_xy_B=tau_xy_A*0.5*Wt/w\n",
+ "sigmaXB=sigmaXA*19.3/20.\n",
+ "\n",
+ "tau_max=3*Ft*8210./(w*Ft**3+37.2*Wt**3)\n",
+ "tau_A=3*Wt*8210./(w*Ft**3+37.2*Wt**3)\n",
+ "\n",
+ "##For point A\n",
+ "Shear=tau_xy_A-tau_A\n",
+ "sigma_x=sigmaXA\n",
+ "sigma_y=0.\n",
+ "tau_xy=Shear\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "\n",
+ "print('For point A')\n",
+ "print'%s %.2f %s'%('\\n Total shear= ',Shear,' kg/cm^2 ')\n",
+ "print'%s %.2f %s'%('\\n Bending stress = ',sigma_x,' kg/cm^2 (Compr.)')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n Principal stresses are ',sigma_1,'(tension)kg/cm^2 'and'' ,sigma_2,'(comp.) kg/cm^2 ')\n",
+ "\n",
+ "##For point B\n",
+ "print('\\n FOr point B')\n",
+ "print'%s %.2f %s'%('\\n Bending shear stress is ',tau_xy_B,' k/cm^2')\n",
+ "sigmaXB=BS*19.3/20.\n",
+ "sigma_x=sigmaXB\n",
+ "sigma_y=0.\n",
+ "tau_xy=tau_max\n",
+ "sigma_1=(sigma_x+sigma_y)/2.+math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "sigma_2=(sigma_x+sigma_y)/2.-math.sqrt((1./2.*(sigma_x-sigma_y))**2+tau_xy**2)\n",
+ "print'%s %.2f %s %.2f %s '%('\\n Principal stresses are ',sigma_1,' (tension) kg/cm^2'and'',sigma_2,' (comp.) kg/cm^2 ')\n",
+ "print('Answers in the text are approximations')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For point A\n",
+ "\n",
+ " Total shear= -399.72 kg/cm^2 \n",
+ "\n",
+ " Bending stress = 372.27 kg/cm^2 (Compr.)\n",
+ "\n",
+ " Principal stresses are 627.07 -254.80 (comp.) kg/cm^2 \n",
+ "\n",
+ " FOr point B\n",
+ "\n",
+ " Bending shear stress is 0.97 k/cm^2\n",
+ "\n",
+ " Principal stresses are 959.64 -573.36 (comp.) kg/cm^2 \n",
+ "Answers in the text are approximations\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calcualte permissible stress and developed stress\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "b=10. ##cm\n",
+ "h=10. ##cm\n",
+ "P=5. ##tonne\n",
+ "e=1. ##cm\n",
+ "E=12*10**4 ##kg/cm^2\n",
+ "str=130. ## kg/cm^2\n",
+ "n=3.\n",
+ "L=2. ##m\n",
+ "## calculations\n",
+ "L=L*100. ##cm\n",
+ "Pcr=math.pi**2*E*b*h**3/(12.*L**2.)\n",
+ "Pcr=Pcr/1000.\n",
+ "Smax=-P*1000./(b*h)-(P*1000.*1.*5.*12./10**4)*1./(1.-(n*P/Pcr))\n",
+ "## results\n",
+ "print'%s %.2f %s'%('permissible stress = ',str,' kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n develoed stress = ',Smax,' kg/cm^2')\n",
+ "print('\\n Since it is below the permissible stress, the design is safe')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "permissible stress = 130.00 kg/cm^2\n",
+ "\n",
+ " develoed stress = -126.52 kg/cm^2\n",
+ "\n",
+ " Since it is below the permissible stress, the design is safe\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initializatio of variables\n",
+ "#calculate Smax and percentage error\n",
+ "## linked to 9.13\n",
+ "b=10. ##cm\n",
+ "h=10. ##cm\n",
+ "P=5. ##tonne\n",
+ "e=1. ##cm\n",
+ "E=12.*10**4 ##kg/cm^2\n",
+ "str=130. ## kg/cm^2\n",
+ "n=3.\n",
+ "L=2. ##m\n",
+ "## calculations\n",
+ "L=L*100. ##cm\n",
+ "Pcr=math.pi**2*E*b*h**3/(12*L**2)\n",
+ "Pcr=Pcr/1000.\n",
+ "Smax=-P*1000./(b*h)-(P*1000.*1.*5.*12./10**4)*1./(1.-(n*P/Pcr))\n",
+ "Smax=abs(Smax)\n",
+ "\n",
+ "rr=b*h**3/(12.*100.)\n",
+ "Smax_se=P*1000./(b*h)*(1+e*5/rr*(1./math.cos(math.pi/2.*math.sqrt(n*P/Pcr))))\n",
+ "Perror=(Smax-Smax_se)/Smax\n",
+ "Perror=Perror*100.\n",
+ "Perror=abs(Perror)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('Using secent formula, stress obtained is ',Smax_se,' kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n hence, the percentage error ',Perror,'')\n",
+ "## approximate answees in the text\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Using secent formula, stress obtained is 138.45 kg/cm^2\n",
+ "\n",
+ " hence, the percentage error 9.43 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#calculate maximum stress developed\n",
+ "P=400. ##kg/m\n",
+ "L=10. ##m\n",
+ "F=10. ##tonne\n",
+ "n=3.\n",
+ "Ixx=5943.1 ##cm^4\n",
+ "A=52.03 ##cm^2\n",
+ "rx=10.69 ##cm\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "## calculations\n",
+ "Pcr=math.pi**2*E*Ixx/((L*100.)**2.)\n",
+ "Pcr=Pcr/1000.\n",
+ "e=P*L**2/(8*F*1000.)\n",
+ "g=e*12.5*100./rx**2\n",
+ "Smax=F*1000./A*(1.+g*1./(1-n*(F/Pcr)))\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximum stress developed is ',Smax,' kg/cm^2')\n",
+ "\n",
+ "print('approximate calculations involved in the text book')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum stress developed is 1604.54 kg/cm^2\n",
+ "approximate calculations involved in the text book\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate maximum stress developed\n",
+ "##initialization of variables\n",
+ "import math\n",
+ "## linked to 9_14\n",
+ "## calculations\n",
+ "P=400. ##kg/m\n",
+ "L=10. ##m\n",
+ "F=10. ##tonne\n",
+ "n=3.\n",
+ "Ixx=5943.1 ##cm^4\n",
+ "A=52.03 ##cm^2\n",
+ "rx=10.69 ##cm\n",
+ "E=2*10**6 ##kg/cm^2\n",
+ "Pcr=math.pi**2.*E*Ixx/((L*100.)**2)\n",
+ "Pcr=Pcr/1000.\n",
+ "e=P*L**2./(8.*F*1000.)\n",
+ "g=e*12.5*100./rx**2.\n",
+ "Smax=F*1000./A*(1+g*1./(1.+n*(F/Pcr)))\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximum stress developed is ',Smax,' kg/cm^2')\n",
+ "\n",
+ "print('approximate answer in the text')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum stress developed is 1029.29 kg/cm^2\n",
+ "approximate answer in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Solid_State_Pulse_Circuits/README.txt b/Solid_State_Pulse_Circuits/README.txt new file mode 100755 index 00000000..e91722c0 --- /dev/null +++ b/Solid_State_Pulse_Circuits/README.txt @@ -0,0 +1,10 @@ +Contributed By: Vidya Sri +Course: btech +College/Institute/Organization: RVR and JC College Of Engineering +Department/Designation: Electronics Engineering +Book Title: Solid State Pulse Circuits +Author: D. A. Bell +Publisher: Phi Publishers, New Delhi +Year of publication: 2006 +Isbn: 9788120307445 +Edition: 4
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer/README.txt b/Textbook_Of_Heat_Transfer/README.txt new file mode 100755 index 00000000..c8d1b5af --- /dev/null +++ b/Textbook_Of_Heat_Transfer/README.txt @@ -0,0 +1,10 @@ +Contributed By: Kavinkumar D +Course: others +College/Institute/Organization: KSR College of Arts & Science,Tiruchengode +Department/Designation: Computer Science +Book Title: Textbook Of Heat Transfer +Author: S. P. Sukhatme +Publisher: Universities Press +Year of publication: 2005 +Isbn: 9788173715440 +Edition: 4
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__1.ipynb new file mode 100755 index 00000000..2ab3d5d9 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__1.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9b1229db232c49aaabbc7f0d29465c24cc6508532c6b435aa2f1e98a362531bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ " Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 , Page no:5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "v=28.8*10**-6; #the viscosity of water at 100 degree Celsius in kgf s/m^2\n",
+ "g=9.81; #Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "v=28.8*10**-6*g; # Conversion of unit\n",
+ "\n",
+ "#result\n",
+ "print (\"The viscosity of water at 100 degree Celsius = {:.4e}\".format(v)),\"N s/m^2 (or kg/m s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of water at 100 degree Celsius = 2.8253e-04 N s/m^2 (or kg/m s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "i=950; # radiation flux [W/m^ 2 ]\n",
+ "A=1.5; # area [m^ 2 ]\n",
+ "Ti=61; # inlet temperature\n",
+ "To=69; # outlet temperature\n",
+ "m=1.5; # mass flow rate\n",
+ "M=1.5/60; # kg/sec\n",
+ "Qconductn=50; # W\n",
+ "t=0.95; # transmissivity\n",
+ "a=0.97; # absoptivity\n",
+ "Cp=4183; # J/kg K\n",
+ "\n",
+ "#calculations\n",
+ "q=M*Cp*(To-Ti); # heat gain rate\n",
+ "n=q/(i*A); # thermal efficiency\n",
+ "n_percent=n*100; # thermal efficiency\n",
+ "Qreradiated=(i*A*t*a)-Qconductn-q; # rate at which energy is lost by re-radiation\n",
+ "\n",
+ "#result\n",
+ "print \"Useful heat gain rate is \",round(q,4),\"W\"\n",
+ "print \"Thermal efficiency is\",'%.4E'%n,\"i.e\",round(n_percent,3),\"%\"\n",
+ "print \"The rate at which energy is lost by re-radiation and convection is \", round(Qreradiated,6),\"W\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful heat gain rate is 836.6 W\n",
+ "Thermal efficiency is 5.8709E-01 i.e 58.709 %\n",
+ "The rate at which energy is lost by re-radiation and convection is 426.5375 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "vi=10; # velocity at inlet in m/s\n",
+ "q=1000; # heat in w\n",
+ "di=0.04; # inside diameter in m\n",
+ "do=0.06; # outside diameter in m\n",
+ "den1=0.946; # density in kg/m^3 at 100 degree C\n",
+ "Cp=1009; # specific heat in J/kg k\n",
+ "den2=0.773; # specific heat at To=183.4 degree C\n",
+ "\n",
+ "#calculations\n",
+ "m=den1*(3.14/4)*(di**2)*vi; # kg/s\n",
+ "dh=q/m; # j/kg\n",
+ "To=dh/Cp+100; # Exit Temperature\n",
+ "vo=m/(den2*(3.14/4)*(do)**2); # Exit velocity \n",
+ "dKeKg=(vo**2-vi**2)/2; # Change in Kinetic Energy per kg\n",
+ "\n",
+ "#result\n",
+ "print \"Exit Temperature is\",round(To,4),\"degree C\"\n",
+ "print \"Exit velocity is \",round(vo,4),\"m/s\"\n",
+ "print \"Change in Kinetic Energy per kg =\",round(dKeKg,5),\"J/kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit Temperature is 183.4119 degree C\n",
+ "Exit velocity is 5.4391 m/s\n",
+ "Change in Kinetic Energy per kg = -35.20795 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__2.ipynb new file mode 100755 index 00000000..2ab3d5d9 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__2.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9b1229db232c49aaabbc7f0d29465c24cc6508532c6b435aa2f1e98a362531bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ " Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 , Page no:5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "v=28.8*10**-6; #the viscosity of water at 100 degree Celsius in kgf s/m^2\n",
+ "g=9.81; #Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "v=28.8*10**-6*g; # Conversion of unit\n",
+ "\n",
+ "#result\n",
+ "print (\"The viscosity of water at 100 degree Celsius = {:.4e}\".format(v)),\"N s/m^2 (or kg/m s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of water at 100 degree Celsius = 2.8253e-04 N s/m^2 (or kg/m s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "i=950; # radiation flux [W/m^ 2 ]\n",
+ "A=1.5; # area [m^ 2 ]\n",
+ "Ti=61; # inlet temperature\n",
+ "To=69; # outlet temperature\n",
+ "m=1.5; # mass flow rate\n",
+ "M=1.5/60; # kg/sec\n",
+ "Qconductn=50; # W\n",
+ "t=0.95; # transmissivity\n",
+ "a=0.97; # absoptivity\n",
+ "Cp=4183; # J/kg K\n",
+ "\n",
+ "#calculations\n",
+ "q=M*Cp*(To-Ti); # heat gain rate\n",
+ "n=q/(i*A); # thermal efficiency\n",
+ "n_percent=n*100; # thermal efficiency\n",
+ "Qreradiated=(i*A*t*a)-Qconductn-q; # rate at which energy is lost by re-radiation\n",
+ "\n",
+ "#result\n",
+ "print \"Useful heat gain rate is \",round(q,4),\"W\"\n",
+ "print \"Thermal efficiency is\",'%.4E'%n,\"i.e\",round(n_percent,3),\"%\"\n",
+ "print \"The rate at which energy is lost by re-radiation and convection is \", round(Qreradiated,6),\"W\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful heat gain rate is 836.6 W\n",
+ "Thermal efficiency is 5.8709E-01 i.e 58.709 %\n",
+ "The rate at which energy is lost by re-radiation and convection is 426.5375 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "vi=10; # velocity at inlet in m/s\n",
+ "q=1000; # heat in w\n",
+ "di=0.04; # inside diameter in m\n",
+ "do=0.06; # outside diameter in m\n",
+ "den1=0.946; # density in kg/m^3 at 100 degree C\n",
+ "Cp=1009; # specific heat in J/kg k\n",
+ "den2=0.773; # specific heat at To=183.4 degree C\n",
+ "\n",
+ "#calculations\n",
+ "m=den1*(3.14/4)*(di**2)*vi; # kg/s\n",
+ "dh=q/m; # j/kg\n",
+ "To=dh/Cp+100; # Exit Temperature\n",
+ "vo=m/(den2*(3.14/4)*(do)**2); # Exit velocity \n",
+ "dKeKg=(vo**2-vi**2)/2; # Change in Kinetic Energy per kg\n",
+ "\n",
+ "#result\n",
+ "print \"Exit Temperature is\",round(To,4),\"degree C\"\n",
+ "print \"Exit velocity is \",round(vo,4),\"m/s\"\n",
+ "print \"Change in Kinetic Energy per kg =\",round(dKeKg,5),\"J/kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit Temperature is 183.4119 degree C\n",
+ "Exit velocity is 5.4391 m/s\n",
+ "Change in Kinetic Energy per kg = -35.20795 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__3.ipynb new file mode 100755 index 00000000..2ab3d5d9 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__3.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9b1229db232c49aaabbc7f0d29465c24cc6508532c6b435aa2f1e98a362531bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ " Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 , Page no:5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "v=28.8*10**-6; #the viscosity of water at 100 degree Celsius in kgf s/m^2\n",
+ "g=9.81; #Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "v=28.8*10**-6*g; # Conversion of unit\n",
+ "\n",
+ "#result\n",
+ "print (\"The viscosity of water at 100 degree Celsius = {:.4e}\".format(v)),\"N s/m^2 (or kg/m s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of water at 100 degree Celsius = 2.8253e-04 N s/m^2 (or kg/m s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "i=950; # radiation flux [W/m^ 2 ]\n",
+ "A=1.5; # area [m^ 2 ]\n",
+ "Ti=61; # inlet temperature\n",
+ "To=69; # outlet temperature\n",
+ "m=1.5; # mass flow rate\n",
+ "M=1.5/60; # kg/sec\n",
+ "Qconductn=50; # W\n",
+ "t=0.95; # transmissivity\n",
+ "a=0.97; # absoptivity\n",
+ "Cp=4183; # J/kg K\n",
+ "\n",
+ "#calculations\n",
+ "q=M*Cp*(To-Ti); # heat gain rate\n",
+ "n=q/(i*A); # thermal efficiency\n",
+ "n_percent=n*100; # thermal efficiency\n",
+ "Qreradiated=(i*A*t*a)-Qconductn-q; # rate at which energy is lost by re-radiation\n",
+ "\n",
+ "#result\n",
+ "print \"Useful heat gain rate is \",round(q,4),\"W\"\n",
+ "print \"Thermal efficiency is\",'%.4E'%n,\"i.e\",round(n_percent,3),\"%\"\n",
+ "print \"The rate at which energy is lost by re-radiation and convection is \", round(Qreradiated,6),\"W\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful heat gain rate is 836.6 W\n",
+ "Thermal efficiency is 5.8709E-01 i.e 58.709 %\n",
+ "The rate at which energy is lost by re-radiation and convection is 426.5375 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "vi=10; # velocity at inlet in m/s\n",
+ "q=1000; # heat in w\n",
+ "di=0.04; # inside diameter in m\n",
+ "do=0.06; # outside diameter in m\n",
+ "den1=0.946; # density in kg/m^3 at 100 degree C\n",
+ "Cp=1009; # specific heat in J/kg k\n",
+ "den2=0.773; # specific heat at To=183.4 degree C\n",
+ "\n",
+ "#calculations\n",
+ "m=den1*(3.14/4)*(di**2)*vi; # kg/s\n",
+ "dh=q/m; # j/kg\n",
+ "To=dh/Cp+100; # Exit Temperature\n",
+ "vo=m/(den2*(3.14/4)*(do)**2); # Exit velocity \n",
+ "dKeKg=(vo**2-vi**2)/2; # Change in Kinetic Energy per kg\n",
+ "\n",
+ "#result\n",
+ "print \"Exit Temperature is\",round(To,4),\"degree C\"\n",
+ "print \"Exit velocity is \",round(vo,4),\"m/s\"\n",
+ "print \"Change in Kinetic Energy per kg =\",round(dKeKg,5),\"J/kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit Temperature is 183.4119 degree C\n",
+ "Exit velocity is 5.4391 m/s\n",
+ "Change in Kinetic Energy per kg = -35.20795 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__4.ipynb new file mode 100755 index 00000000..2ab3d5d9 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__4.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9b1229db232c49aaabbc7f0d29465c24cc6508532c6b435aa2f1e98a362531bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ " Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 , Page no:5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "v=28.8*10**-6; #the viscosity of water at 100 degree Celsius in kgf s/m^2\n",
+ "g=9.81; #Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "v=28.8*10**-6*g; # Conversion of unit\n",
+ "\n",
+ "#result\n",
+ "print (\"The viscosity of water at 100 degree Celsius = {:.4e}\".format(v)),\"N s/m^2 (or kg/m s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of water at 100 degree Celsius = 2.8253e-04 N s/m^2 (or kg/m s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "i=950; # radiation flux [W/m^ 2 ]\n",
+ "A=1.5; # area [m^ 2 ]\n",
+ "Ti=61; # inlet temperature\n",
+ "To=69; # outlet temperature\n",
+ "m=1.5; # mass flow rate\n",
+ "M=1.5/60; # kg/sec\n",
+ "Qconductn=50; # W\n",
+ "t=0.95; # transmissivity\n",
+ "a=0.97; # absoptivity\n",
+ "Cp=4183; # J/kg K\n",
+ "\n",
+ "#calculations\n",
+ "q=M*Cp*(To-Ti); # heat gain rate\n",
+ "n=q/(i*A); # thermal efficiency\n",
+ "n_percent=n*100; # thermal efficiency\n",
+ "Qreradiated=(i*A*t*a)-Qconductn-q; # rate at which energy is lost by re-radiation\n",
+ "\n",
+ "#result\n",
+ "print \"Useful heat gain rate is \",round(q,4),\"W\"\n",
+ "print \"Thermal efficiency is\",'%.4E'%n,\"i.e\",round(n_percent,3),\"%\"\n",
+ "print \"The rate at which energy is lost by re-radiation and convection is \", round(Qreradiated,6),\"W\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful heat gain rate is 836.6 W\n",
+ "Thermal efficiency is 5.8709E-01 i.e 58.709 %\n",
+ "The rate at which energy is lost by re-radiation and convection is 426.5375 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "vi=10; # velocity at inlet in m/s\n",
+ "q=1000; # heat in w\n",
+ "di=0.04; # inside diameter in m\n",
+ "do=0.06; # outside diameter in m\n",
+ "den1=0.946; # density in kg/m^3 at 100 degree C\n",
+ "Cp=1009; # specific heat in J/kg k\n",
+ "den2=0.773; # specific heat at To=183.4 degree C\n",
+ "\n",
+ "#calculations\n",
+ "m=den1*(3.14/4)*(di**2)*vi; # kg/s\n",
+ "dh=q/m; # j/kg\n",
+ "To=dh/Cp+100; # Exit Temperature\n",
+ "vo=m/(den2*(3.14/4)*(do)**2); # Exit velocity \n",
+ "dKeKg=(vo**2-vi**2)/2; # Change in Kinetic Energy per kg\n",
+ "\n",
+ "#result\n",
+ "print \"Exit Temperature is\",round(To,4),\"degree C\"\n",
+ "print \"Exit velocity is \",round(vo,4),\"m/s\"\n",
+ "print \"Change in Kinetic Energy per kg =\",round(dKeKg,5),\"J/kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit Temperature is 183.4119 degree C\n",
+ "Exit velocity is 5.4391 m/s\n",
+ "Change in Kinetic Energy per kg = -35.20795 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__5.ipynb new file mode 100755 index 00000000..2ab3d5d9 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__5.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9b1229db232c49aaabbc7f0d29465c24cc6508532c6b435aa2f1e98a362531bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ " Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 , Page no:5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "v=28.8*10**-6; #the viscosity of water at 100 degree Celsius in kgf s/m^2\n",
+ "g=9.81; #Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "v=28.8*10**-6*g; # Conversion of unit\n",
+ "\n",
+ "#result\n",
+ "print (\"The viscosity of water at 100 degree Celsius = {:.4e}\".format(v)),\"N s/m^2 (or kg/m s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of water at 100 degree Celsius = 2.8253e-04 N s/m^2 (or kg/m s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "i=950; # radiation flux [W/m^ 2 ]\n",
+ "A=1.5; # area [m^ 2 ]\n",
+ "Ti=61; # inlet temperature\n",
+ "To=69; # outlet temperature\n",
+ "m=1.5; # mass flow rate\n",
+ "M=1.5/60; # kg/sec\n",
+ "Qconductn=50; # W\n",
+ "t=0.95; # transmissivity\n",
+ "a=0.97; # absoptivity\n",
+ "Cp=4183; # J/kg K\n",
+ "\n",
+ "#calculations\n",
+ "q=M*Cp*(To-Ti); # heat gain rate\n",
+ "n=q/(i*A); # thermal efficiency\n",
+ "n_percent=n*100; # thermal efficiency\n",
+ "Qreradiated=(i*A*t*a)-Qconductn-q; # rate at which energy is lost by re-radiation\n",
+ "\n",
+ "#result\n",
+ "print \"Useful heat gain rate is \",round(q,4),\"W\"\n",
+ "print \"Thermal efficiency is\",'%.4E'%n,\"i.e\",round(n_percent,3),\"%\"\n",
+ "print \"The rate at which energy is lost by re-radiation and convection is \", round(Qreradiated,6),\"W\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful heat gain rate is 836.6 W\n",
+ "Thermal efficiency is 5.8709E-01 i.e 58.709 %\n",
+ "The rate at which energy is lost by re-radiation and convection is 426.5375 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "vi=10; # velocity at inlet in m/s\n",
+ "q=1000; # heat in w\n",
+ "di=0.04; # inside diameter in m\n",
+ "do=0.06; # outside diameter in m\n",
+ "den1=0.946; # density in kg/m^3 at 100 degree C\n",
+ "Cp=1009; # specific heat in J/kg k\n",
+ "den2=0.773; # specific heat at To=183.4 degree C\n",
+ "\n",
+ "#calculations\n",
+ "m=den1*(3.14/4)*(di**2)*vi; # kg/s\n",
+ "dh=q/m; # j/kg\n",
+ "To=dh/Cp+100; # Exit Temperature\n",
+ "vo=m/(den2*(3.14/4)*(do)**2); # Exit velocity \n",
+ "dKeKg=(vo**2-vi**2)/2; # Change in Kinetic Energy per kg\n",
+ "\n",
+ "#result\n",
+ "print \"Exit Temperature is\",round(To,4),\"degree C\"\n",
+ "print \"Exit velocity is \",round(vo,4),\"m/s\"\n",
+ "print \"Change in Kinetic Energy per kg =\",round(dKeKg,5),\"J/kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit Temperature is 183.4119 degree C\n",
+ "Exit velocity is 5.4391 m/s\n",
+ "Change in Kinetic Energy per kg = -35.20795 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__6.ipynb new file mode 100755 index 00000000..2ab3d5d9 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__6.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9b1229db232c49aaabbc7f0d29465c24cc6508532c6b435aa2f1e98a362531bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ " Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 , Page no:5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "v=28.8*10**-6; #the viscosity of water at 100 degree Celsius in kgf s/m^2\n",
+ "g=9.81; #Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "v=28.8*10**-6*g; # Conversion of unit\n",
+ "\n",
+ "#result\n",
+ "print (\"The viscosity of water at 100 degree Celsius = {:.4e}\".format(v)),\"N s/m^2 (or kg/m s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of water at 100 degree Celsius = 2.8253e-04 N s/m^2 (or kg/m s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "i=950; # radiation flux [W/m^ 2 ]\n",
+ "A=1.5; # area [m^ 2 ]\n",
+ "Ti=61; # inlet temperature\n",
+ "To=69; # outlet temperature\n",
+ "m=1.5; # mass flow rate\n",
+ "M=1.5/60; # kg/sec\n",
+ "Qconductn=50; # W\n",
+ "t=0.95; # transmissivity\n",
+ "a=0.97; # absoptivity\n",
+ "Cp=4183; # J/kg K\n",
+ "\n",
+ "#calculations\n",
+ "q=M*Cp*(To-Ti); # heat gain rate\n",
+ "n=q/(i*A); # thermal efficiency\n",
+ "n_percent=n*100; # thermal efficiency\n",
+ "Qreradiated=(i*A*t*a)-Qconductn-q; # rate at which energy is lost by re-radiation\n",
+ "\n",
+ "#result\n",
+ "print \"Useful heat gain rate is \",round(q,4),\"W\"\n",
+ "print \"Thermal efficiency is\",'%.4E'%n,\"i.e\",round(n_percent,3),\"%\"\n",
+ "print \"The rate at which energy is lost by re-radiation and convection is \", round(Qreradiated,6),\"W\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful heat gain rate is 836.6 W\n",
+ "Thermal efficiency is 5.8709E-01 i.e 58.709 %\n",
+ "The rate at which energy is lost by re-radiation and convection is 426.5375 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "vi=10; # velocity at inlet in m/s\n",
+ "q=1000; # heat in w\n",
+ "di=0.04; # inside diameter in m\n",
+ "do=0.06; # outside diameter in m\n",
+ "den1=0.946; # density in kg/m^3 at 100 degree C\n",
+ "Cp=1009; # specific heat in J/kg k\n",
+ "den2=0.773; # specific heat at To=183.4 degree C\n",
+ "\n",
+ "#calculations\n",
+ "m=den1*(3.14/4)*(di**2)*vi; # kg/s\n",
+ "dh=q/m; # j/kg\n",
+ "To=dh/Cp+100; # Exit Temperature\n",
+ "vo=m/(den2*(3.14/4)*(do)**2); # Exit velocity \n",
+ "dKeKg=(vo**2-vi**2)/2; # Change in Kinetic Energy per kg\n",
+ "\n",
+ "#result\n",
+ "print \"Exit Temperature is\",round(To,4),\"degree C\"\n",
+ "print \"Exit velocity is \",round(vo,4),\"m/s\"\n",
+ "print \"Change in Kinetic Energy per kg =\",round(dKeKg,5),\"J/kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit Temperature is 183.4119 degree C\n",
+ "Exit velocity is 5.4391 m/s\n",
+ "Change in Kinetic Energy per kg = -35.20795 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__7.ipynb new file mode 100755 index 00000000..2ab3d5d9 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__7.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9b1229db232c49aaabbc7f0d29465c24cc6508532c6b435aa2f1e98a362531bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ " Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 , Page no:5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "v=28.8*10**-6; #the viscosity of water at 100 degree Celsius in kgf s/m^2\n",
+ "g=9.81; #Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "v=28.8*10**-6*g; # Conversion of unit\n",
+ "\n",
+ "#result\n",
+ "print (\"The viscosity of water at 100 degree Celsius = {:.4e}\".format(v)),\"N s/m^2 (or kg/m s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of water at 100 degree Celsius = 2.8253e-04 N s/m^2 (or kg/m s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "i=950; # radiation flux [W/m^ 2 ]\n",
+ "A=1.5; # area [m^ 2 ]\n",
+ "Ti=61; # inlet temperature\n",
+ "To=69; # outlet temperature\n",
+ "m=1.5; # mass flow rate\n",
+ "M=1.5/60; # kg/sec\n",
+ "Qconductn=50; # W\n",
+ "t=0.95; # transmissivity\n",
+ "a=0.97; # absoptivity\n",
+ "Cp=4183; # J/kg K\n",
+ "\n",
+ "#calculations\n",
+ "q=M*Cp*(To-Ti); # heat gain rate\n",
+ "n=q/(i*A); # thermal efficiency\n",
+ "n_percent=n*100; # thermal efficiency\n",
+ "Qreradiated=(i*A*t*a)-Qconductn-q; # rate at which energy is lost by re-radiation\n",
+ "\n",
+ "#result\n",
+ "print \"Useful heat gain rate is \",round(q,4),\"W\"\n",
+ "print \"Thermal efficiency is\",'%.4E'%n,\"i.e\",round(n_percent,3),\"%\"\n",
+ "print \"The rate at which energy is lost by re-radiation and convection is \", round(Qreradiated,6),\"W\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful heat gain rate is 836.6 W\n",
+ "Thermal efficiency is 5.8709E-01 i.e 58.709 %\n",
+ "The rate at which energy is lost by re-radiation and convection is 426.5375 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "vi=10; # velocity at inlet in m/s\n",
+ "q=1000; # heat in w\n",
+ "di=0.04; # inside diameter in m\n",
+ "do=0.06; # outside diameter in m\n",
+ "den1=0.946; # density in kg/m^3 at 100 degree C\n",
+ "Cp=1009; # specific heat in J/kg k\n",
+ "den2=0.773; # specific heat at To=183.4 degree C\n",
+ "\n",
+ "#calculations\n",
+ "m=den1*(3.14/4)*(di**2)*vi; # kg/s\n",
+ "dh=q/m; # j/kg\n",
+ "To=dh/Cp+100; # Exit Temperature\n",
+ "vo=m/(den2*(3.14/4)*(do)**2); # Exit velocity \n",
+ "dKeKg=(vo**2-vi**2)/2; # Change in Kinetic Energy per kg\n",
+ "\n",
+ "#result\n",
+ "print \"Exit Temperature is\",round(To,4),\"degree C\"\n",
+ "print \"Exit velocity is \",round(vo,4),\"m/s\"\n",
+ "print \"Change in Kinetic Energy per kg =\",round(dKeKg,5),\"J/kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit Temperature is 183.4119 degree C\n",
+ "Exit velocity is 5.4391 m/s\n",
+ "Change in Kinetic Energy per kg = -35.20795 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__8.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__8.ipynb new file mode 100755 index 00000000..2ab3d5d9 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_1_Introduction__8.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9b1229db232c49aaabbc7f0d29465c24cc6508532c6b435aa2f1e98a362531bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ " Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 , Page no:5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "v=28.8*10**-6; #the viscosity of water at 100 degree Celsius in kgf s/m^2\n",
+ "g=9.81; #Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "v=28.8*10**-6*g; # Conversion of unit\n",
+ "\n",
+ "#result\n",
+ "print (\"The viscosity of water at 100 degree Celsius = {:.4e}\".format(v)),\"N s/m^2 (or kg/m s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of water at 100 degree Celsius = 2.8253e-04 N s/m^2 (or kg/m s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "i=950; # radiation flux [W/m^ 2 ]\n",
+ "A=1.5; # area [m^ 2 ]\n",
+ "Ti=61; # inlet temperature\n",
+ "To=69; # outlet temperature\n",
+ "m=1.5; # mass flow rate\n",
+ "M=1.5/60; # kg/sec\n",
+ "Qconductn=50; # W\n",
+ "t=0.95; # transmissivity\n",
+ "a=0.97; # absoptivity\n",
+ "Cp=4183; # J/kg K\n",
+ "\n",
+ "#calculations\n",
+ "q=M*Cp*(To-Ti); # heat gain rate\n",
+ "n=q/(i*A); # thermal efficiency\n",
+ "n_percent=n*100; # thermal efficiency\n",
+ "Qreradiated=(i*A*t*a)-Qconductn-q; # rate at which energy is lost by re-radiation\n",
+ "\n",
+ "#result\n",
+ "print \"Useful heat gain rate is \",round(q,4),\"W\"\n",
+ "print \"Thermal efficiency is\",'%.4E'%n,\"i.e\",round(n_percent,3),\"%\"\n",
+ "print \"The rate at which energy is lost by re-radiation and convection is \", round(Qreradiated,6),\"W\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful heat gain rate is 836.6 W\n",
+ "Thermal efficiency is 5.8709E-01 i.e 58.709 %\n",
+ "The rate at which energy is lost by re-radiation and convection is 426.5375 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable declaration\n",
+ "vi=10; # velocity at inlet in m/s\n",
+ "q=1000; # heat in w\n",
+ "di=0.04; # inside diameter in m\n",
+ "do=0.06; # outside diameter in m\n",
+ "den1=0.946; # density in kg/m^3 at 100 degree C\n",
+ "Cp=1009; # specific heat in J/kg k\n",
+ "den2=0.773; # specific heat at To=183.4 degree C\n",
+ "\n",
+ "#calculations\n",
+ "m=den1*(3.14/4)*(di**2)*vi; # kg/s\n",
+ "dh=q/m; # j/kg\n",
+ "To=dh/Cp+100; # Exit Temperature\n",
+ "vo=m/(den2*(3.14/4)*(do)**2); # Exit velocity \n",
+ "dKeKg=(vo**2-vi**2)/2; # Change in Kinetic Energy per kg\n",
+ "\n",
+ "#result\n",
+ "print \"Exit Temperature is\",round(To,4),\"degree C\"\n",
+ "print \"Exit velocity is \",round(vo,4),\"m/s\"\n",
+ "print \"Change in Kinetic Energy per kg =\",round(dKeKg,5),\"J/kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit Temperature is 183.4119 degree C\n",
+ "Exit velocity is 5.4391 m/s\n",
+ "Change in Kinetic Energy per kg = -35.20795 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids_.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids_.ipynb new file mode 100755 index 00000000..7143a80a --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids_.ipynb @@ -0,0 +1,1017 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32bc9bb5fc4ebce1f381403610ab4e977682e421d539322e9a2067d2e8eedb87"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Heat Conduction in Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius m\n",
+ "do=0.04; #inner radius m\n",
+ "ri=di/2; #inner radius m\n",
+ "ro=do/2; #inner radius m\n",
+ "k=0.58; #thermal conductivity of tube material w/m K\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length m\n",
+ "\n",
+ "#calculations\n",
+ "q=l*2*(3.14)*k*(ti-to)/math.log(ro/ri);\n",
+ "\n",
+ "#result\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per unit length is -157.6462 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius\n",
+ "do=0.04; #outer radius\n",
+ "ri=di/2; #inner radius\n",
+ "ro=do/2; #outer radius\n",
+ "k=0.58; #thermal conductivity of tube material\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length\n",
+ "h=5000; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Rthtube=(math.log(ro/ri))/(2*3.14*k*l); #thermal resistance of tube per unit length\n",
+ "Rthcond=1/(3.14*do*l*h); #thermal resistance of condensing steam per unit length\n",
+ "q=l*2*(3.14)*k*(ti-100)/math.log(ro/ri); #heat flow rate per unit meter \n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of tube per unit length is\",round(Rthtube,4),\"K/W\";\n",
+ "print\"Thermal resistance of condensing steam perunit length is\",round(Rthcond,5),\"K/W\";\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"K/W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of tube per unit length is 0.1903 K/W\n",
+ "Thermal resistance of condensing steam perunit length is 0.00159 K/W\n",
+ "Heat flow per unit length is -157.6462 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hw=140; #heat transfer coefficient on water side\n",
+ "ho=150; #heat transfer coefficient on oil side\n",
+ "k=30; #thermal conductivity\n",
+ "ro=0.1; #inner diameter of GI pipe on inside\n",
+ "ri=0.008; #outer diameter of GI pipe on inside\n",
+ "l=1; #per unit length\n",
+ "\n",
+ "#calculations\n",
+ "RinnerGI=math.log((ro/ri))/(2*3.14*k*l); #Thermal resistance of inner GI pipe\n",
+ "Roilside=1/(ho*3.14*2*ri*l); #Thermal resistanceon the oil side per unit length\n",
+ "Rwaterside=1/(hw*3.14*2*ro*l); #Thermal resistanceon the water side per unit length\n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of inner GI pipe =\",round(RinnerGI,5),\"K/W\";\n",
+ "print\"Thermal resistance on the oil side perunit length =\",round(Roilside,5),\"K/W\";\n",
+ "print\"Thermal resistance on cold water side per unit length =\",round(Rwaterside,5),\"K/W\";\n",
+ "print\"So,Engineer in-charge has made a bad decision\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of inner GI pipe = 0.01341 K/W\n",
+ "Thermal resistance on the oil side perunit length = 0.1327 K/W\n",
+ "Thermal resistance on cold water side per unit length = 0.01137 K/W\n",
+ "So,Engineer in-charge has made a bad decision\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=300; #Internal temp of hot gas in degree Celsius\n",
+ "od=0.1; #Outer diameter of long metal pipe in meters\n",
+ "i_d=0.04; #Internal diamtere of long metal pipe in meters\n",
+ "ki=0.052; #thermal conductivity of mineral wood in W/mK\n",
+ "to=50; #Outer surface temperature in degree celsius\n",
+ "hi=29; #heat transfer coefficient in the inner side in W/m^2 K\n",
+ "ho=12; #heat transfer coefficient in the outer pipe W/m^2 K\n",
+ "t=25; # Surrounding temperature in degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "#Determination of thickness of insulation\n",
+ "#By solving the following two equations by trial and error method for r3\n",
+ "#q_L=2*3.14*0.047*(t1-t)/(1/hi+(0.047/ki)*2.303*math.log(r3/od/2)+(0.047/h0*r3));\n",
+ "#q_L=2*3.14*h0*(to-t);\n",
+ "#By trial and error we get\n",
+ "r3=0.082; #in m\n",
+ "t=r3-(od/2);\n",
+ "#Heat loss per unit length\n",
+ "q=600*(22/7)*r3;\n",
+ "\n",
+ "#Result\n",
+ "print\"Thickness of insulation =\",t*100,\"cm\";\n",
+ "print\"Heat loss per unit length =\",round(q,1),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 3.2 cm\n",
+ "Heat loss per unit length = 154.6 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=90; #Temp on inner side in degree celsius\n",
+ "to=30; #Temp on outer side in degree celsius\n",
+ "hi=500; #heat transfer coeffcient in W/m^2 K\n",
+ "ho=10; #heat transfer coeffcient in W/m^2 K\n",
+ "i_d=0.016; #Internal diameter in meters\n",
+ "od=0.02; #Outer diameter in meters\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "r3=np.linspace (0.01,0.06,12);\n",
+ "t=[0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5]\n",
+ "q_L=(2*(3.14)*(i_d/2)*(ti-to))/((1/hi)+(0.008/0.2)*np.log(r3/0.01) + (0.008/r3*(1/ho)));\n",
+ "\n",
+ "#Result\n",
+ "print \"Insulaion thickness (cm)\", \" r3 (m)\",\" Heat loss rate per meter (W/m) \" \n",
+ "print \" \",t[0],\" \",0.01,\" \",round(q_L[0],1),\"(roundoff error)\"\n",
+ "print \" \",t[1],\" \",0.015,\" \", round(q_L[1],1),\"(roundoff error)\"\n",
+ "print \" \",t[2],\" \",0.02,\" \",round(q_L[2],1),\"(roundoff error)\"\n",
+ "print \" \",t[4],\" \",0.03,\" \",round(q_L[4],1),\"(roundoff error)\"\n",
+ "print \" \",t[6],\" \",0.04,\" \",round(q_L[6],1),\"(roundoff error)\"\n",
+ "print \" \",t[8],\" \",0.05,\" \",round(q_L[8],1),\"(roundoff error)\"\n",
+ "print \" \",t[10],\" \",0.06,\" \",round(q_L[10],1),\"(roundoff error)\"\n",
+ "plt.plot (t,q_L);\n",
+ "plt.title (\"Variation of heat loss rate with insulation thickness\");\n",
+ "plt.xlabel(\" Insulation thickness in cm\");\n",
+ "plt.ylabel(\" Heat Loss in W/m \");\n",
+ "plt.show();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Insulaion thickness (cm) r3 (m) Heat loss rate per meter (W/m) \n",
+ " 0 0.01 36.8 (roundoff error)\n",
+ " 0.5 0.015 41.9 (roundoff error)\n",
+ " 1 0.02 43.2 (roundoff error)\n",
+ " 2 0.03 42.0 (roundoff error)\n",
+ " 3 0.04 39.6 (roundoff error)\n",
+ " 4 0.05 37.4 (roundoff error)\n",
+ " 5 0.06 35.5 (roundoff error)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEVCAYAAAAM3jVmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdcU2f3APCTsPfeIENE2YSpoIIi4gK3dQEO1OpbtWqt\nYh3UuuqoVVurdaDgrrWKiCIqQwVBZYnUDQKCArI3Se7vj/vm15SXESDhhuR8P5/7UZLce8+9hJMn\nz33ueWgEQQBCCCHxQKc6AIQQQr0Hkz5CCIkRTPoIISRGMOkjhJAYwaSPEEJiBJM+QgiJEUz6HVBS\nUqrJy8sz6c66Z8+enePr6xvD55A69fDhQ48BAwa8VlJSqomMjPRv/byJiUne3bt3vXs7LgAALy+v\n+BMnTiykYt/CIj8/v5+SklINQRC09l5Dp9PZ7969M+Nlezt37gxZtGjRMf5F+L9CQ0NDAwICIrq7\nvo2NTXZiYuJwfsbUno7OHa9/kz09XmEnMkl/zJgxt7Zs2fJ968evXbs2UU9Pr5jNZnf5WGtqapRM\nTEzyOntdXl6eCZ1OZ3PvY86cOWdjYmJ8u7rPntq8efPWFStWHKypqVHy9/ePbP08jUYjaDQa32/O\nOHXq1Lxhw4bd7+g1gto3v3Ql2XZXv3798mtqapQ456GnH4QhISE7jx07toh/Ef6vrvzO5s2bd2rT\npk0/cD+WnZ1tM3z48ER+x9XVc8fr36Qwv0f5QWSS/rx5806dOXNmbuvHIyIiAubOnXuGTqezed0W\nk8mU7E4MHbXeekt+fn4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09\nH0j4YNJHAkEQBC0/P7+fl5dX/K5du9ZXVVWp1NXVKZiYmORxkmFaWppjbm6uaet1q6urlbW1tUsk\nJCRYcXFxI96/f28MAKCkpFTDKZzV2rBhw+6fPXt2DgDAq1evLPLz8/sNGjToRVsJra3HlJSUaqqr\nq5V5OS6CIGiKioq1hoaGhZyJfpqammQaGhrkCIKgqaqqVkZFRU0ICQnZmZCQ4NnetjjfQi5fvjyt\ntLRUCwCgvLxcPT8/v9/nz581mEym5JQpU6788MMPm9LS0hzbO6cdxdrZ8bi5uaUkJiYO57Tc+T0i\nCwkf/LRG3cI9/0HruRBoNBrBYrEkAgICIqqqqlQIgqCtXLnygLKycvXUqVP/DA8PD7Sxscl2c3NL\nGThw4MvW25kzZ85ZPz+/63Z2dlnOzs5PLC0t/wYA0NDQ+Ozh4fHQ1tb22bhx46KXLVt2mLPOsmXL\nDi9duvQ3Ozu7LElJSebp06eDpKSkWmg0GtFWfK2PZ/Hixb+PGTPmloGBwYe7d+96tz4+zs/c/4+I\niAhYsmTJ0c2bN2+VlpZuvnTp0gzO89ra2iVRUVETxo4de/PkyZML2tuvpaXl39u2bds4evTo22w2\nmy4lJdVy+PDhZbKyso3z588P43wr2rVr1/r2zmnrY2sr1vZoaWmV/v7774unTJlyhc1m03V0dD7F\nxMT48vI77mi7SHhhwTWEEBIj2L2DEEJiBJM+QgiJEUz6CCEkRjDpI4SQGMGkjxBCYgSTPkIIiZH/\nAxLp4OAIwDpgAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4fccf30>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hnatural = 10; #heat transfer coefficient for natural \n",
+ "hforced = 50; #heat transfer coefficient for forced\n",
+ "k1 = 0.2; #thermal conductivity\n",
+ "k2 = 0.05; #thermal conductivity\n",
+ "\n",
+ "#result\n",
+ "print\"critical radius of insulation in cm\";\n",
+ "print\"\\n h=10 h=50\";\n",
+ "print\"\\nAsbestos \",k1 *100/ hnatural,\" \", k1*100/ hforced;\n",
+ "print\"\\nMineral wool \",k2 *100/ hnatural,\" \", k2*100/ hforced;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical radius of insulation in cm\n",
+ "\n",
+ " h=10 h=50\n",
+ "\n",
+ "Asbestos 2.0 0.4\n",
+ "\n",
+ "Mineral wool 0.5 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=5; #Height\n",
+ "l=10; #Length\n",
+ "t=1; #thickness\n",
+ "k=1.05; #W/m K\n",
+ "q=58; #W/m^3\n",
+ "t1=35; #c\n",
+ "h=11.6; #Heat transfer coefficient\n",
+ "\n",
+ "#calculations\n",
+ "b=t/2;\n",
+ "tmax=t1+q*b*(b/(2*k)+1/h);\n",
+ "\n",
+ "#result\n",
+ "print\"Maximum Temperature =\",round(tmax,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Temperature = 44.405 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#The bar will have two dimensional variation in temperature\n",
+ "#the differential equation is subject to boundary conditions\n",
+ "x1 = 0; #cm\n",
+ "Tx1 = 30; #C\n",
+ "x2 = 5; #cm\n",
+ "Tx2 = 30; #C\n",
+ "y1 = 0; #cm\n",
+ "Ty1 = 30; #C\n",
+ "y2 = 10; #cm\n",
+ "Ty2 = 130; #C\n",
+ "\n",
+ "#substituting theta = T-30 and using eqn 2.6.11\n",
+ "#putting x = 2.5cm and y = 5cm in infinite summation series\n",
+ "n = 1;\n",
+ "x1 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 3;\n",
+ "x2 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 5;\n",
+ "x3 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "x = x1+x3+x3;\n",
+ "T = x *100+30;\n",
+ "\n",
+ "#result\n",
+ "print \"Steady statetemper a ture= \",T,\"c (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady statetemper a ture= 33.1695223665 c (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k = 330; #thermal conductivity\n",
+ "a = 95*10**(-6); #thermal expansion coefficient\n",
+ "R = 0.01; #radius in meters\n",
+ "To = 77; #temperature in kelvins\n",
+ "Tf = 273+50; #temperature in kelvins\n",
+ "theta1 = To - Tf; \n",
+ "T = 273+10; ##temperature in kelvins\n",
+ "theta = T - Tf;\n",
+ "h = 20; #heat transfer coefficient in W/m^2 K\n",
+ "\n",
+ "print\"Theta1 =\",theta1,\"K\";\n",
+ "print\"Theta =\",theta,\"K\";\n",
+ "print\"v/A =\",R/2,\"m\";\n",
+ "print\"k/a =\",round((k/a)*10**(-6),4),\"*10^(6)J/m^3 K\";\n",
+ "\n",
+ "time =(k/a)*(R/2)/h*math.log(theta1/theta);\n",
+ "\n",
+ "print\"Time taken by the rod to heat up =\",round(time,1),\"secs\";\n",
+ "\n",
+ "Bi = h*R/k;\n",
+ "\n",
+ "#result\n",
+ "print\"Biot number Bi =\",round(Bi*10**4,2),\"*10^(-4)\";\n",
+ "print\"Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta1 = -246 K\n",
+ "Theta = -40 K\n",
+ "v/A = 0.005 m\n",
+ "k/a = 3.4737 *10^(6)J/m^3 K\n",
+ "Time taken by the rod to heat up = 1577.4 secs\n",
+ "Biot number Bi = 6.06 *10^(-4)\n",
+ "Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(1) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20 ; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12; \n",
+ "ratiob1 = 0.48; \n",
+ "lambda1b = 1.0498; \n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho*Cp); #alpha\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta*ratiob0;\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "thetaxb1 = theta*ratiob1 ;\n",
+ "Txb1 = thetaxb1+Tw ;\n",
+ "\n",
+ "x = (2*math.sin((lambda1b)))/(lambda1b+((math.sin((lambda1b)))*(math.cos((lambda1b)))));\n",
+ "thetaxb0 = theta*x*(math.exp((-lambda1b**2)*Fourierno));\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=0 is\",round(Txb0,4),\"degree\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=0 is 41.3418 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(2) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12;\n",
+ "ratiob1 = 0.48;\n",
+ "lambda1b = 1.0498;\n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho *Cp);\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta * ratiob0;\n",
+ "Txb0 = thetaxb0 + Tw;\n",
+ "thetaxb1 = theta * ratiob1;\n",
+ "Txb1 = thetaxb1 + Tw;\n",
+ "x = 2*math.sin(((lambda1b)))/(lambda1b + (math.sin(((lambda1b))))*(math.cos((lambda1b))));\n",
+ "thetaxb1 = thetaxb0*(math.cos (lambda1b *1));\n",
+ "Txb1 = thetaxb1+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=1 is\",round(Txb1,3),\"degree C\\n\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=1 is 30.751 degree C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(1) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2; \n",
+ "\n",
+ "#calculations\n",
+ "t1 = rho*Cp*R /(3* h)* math.log ((To -Tf)/(T-Tf)); #sec\n",
+ "t1min = t1 /60 ; #min\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is\",round(t1,4),\"seconds i.e.\",round(t1min,4),\"minutes\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is 436.2545 seconds i.e. 7.2709 minutes\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(2) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2;\n",
+ "lambda1R = 0.430;\n",
+ "y = 5;\n",
+ "\n",
+ "#calculations\n",
+ "ratio = (T-Tf)/( To - Tf);\n",
+ "Bi = h*R/k;\n",
+ "x = 2* (math.sin(lambda1R)- lambda1R * math.cos(lambda1R))/ (lambda1R - math.sin ( lambda1R)*math.cos( lambda1R));\n",
+ "t=(math.log (ratio/x))/(-1*(k/(Cp*rho*R**2))*lambda1R**2);\n",
+ "tmin = t /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree\" \n",
+ "print \"C if internal temperature gradients are not neglected is\",round(t,3),\"seconds i.e\",round(tmin,3),\"min (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree\n",
+ "C if internal temperature gradients are not neglected is 446.95 seconds i.e 7.449 min (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.12 ; #m\n",
+ "T = 400 ; #C\n",
+ "To = 25 ; #C\n",
+ "t = 100/60 ; #hour\n",
+ "h = 10 ; #W/m^2 K\n",
+ "k = 1.0 ; #W/m K\n",
+ "alpha = 3.33*10** -3 ; #m^2/h\n",
+ "ratiox = 0.82 ;\n",
+ "ratioy = 0.41;\n",
+ "ratioz = 0.30;\n",
+ "\n",
+ "#calculations\n",
+ "x1 = h*a/k ;\n",
+ "x2 = k/(h*a);\n",
+ "x3 = alpha *t/a**2;\n",
+ "totalratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "ratiox = 1.1310* math.exp ( -(0.9036**2) *0.385) ;\n",
+ "ratioy = 1.0701* math.exp ( -(0.6533**2) *2.220) ;\n",
+ "ratioz = 1.0580* math.exp ( -(0.5932**2) *3.469) ;\n",
+ "ratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";\n",
+ "print\"Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\";\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the brick = 62.822 degree c\n",
+ "Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\n",
+ "Temperature at the centre of the brick = 62.822 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(1) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 350 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of copper is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.1852\n",
+ "Temperature at the tip of fin made of copper is 118.3099 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(2) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "l = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 15 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4*h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*l);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of steel is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.8944\n",
+ "Temperature at the tip of fin made of steel is 90.058 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(3) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 0.35 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "mL = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(mL,4);\n",
+ "print\"Temperature at the tip of fin made of teflon is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 5.8554\n",
+ "Temperature at the tip of fin made of teflon is 20.5729 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.02 ; #M\n",
+ "t = 0.002 ; #M\n",
+ "b = 0.2 ; #M\n",
+ "theta1 = 200 ; #C\n",
+ "h = 15 ; #W/m^2 K\n",
+ "k = 45 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*(t /2) /k ;\n",
+ "P = 2*( b+t); #m\n",
+ "A = b*t ;\n",
+ "mL = math.sqrt((h*P)/(A*k))*L;\n",
+ "n = math.tanh(mL)/mL;\n",
+ "qloss = n*h *40.4*2*10**-4*200;\n",
+ "\n",
+ "#result\n",
+ "print\"Fin Effectiveness =\",round(n,3);\n",
+ "print\"Heat loss rate from fin surface =\",round(qloss,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fin Effectiveness = 0.957\n",
+ "Heat loss rate from fin surface = 23.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 15 ; #W/m^2 .K\n",
+ "k = 300; #W/m.K\n",
+ "T = 200; #C\n",
+ "Tsurr = 30; #C\n",
+ "d = .01; #M\n",
+ "L = .1; #M #\n",
+ "A = .5*.5; #M^2\n",
+ "n = 100; #Number of Pins\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*d /2/ k; #Biot Number\n",
+ "mL = (h *4/ k/d) **.5* L; \n",
+ "zi = math.tanh (mL)/mL;\n",
+ "Res1 = 1/h/A; #Thermal resistance without fins\n",
+ "Res2 = 1/(h*(A - n*3.14 /4* d**2 + zi *(n* 3.14 *d*L))); #Thermal resistance with fins\n",
+ "delRes = Res1 - Res2 ; #heat transfer rate\n",
+ "q = (T- Tsurr )/ Res2 - (T- Tsurr )/ Res1 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Decrease in thermal resistaneat surface\",round(delRes,4),\"k/w\",\"\\nIncrease in heattransfer rate\",round(q,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in thermal resistaneat surface 0.1425 k/w \n",
+ "Increase in heattransfer rate 731.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__1.ipynb new file mode 100755 index 00000000..7143a80a --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__1.ipynb @@ -0,0 +1,1017 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32bc9bb5fc4ebce1f381403610ab4e977682e421d539322e9a2067d2e8eedb87"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Heat Conduction in Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius m\n",
+ "do=0.04; #inner radius m\n",
+ "ri=di/2; #inner radius m\n",
+ "ro=do/2; #inner radius m\n",
+ "k=0.58; #thermal conductivity of tube material w/m K\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length m\n",
+ "\n",
+ "#calculations\n",
+ "q=l*2*(3.14)*k*(ti-to)/math.log(ro/ri);\n",
+ "\n",
+ "#result\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per unit length is -157.6462 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius\n",
+ "do=0.04; #outer radius\n",
+ "ri=di/2; #inner radius\n",
+ "ro=do/2; #outer radius\n",
+ "k=0.58; #thermal conductivity of tube material\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length\n",
+ "h=5000; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Rthtube=(math.log(ro/ri))/(2*3.14*k*l); #thermal resistance of tube per unit length\n",
+ "Rthcond=1/(3.14*do*l*h); #thermal resistance of condensing steam per unit length\n",
+ "q=l*2*(3.14)*k*(ti-100)/math.log(ro/ri); #heat flow rate per unit meter \n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of tube per unit length is\",round(Rthtube,4),\"K/W\";\n",
+ "print\"Thermal resistance of condensing steam perunit length is\",round(Rthcond,5),\"K/W\";\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"K/W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of tube per unit length is 0.1903 K/W\n",
+ "Thermal resistance of condensing steam perunit length is 0.00159 K/W\n",
+ "Heat flow per unit length is -157.6462 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hw=140; #heat transfer coefficient on water side\n",
+ "ho=150; #heat transfer coefficient on oil side\n",
+ "k=30; #thermal conductivity\n",
+ "ro=0.1; #inner diameter of GI pipe on inside\n",
+ "ri=0.008; #outer diameter of GI pipe on inside\n",
+ "l=1; #per unit length\n",
+ "\n",
+ "#calculations\n",
+ "RinnerGI=math.log((ro/ri))/(2*3.14*k*l); #Thermal resistance of inner GI pipe\n",
+ "Roilside=1/(ho*3.14*2*ri*l); #Thermal resistanceon the oil side per unit length\n",
+ "Rwaterside=1/(hw*3.14*2*ro*l); #Thermal resistanceon the water side per unit length\n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of inner GI pipe =\",round(RinnerGI,5),\"K/W\";\n",
+ "print\"Thermal resistance on the oil side perunit length =\",round(Roilside,5),\"K/W\";\n",
+ "print\"Thermal resistance on cold water side per unit length =\",round(Rwaterside,5),\"K/W\";\n",
+ "print\"So,Engineer in-charge has made a bad decision\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of inner GI pipe = 0.01341 K/W\n",
+ "Thermal resistance on the oil side perunit length = 0.1327 K/W\n",
+ "Thermal resistance on cold water side per unit length = 0.01137 K/W\n",
+ "So,Engineer in-charge has made a bad decision\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=300; #Internal temp of hot gas in degree Celsius\n",
+ "od=0.1; #Outer diameter of long metal pipe in meters\n",
+ "i_d=0.04; #Internal diamtere of long metal pipe in meters\n",
+ "ki=0.052; #thermal conductivity of mineral wood in W/mK\n",
+ "to=50; #Outer surface temperature in degree celsius\n",
+ "hi=29; #heat transfer coefficient in the inner side in W/m^2 K\n",
+ "ho=12; #heat transfer coefficient in the outer pipe W/m^2 K\n",
+ "t=25; # Surrounding temperature in degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "#Determination of thickness of insulation\n",
+ "#By solving the following two equations by trial and error method for r3\n",
+ "#q_L=2*3.14*0.047*(t1-t)/(1/hi+(0.047/ki)*2.303*math.log(r3/od/2)+(0.047/h0*r3));\n",
+ "#q_L=2*3.14*h0*(to-t);\n",
+ "#By trial and error we get\n",
+ "r3=0.082; #in m\n",
+ "t=r3-(od/2);\n",
+ "#Heat loss per unit length\n",
+ "q=600*(22/7)*r3;\n",
+ "\n",
+ "#Result\n",
+ "print\"Thickness of insulation =\",t*100,\"cm\";\n",
+ "print\"Heat loss per unit length =\",round(q,1),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 3.2 cm\n",
+ "Heat loss per unit length = 154.6 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=90; #Temp on inner side in degree celsius\n",
+ "to=30; #Temp on outer side in degree celsius\n",
+ "hi=500; #heat transfer coeffcient in W/m^2 K\n",
+ "ho=10; #heat transfer coeffcient in W/m^2 K\n",
+ "i_d=0.016; #Internal diameter in meters\n",
+ "od=0.02; #Outer diameter in meters\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "r3=np.linspace (0.01,0.06,12);\n",
+ "t=[0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5]\n",
+ "q_L=(2*(3.14)*(i_d/2)*(ti-to))/((1/hi)+(0.008/0.2)*np.log(r3/0.01) + (0.008/r3*(1/ho)));\n",
+ "\n",
+ "#Result\n",
+ "print \"Insulaion thickness (cm)\", \" r3 (m)\",\" Heat loss rate per meter (W/m) \" \n",
+ "print \" \",t[0],\" \",0.01,\" \",round(q_L[0],1),\"(roundoff error)\"\n",
+ "print \" \",t[1],\" \",0.015,\" \", round(q_L[1],1),\"(roundoff error)\"\n",
+ "print \" \",t[2],\" \",0.02,\" \",round(q_L[2],1),\"(roundoff error)\"\n",
+ "print \" \",t[4],\" \",0.03,\" \",round(q_L[4],1),\"(roundoff error)\"\n",
+ "print \" \",t[6],\" \",0.04,\" \",round(q_L[6],1),\"(roundoff error)\"\n",
+ "print \" \",t[8],\" \",0.05,\" \",round(q_L[8],1),\"(roundoff error)\"\n",
+ "print \" \",t[10],\" \",0.06,\" \",round(q_L[10],1),\"(roundoff error)\"\n",
+ "plt.plot (t,q_L);\n",
+ "plt.title (\"Variation of heat loss rate with insulation thickness\");\n",
+ "plt.xlabel(\" Insulation thickness in cm\");\n",
+ "plt.ylabel(\" Heat Loss in W/m \");\n",
+ "plt.show();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Insulaion thickness (cm) r3 (m) Heat loss rate per meter (W/m) \n",
+ " 0 0.01 36.8 (roundoff error)\n",
+ " 0.5 0.015 41.9 (roundoff error)\n",
+ " 1 0.02 43.2 (roundoff error)\n",
+ " 2 0.03 42.0 (roundoff error)\n",
+ " 3 0.04 39.6 (roundoff error)\n",
+ " 4 0.05 37.4 (roundoff error)\n",
+ " 5 0.06 35.5 (roundoff error)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEVCAYAAAAM3jVmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdcU2f3APCTsPfeIENE2YSpoIIi4gK3dQEO1OpbtWqt\nYh3UuuqoVVurdaDgrrWKiCIqQwVBZYnUDQKCArI3Se7vj/v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ElJSebp06eDpKSkWmg0GtFWfK2PZ/Hixb+PGTPmloGBwYe7d+96tz4+zs/c/4+I\niAhYsmTJ0c2bN2+VlpZuvnTp0gzO89ra2iVRUVETxo4de/PkyZML2tuvpaXl39u2bds4evTo22w2\nmy4lJdVy+PDhZbKyso3z588P43wr2rVr1/r2zmnrY2sr1vZoaWmV/v7774unTJlyhc1m03V0dD7F\nxMT48vI77mi7SHhhwTWEEBIj2L2DEEJiBJM+QgiJEUz6CCEkRjDpI4SQGMGkjxBCYgSTPkIIiZH/\nAxLp4OAIwDpgAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4fccf30>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hnatural = 10; #heat transfer coefficient for natural \n",
+ "hforced = 50; #heat transfer coefficient for forced\n",
+ "k1 = 0.2; #thermal conductivity\n",
+ "k2 = 0.05; #thermal conductivity\n",
+ "\n",
+ "#result\n",
+ "print\"critical radius of insulation in cm\";\n",
+ "print\"\\n h=10 h=50\";\n",
+ "print\"\\nAsbestos \",k1 *100/ hnatural,\" \", k1*100/ hforced;\n",
+ "print\"\\nMineral wool \",k2 *100/ hnatural,\" \", k2*100/ hforced;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical radius of insulation in cm\n",
+ "\n",
+ " h=10 h=50\n",
+ "\n",
+ "Asbestos 2.0 0.4\n",
+ "\n",
+ "Mineral wool 0.5 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=5; #Height\n",
+ "l=10; #Length\n",
+ "t=1; #thickness\n",
+ "k=1.05; #W/m K\n",
+ "q=58; #W/m^3\n",
+ "t1=35; #c\n",
+ "h=11.6; #Heat transfer coefficient\n",
+ "\n",
+ "#calculations\n",
+ "b=t/2;\n",
+ "tmax=t1+q*b*(b/(2*k)+1/h);\n",
+ "\n",
+ "#result\n",
+ "print\"Maximum Temperature =\",round(tmax,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Temperature = 44.405 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#The bar will have two dimensional variation in temperature\n",
+ "#the differential equation is subject to boundary conditions\n",
+ "x1 = 0; #cm\n",
+ "Tx1 = 30; #C\n",
+ "x2 = 5; #cm\n",
+ "Tx2 = 30; #C\n",
+ "y1 = 0; #cm\n",
+ "Ty1 = 30; #C\n",
+ "y2 = 10; #cm\n",
+ "Ty2 = 130; #C\n",
+ "\n",
+ "#substituting theta = T-30 and using eqn 2.6.11\n",
+ "#putting x = 2.5cm and y = 5cm in infinite summation series\n",
+ "n = 1;\n",
+ "x1 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 3;\n",
+ "x2 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 5;\n",
+ "x3 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "x = x1+x3+x3;\n",
+ "T = x *100+30;\n",
+ "\n",
+ "#result\n",
+ "print \"Steady statetemper a ture= \",T,\"c (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady statetemper a ture= 33.1695223665 c (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k = 330; #thermal conductivity\n",
+ "a = 95*10**(-6); #thermal expansion coefficient\n",
+ "R = 0.01; #radius in meters\n",
+ "To = 77; #temperature in kelvins\n",
+ "Tf = 273+50; #temperature in kelvins\n",
+ "theta1 = To - Tf; \n",
+ "T = 273+10; ##temperature in kelvins\n",
+ "theta = T - Tf;\n",
+ "h = 20; #heat transfer coefficient in W/m^2 K\n",
+ "\n",
+ "print\"Theta1 =\",theta1,\"K\";\n",
+ "print\"Theta =\",theta,\"K\";\n",
+ "print\"v/A =\",R/2,\"m\";\n",
+ "print\"k/a =\",round((k/a)*10**(-6),4),\"*10^(6)J/m^3 K\";\n",
+ "\n",
+ "time =(k/a)*(R/2)/h*math.log(theta1/theta);\n",
+ "\n",
+ "print\"Time taken by the rod to heat up =\",round(time,1),\"secs\";\n",
+ "\n",
+ "Bi = h*R/k;\n",
+ "\n",
+ "#result\n",
+ "print\"Biot number Bi =\",round(Bi*10**4,2),\"*10^(-4)\";\n",
+ "print\"Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta1 = -246 K\n",
+ "Theta = -40 K\n",
+ "v/A = 0.005 m\n",
+ "k/a = 3.4737 *10^(6)J/m^3 K\n",
+ "Time taken by the rod to heat up = 1577.4 secs\n",
+ "Biot number Bi = 6.06 *10^(-4)\n",
+ "Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(1) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20 ; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12; \n",
+ "ratiob1 = 0.48; \n",
+ "lambda1b = 1.0498; \n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho*Cp); #alpha\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta*ratiob0;\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "thetaxb1 = theta*ratiob1 ;\n",
+ "Txb1 = thetaxb1+Tw ;\n",
+ "\n",
+ "x = (2*math.sin((lambda1b)))/(lambda1b+((math.sin((lambda1b)))*(math.cos((lambda1b)))));\n",
+ "thetaxb0 = theta*x*(math.exp((-lambda1b**2)*Fourierno));\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=0 is\",round(Txb0,4),\"degree\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=0 is 41.3418 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(2) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12;\n",
+ "ratiob1 = 0.48;\n",
+ "lambda1b = 1.0498;\n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho *Cp);\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta * ratiob0;\n",
+ "Txb0 = thetaxb0 + Tw;\n",
+ "thetaxb1 = theta * ratiob1;\n",
+ "Txb1 = thetaxb1 + Tw;\n",
+ "x = 2*math.sin(((lambda1b)))/(lambda1b + (math.sin(((lambda1b))))*(math.cos((lambda1b))));\n",
+ "thetaxb1 = thetaxb0*(math.cos (lambda1b *1));\n",
+ "Txb1 = thetaxb1+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=1 is\",round(Txb1,3),\"degree C\\n\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=1 is 30.751 degree C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(1) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2; \n",
+ "\n",
+ "#calculations\n",
+ "t1 = rho*Cp*R /(3* h)* math.log ((To -Tf)/(T-Tf)); #sec\n",
+ "t1min = t1 /60 ; #min\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is\",round(t1,4),\"seconds i.e.\",round(t1min,4),\"minutes\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is 436.2545 seconds i.e. 7.2709 minutes\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(2) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2;\n",
+ "lambda1R = 0.430;\n",
+ "y = 5;\n",
+ "\n",
+ "#calculations\n",
+ "ratio = (T-Tf)/( To - Tf);\n",
+ "Bi = h*R/k;\n",
+ "x = 2* (math.sin(lambda1R)- lambda1R * math.cos(lambda1R))/ (lambda1R - math.sin ( lambda1R)*math.cos( lambda1R));\n",
+ "t=(math.log (ratio/x))/(-1*(k/(Cp*rho*R**2))*lambda1R**2);\n",
+ "tmin = t /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree\" \n",
+ "print \"C if internal temperature gradients are not neglected is\",round(t,3),\"seconds i.e\",round(tmin,3),\"min (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree\n",
+ "C if internal temperature gradients are not neglected is 446.95 seconds i.e 7.449 min (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.12 ; #m\n",
+ "T = 400 ; #C\n",
+ "To = 25 ; #C\n",
+ "t = 100/60 ; #hour\n",
+ "h = 10 ; #W/m^2 K\n",
+ "k = 1.0 ; #W/m K\n",
+ "alpha = 3.33*10** -3 ; #m^2/h\n",
+ "ratiox = 0.82 ;\n",
+ "ratioy = 0.41;\n",
+ "ratioz = 0.30;\n",
+ "\n",
+ "#calculations\n",
+ "x1 = h*a/k ;\n",
+ "x2 = k/(h*a);\n",
+ "x3 = alpha *t/a**2;\n",
+ "totalratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "ratiox = 1.1310* math.exp ( -(0.9036**2) *0.385) ;\n",
+ "ratioy = 1.0701* math.exp ( -(0.6533**2) *2.220) ;\n",
+ "ratioz = 1.0580* math.exp ( -(0.5932**2) *3.469) ;\n",
+ "ratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";\n",
+ "print\"Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\";\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the brick = 62.822 degree c\n",
+ "Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\n",
+ "Temperature at the centre of the brick = 62.822 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(1) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 350 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of copper is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.1852\n",
+ "Temperature at the tip of fin made of copper is 118.3099 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(2) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "l = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 15 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4*h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*l);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of steel is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.8944\n",
+ "Temperature at the tip of fin made of steel is 90.058 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(3) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 0.35 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "mL = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(mL,4);\n",
+ "print\"Temperature at the tip of fin made of teflon is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 5.8554\n",
+ "Temperature at the tip of fin made of teflon is 20.5729 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.02 ; #M\n",
+ "t = 0.002 ; #M\n",
+ "b = 0.2 ; #M\n",
+ "theta1 = 200 ; #C\n",
+ "h = 15 ; #W/m^2 K\n",
+ "k = 45 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*(t /2) /k ;\n",
+ "P = 2*( b+t); #m\n",
+ "A = b*t ;\n",
+ "mL = math.sqrt((h*P)/(A*k))*L;\n",
+ "n = math.tanh(mL)/mL;\n",
+ "qloss = n*h *40.4*2*10**-4*200;\n",
+ "\n",
+ "#result\n",
+ "print\"Fin Effectiveness =\",round(n,3);\n",
+ "print\"Heat loss rate from fin surface =\",round(qloss,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fin Effectiveness = 0.957\n",
+ "Heat loss rate from fin surface = 23.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 15 ; #W/m^2 .K\n",
+ "k = 300; #W/m.K\n",
+ "T = 200; #C\n",
+ "Tsurr = 30; #C\n",
+ "d = .01; #M\n",
+ "L = .1; #M #\n",
+ "A = .5*.5; #M^2\n",
+ "n = 100; #Number of Pins\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*d /2/ k; #Biot Number\n",
+ "mL = (h *4/ k/d) **.5* L; \n",
+ "zi = math.tanh (mL)/mL;\n",
+ "Res1 = 1/h/A; #Thermal resistance without fins\n",
+ "Res2 = 1/(h*(A - n*3.14 /4* d**2 + zi *(n* 3.14 *d*L))); #Thermal resistance with fins\n",
+ "delRes = Res1 - Res2 ; #heat transfer rate\n",
+ "q = (T- Tsurr )/ Res2 - (T- Tsurr )/ Res1 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Decrease in thermal resistaneat surface\",round(delRes,4),\"k/w\",\"\\nIncrease in heattransfer rate\",round(q,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in thermal resistaneat surface 0.1425 k/w \n",
+ "Increase in heattransfer rate 731.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__2.ipynb new file mode 100755 index 00000000..7143a80a --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__2.ipynb @@ -0,0 +1,1017 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32bc9bb5fc4ebce1f381403610ab4e977682e421d539322e9a2067d2e8eedb87"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Heat Conduction in Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius m\n",
+ "do=0.04; #inner radius m\n",
+ "ri=di/2; #inner radius m\n",
+ "ro=do/2; #inner radius m\n",
+ "k=0.58; #thermal conductivity of tube material w/m K\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length m\n",
+ "\n",
+ "#calculations\n",
+ "q=l*2*(3.14)*k*(ti-to)/math.log(ro/ri);\n",
+ "\n",
+ "#result\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per unit length is -157.6462 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius\n",
+ "do=0.04; #outer radius\n",
+ "ri=di/2; #inner radius\n",
+ "ro=do/2; #outer radius\n",
+ "k=0.58; #thermal conductivity of tube material\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length\n",
+ "h=5000; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Rthtube=(math.log(ro/ri))/(2*3.14*k*l); #thermal resistance of tube per unit length\n",
+ "Rthcond=1/(3.14*do*l*h); #thermal resistance of condensing steam per unit length\n",
+ "q=l*2*(3.14)*k*(ti-100)/math.log(ro/ri); #heat flow rate per unit meter \n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of tube per unit length is\",round(Rthtube,4),\"K/W\";\n",
+ "print\"Thermal resistance of condensing steam perunit length is\",round(Rthcond,5),\"K/W\";\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"K/W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of tube per unit length is 0.1903 K/W\n",
+ "Thermal resistance of condensing steam perunit length is 0.00159 K/W\n",
+ "Heat flow per unit length is -157.6462 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hw=140; #heat transfer coefficient on water side\n",
+ "ho=150; #heat transfer coefficient on oil side\n",
+ "k=30; #thermal conductivity\n",
+ "ro=0.1; #inner diameter of GI pipe on inside\n",
+ "ri=0.008; #outer diameter of GI pipe on inside\n",
+ "l=1; #per unit length\n",
+ "\n",
+ "#calculations\n",
+ "RinnerGI=math.log((ro/ri))/(2*3.14*k*l); #Thermal resistance of inner GI pipe\n",
+ "Roilside=1/(ho*3.14*2*ri*l); #Thermal resistanceon the oil side per unit length\n",
+ "Rwaterside=1/(hw*3.14*2*ro*l); #Thermal resistanceon the water side per unit length\n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of inner GI pipe =\",round(RinnerGI,5),\"K/W\";\n",
+ "print\"Thermal resistance on the oil side perunit length =\",round(Roilside,5),\"K/W\";\n",
+ "print\"Thermal resistance on cold water side per unit length =\",round(Rwaterside,5),\"K/W\";\n",
+ "print\"So,Engineer in-charge has made a bad decision\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of inner GI pipe = 0.01341 K/W\n",
+ "Thermal resistance on the oil side perunit length = 0.1327 K/W\n",
+ "Thermal resistance on cold water side per unit length = 0.01137 K/W\n",
+ "So,Engineer in-charge has made a bad decision\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=300; #Internal temp of hot gas in degree Celsius\n",
+ "od=0.1; #Outer diameter of long metal pipe in meters\n",
+ "i_d=0.04; #Internal diamtere of long metal pipe in meters\n",
+ "ki=0.052; #thermal conductivity of mineral wood in W/mK\n",
+ "to=50; #Outer surface temperature in degree celsius\n",
+ "hi=29; #heat transfer coefficient in the inner side in W/m^2 K\n",
+ "ho=12; #heat transfer coefficient in the outer pipe W/m^2 K\n",
+ "t=25; # Surrounding temperature in degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "#Determination of thickness of insulation\n",
+ "#By solving the following two equations by trial and error method for r3\n",
+ "#q_L=2*3.14*0.047*(t1-t)/(1/hi+(0.047/ki)*2.303*math.log(r3/od/2)+(0.047/h0*r3));\n",
+ "#q_L=2*3.14*h0*(to-t);\n",
+ "#By trial and error we get\n",
+ "r3=0.082; #in m\n",
+ "t=r3-(od/2);\n",
+ "#Heat loss per unit length\n",
+ "q=600*(22/7)*r3;\n",
+ "\n",
+ "#Result\n",
+ "print\"Thickness of insulation =\",t*100,\"cm\";\n",
+ "print\"Heat loss per unit length =\",round(q,1),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 3.2 cm\n",
+ "Heat loss per unit length = 154.6 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=90; #Temp on inner side in degree celsius\n",
+ "to=30; #Temp on outer side in degree celsius\n",
+ "hi=500; #heat transfer coeffcient in W/m^2 K\n",
+ "ho=10; #heat transfer coeffcient in W/m^2 K\n",
+ "i_d=0.016; #Internal diameter in meters\n",
+ "od=0.02; #Outer diameter in meters\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "r3=np.linspace (0.01,0.06,12);\n",
+ "t=[0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5]\n",
+ "q_L=(2*(3.14)*(i_d/2)*(ti-to))/((1/hi)+(0.008/0.2)*np.log(r3/0.01) + (0.008/r3*(1/ho)));\n",
+ "\n",
+ "#Result\n",
+ "print \"Insulaion thickness (cm)\", \" r3 (m)\",\" Heat loss rate per meter (W/m) \" \n",
+ "print \" \",t[0],\" \",0.01,\" \",round(q_L[0],1),\"(roundoff error)\"\n",
+ "print \" \",t[1],\" \",0.015,\" \", round(q_L[1],1),\"(roundoff error)\"\n",
+ "print \" \",t[2],\" \",0.02,\" \",round(q_L[2],1),\"(roundoff error)\"\n",
+ "print \" \",t[4],\" \",0.03,\" \",round(q_L[4],1),\"(roundoff error)\"\n",
+ "print \" \",t[6],\" \",0.04,\" \",round(q_L[6],1),\"(roundoff error)\"\n",
+ "print \" \",t[8],\" \",0.05,\" \",round(q_L[8],1),\"(roundoff error)\"\n",
+ "print \" \",t[10],\" \",0.06,\" \",round(q_L[10],1),\"(roundoff error)\"\n",
+ "plt.plot (t,q_L);\n",
+ "plt.title (\"Variation of heat loss rate with insulation thickness\");\n",
+ "plt.xlabel(\" Insulation thickness in cm\");\n",
+ "plt.ylabel(\" Heat Loss in W/m \");\n",
+ "plt.show();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Insulaion thickness (cm) r3 (m) Heat loss rate per meter (W/m) \n",
+ " 0 0.01 36.8 (roundoff error)\n",
+ " 0.5 0.015 41.9 (roundoff error)\n",
+ " 1 0.02 43.2 (roundoff error)\n",
+ " 2 0.03 42.0 (roundoff error)\n",
+ " 3 0.04 39.6 (roundoff error)\n",
+ " 4 0.05 37.4 (roundoff error)\n",
+ " 5 0.06 35.5 (roundoff error)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEVCAYAAAAM3jVmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdcU2f3APCTsPfeIENE2YSpoIIi4gK3dQEO1OpbtWqt\nYh3UuuqoVVurdaDgrrWKiCIqQwVBZYnUDQKCArI3Se7vj/vm15SXESDhhuR8P5/7UZLce8+9hJMn\nz33ueWgEQQBCCCHxQKc6AIQQQr0Hkz5CCIkRTPoIISRGMOkjhJAYwaSPEEJiBJM+QgiJEUz6HVBS\nUqrJy8sz6c66Z8+enePr6xvD55A69fDhQ48BAwa8VlJSqomMjPRv/byJiUne3bt3vXs7LgAALy+v\n+BMnTiykYt/CIj8/v5+SklINQRC09l5Dp9PZ7969M+Nlezt37gxZtGjRMf5F+L9CQ0NDAwICIrq7\nvo2NTXZiYuJwfsbUno7OHa9/kz09XmEnMkl/zJgxt7Zs2fJ968evXbs2UU9Pr5jNZnf5WGtqapRM\nTEzyOntdXl6eCZ1OZ3PvY86cOWdjYmJ8u7rPntq8efPWFStWHKypqVHy9/ePbP08jUYjaDQa32/O\nOHXq1Lxhw4bd7+g1gto3v3Ql2XZXv3798mtqapQ456GnH4QhISE7jx07toh/Ef6vrvzO5s2bd2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kWvpKWlm7nj4GwzKCjodHp6\nOiM9PZ3x4sWLQZs3b96qqqpamZWVZefl5RV/5MiRL4ODg48DtH1OO4qnvX1yx9veeeOsS6fT2d09\nH0j4YNJHAkEQBC0/P7+fl5dX/K5du9ZXVVWp1NXVKZiYmORxkmFaWppjbm6uaet1q6urlbW1tUsk\nJCRYcXFxI96/f28MAKCkpFTDKZzV2rBhw+6fPXt2DgDAq1evLPLz8/sNGjToRVsJra3HlJSUaqqr\nq5V5OS6CIGiKioq1hoaGhZyJfpqammQaGhrkCIKgqaqqVkZFRU0ICQnZmZCQ4NnetjjfQi5fvjyt\ntLRUCwCgvLxcPT8/v9/nz581mEym5JQpU6788MMPm9LS0hzbO6cdxdrZ8bi5uaUkJiYO57Tc+T0i\nCwkf/LRG3cI9/0HruRBoNBrBYrEkAgICIqqqqlQIgqCtXLnygLKycvXUqVP/DA8PD7Sxscl2c3NL\nGThw4MvW25kzZ85ZPz+/63Z2dlnOzs5PLC0t/wYA0NDQ+Ozh4fHQ1tb22bhx46KXLVt2mLPOsmXL\nDi9duvQ3Ozu7LElJSebp06eDpKSkWmg0GtFWfK2PZ/Hixb+PGTPmloGBwYe7d+96tz4+zs/c/4+I\niAhYsmTJ0c2bN2+VlpZuvnTp0gzO89ra2iVRUVETxo4de/PkyZML2tuvpaXl39u2bds4evTo22w2\nmy4lJdVy+PDhZbKyso3z588P43wr2rVr1/r2zmnrY2sr1vZoaWmV/v7774unTJlyhc1m03V0dD7F\nxMT48vI77mi7SHhhwTWEEBIj2L2DEEJiBJM+QgiJEUz6CCEkRjDpI4SQGMGkjxBCYgSTPkIIiZH/\nAxLp4OAIwDpgAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4fccf30>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hnatural = 10; #heat transfer coefficient for natural \n",
+ "hforced = 50; #heat transfer coefficient for forced\n",
+ "k1 = 0.2; #thermal conductivity\n",
+ "k2 = 0.05; #thermal conductivity\n",
+ "\n",
+ "#result\n",
+ "print\"critical radius of insulation in cm\";\n",
+ "print\"\\n h=10 h=50\";\n",
+ "print\"\\nAsbestos \",k1 *100/ hnatural,\" \", k1*100/ hforced;\n",
+ "print\"\\nMineral wool \",k2 *100/ hnatural,\" \", k2*100/ hforced;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical radius of insulation in cm\n",
+ "\n",
+ " h=10 h=50\n",
+ "\n",
+ "Asbestos 2.0 0.4\n",
+ "\n",
+ "Mineral wool 0.5 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=5; #Height\n",
+ "l=10; #Length\n",
+ "t=1; #thickness\n",
+ "k=1.05; #W/m K\n",
+ "q=58; #W/m^3\n",
+ "t1=35; #c\n",
+ "h=11.6; #Heat transfer coefficient\n",
+ "\n",
+ "#calculations\n",
+ "b=t/2;\n",
+ "tmax=t1+q*b*(b/(2*k)+1/h);\n",
+ "\n",
+ "#result\n",
+ "print\"Maximum Temperature =\",round(tmax,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Temperature = 44.405 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#The bar will have two dimensional variation in temperature\n",
+ "#the differential equation is subject to boundary conditions\n",
+ "x1 = 0; #cm\n",
+ "Tx1 = 30; #C\n",
+ "x2 = 5; #cm\n",
+ "Tx2 = 30; #C\n",
+ "y1 = 0; #cm\n",
+ "Ty1 = 30; #C\n",
+ "y2 = 10; #cm\n",
+ "Ty2 = 130; #C\n",
+ "\n",
+ "#substituting theta = T-30 and using eqn 2.6.11\n",
+ "#putting x = 2.5cm and y = 5cm in infinite summation series\n",
+ "n = 1;\n",
+ "x1 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 3;\n",
+ "x2 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 5;\n",
+ "x3 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "x = x1+x3+x3;\n",
+ "T = x *100+30;\n",
+ "\n",
+ "#result\n",
+ "print \"Steady statetemper a ture= \",T,\"c (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady statetemper a ture= 33.1695223665 c (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k = 330; #thermal conductivity\n",
+ "a = 95*10**(-6); #thermal expansion coefficient\n",
+ "R = 0.01; #radius in meters\n",
+ "To = 77; #temperature in kelvins\n",
+ "Tf = 273+50; #temperature in kelvins\n",
+ "theta1 = To - Tf; \n",
+ "T = 273+10; ##temperature in kelvins\n",
+ "theta = T - Tf;\n",
+ "h = 20; #heat transfer coefficient in W/m^2 K\n",
+ "\n",
+ "print\"Theta1 =\",theta1,\"K\";\n",
+ "print\"Theta =\",theta,\"K\";\n",
+ "print\"v/A =\",R/2,\"m\";\n",
+ "print\"k/a =\",round((k/a)*10**(-6),4),\"*10^(6)J/m^3 K\";\n",
+ "\n",
+ "time =(k/a)*(R/2)/h*math.log(theta1/theta);\n",
+ "\n",
+ "print\"Time taken by the rod to heat up =\",round(time,1),\"secs\";\n",
+ "\n",
+ "Bi = h*R/k;\n",
+ "\n",
+ "#result\n",
+ "print\"Biot number Bi =\",round(Bi*10**4,2),\"*10^(-4)\";\n",
+ "print\"Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta1 = -246 K\n",
+ "Theta = -40 K\n",
+ "v/A = 0.005 m\n",
+ "k/a = 3.4737 *10^(6)J/m^3 K\n",
+ "Time taken by the rod to heat up = 1577.4 secs\n",
+ "Biot number Bi = 6.06 *10^(-4)\n",
+ "Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(1) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20 ; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12; \n",
+ "ratiob1 = 0.48; \n",
+ "lambda1b = 1.0498; \n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho*Cp); #alpha\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta*ratiob0;\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "thetaxb1 = theta*ratiob1 ;\n",
+ "Txb1 = thetaxb1+Tw ;\n",
+ "\n",
+ "x = (2*math.sin((lambda1b)))/(lambda1b+((math.sin((lambda1b)))*(math.cos((lambda1b)))));\n",
+ "thetaxb0 = theta*x*(math.exp((-lambda1b**2)*Fourierno));\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=0 is\",round(Txb0,4),\"degree\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=0 is 41.3418 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(2) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12;\n",
+ "ratiob1 = 0.48;\n",
+ "lambda1b = 1.0498;\n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho *Cp);\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta * ratiob0;\n",
+ "Txb0 = thetaxb0 + Tw;\n",
+ "thetaxb1 = theta * ratiob1;\n",
+ "Txb1 = thetaxb1 + Tw;\n",
+ "x = 2*math.sin(((lambda1b)))/(lambda1b + (math.sin(((lambda1b))))*(math.cos((lambda1b))));\n",
+ "thetaxb1 = thetaxb0*(math.cos (lambda1b *1));\n",
+ "Txb1 = thetaxb1+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=1 is\",round(Txb1,3),\"degree C\\n\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=1 is 30.751 degree C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(1) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2; \n",
+ "\n",
+ "#calculations\n",
+ "t1 = rho*Cp*R /(3* h)* math.log ((To -Tf)/(T-Tf)); #sec\n",
+ "t1min = t1 /60 ; #min\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is\",round(t1,4),\"seconds i.e.\",round(t1min,4),\"minutes\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is 436.2545 seconds i.e. 7.2709 minutes\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(2) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2;\n",
+ "lambda1R = 0.430;\n",
+ "y = 5;\n",
+ "\n",
+ "#calculations\n",
+ "ratio = (T-Tf)/( To - Tf);\n",
+ "Bi = h*R/k;\n",
+ "x = 2* (math.sin(lambda1R)- lambda1R * math.cos(lambda1R))/ (lambda1R - math.sin ( lambda1R)*math.cos( lambda1R));\n",
+ "t=(math.log (ratio/x))/(-1*(k/(Cp*rho*R**2))*lambda1R**2);\n",
+ "tmin = t /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree\" \n",
+ "print \"C if internal temperature gradients are not neglected is\",round(t,3),\"seconds i.e\",round(tmin,3),\"min (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree\n",
+ "C if internal temperature gradients are not neglected is 446.95 seconds i.e 7.449 min (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.12 ; #m\n",
+ "T = 400 ; #C\n",
+ "To = 25 ; #C\n",
+ "t = 100/60 ; #hour\n",
+ "h = 10 ; #W/m^2 K\n",
+ "k = 1.0 ; #W/m K\n",
+ "alpha = 3.33*10** -3 ; #m^2/h\n",
+ "ratiox = 0.82 ;\n",
+ "ratioy = 0.41;\n",
+ "ratioz = 0.30;\n",
+ "\n",
+ "#calculations\n",
+ "x1 = h*a/k ;\n",
+ "x2 = k/(h*a);\n",
+ "x3 = alpha *t/a**2;\n",
+ "totalratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "ratiox = 1.1310* math.exp ( -(0.9036**2) *0.385) ;\n",
+ "ratioy = 1.0701* math.exp ( -(0.6533**2) *2.220) ;\n",
+ "ratioz = 1.0580* math.exp ( -(0.5932**2) *3.469) ;\n",
+ "ratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";\n",
+ "print\"Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\";\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the brick = 62.822 degree c\n",
+ "Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\n",
+ "Temperature at the centre of the brick = 62.822 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(1) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 350 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of copper is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.1852\n",
+ "Temperature at the tip of fin made of copper is 118.3099 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(2) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "l = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 15 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4*h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*l);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of steel is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.8944\n",
+ "Temperature at the tip of fin made of steel is 90.058 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(3) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 0.35 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "mL = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(mL,4);\n",
+ "print\"Temperature at the tip of fin made of teflon is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 5.8554\n",
+ "Temperature at the tip of fin made of teflon is 20.5729 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.02 ; #M\n",
+ "t = 0.002 ; #M\n",
+ "b = 0.2 ; #M\n",
+ "theta1 = 200 ; #C\n",
+ "h = 15 ; #W/m^2 K\n",
+ "k = 45 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*(t /2) /k ;\n",
+ "P = 2*( b+t); #m\n",
+ "A = b*t ;\n",
+ "mL = math.sqrt((h*P)/(A*k))*L;\n",
+ "n = math.tanh(mL)/mL;\n",
+ "qloss = n*h *40.4*2*10**-4*200;\n",
+ "\n",
+ "#result\n",
+ "print\"Fin Effectiveness =\",round(n,3);\n",
+ "print\"Heat loss rate from fin surface =\",round(qloss,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fin Effectiveness = 0.957\n",
+ "Heat loss rate from fin surface = 23.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 15 ; #W/m^2 .K\n",
+ "k = 300; #W/m.K\n",
+ "T = 200; #C\n",
+ "Tsurr = 30; #C\n",
+ "d = .01; #M\n",
+ "L = .1; #M #\n",
+ "A = .5*.5; #M^2\n",
+ "n = 100; #Number of Pins\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*d /2/ k; #Biot Number\n",
+ "mL = (h *4/ k/d) **.5* L; \n",
+ "zi = math.tanh (mL)/mL;\n",
+ "Res1 = 1/h/A; #Thermal resistance without fins\n",
+ "Res2 = 1/(h*(A - n*3.14 /4* d**2 + zi *(n* 3.14 *d*L))); #Thermal resistance with fins\n",
+ "delRes = Res1 - Res2 ; #heat transfer rate\n",
+ "q = (T- Tsurr )/ Res2 - (T- Tsurr )/ Res1 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Decrease in thermal resistaneat surface\",round(delRes,4),\"k/w\",\"\\nIncrease in heattransfer rate\",round(q,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in thermal resistaneat surface 0.1425 k/w \n",
+ "Increase in heattransfer rate 731.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__3.ipynb new file mode 100755 index 00000000..7143a80a --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__3.ipynb @@ -0,0 +1,1017 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32bc9bb5fc4ebce1f381403610ab4e977682e421d539322e9a2067d2e8eedb87"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Heat Conduction in Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius m\n",
+ "do=0.04; #inner radius m\n",
+ "ri=di/2; #inner radius m\n",
+ "ro=do/2; #inner radius m\n",
+ "k=0.58; #thermal conductivity of tube material w/m K\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length m\n",
+ "\n",
+ "#calculations\n",
+ "q=l*2*(3.14)*k*(ti-to)/math.log(ro/ri);\n",
+ "\n",
+ "#result\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per unit length is -157.6462 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius\n",
+ "do=0.04; #outer radius\n",
+ "ri=di/2; #inner radius\n",
+ "ro=do/2; #outer radius\n",
+ "k=0.58; #thermal conductivity of tube material\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length\n",
+ "h=5000; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Rthtube=(math.log(ro/ri))/(2*3.14*k*l); #thermal resistance of tube per unit length\n",
+ "Rthcond=1/(3.14*do*l*h); #thermal resistance of condensing steam per unit length\n",
+ "q=l*2*(3.14)*k*(ti-100)/math.log(ro/ri); #heat flow rate per unit meter \n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of tube per unit length is\",round(Rthtube,4),\"K/W\";\n",
+ "print\"Thermal resistance of condensing steam perunit length is\",round(Rthcond,5),\"K/W\";\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"K/W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of tube per unit length is 0.1903 K/W\n",
+ "Thermal resistance of condensing steam perunit length is 0.00159 K/W\n",
+ "Heat flow per unit length is -157.6462 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hw=140; #heat transfer coefficient on water side\n",
+ "ho=150; #heat transfer coefficient on oil side\n",
+ "k=30; #thermal conductivity\n",
+ "ro=0.1; #inner diameter of GI pipe on inside\n",
+ "ri=0.008; #outer diameter of GI pipe on inside\n",
+ "l=1; #per unit length\n",
+ "\n",
+ "#calculations\n",
+ "RinnerGI=math.log((ro/ri))/(2*3.14*k*l); #Thermal resistance of inner GI pipe\n",
+ "Roilside=1/(ho*3.14*2*ri*l); #Thermal resistanceon the oil side per unit length\n",
+ "Rwaterside=1/(hw*3.14*2*ro*l); #Thermal resistanceon the water side per unit length\n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of inner GI pipe =\",round(RinnerGI,5),\"K/W\";\n",
+ "print\"Thermal resistance on the oil side perunit length =\",round(Roilside,5),\"K/W\";\n",
+ "print\"Thermal resistance on cold water side per unit length =\",round(Rwaterside,5),\"K/W\";\n",
+ "print\"So,Engineer in-charge has made a bad decision\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of inner GI pipe = 0.01341 K/W\n",
+ "Thermal resistance on the oil side perunit length = 0.1327 K/W\n",
+ "Thermal resistance on cold water side per unit length = 0.01137 K/W\n",
+ "So,Engineer in-charge has made a bad decision\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=300; #Internal temp of hot gas in degree Celsius\n",
+ "od=0.1; #Outer diameter of long metal pipe in meters\n",
+ "i_d=0.04; #Internal diamtere of long metal pipe in meters\n",
+ "ki=0.052; #thermal conductivity of mineral wood in W/mK\n",
+ "to=50; #Outer surface temperature in degree celsius\n",
+ "hi=29; #heat transfer coefficient in the inner side in W/m^2 K\n",
+ "ho=12; #heat transfer coefficient in the outer pipe W/m^2 K\n",
+ "t=25; # Surrounding temperature in degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "#Determination of thickness of insulation\n",
+ "#By solving the following two equations by trial and error method for r3\n",
+ "#q_L=2*3.14*0.047*(t1-t)/(1/hi+(0.047/ki)*2.303*math.log(r3/od/2)+(0.047/h0*r3));\n",
+ "#q_L=2*3.14*h0*(to-t);\n",
+ "#By trial and error we get\n",
+ "r3=0.082; #in m\n",
+ "t=r3-(od/2);\n",
+ "#Heat loss per unit length\n",
+ "q=600*(22/7)*r3;\n",
+ "\n",
+ "#Result\n",
+ "print\"Thickness of insulation =\",t*100,\"cm\";\n",
+ "print\"Heat loss per unit length =\",round(q,1),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 3.2 cm\n",
+ "Heat loss per unit length = 154.6 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=90; #Temp on inner side in degree celsius\n",
+ "to=30; #Temp on outer side in degree celsius\n",
+ "hi=500; #heat transfer coeffcient in W/m^2 K\n",
+ "ho=10; #heat transfer coeffcient in W/m^2 K\n",
+ "i_d=0.016; #Internal diameter in meters\n",
+ "od=0.02; #Outer diameter in meters\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "r3=np.linspace (0.01,0.06,12);\n",
+ "t=[0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5]\n",
+ "q_L=(2*(3.14)*(i_d/2)*(ti-to))/((1/hi)+(0.008/0.2)*np.log(r3/0.01) + (0.008/r3*(1/ho)));\n",
+ "\n",
+ "#Result\n",
+ "print \"Insulaion thickness (cm)\", \" r3 (m)\",\" Heat loss rate per meter (W/m) \" \n",
+ "print \" \",t[0],\" \",0.01,\" \",round(q_L[0],1),\"(roundoff error)\"\n",
+ "print \" \",t[1],\" \",0.015,\" \", round(q_L[1],1),\"(roundoff error)\"\n",
+ "print \" \",t[2],\" \",0.02,\" \",round(q_L[2],1),\"(roundoff error)\"\n",
+ "print \" \",t[4],\" \",0.03,\" \",round(q_L[4],1),\"(roundoff error)\"\n",
+ "print \" \",t[6],\" \",0.04,\" \",round(q_L[6],1),\"(roundoff error)\"\n",
+ "print \" \",t[8],\" \",0.05,\" \",round(q_L[8],1),\"(roundoff error)\"\n",
+ "print \" \",t[10],\" \",0.06,\" \",round(q_L[10],1),\"(roundoff error)\"\n",
+ "plt.plot (t,q_L);\n",
+ "plt.title (\"Variation of heat loss rate with insulation thickness\");\n",
+ "plt.xlabel(\" Insulation thickness in cm\");\n",
+ "plt.ylabel(\" Heat Loss in W/m \");\n",
+ "plt.show();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Insulaion thickness (cm) r3 (m) Heat loss rate per meter (W/m) \n",
+ " 0 0.01 36.8 (roundoff error)\n",
+ " 0.5 0.015 41.9 (roundoff error)\n",
+ " 1 0.02 43.2 (roundoff error)\n",
+ " 2 0.03 42.0 (roundoff error)\n",
+ " 3 0.04 39.6 (roundoff error)\n",
+ " 4 0.05 37.4 (roundoff error)\n",
+ " 5 0.06 35.5 (roundoff error)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEVCAYAAAAM3jVmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREF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\nGThw4MvW25kzZ85ZPz+/63Z2dlnOzs5PLC0t/wYA0NDQ+Ozh4fHQ1tb22bhx46KXLVt2mLPOsmXL\nDi9duvQ3Ozu7LElJSebp06eDpKSkWmg0GtFWfK2PZ/Hixb+PGTPmloGBwYe7d+96tz4+zs/c/4+I\niAhYsmTJ0c2bN2+VlpZuvnTp0gzO89ra2iVRUVETxo4de/PkyZML2tuvpaXl39u2bds4evTo22w2\nmy4lJdVy+PDhZbKyso3z588P43wr2rVr1/r2zmnrY2sr1vZoaWmV/v7774unTJlyhc1m03V0dD7F\nxMT48vI77mi7SHhhwTWEEBIj2L2DEEJiBJM+QgiJEUz6CCEkRjDpI4SQGMGkjxBCYgSTPkIIiZH/\nAxLp4OAIwDpgAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4fccf30>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hnatural = 10; #heat transfer coefficient for natural \n",
+ "hforced = 50; #heat transfer coefficient for forced\n",
+ "k1 = 0.2; #thermal conductivity\n",
+ "k2 = 0.05; #thermal conductivity\n",
+ "\n",
+ "#result\n",
+ "print\"critical radius of insulation in cm\";\n",
+ "print\"\\n h=10 h=50\";\n",
+ "print\"\\nAsbestos \",k1 *100/ hnatural,\" \", k1*100/ hforced;\n",
+ "print\"\\nMineral wool \",k2 *100/ hnatural,\" \", k2*100/ hforced;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical radius of insulation in cm\n",
+ "\n",
+ " h=10 h=50\n",
+ "\n",
+ "Asbestos 2.0 0.4\n",
+ "\n",
+ "Mineral wool 0.5 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=5; #Height\n",
+ "l=10; #Length\n",
+ "t=1; #thickness\n",
+ "k=1.05; #W/m K\n",
+ "q=58; #W/m^3\n",
+ "t1=35; #c\n",
+ "h=11.6; #Heat transfer coefficient\n",
+ "\n",
+ "#calculations\n",
+ "b=t/2;\n",
+ "tmax=t1+q*b*(b/(2*k)+1/h);\n",
+ "\n",
+ "#result\n",
+ "print\"Maximum Temperature =\",round(tmax,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Temperature = 44.405 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#The bar will have two dimensional variation in temperature\n",
+ "#the differential equation is subject to boundary conditions\n",
+ "x1 = 0; #cm\n",
+ "Tx1 = 30; #C\n",
+ "x2 = 5; #cm\n",
+ "Tx2 = 30; #C\n",
+ "y1 = 0; #cm\n",
+ "Ty1 = 30; #C\n",
+ "y2 = 10; #cm\n",
+ "Ty2 = 130; #C\n",
+ "\n",
+ "#substituting theta = T-30 and using eqn 2.6.11\n",
+ "#putting x = 2.5cm and y = 5cm in infinite summation series\n",
+ "n = 1;\n",
+ "x1 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 3;\n",
+ "x2 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 5;\n",
+ "x3 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "x = x1+x3+x3;\n",
+ "T = x *100+30;\n",
+ "\n",
+ "#result\n",
+ "print \"Steady statetemper a ture= \",T,\"c (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady statetemper a ture= 33.1695223665 c (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k = 330; #thermal conductivity\n",
+ "a = 95*10**(-6); #thermal expansion coefficient\n",
+ "R = 0.01; #radius in meters\n",
+ "To = 77; #temperature in kelvins\n",
+ "Tf = 273+50; #temperature in kelvins\n",
+ "theta1 = To - Tf; \n",
+ "T = 273+10; ##temperature in kelvins\n",
+ "theta = T - Tf;\n",
+ "h = 20; #heat transfer coefficient in W/m^2 K\n",
+ "\n",
+ "print\"Theta1 =\",theta1,\"K\";\n",
+ "print\"Theta =\",theta,\"K\";\n",
+ "print\"v/A =\",R/2,\"m\";\n",
+ "print\"k/a =\",round((k/a)*10**(-6),4),\"*10^(6)J/m^3 K\";\n",
+ "\n",
+ "time =(k/a)*(R/2)/h*math.log(theta1/theta);\n",
+ "\n",
+ "print\"Time taken by the rod to heat up =\",round(time,1),\"secs\";\n",
+ "\n",
+ "Bi = h*R/k;\n",
+ "\n",
+ "#result\n",
+ "print\"Biot number Bi =\",round(Bi*10**4,2),\"*10^(-4)\";\n",
+ "print\"Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta1 = -246 K\n",
+ "Theta = -40 K\n",
+ "v/A = 0.005 m\n",
+ "k/a = 3.4737 *10^(6)J/m^3 K\n",
+ "Time taken by the rod to heat up = 1577.4 secs\n",
+ "Biot number Bi = 6.06 *10^(-4)\n",
+ "Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(1) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20 ; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12; \n",
+ "ratiob1 = 0.48; \n",
+ "lambda1b = 1.0498; \n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho*Cp); #alpha\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta*ratiob0;\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "thetaxb1 = theta*ratiob1 ;\n",
+ "Txb1 = thetaxb1+Tw ;\n",
+ "\n",
+ "x = (2*math.sin((lambda1b)))/(lambda1b+((math.sin((lambda1b)))*(math.cos((lambda1b)))));\n",
+ "thetaxb0 = theta*x*(math.exp((-lambda1b**2)*Fourierno));\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=0 is\",round(Txb0,4),\"degree\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=0 is 41.3418 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(2) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12;\n",
+ "ratiob1 = 0.48;\n",
+ "lambda1b = 1.0498;\n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho *Cp);\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta * ratiob0;\n",
+ "Txb0 = thetaxb0 + Tw;\n",
+ "thetaxb1 = theta * ratiob1;\n",
+ "Txb1 = thetaxb1 + Tw;\n",
+ "x = 2*math.sin(((lambda1b)))/(lambda1b + (math.sin(((lambda1b))))*(math.cos((lambda1b))));\n",
+ "thetaxb1 = thetaxb0*(math.cos (lambda1b *1));\n",
+ "Txb1 = thetaxb1+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=1 is\",round(Txb1,3),\"degree C\\n\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=1 is 30.751 degree C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(1) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2; \n",
+ "\n",
+ "#calculations\n",
+ "t1 = rho*Cp*R /(3* h)* math.log ((To -Tf)/(T-Tf)); #sec\n",
+ "t1min = t1 /60 ; #min\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is\",round(t1,4),\"seconds i.e.\",round(t1min,4),\"minutes\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is 436.2545 seconds i.e. 7.2709 minutes\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(2) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2;\n",
+ "lambda1R = 0.430;\n",
+ "y = 5;\n",
+ "\n",
+ "#calculations\n",
+ "ratio = (T-Tf)/( To - Tf);\n",
+ "Bi = h*R/k;\n",
+ "x = 2* (math.sin(lambda1R)- lambda1R * math.cos(lambda1R))/ (lambda1R - math.sin ( lambda1R)*math.cos( lambda1R));\n",
+ "t=(math.log (ratio/x))/(-1*(k/(Cp*rho*R**2))*lambda1R**2);\n",
+ "tmin = t /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree\" \n",
+ "print \"C if internal temperature gradients are not neglected is\",round(t,3),\"seconds i.e\",round(tmin,3),\"min (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree\n",
+ "C if internal temperature gradients are not neglected is 446.95 seconds i.e 7.449 min (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.12 ; #m\n",
+ "T = 400 ; #C\n",
+ "To = 25 ; #C\n",
+ "t = 100/60 ; #hour\n",
+ "h = 10 ; #W/m^2 K\n",
+ "k = 1.0 ; #W/m K\n",
+ "alpha = 3.33*10** -3 ; #m^2/h\n",
+ "ratiox = 0.82 ;\n",
+ "ratioy = 0.41;\n",
+ "ratioz = 0.30;\n",
+ "\n",
+ "#calculations\n",
+ "x1 = h*a/k ;\n",
+ "x2 = k/(h*a);\n",
+ "x3 = alpha *t/a**2;\n",
+ "totalratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "ratiox = 1.1310* math.exp ( -(0.9036**2) *0.385) ;\n",
+ "ratioy = 1.0701* math.exp ( -(0.6533**2) *2.220) ;\n",
+ "ratioz = 1.0580* math.exp ( -(0.5932**2) *3.469) ;\n",
+ "ratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";\n",
+ "print\"Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\";\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the brick = 62.822 degree c\n",
+ "Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\n",
+ "Temperature at the centre of the brick = 62.822 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(1) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 350 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of copper is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.1852\n",
+ "Temperature at the tip of fin made of copper is 118.3099 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(2) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "l = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 15 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4*h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*l);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of steel is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.8944\n",
+ "Temperature at the tip of fin made of steel is 90.058 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(3) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 0.35 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "mL = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(mL,4);\n",
+ "print\"Temperature at the tip of fin made of teflon is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 5.8554\n",
+ "Temperature at the tip of fin made of teflon is 20.5729 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.02 ; #M\n",
+ "t = 0.002 ; #M\n",
+ "b = 0.2 ; #M\n",
+ "theta1 = 200 ; #C\n",
+ "h = 15 ; #W/m^2 K\n",
+ "k = 45 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*(t /2) /k ;\n",
+ "P = 2*( b+t); #m\n",
+ "A = b*t ;\n",
+ "mL = math.sqrt((h*P)/(A*k))*L;\n",
+ "n = math.tanh(mL)/mL;\n",
+ "qloss = n*h *40.4*2*10**-4*200;\n",
+ "\n",
+ "#result\n",
+ "print\"Fin Effectiveness =\",round(n,3);\n",
+ "print\"Heat loss rate from fin surface =\",round(qloss,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fin Effectiveness = 0.957\n",
+ "Heat loss rate from fin surface = 23.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 15 ; #W/m^2 .K\n",
+ "k = 300; #W/m.K\n",
+ "T = 200; #C\n",
+ "Tsurr = 30; #C\n",
+ "d = .01; #M\n",
+ "L = .1; #M #\n",
+ "A = .5*.5; #M^2\n",
+ "n = 100; #Number of Pins\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*d /2/ k; #Biot Number\n",
+ "mL = (h *4/ k/d) **.5* L; \n",
+ "zi = math.tanh (mL)/mL;\n",
+ "Res1 = 1/h/A; #Thermal resistance without fins\n",
+ "Res2 = 1/(h*(A - n*3.14 /4* d**2 + zi *(n* 3.14 *d*L))); #Thermal resistance with fins\n",
+ "delRes = Res1 - Res2 ; #heat transfer rate\n",
+ "q = (T- Tsurr )/ Res2 - (T- Tsurr )/ Res1 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Decrease in thermal resistaneat surface\",round(delRes,4),\"k/w\",\"\\nIncrease in heattransfer rate\",round(q,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in thermal resistaneat surface 0.1425 k/w \n",
+ "Increase in heattransfer rate 731.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__4.ipynb new file mode 100755 index 00000000..7143a80a --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__4.ipynb @@ -0,0 +1,1017 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32bc9bb5fc4ebce1f381403610ab4e977682e421d539322e9a2067d2e8eedb87"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Heat Conduction in Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius m\n",
+ "do=0.04; #inner radius m\n",
+ "ri=di/2; #inner radius m\n",
+ "ro=do/2; #inner radius m\n",
+ "k=0.58; #thermal conductivity of tube material w/m K\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length m\n",
+ "\n",
+ "#calculations\n",
+ "q=l*2*(3.14)*k*(ti-to)/math.log(ro/ri);\n",
+ "\n",
+ "#result\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per unit length is -157.6462 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius\n",
+ "do=0.04; #outer radius\n",
+ "ri=di/2; #inner radius\n",
+ "ro=do/2; #outer radius\n",
+ "k=0.58; #thermal conductivity of tube material\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length\n",
+ "h=5000; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Rthtube=(math.log(ro/ri))/(2*3.14*k*l); #thermal resistance of tube per unit length\n",
+ "Rthcond=1/(3.14*do*l*h); #thermal resistance of condensing steam per unit length\n",
+ "q=l*2*(3.14)*k*(ti-100)/math.log(ro/ri); #heat flow rate per unit meter \n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of tube per unit length is\",round(Rthtube,4),\"K/W\";\n",
+ "print\"Thermal resistance of condensing steam perunit length is\",round(Rthcond,5),\"K/W\";\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"K/W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of tube per unit length is 0.1903 K/W\n",
+ "Thermal resistance of condensing steam perunit length is 0.00159 K/W\n",
+ "Heat flow per unit length is -157.6462 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hw=140; #heat transfer coefficient on water side\n",
+ "ho=150; #heat transfer coefficient on oil side\n",
+ "k=30; #thermal conductivity\n",
+ "ro=0.1; #inner diameter of GI pipe on inside\n",
+ "ri=0.008; #outer diameter of GI pipe on inside\n",
+ "l=1; #per unit length\n",
+ "\n",
+ "#calculations\n",
+ "RinnerGI=math.log((ro/ri))/(2*3.14*k*l); #Thermal resistance of inner GI pipe\n",
+ "Roilside=1/(ho*3.14*2*ri*l); #Thermal resistanceon the oil side per unit length\n",
+ "Rwaterside=1/(hw*3.14*2*ro*l); #Thermal resistanceon the water side per unit length\n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of inner GI pipe =\",round(RinnerGI,5),\"K/W\";\n",
+ "print\"Thermal resistance on the oil side perunit length =\",round(Roilside,5),\"K/W\";\n",
+ "print\"Thermal resistance on cold water side per unit length =\",round(Rwaterside,5),\"K/W\";\n",
+ "print\"So,Engineer in-charge has made a bad decision\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of inner GI pipe = 0.01341 K/W\n",
+ "Thermal resistance on the oil side perunit length = 0.1327 K/W\n",
+ "Thermal resistance on cold water side per unit length = 0.01137 K/W\n",
+ "So,Engineer in-charge has made a bad decision\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=300; #Internal temp of hot gas in degree Celsius\n",
+ "od=0.1; #Outer diameter of long metal pipe in meters\n",
+ "i_d=0.04; #Internal diamtere of long metal pipe in meters\n",
+ "ki=0.052; #thermal conductivity of mineral wood in W/mK\n",
+ "to=50; #Outer surface temperature in degree celsius\n",
+ "hi=29; #heat transfer coefficient in the inner side in W/m^2 K\n",
+ "ho=12; #heat transfer coefficient in the outer pipe W/m^2 K\n",
+ "t=25; # Surrounding temperature in degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "#Determination of thickness of insulation\n",
+ "#By solving the following two equations by trial and error method for r3\n",
+ "#q_L=2*3.14*0.047*(t1-t)/(1/hi+(0.047/ki)*2.303*math.log(r3/od/2)+(0.047/h0*r3));\n",
+ "#q_L=2*3.14*h0*(to-t);\n",
+ "#By trial and error we get\n",
+ "r3=0.082; #in m\n",
+ "t=r3-(od/2);\n",
+ "#Heat loss per unit length\n",
+ "q=600*(22/7)*r3;\n",
+ "\n",
+ "#Result\n",
+ "print\"Thickness of insulation =\",t*100,\"cm\";\n",
+ "print\"Heat loss per unit length =\",round(q,1),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 3.2 cm\n",
+ "Heat loss per unit length = 154.6 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=90; #Temp on inner side in degree celsius\n",
+ "to=30; #Temp on outer side in degree celsius\n",
+ "hi=500; #heat transfer coeffcient in W/m^2 K\n",
+ "ho=10; #heat transfer coeffcient in W/m^2 K\n",
+ "i_d=0.016; #Internal diameter in meters\n",
+ "od=0.02; #Outer diameter in meters\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "r3=np.linspace (0.01,0.06,12);\n",
+ "t=[0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5]\n",
+ "q_L=(2*(3.14)*(i_d/2)*(ti-to))/((1/hi)+(0.008/0.2)*np.log(r3/0.01) + (0.008/r3*(1/ho)));\n",
+ "\n",
+ "#Result\n",
+ "print \"Insulaion thickness (cm)\", \" r3 (m)\",\" Heat loss rate per meter (W/m) \" \n",
+ "print \" \",t[0],\" \",0.01,\" \",round(q_L[0],1),\"(roundoff error)\"\n",
+ "print \" \",t[1],\" \",0.015,\" \", round(q_L[1],1),\"(roundoff error)\"\n",
+ "print \" \",t[2],\" \",0.02,\" \",round(q_L[2],1),\"(roundoff error)\"\n",
+ "print \" \",t[4],\" \",0.03,\" \",round(q_L[4],1),\"(roundoff error)\"\n",
+ "print \" \",t[6],\" \",0.04,\" \",round(q_L[6],1),\"(roundoff error)\"\n",
+ "print \" \",t[8],\" \",0.05,\" \",round(q_L[8],1),\"(roundoff error)\"\n",
+ "print \" \",t[10],\" \",0.06,\" \",round(q_L[10],1),\"(roundoff error)\"\n",
+ "plt.plot (t,q_L);\n",
+ "plt.title (\"Variation of heat loss rate with insulation thickness\");\n",
+ "plt.xlabel(\" Insulation thickness in cm\");\n",
+ "plt.ylabel(\" Heat Loss in W/m \");\n",
+ "plt.show();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Insulaion thickness (cm) r3 (m) Heat loss rate per meter (W/m) \n",
+ " 0 0.01 36.8 (roundoff error)\n",
+ " 0.5 0.015 41.9 (roundoff error)\n",
+ " 1 0.02 43.2 (roundoff error)\n",
+ " 2 0.03 42.0 (roundoff error)\n",
+ " 3 0.04 39.6 (roundoff error)\n",
+ " 4 0.05 37.4 (roundoff error)\n",
+ " 5 0.06 35.5 (roundoff error)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
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O6cdxdrZ8bi5uaUkJiYO57Tc+T0i\nCwkf/LRG3cI9/0HruRBoNBrBYrEkAgICIqqqqlQIgqCtXLnygLKycvXUqVP/DA8PD7Sxscl2c3NL\nGThw4MvW25kzZ85ZPz+/63Z2dlnOzs5PLC0t/wYA0NDQ+Ozh4fHQ1tb22bhx46KXLVt2mLPOsmXL\nDi9duvQ3Ozu7LElJSebp06eDpKSkWmg0GtFWfK2PZ/Hixb+PGTPmloGBwYe7d+96tz4+zs/c/4+I\niAhYsmTJ0c2bN2+VlpZuvnTp0gzO89ra2iVRUVETxo4de/PkyZML2tuvpaXl39u2bds4evTo22w2\nmy4lJdVy+PDhZbKyso3z588P43wr2rVr1/r2zmnrY2sr1vZoaWmV/v7774unTJlyhc1m03V0dD7F\nxMT48vI77mi7SHhhwTWEEBIj2L2DEEJiBJM+QgiJEUz6CCEkRjDpI4SQGMGkjxBCYgSTPkIIiZH/\nAxLp4OAIwDpgAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4fccf30>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hnatural = 10; #heat transfer coefficient for natural \n",
+ "hforced = 50; #heat transfer coefficient for forced\n",
+ "k1 = 0.2; #thermal conductivity\n",
+ "k2 = 0.05; #thermal conductivity\n",
+ "\n",
+ "#result\n",
+ "print\"critical radius of insulation in cm\";\n",
+ "print\"\\n h=10 h=50\";\n",
+ "print\"\\nAsbestos \",k1 *100/ hnatural,\" \", k1*100/ hforced;\n",
+ "print\"\\nMineral wool \",k2 *100/ hnatural,\" \", k2*100/ hforced;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical radius of insulation in cm\n",
+ "\n",
+ " h=10 h=50\n",
+ "\n",
+ "Asbestos 2.0 0.4\n",
+ "\n",
+ "Mineral wool 0.5 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=5; #Height\n",
+ "l=10; #Length\n",
+ "t=1; #thickness\n",
+ "k=1.05; #W/m K\n",
+ "q=58; #W/m^3\n",
+ "t1=35; #c\n",
+ "h=11.6; #Heat transfer coefficient\n",
+ "\n",
+ "#calculations\n",
+ "b=t/2;\n",
+ "tmax=t1+q*b*(b/(2*k)+1/h);\n",
+ "\n",
+ "#result\n",
+ "print\"Maximum Temperature =\",round(tmax,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Temperature = 44.405 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#The bar will have two dimensional variation in temperature\n",
+ "#the differential equation is subject to boundary conditions\n",
+ "x1 = 0; #cm\n",
+ "Tx1 = 30; #C\n",
+ "x2 = 5; #cm\n",
+ "Tx2 = 30; #C\n",
+ "y1 = 0; #cm\n",
+ "Ty1 = 30; #C\n",
+ "y2 = 10; #cm\n",
+ "Ty2 = 130; #C\n",
+ "\n",
+ "#substituting theta = T-30 and using eqn 2.6.11\n",
+ "#putting x = 2.5cm and y = 5cm in infinite summation series\n",
+ "n = 1;\n",
+ "x1 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 3;\n",
+ "x2 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 5;\n",
+ "x3 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "x = x1+x3+x3;\n",
+ "T = x *100+30;\n",
+ "\n",
+ "#result\n",
+ "print \"Steady statetemper a ture= \",T,\"c (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady statetemper a ture= 33.1695223665 c (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k = 330; #thermal conductivity\n",
+ "a = 95*10**(-6); #thermal expansion coefficient\n",
+ "R = 0.01; #radius in meters\n",
+ "To = 77; #temperature in kelvins\n",
+ "Tf = 273+50; #temperature in kelvins\n",
+ "theta1 = To - Tf; \n",
+ "T = 273+10; ##temperature in kelvins\n",
+ "theta = T - Tf;\n",
+ "h = 20; #heat transfer coefficient in W/m^2 K\n",
+ "\n",
+ "print\"Theta1 =\",theta1,\"K\";\n",
+ "print\"Theta =\",theta,\"K\";\n",
+ "print\"v/A =\",R/2,\"m\";\n",
+ "print\"k/a =\",round((k/a)*10**(-6),4),\"*10^(6)J/m^3 K\";\n",
+ "\n",
+ "time =(k/a)*(R/2)/h*math.log(theta1/theta);\n",
+ "\n",
+ "print\"Time taken by the rod to heat up =\",round(time,1),\"secs\";\n",
+ "\n",
+ "Bi = h*R/k;\n",
+ "\n",
+ "#result\n",
+ "print\"Biot number Bi =\",round(Bi*10**4,2),\"*10^(-4)\";\n",
+ "print\"Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta1 = -246 K\n",
+ "Theta = -40 K\n",
+ "v/A = 0.005 m\n",
+ "k/a = 3.4737 *10^(6)J/m^3 K\n",
+ "Time taken by the rod to heat up = 1577.4 secs\n",
+ "Biot number Bi = 6.06 *10^(-4)\n",
+ "Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(1) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20 ; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12; \n",
+ "ratiob1 = 0.48; \n",
+ "lambda1b = 1.0498; \n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho*Cp); #alpha\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta*ratiob0;\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "thetaxb1 = theta*ratiob1 ;\n",
+ "Txb1 = thetaxb1+Tw ;\n",
+ "\n",
+ "x = (2*math.sin((lambda1b)))/(lambda1b+((math.sin((lambda1b)))*(math.cos((lambda1b)))));\n",
+ "thetaxb0 = theta*x*(math.exp((-lambda1b**2)*Fourierno));\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=0 is\",round(Txb0,4),\"degree\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=0 is 41.3418 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(2) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12;\n",
+ "ratiob1 = 0.48;\n",
+ "lambda1b = 1.0498;\n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho *Cp);\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta * ratiob0;\n",
+ "Txb0 = thetaxb0 + Tw;\n",
+ "thetaxb1 = theta * ratiob1;\n",
+ "Txb1 = thetaxb1 + Tw;\n",
+ "x = 2*math.sin(((lambda1b)))/(lambda1b + (math.sin(((lambda1b))))*(math.cos((lambda1b))));\n",
+ "thetaxb1 = thetaxb0*(math.cos (lambda1b *1));\n",
+ "Txb1 = thetaxb1+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=1 is\",round(Txb1,3),\"degree C\\n\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=1 is 30.751 degree C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(1) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2; \n",
+ "\n",
+ "#calculations\n",
+ "t1 = rho*Cp*R /(3* h)* math.log ((To -Tf)/(T-Tf)); #sec\n",
+ "t1min = t1 /60 ; #min\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is\",round(t1,4),\"seconds i.e.\",round(t1min,4),\"minutes\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is 436.2545 seconds i.e. 7.2709 minutes\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(2) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2;\n",
+ "lambda1R = 0.430;\n",
+ "y = 5;\n",
+ "\n",
+ "#calculations\n",
+ "ratio = (T-Tf)/( To - Tf);\n",
+ "Bi = h*R/k;\n",
+ "x = 2* (math.sin(lambda1R)- lambda1R * math.cos(lambda1R))/ (lambda1R - math.sin ( lambda1R)*math.cos( lambda1R));\n",
+ "t=(math.log (ratio/x))/(-1*(k/(Cp*rho*R**2))*lambda1R**2);\n",
+ "tmin = t /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree\" \n",
+ "print \"C if internal temperature gradients are not neglected is\",round(t,3),\"seconds i.e\",round(tmin,3),\"min (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree\n",
+ "C if internal temperature gradients are not neglected is 446.95 seconds i.e 7.449 min (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.12 ; #m\n",
+ "T = 400 ; #C\n",
+ "To = 25 ; #C\n",
+ "t = 100/60 ; #hour\n",
+ "h = 10 ; #W/m^2 K\n",
+ "k = 1.0 ; #W/m K\n",
+ "alpha = 3.33*10** -3 ; #m^2/h\n",
+ "ratiox = 0.82 ;\n",
+ "ratioy = 0.41;\n",
+ "ratioz = 0.30;\n",
+ "\n",
+ "#calculations\n",
+ "x1 = h*a/k ;\n",
+ "x2 = k/(h*a);\n",
+ "x3 = alpha *t/a**2;\n",
+ "totalratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "ratiox = 1.1310* math.exp ( -(0.9036**2) *0.385) ;\n",
+ "ratioy = 1.0701* math.exp ( -(0.6533**2) *2.220) ;\n",
+ "ratioz = 1.0580* math.exp ( -(0.5932**2) *3.469) ;\n",
+ "ratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";\n",
+ "print\"Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\";\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the brick = 62.822 degree c\n",
+ "Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\n",
+ "Temperature at the centre of the brick = 62.822 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(1) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 350 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of copper is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.1852\n",
+ "Temperature at the tip of fin made of copper is 118.3099 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(2) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "l = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 15 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4*h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*l);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of steel is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.8944\n",
+ "Temperature at the tip of fin made of steel is 90.058 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(3) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 0.35 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "mL = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(mL,4);\n",
+ "print\"Temperature at the tip of fin made of teflon is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 5.8554\n",
+ "Temperature at the tip of fin made of teflon is 20.5729 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.02 ; #M\n",
+ "t = 0.002 ; #M\n",
+ "b = 0.2 ; #M\n",
+ "theta1 = 200 ; #C\n",
+ "h = 15 ; #W/m^2 K\n",
+ "k = 45 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*(t /2) /k ;\n",
+ "P = 2*( b+t); #m\n",
+ "A = b*t ;\n",
+ "mL = math.sqrt((h*P)/(A*k))*L;\n",
+ "n = math.tanh(mL)/mL;\n",
+ "qloss = n*h *40.4*2*10**-4*200;\n",
+ "\n",
+ "#result\n",
+ "print\"Fin Effectiveness =\",round(n,3);\n",
+ "print\"Heat loss rate from fin surface =\",round(qloss,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fin Effectiveness = 0.957\n",
+ "Heat loss rate from fin surface = 23.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 15 ; #W/m^2 .K\n",
+ "k = 300; #W/m.K\n",
+ "T = 200; #C\n",
+ "Tsurr = 30; #C\n",
+ "d = .01; #M\n",
+ "L = .1; #M #\n",
+ "A = .5*.5; #M^2\n",
+ "n = 100; #Number of Pins\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*d /2/ k; #Biot Number\n",
+ "mL = (h *4/ k/d) **.5* L; \n",
+ "zi = math.tanh (mL)/mL;\n",
+ "Res1 = 1/h/A; #Thermal resistance without fins\n",
+ "Res2 = 1/(h*(A - n*3.14 /4* d**2 + zi *(n* 3.14 *d*L))); #Thermal resistance with fins\n",
+ "delRes = Res1 - Res2 ; #heat transfer rate\n",
+ "q = (T- Tsurr )/ Res2 - (T- Tsurr )/ Res1 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Decrease in thermal resistaneat surface\",round(delRes,4),\"k/w\",\"\\nIncrease in heattransfer rate\",round(q,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in thermal resistaneat surface 0.1425 k/w \n",
+ "Increase in heattransfer rate 731.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__5.ipynb new file mode 100755 index 00000000..7143a80a --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__5.ipynb @@ -0,0 +1,1017 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32bc9bb5fc4ebce1f381403610ab4e977682e421d539322e9a2067d2e8eedb87"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Heat Conduction in Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius m\n",
+ "do=0.04; #inner radius m\n",
+ "ri=di/2; #inner radius m\n",
+ "ro=do/2; #inner radius m\n",
+ "k=0.58; #thermal conductivity of tube material w/m K\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length m\n",
+ "\n",
+ "#calculations\n",
+ "q=l*2*(3.14)*k*(ti-to)/math.log(ro/ri);\n",
+ "\n",
+ "#result\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per unit length is -157.6462 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius\n",
+ "do=0.04; #outer radius\n",
+ "ri=di/2; #inner radius\n",
+ "ro=do/2; #outer radius\n",
+ "k=0.58; #thermal conductivity of tube material\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length\n",
+ "h=5000; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Rthtube=(math.log(ro/ri))/(2*3.14*k*l); #thermal resistance of tube per unit length\n",
+ "Rthcond=1/(3.14*do*l*h); #thermal resistance of condensing steam per unit length\n",
+ "q=l*2*(3.14)*k*(ti-100)/math.log(ro/ri); #heat flow rate per unit meter \n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of tube per unit length is\",round(Rthtube,4),\"K/W\";\n",
+ "print\"Thermal resistance of condensing steam perunit length is\",round(Rthcond,5),\"K/W\";\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"K/W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of tube per unit length is 0.1903 K/W\n",
+ "Thermal resistance of condensing steam perunit length is 0.00159 K/W\n",
+ "Heat flow per unit length is -157.6462 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hw=140; #heat transfer coefficient on water side\n",
+ "ho=150; #heat transfer coefficient on oil side\n",
+ "k=30; #thermal conductivity\n",
+ "ro=0.1; #inner diameter of GI pipe on inside\n",
+ "ri=0.008; #outer diameter of GI pipe on inside\n",
+ "l=1; #per unit length\n",
+ "\n",
+ "#calculations\n",
+ "RinnerGI=math.log((ro/ri))/(2*3.14*k*l); #Thermal resistance of inner GI pipe\n",
+ "Roilside=1/(ho*3.14*2*ri*l); #Thermal resistanceon the oil side per unit length\n",
+ "Rwaterside=1/(hw*3.14*2*ro*l); #Thermal resistanceon the water side per unit length\n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of inner GI pipe =\",round(RinnerGI,5),\"K/W\";\n",
+ "print\"Thermal resistance on the oil side perunit length =\",round(Roilside,5),\"K/W\";\n",
+ "print\"Thermal resistance on cold water side per unit length =\",round(Rwaterside,5),\"K/W\";\n",
+ "print\"So,Engineer in-charge has made a bad decision\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of inner GI pipe = 0.01341 K/W\n",
+ "Thermal resistance on the oil side perunit length = 0.1327 K/W\n",
+ "Thermal resistance on cold water side per unit length = 0.01137 K/W\n",
+ "So,Engineer in-charge has made a bad decision\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=300; #Internal temp of hot gas in degree Celsius\n",
+ "od=0.1; #Outer diameter of long metal pipe in meters\n",
+ "i_d=0.04; #Internal diamtere of long metal pipe in meters\n",
+ "ki=0.052; #thermal conductivity of mineral wood in W/mK\n",
+ "to=50; #Outer surface temperature in degree celsius\n",
+ "hi=29; #heat transfer coefficient in the inner side in W/m^2 K\n",
+ "ho=12; #heat transfer coefficient in the outer pipe W/m^2 K\n",
+ "t=25; # Surrounding temperature in degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "#Determination of thickness of insulation\n",
+ "#By solving the following two equations by trial and error method for r3\n",
+ "#q_L=2*3.14*0.047*(t1-t)/(1/hi+(0.047/ki)*2.303*math.log(r3/od/2)+(0.047/h0*r3));\n",
+ "#q_L=2*3.14*h0*(to-t);\n",
+ "#By trial and error we get\n",
+ "r3=0.082; #in m\n",
+ "t=r3-(od/2);\n",
+ "#Heat loss per unit length\n",
+ "q=600*(22/7)*r3;\n",
+ "\n",
+ "#Result\n",
+ "print\"Thickness of insulation =\",t*100,\"cm\";\n",
+ "print\"Heat loss per unit length =\",round(q,1),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 3.2 cm\n",
+ "Heat loss per unit length = 154.6 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=90; #Temp on inner side in degree celsius\n",
+ "to=30; #Temp on outer side in degree celsius\n",
+ "hi=500; #heat transfer coeffcient in W/m^2 K\n",
+ "ho=10; #heat transfer coeffcient in W/m^2 K\n",
+ "i_d=0.016; #Internal diameter in meters\n",
+ "od=0.02; #Outer diameter in meters\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "r3=np.linspace (0.01,0.06,12);\n",
+ "t=[0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5]\n",
+ "q_L=(2*(3.14)*(i_d/2)*(ti-to))/((1/hi)+(0.008/0.2)*np.log(r3/0.01) + (0.008/r3*(1/ho)));\n",
+ "\n",
+ "#Result\n",
+ "print \"Insulaion thickness (cm)\", \" r3 (m)\",\" Heat loss rate per meter (W/m) \" \n",
+ "print \" \",t[0],\" \",0.01,\" \",round(q_L[0],1),\"(roundoff error)\"\n",
+ "print \" \",t[1],\" \",0.015,\" \", round(q_L[1],1),\"(roundoff error)\"\n",
+ "print \" \",t[2],\" \",0.02,\" \",round(q_L[2],1),\"(roundoff error)\"\n",
+ "print \" \",t[4],\" \",0.03,\" \",round(q_L[4],1),\"(roundoff error)\"\n",
+ "print \" \",t[6],\" \",0.04,\" \",round(q_L[6],1),\"(roundoff error)\"\n",
+ "print \" \",t[8],\" \",0.05,\" \",round(q_L[8],1),\"(roundoff error)\"\n",
+ "print \" \",t[10],\" \",0.06,\" \",round(q_L[10],1),\"(roundoff error)\"\n",
+ "plt.plot (t,q_L);\n",
+ "plt.title (\"Variation of heat loss rate with insulation thickness\");\n",
+ "plt.xlabel(\" Insulation thickness in cm\");\n",
+ "plt.ylabel(\" Heat Loss in W/m \");\n",
+ "plt.show();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Insulaion thickness (cm) r3 (m) Heat loss rate per meter (W/m) \n",
+ " 0 0.01 36.8 (roundoff error)\n",
+ " 0.5 0.015 41.9 (roundoff error)\n",
+ " 1 0.02 43.2 (roundoff error)\n",
+ " 2 0.03 42.0 (roundoff error)\n",
+ " 3 0.04 39.6 (roundoff error)\n",
+ " 4 0.05 37.4 (roundoff error)\n",
+ " 5 0.06 35.5 (roundoff error)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEVCAYAAAAM3jVmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdcU2f3APCTsPfeIENE2YSpoIIi4gK3dQEO1OpbtWqt\nYh3UuuqoVVurdaDgrrWKiCIqQwVBZYnUDQKCArI3Se7vj/vm15SXESDhhuR8P5/7UZLce8+9hJMn\nz33ueWgEQQBCCCHxQKc6AIQQQr0Hkz5CCIkRTPoIISRGMOkjhJAYwaSPEEJiBJM+QgiJEUz6HVBS\nUqrJy8sz6c66Z8+enePr6xvD55A69fDhQ48BAwa8VlJSqomMjPRv/byJiUne3bt3vXs7LgAALy+v\n+BMnTiykYt/CIj8/v5+SklINQRC09l5Dp9PZ7969M+Nlezt37gxZtGjRMf5F+L9CQ0NDAwICIrq7\nvo2NTXZiYuJwfsbUno7OH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kIIiZH/\nAxLp4OAIwDpgAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4fccf30>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hnatural = 10; #heat transfer coefficient for natural \n",
+ "hforced = 50; #heat transfer coefficient for forced\n",
+ "k1 = 0.2; #thermal conductivity\n",
+ "k2 = 0.05; #thermal conductivity\n",
+ "\n",
+ "#result\n",
+ "print\"critical radius of insulation in cm\";\n",
+ "print\"\\n h=10 h=50\";\n",
+ "print\"\\nAsbestos \",k1 *100/ hnatural,\" \", k1*100/ hforced;\n",
+ "print\"\\nMineral wool \",k2 *100/ hnatural,\" \", k2*100/ hforced;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical radius of insulation in cm\n",
+ "\n",
+ " h=10 h=50\n",
+ "\n",
+ "Asbestos 2.0 0.4\n",
+ "\n",
+ "Mineral wool 0.5 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=5; #Height\n",
+ "l=10; #Length\n",
+ "t=1; #thickness\n",
+ "k=1.05; #W/m K\n",
+ "q=58; #W/m^3\n",
+ "t1=35; #c\n",
+ "h=11.6; #Heat transfer coefficient\n",
+ "\n",
+ "#calculations\n",
+ "b=t/2;\n",
+ "tmax=t1+q*b*(b/(2*k)+1/h);\n",
+ "\n",
+ "#result\n",
+ "print\"Maximum Temperature =\",round(tmax,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Temperature = 44.405 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#The bar will have two dimensional variation in temperature\n",
+ "#the differential equation is subject to boundary conditions\n",
+ "x1 = 0; #cm\n",
+ "Tx1 = 30; #C\n",
+ "x2 = 5; #cm\n",
+ "Tx2 = 30; #C\n",
+ "y1 = 0; #cm\n",
+ "Ty1 = 30; #C\n",
+ "y2 = 10; #cm\n",
+ "Ty2 = 130; #C\n",
+ "\n",
+ "#substituting theta = T-30 and using eqn 2.6.11\n",
+ "#putting x = 2.5cm and y = 5cm in infinite summation series\n",
+ "n = 1;\n",
+ "x1 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 3;\n",
+ "x2 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 5;\n",
+ "x3 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "x = x1+x3+x3;\n",
+ "T = x *100+30;\n",
+ "\n",
+ "#result\n",
+ "print \"Steady statetemper a ture= \",T,\"c (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady statetemper a ture= 33.1695223665 c (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k = 330; #thermal conductivity\n",
+ "a = 95*10**(-6); #thermal expansion coefficient\n",
+ "R = 0.01; #radius in meters\n",
+ "To = 77; #temperature in kelvins\n",
+ "Tf = 273+50; #temperature in kelvins\n",
+ "theta1 = To - Tf; \n",
+ "T = 273+10; ##temperature in kelvins\n",
+ "theta = T - Tf;\n",
+ "h = 20; #heat transfer coefficient in W/m^2 K\n",
+ "\n",
+ "print\"Theta1 =\",theta1,\"K\";\n",
+ "print\"Theta =\",theta,\"K\";\n",
+ "print\"v/A =\",R/2,\"m\";\n",
+ "print\"k/a =\",round((k/a)*10**(-6),4),\"*10^(6)J/m^3 K\";\n",
+ "\n",
+ "time =(k/a)*(R/2)/h*math.log(theta1/theta);\n",
+ "\n",
+ "print\"Time taken by the rod to heat up =\",round(time,1),\"secs\";\n",
+ "\n",
+ "Bi = h*R/k;\n",
+ "\n",
+ "#result\n",
+ "print\"Biot number Bi =\",round(Bi*10**4,2),\"*10^(-4)\";\n",
+ "print\"Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta1 = -246 K\n",
+ "Theta = -40 K\n",
+ "v/A = 0.005 m\n",
+ "k/a = 3.4737 *10^(6)J/m^3 K\n",
+ "Time taken by the rod to heat up = 1577.4 secs\n",
+ "Biot number Bi = 6.06 *10^(-4)\n",
+ "Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(1) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20 ; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12; \n",
+ "ratiob1 = 0.48; \n",
+ "lambda1b = 1.0498; \n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho*Cp); #alpha\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta*ratiob0;\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "thetaxb1 = theta*ratiob1 ;\n",
+ "Txb1 = thetaxb1+Tw ;\n",
+ "\n",
+ "x = (2*math.sin((lambda1b)))/(lambda1b+((math.sin((lambda1b)))*(math.cos((lambda1b)))));\n",
+ "thetaxb0 = theta*x*(math.exp((-lambda1b**2)*Fourierno));\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=0 is\",round(Txb0,4),\"degree\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=0 is 41.3418 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(2) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12;\n",
+ "ratiob1 = 0.48;\n",
+ "lambda1b = 1.0498;\n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho *Cp);\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta * ratiob0;\n",
+ "Txb0 = thetaxb0 + Tw;\n",
+ "thetaxb1 = theta * ratiob1;\n",
+ "Txb1 = thetaxb1 + Tw;\n",
+ "x = 2*math.sin(((lambda1b)))/(lambda1b + (math.sin(((lambda1b))))*(math.cos((lambda1b))));\n",
+ "thetaxb1 = thetaxb0*(math.cos (lambda1b *1));\n",
+ "Txb1 = thetaxb1+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=1 is\",round(Txb1,3),\"degree C\\n\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=1 is 30.751 degree C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(1) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2; \n",
+ "\n",
+ "#calculations\n",
+ "t1 = rho*Cp*R /(3* h)* math.log ((To -Tf)/(T-Tf)); #sec\n",
+ "t1min = t1 /60 ; #min\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is\",round(t1,4),\"seconds i.e.\",round(t1min,4),\"minutes\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is 436.2545 seconds i.e. 7.2709 minutes\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(2) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2;\n",
+ "lambda1R = 0.430;\n",
+ "y = 5;\n",
+ "\n",
+ "#calculations\n",
+ "ratio = (T-Tf)/( To - Tf);\n",
+ "Bi = h*R/k;\n",
+ "x = 2* (math.sin(lambda1R)- lambda1R * math.cos(lambda1R))/ (lambda1R - math.sin ( lambda1R)*math.cos( lambda1R));\n",
+ "t=(math.log (ratio/x))/(-1*(k/(Cp*rho*R**2))*lambda1R**2);\n",
+ "tmin = t /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree\" \n",
+ "print \"C if internal temperature gradients are not neglected is\",round(t,3),\"seconds i.e\",round(tmin,3),\"min (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree\n",
+ "C if internal temperature gradients are not neglected is 446.95 seconds i.e 7.449 min (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.12 ; #m\n",
+ "T = 400 ; #C\n",
+ "To = 25 ; #C\n",
+ "t = 100/60 ; #hour\n",
+ "h = 10 ; #W/m^2 K\n",
+ "k = 1.0 ; #W/m K\n",
+ "alpha = 3.33*10** -3 ; #m^2/h\n",
+ "ratiox = 0.82 ;\n",
+ "ratioy = 0.41;\n",
+ "ratioz = 0.30;\n",
+ "\n",
+ "#calculations\n",
+ "x1 = h*a/k ;\n",
+ "x2 = k/(h*a);\n",
+ "x3 = alpha *t/a**2;\n",
+ "totalratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "ratiox = 1.1310* math.exp ( -(0.9036**2) *0.385) ;\n",
+ "ratioy = 1.0701* math.exp ( -(0.6533**2) *2.220) ;\n",
+ "ratioz = 1.0580* math.exp ( -(0.5932**2) *3.469) ;\n",
+ "ratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";\n",
+ "print\"Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\";\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the brick = 62.822 degree c\n",
+ "Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\n",
+ "Temperature at the centre of the brick = 62.822 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(1) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 350 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of copper is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.1852\n",
+ "Temperature at the tip of fin made of copper is 118.3099 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(2) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "l = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 15 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4*h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*l);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of steel is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.8944\n",
+ "Temperature at the tip of fin made of steel is 90.058 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(3) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 0.35 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "mL = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(mL,4);\n",
+ "print\"Temperature at the tip of fin made of teflon is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 5.8554\n",
+ "Temperature at the tip of fin made of teflon is 20.5729 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.02 ; #M\n",
+ "t = 0.002 ; #M\n",
+ "b = 0.2 ; #M\n",
+ "theta1 = 200 ; #C\n",
+ "h = 15 ; #W/m^2 K\n",
+ "k = 45 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*(t /2) /k ;\n",
+ "P = 2*( b+t); #m\n",
+ "A = b*t ;\n",
+ "mL = math.sqrt((h*P)/(A*k))*L;\n",
+ "n = math.tanh(mL)/mL;\n",
+ "qloss = n*h *40.4*2*10**-4*200;\n",
+ "\n",
+ "#result\n",
+ "print\"Fin Effectiveness =\",round(n,3);\n",
+ "print\"Heat loss rate from fin surface =\",round(qloss,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fin Effectiveness = 0.957\n",
+ "Heat loss rate from fin surface = 23.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 15 ; #W/m^2 .K\n",
+ "k = 300; #W/m.K\n",
+ "T = 200; #C\n",
+ "Tsurr = 30; #C\n",
+ "d = .01; #M\n",
+ "L = .1; #M #\n",
+ "A = .5*.5; #M^2\n",
+ "n = 100; #Number of Pins\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*d /2/ k; #Biot Number\n",
+ "mL = (h *4/ k/d) **.5* L; \n",
+ "zi = math.tanh (mL)/mL;\n",
+ "Res1 = 1/h/A; #Thermal resistance without fins\n",
+ "Res2 = 1/(h*(A - n*3.14 /4* d**2 + zi *(n* 3.14 *d*L))); #Thermal resistance with fins\n",
+ "delRes = Res1 - Res2 ; #heat transfer rate\n",
+ "q = (T- Tsurr )/ Res2 - (T- Tsurr )/ Res1 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Decrease in thermal resistaneat surface\",round(delRes,4),\"k/w\",\"\\nIncrease in heattransfer rate\",round(q,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in thermal resistaneat surface 0.1425 k/w \n",
+ "Increase in heattransfer rate 731.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__6.ipynb new file mode 100755 index 00000000..7143a80a --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__6.ipynb @@ -0,0 +1,1017 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32bc9bb5fc4ebce1f381403610ab4e977682e421d539322e9a2067d2e8eedb87"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Heat Conduction in Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius m\n",
+ "do=0.04; #inner radius m\n",
+ "ri=di/2; #inner radius m\n",
+ "ro=do/2; #inner radius m\n",
+ "k=0.58; #thermal conductivity of tube material w/m K\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length m\n",
+ "\n",
+ "#calculations\n",
+ "q=l*2*(3.14)*k*(ti-to)/math.log(ro/ri);\n",
+ "\n",
+ "#result\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per unit length is -157.6462 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius\n",
+ "do=0.04; #outer radius\n",
+ "ri=di/2; #inner radius\n",
+ "ro=do/2; #outer radius\n",
+ "k=0.58; #thermal conductivity of tube material\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length\n",
+ "h=5000; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Rthtube=(math.log(ro/ri))/(2*3.14*k*l); #thermal resistance of tube per unit length\n",
+ "Rthcond=1/(3.14*do*l*h); #thermal resistance of condensing steam per unit length\n",
+ "q=l*2*(3.14)*k*(ti-100)/math.log(ro/ri); #heat flow rate per unit meter \n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of tube per unit length is\",round(Rthtube,4),\"K/W\";\n",
+ "print\"Thermal resistance of condensing steam perunit length is\",round(Rthcond,5),\"K/W\";\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"K/W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of tube per unit length is 0.1903 K/W\n",
+ "Thermal resistance of condensing steam perunit length is 0.00159 K/W\n",
+ "Heat flow per unit length is -157.6462 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hw=140; #heat transfer coefficient on water side\n",
+ "ho=150; #heat transfer coefficient on oil side\n",
+ "k=30; #thermal conductivity\n",
+ "ro=0.1; #inner diameter of GI pipe on inside\n",
+ "ri=0.008; #outer diameter of GI pipe on inside\n",
+ "l=1; #per unit length\n",
+ "\n",
+ "#calculations\n",
+ "RinnerGI=math.log((ro/ri))/(2*3.14*k*l); #Thermal resistance of inner GI pipe\n",
+ "Roilside=1/(ho*3.14*2*ri*l); #Thermal resistanceon the oil side per unit length\n",
+ "Rwaterside=1/(hw*3.14*2*ro*l); #Thermal resistanceon the water side per unit length\n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of inner GI pipe =\",round(RinnerGI,5),\"K/W\";\n",
+ "print\"Thermal resistance on the oil side perunit length =\",round(Roilside,5),\"K/W\";\n",
+ "print\"Thermal resistance on cold water side per unit length =\",round(Rwaterside,5),\"K/W\";\n",
+ "print\"So,Engineer in-charge has made a bad decision\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of inner GI pipe = 0.01341 K/W\n",
+ "Thermal resistance on the oil side perunit length = 0.1327 K/W\n",
+ "Thermal resistance on cold water side per unit length = 0.01137 K/W\n",
+ "So,Engineer in-charge has made a bad decision\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=300; #Internal temp of hot gas in degree Celsius\n",
+ "od=0.1; #Outer diameter of long metal pipe in meters\n",
+ "i_d=0.04; #Internal diamtere of long metal pipe in meters\n",
+ "ki=0.052; #thermal conductivity of mineral wood in W/mK\n",
+ "to=50; #Outer surface temperature in degree celsius\n",
+ "hi=29; #heat transfer coefficient in the inner side in W/m^2 K\n",
+ "ho=12; #heat transfer coefficient in the outer pipe W/m^2 K\n",
+ "t=25; # Surrounding temperature in degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "#Determination of thickness of insulation\n",
+ "#By solving the following two equations by trial and error method for r3\n",
+ "#q_L=2*3.14*0.047*(t1-t)/(1/hi+(0.047/ki)*2.303*math.log(r3/od/2)+(0.047/h0*r3));\n",
+ "#q_L=2*3.14*h0*(to-t);\n",
+ "#By trial and error we get\n",
+ "r3=0.082; #in m\n",
+ "t=r3-(od/2);\n",
+ "#Heat loss per unit length\n",
+ "q=600*(22/7)*r3;\n",
+ "\n",
+ "#Result\n",
+ "print\"Thickness of insulation =\",t*100,\"cm\";\n",
+ "print\"Heat loss per unit length =\",round(q,1),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 3.2 cm\n",
+ "Heat loss per unit length = 154.6 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=90; #Temp on inner side in degree celsius\n",
+ "to=30; #Temp on outer side in degree celsius\n",
+ "hi=500; #heat transfer coeffcient in W/m^2 K\n",
+ "ho=10; #heat transfer coeffcient in W/m^2 K\n",
+ "i_d=0.016; #Internal diameter in meters\n",
+ "od=0.02; #Outer diameter in meters\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "r3=np.linspace (0.01,0.06,12);\n",
+ "t=[0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5]\n",
+ "q_L=(2*(3.14)*(i_d/2)*(ti-to))/((1/hi)+(0.008/0.2)*np.log(r3/0.01) + (0.008/r3*(1/ho)));\n",
+ "\n",
+ "#Result\n",
+ "print \"Insulaion thickness (cm)\", \" r3 (m)\",\" Heat loss rate per meter (W/m) \" \n",
+ "print \" \",t[0],\" \",0.01,\" \",round(q_L[0],1),\"(roundoff error)\"\n",
+ "print \" \",t[1],\" \",0.015,\" \", round(q_L[1],1),\"(roundoff error)\"\n",
+ "print \" \",t[2],\" \",0.02,\" \",round(q_L[2],1),\"(roundoff error)\"\n",
+ "print \" \",t[4],\" \",0.03,\" \",round(q_L[4],1),\"(roundoff error)\"\n",
+ "print \" \",t[6],\" \",0.04,\" \",round(q_L[6],1),\"(roundoff error)\"\n",
+ "print \" \",t[8],\" \",0.05,\" \",round(q_L[8],1),\"(roundoff error)\"\n",
+ "print \" \",t[10],\" \",0.06,\" \",round(q_L[10],1),\"(roundoff error)\"\n",
+ "plt.plot (t,q_L);\n",
+ "plt.title (\"Variation of heat loss rate with insulation thickness\");\n",
+ "plt.xlabel(\" Insulation thickness in cm\");\n",
+ "plt.ylabel(\" Heat Loss in W/m \");\n",
+ "plt.show();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Insulaion thickness (cm) r3 (m) Heat loss rate per meter (W/m) \n",
+ " 0 0.01 36.8 (roundoff error)\n",
+ " 0.5 0.015 41.9 (roundoff error)\n",
+ " 1 0.02 43.2 (roundoff error)\n",
+ " 2 0.03 42.0 (roundoff error)\n",
+ " 3 0.04 39.6 (roundoff error)\n",
+ " 4 0.05 37.4 (roundoff error)\n",
+ " 5 0.06 35.5 (roundoff error)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEVCAYAAAAM3jVmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdcU2f3APCTsPfeIENE2YSpoIIi4gK3dQEO1OpbtWqt\nYh3UuuqoVVurdaDgrrWKiCIqQwVBZYnUDQKCArI3Se7vj/vm15SXESDhhuR8P5/7UZLce8+9hJMn\nz33ueWgEQQBCCCHxQKc6AIQQQr0Hkz5CCIkRTPoIISRGMOkjhJAYwaSPEEJiBJM+QgiJEUz6HVBS\nUqrJy8sz6c66Z8+enePr6xvD55A69fDhQ48BAwa8VlJSqomMjPRv/byJiUne3bt3vXs7LgAALy+v\n+BMnTiykYt/CIj8/v5+SklINQRC09l5Dp9PZ7969M+Nlezt37gxZtGjRMf5F+L9CQ0NDAwICIrq7\nvo2NTXZiYuJwfsbUno7OHa9/kz09XmEnMkl/zJgxt7Zs2fJ968evXbs2UU9Pr5jNZnf5WGtqapRM\nTEzyOntdXl6eCZ1OZ3PvY86cOWdjYmJ8u7rPntq8efPWFStWHKypqVHy9/ePbP08jUYjaDQa32/O\nOHXq1Lxhw4bd7+g1gto3v3Ql2XZXv3798mtqapQ456GnH4QhISE7jx07toh/Ef6vrvzO5s2bd2rT\npk0/cD+WnZ1tM3z48ER+x9XVc8fr36Qwv0f5QWSS/rx5806dOXNmbuvHIyIiAubOnXuGTqezed0W\nk8mU7E4MHbXeekt+fn4/KyurHKrjEDYsFkuCl9f19u+wLyQYYXhft0VQ505Yj5dvCIIQiaW+vl5O\nRUWlMjExcRjnsfLycjVZWdmGrKws25SUFNfBgwcnq6qqVujp6RV99dVXh5qbm6U4r6XRaOxff/11\nmbm5+WszM7O3nMfevn1rRhAEREVFjXdwcEhXVlauMjIyyg8NDd3C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pqammQaGhrkCIKgqaqqVkZFRU0ICQnZmZCQ4NnetjjfQi5fvjyt\ntLRUCwCgvLxcPT8/v9/nz581mEym5JQpU6788MMPm9LS0hzbO6cdxdrZ8bi5uaUkJiYO57Tc+T0i\nCwkf/LRG3cI9/0HruRBoNBrBYrEkAgICIqqqqlQIgqCtXLnygLKycvXUqVP/DA8PD7Sxscl2c3NL\nGThw4MvW25kzZ85ZPz+/63Z2dlnOzs5PLC0t/wYA0NDQ+Ozh4fHQ1tb22bhx46KXLVt2mLPOsmXL\nDi9duvQ3Ozu7LElJSebp06eDpKSkWmg0GtFWfK2PZ/Hixb+PGTPmloGBwYe7d+96tz4+zs/c/4+I\niAhYsmTJ0c2bN2+VlpZuvnTp0gzO89ra2iVRUVETxo4de/PkyZML2tuvpaXl39u2bds4evTo22w2\nmy4lJdVy+PDhZbKyso3z588P43wr2rVr1/r2zmnrY2sr1vZoaWmV/v7774unTJlyhc1m03V0dD7F\nxMT48vI77mi7SHhhwTWEEBIj2L2DEEJiBJM+QgiJEUz6CCEkRjDpI4SQGMGkjxBCYgSTPkIIiZH/\nAxLp4OAIwDpgAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4fccf30>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hnatural = 10; #heat transfer coefficient for natural \n",
+ "hforced = 50; #heat transfer coefficient for forced\n",
+ "k1 = 0.2; #thermal conductivity\n",
+ "k2 = 0.05; #thermal conductivity\n",
+ "\n",
+ "#result\n",
+ "print\"critical radius of insulation in cm\";\n",
+ "print\"\\n h=10 h=50\";\n",
+ "print\"\\nAsbestos \",k1 *100/ hnatural,\" \", k1*100/ hforced;\n",
+ "print\"\\nMineral wool \",k2 *100/ hnatural,\" \", k2*100/ hforced;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical radius of insulation in cm\n",
+ "\n",
+ " h=10 h=50\n",
+ "\n",
+ "Asbestos 2.0 0.4\n",
+ "\n",
+ "Mineral wool 0.5 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=5; #Height\n",
+ "l=10; #Length\n",
+ "t=1; #thickness\n",
+ "k=1.05; #W/m K\n",
+ "q=58; #W/m^3\n",
+ "t1=35; #c\n",
+ "h=11.6; #Heat transfer coefficient\n",
+ "\n",
+ "#calculations\n",
+ "b=t/2;\n",
+ "tmax=t1+q*b*(b/(2*k)+1/h);\n",
+ "\n",
+ "#result\n",
+ "print\"Maximum Temperature =\",round(tmax,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Temperature = 44.405 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#The bar will have two dimensional variation in temperature\n",
+ "#the differential equation is subject to boundary conditions\n",
+ "x1 = 0; #cm\n",
+ "Tx1 = 30; #C\n",
+ "x2 = 5; #cm\n",
+ "Tx2 = 30; #C\n",
+ "y1 = 0; #cm\n",
+ "Ty1 = 30; #C\n",
+ "y2 = 10; #cm\n",
+ "Ty2 = 130; #C\n",
+ "\n",
+ "#substituting theta = T-30 and using eqn 2.6.11\n",
+ "#putting x = 2.5cm and y = 5cm in infinite summation series\n",
+ "n = 1;\n",
+ "x1 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 3;\n",
+ "x2 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 5;\n",
+ "x3 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "x = x1+x3+x3;\n",
+ "T = x *100+30;\n",
+ "\n",
+ "#result\n",
+ "print \"Steady statetemper a ture= \",T,\"c (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady statetemper a ture= 33.1695223665 c (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k = 330; #thermal conductivity\n",
+ "a = 95*10**(-6); #thermal expansion coefficient\n",
+ "R = 0.01; #radius in meters\n",
+ "To = 77; #temperature in kelvins\n",
+ "Tf = 273+50; #temperature in kelvins\n",
+ "theta1 = To - Tf; \n",
+ "T = 273+10; ##temperature in kelvins\n",
+ "theta = T - Tf;\n",
+ "h = 20; #heat transfer coefficient in W/m^2 K\n",
+ "\n",
+ "print\"Theta1 =\",theta1,\"K\";\n",
+ "print\"Theta =\",theta,\"K\";\n",
+ "print\"v/A =\",R/2,\"m\";\n",
+ "print\"k/a =\",round((k/a)*10**(-6),4),\"*10^(6)J/m^3 K\";\n",
+ "\n",
+ "time =(k/a)*(R/2)/h*math.log(theta1/theta);\n",
+ "\n",
+ "print\"Time taken by the rod to heat up =\",round(time,1),\"secs\";\n",
+ "\n",
+ "Bi = h*R/k;\n",
+ "\n",
+ "#result\n",
+ "print\"Biot number Bi =\",round(Bi*10**4,2),\"*10^(-4)\";\n",
+ "print\"Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta1 = -246 K\n",
+ "Theta = -40 K\n",
+ "v/A = 0.005 m\n",
+ "k/a = 3.4737 *10^(6)J/m^3 K\n",
+ "Time taken by the rod to heat up = 1577.4 secs\n",
+ "Biot number Bi = 6.06 *10^(-4)\n",
+ "Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(1) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20 ; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12; \n",
+ "ratiob1 = 0.48; \n",
+ "lambda1b = 1.0498; \n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho*Cp); #alpha\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta*ratiob0;\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "thetaxb1 = theta*ratiob1 ;\n",
+ "Txb1 = thetaxb1+Tw ;\n",
+ "\n",
+ "x = (2*math.sin((lambda1b)))/(lambda1b+((math.sin((lambda1b)))*(math.cos((lambda1b)))));\n",
+ "thetaxb0 = theta*x*(math.exp((-lambda1b**2)*Fourierno));\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=0 is\",round(Txb0,4),\"degree\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=0 is 41.3418 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(2) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12;\n",
+ "ratiob1 = 0.48;\n",
+ "lambda1b = 1.0498;\n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho *Cp);\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta * ratiob0;\n",
+ "Txb0 = thetaxb0 + Tw;\n",
+ "thetaxb1 = theta * ratiob1;\n",
+ "Txb1 = thetaxb1 + Tw;\n",
+ "x = 2*math.sin(((lambda1b)))/(lambda1b + (math.sin(((lambda1b))))*(math.cos((lambda1b))));\n",
+ "thetaxb1 = thetaxb0*(math.cos (lambda1b *1));\n",
+ "Txb1 = thetaxb1+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=1 is\",round(Txb1,3),\"degree C\\n\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=1 is 30.751 degree C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(1) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2; \n",
+ "\n",
+ "#calculations\n",
+ "t1 = rho*Cp*R /(3* h)* math.log ((To -Tf)/(T-Tf)); #sec\n",
+ "t1min = t1 /60 ; #min\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is\",round(t1,4),\"seconds i.e.\",round(t1min,4),\"minutes\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is 436.2545 seconds i.e. 7.2709 minutes\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(2) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2;\n",
+ "lambda1R = 0.430;\n",
+ "y = 5;\n",
+ "\n",
+ "#calculations\n",
+ "ratio = (T-Tf)/( To - Tf);\n",
+ "Bi = h*R/k;\n",
+ "x = 2* (math.sin(lambda1R)- lambda1R * math.cos(lambda1R))/ (lambda1R - math.sin ( lambda1R)*math.cos( lambda1R));\n",
+ "t=(math.log (ratio/x))/(-1*(k/(Cp*rho*R**2))*lambda1R**2);\n",
+ "tmin = t /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree\" \n",
+ "print \"C if internal temperature gradients are not neglected is\",round(t,3),\"seconds i.e\",round(tmin,3),\"min (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree\n",
+ "C if internal temperature gradients are not neglected is 446.95 seconds i.e 7.449 min (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.12 ; #m\n",
+ "T = 400 ; #C\n",
+ "To = 25 ; #C\n",
+ "t = 100/60 ; #hour\n",
+ "h = 10 ; #W/m^2 K\n",
+ "k = 1.0 ; #W/m K\n",
+ "alpha = 3.33*10** -3 ; #m^2/h\n",
+ "ratiox = 0.82 ;\n",
+ "ratioy = 0.41;\n",
+ "ratioz = 0.30;\n",
+ "\n",
+ "#calculations\n",
+ "x1 = h*a/k ;\n",
+ "x2 = k/(h*a);\n",
+ "x3 = alpha *t/a**2;\n",
+ "totalratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "ratiox = 1.1310* math.exp ( -(0.9036**2) *0.385) ;\n",
+ "ratioy = 1.0701* math.exp ( -(0.6533**2) *2.220) ;\n",
+ "ratioz = 1.0580* math.exp ( -(0.5932**2) *3.469) ;\n",
+ "ratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";\n",
+ "print\"Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\";\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the brick = 62.822 degree c\n",
+ "Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\n",
+ "Temperature at the centre of the brick = 62.822 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(1) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 350 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of copper is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.1852\n",
+ "Temperature at the tip of fin made of copper is 118.3099 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(2) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "l = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 15 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4*h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*l);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of steel is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.8944\n",
+ "Temperature at the tip of fin made of steel is 90.058 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(3) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 0.35 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "mL = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(mL,4);\n",
+ "print\"Temperature at the tip of fin made of teflon is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 5.8554\n",
+ "Temperature at the tip of fin made of teflon is 20.5729 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.02 ; #M\n",
+ "t = 0.002 ; #M\n",
+ "b = 0.2 ; #M\n",
+ "theta1 = 200 ; #C\n",
+ "h = 15 ; #W/m^2 K\n",
+ "k = 45 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*(t /2) /k ;\n",
+ "P = 2*( b+t); #m\n",
+ "A = b*t ;\n",
+ "mL = math.sqrt((h*P)/(A*k))*L;\n",
+ "n = math.tanh(mL)/mL;\n",
+ "qloss = n*h *40.4*2*10**-4*200;\n",
+ "\n",
+ "#result\n",
+ "print\"Fin Effectiveness =\",round(n,3);\n",
+ "print\"Heat loss rate from fin surface =\",round(qloss,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fin Effectiveness = 0.957\n",
+ "Heat loss rate from fin surface = 23.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 15 ; #W/m^2 .K\n",
+ "k = 300; #W/m.K\n",
+ "T = 200; #C\n",
+ "Tsurr = 30; #C\n",
+ "d = .01; #M\n",
+ "L = .1; #M #\n",
+ "A = .5*.5; #M^2\n",
+ "n = 100; #Number of Pins\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*d /2/ k; #Biot Number\n",
+ "mL = (h *4/ k/d) **.5* L; \n",
+ "zi = math.tanh (mL)/mL;\n",
+ "Res1 = 1/h/A; #Thermal resistance without fins\n",
+ "Res2 = 1/(h*(A - n*3.14 /4* d**2 + zi *(n* 3.14 *d*L))); #Thermal resistance with fins\n",
+ "delRes = Res1 - Res2 ; #heat transfer rate\n",
+ "q = (T- Tsurr )/ Res2 - (T- Tsurr )/ Res1 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Decrease in thermal resistaneat surface\",round(delRes,4),\"k/w\",\"\\nIncrease in heattransfer rate\",round(q,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in thermal resistaneat surface 0.1425 k/w \n",
+ "Increase in heattransfer rate 731.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__7.ipynb new file mode 100755 index 00000000..7143a80a --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_2_Heat_Conduction_in_Solids__7.ipynb @@ -0,0 +1,1017 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32bc9bb5fc4ebce1f381403610ab4e977682e421d539322e9a2067d2e8eedb87"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Heat Conduction in Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius m\n",
+ "do=0.04; #inner radius m\n",
+ "ri=di/2; #inner radius m\n",
+ "ro=do/2; #inner radius m\n",
+ "k=0.58; #thermal conductivity of tube material w/m K\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length m\n",
+ "\n",
+ "#calculations\n",
+ "q=l*2*(3.14)*k*(ti-to)/math.log(ro/ri);\n",
+ "\n",
+ "#result\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per unit length is -157.6462 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "di=0.02; #inner radius\n",
+ "do=0.04; #outer radius\n",
+ "ri=di/2; #inner radius\n",
+ "ro=do/2; #outer radius\n",
+ "k=0.58; #thermal conductivity of tube material\n",
+ "ti=70; #degree C\n",
+ "to=100; #degree C\n",
+ "l=1; #per unit length\n",
+ "h=5000; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Rthtube=(math.log(ro/ri))/(2*3.14*k*l); #thermal resistance of tube per unit length\n",
+ "Rthcond=1/(3.14*do*l*h); #thermal resistance of condensing steam per unit length\n",
+ "q=l*2*(3.14)*k*(ti-100)/math.log(ro/ri); #heat flow rate per unit meter \n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of tube per unit length is\",round(Rthtube,4),\"K/W\";\n",
+ "print\"Thermal resistance of condensing steam perunit length is\",round(Rthcond,5),\"K/W\";\n",
+ "print\"Heat flow per unit length is\",round(q,4),\"K/W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of tube per unit length is 0.1903 K/W\n",
+ "Thermal resistance of condensing steam perunit length is 0.00159 K/W\n",
+ "Heat flow per unit length is -157.6462 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hw=140; #heat transfer coefficient on water side\n",
+ "ho=150; #heat transfer coefficient on oil side\n",
+ "k=30; #thermal conductivity\n",
+ "ro=0.1; #inner diameter of GI pipe on inside\n",
+ "ri=0.008; #outer diameter of GI pipe on inside\n",
+ "l=1; #per unit length\n",
+ "\n",
+ "#calculations\n",
+ "RinnerGI=math.log((ro/ri))/(2*3.14*k*l); #Thermal resistance of inner GI pipe\n",
+ "Roilside=1/(ho*3.14*2*ri*l); #Thermal resistanceon the oil side per unit length\n",
+ "Rwaterside=1/(hw*3.14*2*ro*l); #Thermal resistanceon the water side per unit length\n",
+ "\n",
+ "#result\n",
+ "print\"Thermal resistance of inner GI pipe =\",round(RinnerGI,5),\"K/W\";\n",
+ "print\"Thermal resistance on the oil side perunit length =\",round(Roilside,5),\"K/W\";\n",
+ "print\"Thermal resistance on cold water side per unit length =\",round(Rwaterside,5),\"K/W\";\n",
+ "print\"So,Engineer in-charge has made a bad decision\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal resistance of inner GI pipe = 0.01341 K/W\n",
+ "Thermal resistance on the oil side perunit length = 0.1327 K/W\n",
+ "Thermal resistance on cold water side per unit length = 0.01137 K/W\n",
+ "So,Engineer in-charge has made a bad decision\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=300; #Internal temp of hot gas in degree Celsius\n",
+ "od=0.1; #Outer diameter of long metal pipe in meters\n",
+ "i_d=0.04; #Internal diamtere of long metal pipe in meters\n",
+ "ki=0.052; #thermal conductivity of mineral wood in W/mK\n",
+ "to=50; #Outer surface temperature in degree celsius\n",
+ "hi=29; #heat transfer coefficient in the inner side in W/m^2 K\n",
+ "ho=12; #heat transfer coefficient in the outer pipe W/m^2 K\n",
+ "t=25; # Surrounding temperature in degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "#Determination of thickness of insulation\n",
+ "#By solving the following two equations by trial and error method for r3\n",
+ "#q_L=2*3.14*0.047*(t1-t)/(1/hi+(0.047/ki)*2.303*math.log(r3/od/2)+(0.047/h0*r3));\n",
+ "#q_L=2*3.14*h0*(to-t);\n",
+ "#By trial and error we get\n",
+ "r3=0.082; #in m\n",
+ "t=r3-(od/2);\n",
+ "#Heat loss per unit length\n",
+ "q=600*(22/7)*r3;\n",
+ "\n",
+ "#Result\n",
+ "print\"Thickness of insulation =\",t*100,\"cm\";\n",
+ "print\"Heat loss per unit length =\",round(q,1),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 3.2 cm\n",
+ "Heat loss per unit length = 154.6 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "ti=90; #Temp on inner side in degree celsius\n",
+ "to=30; #Temp on outer side in degree celsius\n",
+ "hi=500; #heat transfer coeffcient in W/m^2 K\n",
+ "ho=10; #heat transfer coeffcient in W/m^2 K\n",
+ "i_d=0.016; #Internal diameter in meters\n",
+ "od=0.02; #Outer diameter in meters\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "r3=np.linspace (0.01,0.06,12);\n",
+ "t=[0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5]\n",
+ "q_L=(2*(3.14)*(i_d/2)*(ti-to))/((1/hi)+(0.008/0.2)*np.log(r3/0.01) + (0.008/r3*(1/ho)));\n",
+ "\n",
+ "#Result\n",
+ "print \"Insulaion thickness (cm)\", \" r3 (m)\",\" Heat loss rate per meter (W/m) \" \n",
+ "print \" \",t[0],\" \",0.01,\" \",round(q_L[0],1),\"(roundoff error)\"\n",
+ "print \" \",t[1],\" \",0.015,\" \", round(q_L[1],1),\"(roundoff error)\"\n",
+ "print \" \",t[2],\" \",0.02,\" \",round(q_L[2],1),\"(roundoff error)\"\n",
+ "print \" \",t[4],\" \",0.03,\" \",round(q_L[4],1),\"(roundoff error)\"\n",
+ "print \" \",t[6],\" \",0.04,\" \",round(q_L[6],1),\"(roundoff error)\"\n",
+ "print \" \",t[8],\" \",0.05,\" \",round(q_L[8],1),\"(roundoff error)\"\n",
+ "print \" \",t[10],\" \",0.06,\" \",round(q_L[10],1),\"(roundoff error)\"\n",
+ "plt.plot (t,q_L);\n",
+ "plt.title (\"Variation of heat loss rate with insulation thickness\");\n",
+ "plt.xlabel(\" Insulation thickness in cm\");\n",
+ "plt.ylabel(\" Heat Loss in W/m \");\n",
+ "plt.show();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Insulaion thickness (cm) r3 (m) Heat loss rate per meter (W/m) \n",
+ " 0 0.01 36.8 (roundoff error)\n",
+ " 0.5 0.015 41.9 (roundoff error)\n",
+ " 1 0.02 43.2 (roundoff error)\n",
+ " 2 0.03 42.0 (roundoff error)\n",
+ " 3 0.04 39.6 (roundoff error)\n",
+ " 4 0.05 37.4 (roundoff error)\n",
+ " 5 0.06 35.5 (roundoff error)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEVCAYAAAAM3jVmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdcU2f3APCTsPfeIENE2YSpoIIi4gK3dQEO1OpbtWqt\nYh3UuuqoVVurdaDgrrWKiCIqQwVBZYnUDQKCArI3Se7vj/vm15SXESDhhuR8P5/7UZLce8+9hJMn\nz33ueWgEQQBCCCHxQKc6AIQQQr0Hkz5CCIkRTPoIISRGMOkjhJAYwaSPEEJiBJM+QgiJEUz6HVBS\nUqrJy8sz6c66Z8+enePr6xvD55A69fDhQ48BAwa8VlJSqomMjPRv/byJiUne3bt3vXs7LgAALy+v\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oaWmV/v7774unTJlyhc1m03V0dD7F\nxMT48vI77mi7SHhhwTWEEBIj2L2DEEJiBJM+QgiJEUz6CCEkRjDpI4SQGMGkjxBCYgSTPkIIiZH/\nAxLp4OAIwDpgAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4fccf30>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "hnatural = 10; #heat transfer coefficient for natural \n",
+ "hforced = 50; #heat transfer coefficient for forced\n",
+ "k1 = 0.2; #thermal conductivity\n",
+ "k2 = 0.05; #thermal conductivity\n",
+ "\n",
+ "#result\n",
+ "print\"critical radius of insulation in cm\";\n",
+ "print\"\\n h=10 h=50\";\n",
+ "print\"\\nAsbestos \",k1 *100/ hnatural,\" \", k1*100/ hforced;\n",
+ "print\"\\nMineral wool \",k2 *100/ hnatural,\" \", k2*100/ hforced;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical radius of insulation in cm\n",
+ "\n",
+ " h=10 h=50\n",
+ "\n",
+ "Asbestos 2.0 0.4\n",
+ "\n",
+ "Mineral wool 0.5 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=5; #Height\n",
+ "l=10; #Length\n",
+ "t=1; #thickness\n",
+ "k=1.05; #W/m K\n",
+ "q=58; #W/m^3\n",
+ "t1=35; #c\n",
+ "h=11.6; #Heat transfer coefficient\n",
+ "\n",
+ "#calculations\n",
+ "b=t/2;\n",
+ "tmax=t1+q*b*(b/(2*k)+1/h);\n",
+ "\n",
+ "#result\n",
+ "print\"Maximum Temperature =\",round(tmax,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Temperature = 44.405 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#The bar will have two dimensional variation in temperature\n",
+ "#the differential equation is subject to boundary conditions\n",
+ "x1 = 0; #cm\n",
+ "Tx1 = 30; #C\n",
+ "x2 = 5; #cm\n",
+ "Tx2 = 30; #C\n",
+ "y1 = 0; #cm\n",
+ "Ty1 = 30; #C\n",
+ "y2 = 10; #cm\n",
+ "Ty2 = 130; #C\n",
+ "\n",
+ "#substituting theta = T-30 and using eqn 2.6.11\n",
+ "#putting x = 2.5cm and y = 5cm in infinite summation series\n",
+ "n = 1;\n",
+ "x1 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 3;\n",
+ "x2 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "n = 5;\n",
+ "x3 = (1- math.cos ( 3.14*3.14/180 *n))/( math.sinh (2*3.14* 3.14/180 *n))*math.sin(n**(3.14*3.14/180 /2))*math.sinh (n*3.14*3.14/180);\n",
+ "\n",
+ "x = x1+x3+x3;\n",
+ "T = x *100+30;\n",
+ "\n",
+ "#result\n",
+ "print \"Steady statetemper a ture= \",T,\"c (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady statetemper a ture= 33.1695223665 c (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "k = 330; #thermal conductivity\n",
+ "a = 95*10**(-6); #thermal expansion coefficient\n",
+ "R = 0.01; #radius in meters\n",
+ "To = 77; #temperature in kelvins\n",
+ "Tf = 273+50; #temperature in kelvins\n",
+ "theta1 = To - Tf; \n",
+ "T = 273+10; ##temperature in kelvins\n",
+ "theta = T - Tf;\n",
+ "h = 20; #heat transfer coefficient in W/m^2 K\n",
+ "\n",
+ "print\"Theta1 =\",theta1,\"K\";\n",
+ "print\"Theta =\",theta,\"K\";\n",
+ "print\"v/A =\",R/2,\"m\";\n",
+ "print\"k/a =\",round((k/a)*10**(-6),4),\"*10^(6)J/m^3 K\";\n",
+ "\n",
+ "time =(k/a)*(R/2)/h*math.log(theta1/theta);\n",
+ "\n",
+ "print\"Time taken by the rod to heat up =\",round(time,1),\"secs\";\n",
+ "\n",
+ "Bi = h*R/k;\n",
+ "\n",
+ "#result\n",
+ "print\"Biot number Bi =\",round(Bi*10**4,2),\"*10^(-4)\";\n",
+ "print\"Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta1 = -246 K\n",
+ "Theta = -40 K\n",
+ "v/A = 0.005 m\n",
+ "k/a = 3.4737 *10^(6)J/m^3 K\n",
+ "Time taken by the rod to heat up = 1577.4 secs\n",
+ "Biot number Bi = 6.06 *10^(-4)\n",
+ "Since Biot number is much less than 0.1,therefore assumption that internal temper a ture gradients are negligible is a good one\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(1) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20 ; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12; \n",
+ "ratiob1 = 0.48; \n",
+ "lambda1b = 1.0498; \n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho*Cp); #alpha\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta*ratiob0;\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "thetaxb1 = theta*ratiob1 ;\n",
+ "Txb1 = thetaxb1+Tw ;\n",
+ "\n",
+ "x = (2*math.sin((lambda1b)))/(lambda1b+((math.sin((lambda1b)))*(math.cos((lambda1b)))));\n",
+ "thetaxb0 = theta*x*(math.exp((-lambda1b**2)*Fourierno));\n",
+ "Txb0 = thetaxb0+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=0 is\",round(Txb0,4),\"degree\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=0 is 41.3418 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10(2) , Page no:58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.005; #m\n",
+ "t = 5*60; #time, [sec]\n",
+ "Th = 200; #C\n",
+ "Tw = 20; #C\n",
+ "h = 150; #W/m^2 K\n",
+ "rho = 2200; #kg/m^3\n",
+ "Cp = 1050; #J/kg K\n",
+ "k = 0.4; #W/m K\n",
+ "ratiob0 = 0.12;\n",
+ "ratiob1 = 0.48;\n",
+ "lambda1b = 1.0498;\n",
+ "\n",
+ "#calculations\n",
+ "theta = Th - Tw;\n",
+ "Biotno = h*b/k;\n",
+ "a = k/( rho *Cp);\n",
+ "Fourierno = a*t/b**2;\n",
+ "thetaxb0 = theta * ratiob0;\n",
+ "Txb0 = thetaxb0 + Tw;\n",
+ "thetaxb1 = theta * ratiob1;\n",
+ "Txb1 = thetaxb1 + Tw;\n",
+ "x = 2*math.sin(((lambda1b)))/(lambda1b + (math.sin(((lambda1b))))*(math.cos((lambda1b))));\n",
+ "thetaxb1 = thetaxb0*(math.cos (lambda1b *1));\n",
+ "Txb1 = thetaxb1+Tw;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at b=1 is\",round(Txb1,3),\"degree C\\n\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at b=1 is 30.751 degree C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(1) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2; \n",
+ "\n",
+ "#calculations\n",
+ "t1 = rho*Cp*R /(3* h)* math.log ((To -Tf)/(T-Tf)); #sec\n",
+ "t1min = t1 /60 ; #min\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is\",round(t1,4),\"seconds i.e.\",round(t1min,4),\"minutes\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree C if internal gradients are neglected is 436.2545 seconds i.e. 7.2709 minutes\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11(2) , Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.05 ; #m\n",
+ "To = 450 ; #degree C\n",
+ "Tf = 90 ; #degree C\n",
+ "T = 150 ; #degree C\n",
+ "h = 115 ; #W/m^2 K\n",
+ "rho = 8000 ; #kg/m^3\n",
+ "Cp = 0.42*1000 ; #kg/m^3\n",
+ "k = 46 ; #W/m K\n",
+ "R = D/2;\n",
+ "lambda1R = 0.430;\n",
+ "y = 5;\n",
+ "\n",
+ "#calculations\n",
+ "ratio = (T-Tf)/( To - Tf);\n",
+ "Bi = h*R/k;\n",
+ "x = 2* (math.sin(lambda1R)- lambda1R * math.cos(lambda1R))/ (lambda1R - math.sin ( lambda1R)*math.cos( lambda1R));\n",
+ "t=(math.log (ratio/x))/(-1*(k/(Cp*rho*R**2))*lambda1R**2);\n",
+ "tmin = t /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time taken by the centre of the ball to reach 150 degree\" \n",
+ "print \"C if internal temperature gradients are not neglected is\",round(t,3),\"seconds i.e\",round(tmin,3),\"min (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the centre of the ball to reach 150 degree\n",
+ "C if internal temperature gradients are not neglected is 446.95 seconds i.e 7.449 min (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.12 ; #m\n",
+ "T = 400 ; #C\n",
+ "To = 25 ; #C\n",
+ "t = 100/60 ; #hour\n",
+ "h = 10 ; #W/m^2 K\n",
+ "k = 1.0 ; #W/m K\n",
+ "alpha = 3.33*10** -3 ; #m^2/h\n",
+ "ratiox = 0.82 ;\n",
+ "ratioy = 0.41;\n",
+ "ratioz = 0.30;\n",
+ "\n",
+ "#calculations\n",
+ "x1 = h*a/k ;\n",
+ "x2 = k/(h*a);\n",
+ "x3 = alpha *t/a**2;\n",
+ "totalratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "ratiox = 1.1310* math.exp ( -(0.9036**2) *0.385) ;\n",
+ "ratioy = 1.0701* math.exp ( -(0.6533**2) *2.220) ;\n",
+ "ratioz = 1.0580* math.exp ( -(0.5932**2) *3.469) ;\n",
+ "ratio = ratiox * ratioy * ratioz ;\n",
+ "Tcentre = To + totalratio *(T-To) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";\n",
+ "print\"Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\";\n",
+ "print\"Temperature at the centre of the brick =\",round(Tcentre,3),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the brick = 62.822 degree c\n",
+ "Alternatively, obtaining Biot number and values of lambda1b and using eqn 2.7.20, we get\n",
+ "Temperature at the centre of the brick = 62.822 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(1) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 350 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of copper is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.1852\n",
+ "Temperature at the tip of fin made of copper is 118.3099 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(2) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "l = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 15 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4*h/(k*D)) **(1/2) ;\n",
+ "ml = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*l);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(ml,4);\n",
+ "print\"Temperature at the tip of fin made of steel is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 0.8944\n",
+ "Temperature at the tip of fin made of steel is 90.058 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13(3) , Page no:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.003 ; #m\n",
+ "L = 0.03 ; #m\n",
+ "h = 10 ; #W/m^2\n",
+ "Tf = 20 ; #C\n",
+ "T1 = 120 ; #C\n",
+ "k = 0.35 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "m = (4* h/(k*D)) **(1/2) ;\n",
+ "mL = m *0.03 ;\n",
+ "T = Tf + (T1 -Tf)/ math.cosh (m*L);\n",
+ "\n",
+ "#result\n",
+ "print\"ml=\",round(mL,4);\n",
+ "print\"Temperature at the tip of fin made of teflon is\",round(T,4),\"degree c\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ml= 5.8554\n",
+ "Temperature at the tip of fin made of teflon is 20.5729 degree c\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.02 ; #M\n",
+ "t = 0.002 ; #M\n",
+ "b = 0.2 ; #M\n",
+ "theta1 = 200 ; #C\n",
+ "h = 15 ; #W/m^2 K\n",
+ "k = 45 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*(t /2) /k ;\n",
+ "P = 2*( b+t); #m\n",
+ "A = b*t ;\n",
+ "mL = math.sqrt((h*P)/(A*k))*L;\n",
+ "n = math.tanh(mL)/mL;\n",
+ "qloss = n*h *40.4*2*10**-4*200;\n",
+ "\n",
+ "#result\n",
+ "print\"Fin Effectiveness =\",round(n,3);\n",
+ "print\"Heat loss rate from fin surface =\",round(qloss,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fin Effectiveness = 0.957\n",
+ "Heat loss rate from fin surface = 23.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 15 ; #W/m^2 .K\n",
+ "k = 300; #W/m.K\n",
+ "T = 200; #C\n",
+ "Tsurr = 30; #C\n",
+ "d = .01; #M\n",
+ "L = .1; #M #\n",
+ "A = .5*.5; #M^2\n",
+ "n = 100; #Number of Pins\n",
+ "\n",
+ "#calculations\n",
+ "Bi = h*d /2/ k; #Biot Number\n",
+ "mL = (h *4/ k/d) **.5* L; \n",
+ "zi = math.tanh (mL)/mL;\n",
+ "Res1 = 1/h/A; #Thermal resistance without fins\n",
+ "Res2 = 1/(h*(A - n*3.14 /4* d**2 + zi *(n* 3.14 *d*L))); #Thermal resistance with fins\n",
+ "delRes = Res1 - Res2 ; #heat transfer rate\n",
+ "q = (T- Tsurr )/ Res2 - (T- Tsurr )/ Res1 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Decrease in thermal resistaneat surface\",round(delRes,4),\"k/w\",\"\\nIncrease in heattransfer rate\",round(q,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in thermal resistaneat surface 0.1425 k/w \n",
+ "Increase in heattransfer rate 731.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_1.ipynb new file mode 100755 index 00000000..b531d4b6 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_1.ipynb @@ -0,0 +1,641 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3f494d977b9882173f1289b65c0c4b5e1b60b5511a2cd5bc368a603771906dc9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Thermal Radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 , Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T = 5779 ; #Temperature,in Kelvin\n",
+ "\n",
+ "#calculations\n",
+ "lambdam = 0.00290/ T ; #m\n",
+ "e = 2*(3.14) *0.596*(10** -16) /(((0.5018*10** -6) **5) *( math.exp(0.014387/0.00290) -1)) ; #W/m^2 m\n",
+ "eblmax = e / 10**6 ;\n",
+ "eearth = eblmax *((0.695*10**6) /(1.496*10**8) )**2 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Value of emissivity on sun surface is\",round(eblmax,4),\"W/m^2 um\";\n",
+ "print\"The value of emmissivity on earths surface is\",round(eearth,4),\"W/m^2 um\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of emissivity on sun surface is 82995768.8548 W/m^2 um\n",
+ "The value of emmissivity on earths surface is 1791.2755 W/m^2 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 , Page no:115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "T = 1500; #tempera ture is in kelvins\n",
+ "eb = ( Stefanconstt )*(T **(4) ); #energy radiated by blackbody\n",
+ "e = 0.9; #emissivity\n",
+ "lamda1 = 1; #wave lengthis in um\n",
+ "lamda2 = 0.3; #wave lengthis in um\n",
+ "D01 =0.5*(0.01972+0.00779) ;\n",
+ "D02 =0;\n",
+ "\n",
+ "#calculations\n",
+ "q = e*( D01 - D02 )* Stefanconstt *T **(4) ; #W/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"wavelength*temp=\",1*1500,\"um K\";\n",
+ "print\"wavelength*temp at\",0.3*1500,\"um K\";\n",
+ "print\"Required heat flux, q =\",round(q,0),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength*temp= 1500 um K\n",
+ "wavelength*temp at 450.0 um K\n",
+ "Required heat flux, q = 3553.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 , Page no:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a02 =1; #absorptivity\n",
+ "a24 =1; #absorptivity\n",
+ "a46 =0.5; #absorptivity\n",
+ "a68 =0.5; #absorptivity\n",
+ "a8 =0; #absorptivity\n",
+ "H02 =0; #Irradiationin W/m^2 um\n",
+ "H24 =750;#Irradiationin W/m^2 um\n",
+ "H46 =750;#Irradiationin W/m^2 um\n",
+ "H68 =750;#Irradiationin W/m^2 um\n",
+ "H8 =750;#Irradiationin W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "Absorbedradiantflux =1*0*(2 -0) +1*750*(4 -2)+0.5*750*(8 -4) +0;\n",
+ "H = 750*(8 -2) ; #Incident flux\n",
+ "a = Absorbedradiantflux /H;\n",
+ "p = 1-a;\n",
+ "\n",
+ "#result\n",
+ "print\"Absorbed radiant flux =\",Absorbedradiantflux,\"W/m^2\";\n",
+ "print\"Incident flux =\",H,\"W/m^2\";\n",
+ "print\"Absorptivity =\",round(a,3);\n",
+ "print\"Since the surf =\",round(p,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorbed radiant flux = 3000.0 W/m^2\n",
+ "Incident flux = 4500 W/m^2\n",
+ "Absorptivity = 0.667\n",
+ "Since the surf = 0.333\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(a) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "\n",
+ "#result\n",
+ "print\"Energy emitted =\",round(q,1),\"W/m^2\";\n",
+ "print\"Energy emitted normal to the surface =\",round(i_n,1),\"W/m^2 sr\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy emitted = 1857.9 W/m^2\n",
+ "Energy emitted normal to the surface = 591.7 W/m^2 sr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(b) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "#Radiant flux emitted in the cone 0<= pzi <= 50 degree, 0 <= theta <= 2*3.14\n",
+ "qcone =2*(3.14)*i_n *((- math.cos(math.radians(100))+(math.cos(math.radians(0))))/4);\n",
+ "Ratio = qcone /q;\n",
+ "\n",
+ "#result\n",
+ "print\"Radiant flux emitted in the cone =\",round(qcone,1),\"W/m^2\";\n",
+ "print\"Ratio =\",round(Ratio,3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiant flux emitted in the cone = 1090.3 W/m^2\n",
+ "Ratio = 0.587\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 , Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l1 = 0.5 ; #wavelength , [um]\n",
+ "l2 = 1.5 ; #wavelength , [um]\n",
+ "l3 = 2.5 ; #wavelength , [um]\n",
+ "l4 = 3.5 ; #wavelength , [um]\n",
+ "H1 = 2500 ; #W/m^2 um\n",
+ "H2 = 4000 ; #W/m^2 um\n",
+ "H3 = 2500 ; #W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "#Since the irridiation is diffuse, the spectral intensity\n",
+ "#Integrating i_lambda over the directions of the specified solid angle and using fig 3.12\n",
+ "flux = 3/4*( H1 *(l2 -l1)+H2 *(l3 -l2)+H3 *(l4 -l3) );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which radiation is incident on the surface =\",round(flux,3),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which radiation is incident on the surface = 6750.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 , Page no:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "F65 = 0.22;\n",
+ "F64 = 0.16;\n",
+ "F35 = 0.32;\n",
+ "F34 = 0.27;\n",
+ "A1 = 3; #m^ 2\n",
+ "A3 = 3; #m^ 2\n",
+ "A6 = 6; #m^ 2\n",
+ "\n",
+ "#calculations\n",
+ "#Using additive and reciprocal relations\n",
+ "F61 = F65 - F64 ;\n",
+ "F31 = F35 - F34 ;\n",
+ "F16 = A6/A1* F61 ;\n",
+ "F13 = A3/A1* F31 ;\n",
+ "F12 = F16 - F13;\n",
+ "\n",
+ "#result\n",
+ "print\"F1-2 =\",round(F12,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F1-2 = 0.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 , Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "sigma = 5.670*10** -8 ;\n",
+ "T1 = 473 ; #K\n",
+ "T2 = 373 ; #K\n",
+ "A1 = 1*2 ; #area,[m^ 2 ]\n",
+ "X = 0.25;\n",
+ "Y = 0.5 ;\n",
+ "\n",
+ "#calculations\n",
+ "F12 =(2/(3.14*X*Y))*math.log((((1+X**2)*(1+ Y**2))/(1+X**2+Y**2))**(1/2))+Y*((1+X**2)**(1/2))*math.atan((Y/((1+X**2)**(1/2))))+X*((1+Y**2)**(1/2))*math.atan((X/((1+Y**2)**(1/2))))-Y*math.atan(Y)-X*math.atan(X);\n",
+ "q1 = sigma *A1 *( T1 **4- T2 **4) *(1 - F12 **2) /(2*(1 - F12 ));\n",
+ "\n",
+ "#result\n",
+ "print\"Net radiative heat transfer from the surface =\",round(q1,1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net radiative heat transfer from the surface = 1795.1 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 , Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1 = 20; #W/m^2 K\n",
+ "w1 = 0.2; #m\n",
+ "k1 = 1; #W/m K\n",
+ "e1 = 0.5; #emmisivity at surfce 1\n",
+ "e2 = 0.4; #emmisivity at surfce 2\n",
+ "w2 = 0.3; #m\n",
+ "k2 = 0.5; #W/m K\n",
+ "h2 = 10; #W/m^2 K\n",
+ "T1 = 473.15; #Kelvin\n",
+ "T2 = 273.15+40; #Kelvin\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "stefan_cnst = 5.67*10**-8;\n",
+ "#q_A12=(T1-T_1)/(1/h1+w1/k1);for resistance 1&2\n",
+ "#q_A45=(T_2-T2)/(1/h2+w2/k2); for resistance 4&5\n",
+ "q_A=stefan_cnst*((T1-(1/h1+w1/k1))**4-(T2+(1/h1+w1/k1))**4)/(1/e1+1/e2-1)\n",
+ "#By solving trial and error method we can get q_A\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"Steady state heat flux q/A =\",round(q_A/4.7),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state heat flux q/A = 139.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 , Page no:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #C\n",
+ "T1 = 1000+273 ; #K\n",
+ "T2 = 27+273 ; #K\n",
+ "s = 5.670*10** -8 ; #stefansconstant\n",
+ "\n",
+ "#calculations\n",
+ "q = s*1* 3.14 *(( D/2) **2) *( T1 **4- T2 **4) ; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which heat is lost by radiation =\",round(q,6),\"W \";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which heat is lost by radiation = 46.610602 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 , Page no:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.32 ; #m\n",
+ "Ds = 0.36 ; #m\n",
+ "e = 0.02 ; #emissivity\n",
+ "l = 201 ; #kJ / kg\n",
+ "rho = 800 ; #kg /m^ 3\n",
+ "s = 5.670*10** -8 ; \n",
+ "T2 = 303 ; #K\n",
+ "T1 = 77 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "q1 = s*4*3.14*(( D/2) **2) *( T1 **4- T2 **4) /(1/ e +(( D/ Ds )**2)*(1/e -1)); #W\n",
+ "evap = abs(q1) *3600*24/( l *1000) ; #kg / day\n",
+ "mass = 4/3*3.14*(( D/2) **3) * rho ;\n",
+ "boiloff = evap / mass *100 ; #percent\n",
+ "Tdrop = (abs(q1)) /(4*3.14*(( D/2) **2) ) *(1/100) ; #C\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which nitrogen evaporates =\",round(evap,6),\"kg/day\";\n",
+ "print\"Boil-off rate =\",round(boiloff,4),\"percent\";\n",
+ "print\"Temperature drop between liquid Nitrogen and inner surface =\",round(Tdrop,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which nitrogen evaporates = 0.741453 kg/day\n",
+ "Boil-off rate = 5.4046 percent\n",
+ "Temperature drop between liquid Nitrogen and inner surface = 0.0536 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 , Page no:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 1 ; #m\n",
+ "r = 6250 ; #km\n",
+ "Dsurf = 300 ; #km\n",
+ "s = 5.670*10** -8;\n",
+ "e = 0.3 ;\n",
+ "Tc = -18+273 ; #K\n",
+ "Tsurf = 27+273 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "remission = 2*e*3.14 *(( D /2) **2)*s*Tc **4; #Rate o f emissino of radian tenergy from the two faces of satellited is c\n",
+ "sin_alpha = (r/(r+ Dsurf ));\n",
+ "F12 = sin_alpha**2;\n",
+ "rreceive = e*s*(3.14*(( D/2)**2))* F12 * Tsurf **4; #Rate at which the satellite receives and absorbs energy coming from eart h \n",
+ "rloss = remission - rreceive ;\n",
+ "\n",
+ "#result\n",
+ "print\"Net Rate at which energy is leaving the satellite =\",round(rloss,4),\"W\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net Rate at which energy is leaving the satellite = 14.441 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 , Page no:151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "\n",
+ "#Variable declaration\n",
+ "F12 = 0.0363;\n",
+ "F11 = 0;\n",
+ "F21 = 0.0363; #Similarly\n",
+ "F22 = 0;\n",
+ "F23 = 0.9637;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "F13 = 1-F11 - F12 ;\n",
+ "F31 = 2/24* F13; #F31 = A1/A3*F13\n",
+ "F32 = F31 ; #Therefore\n",
+ "F33 = 1-F31 - F32 ;\n",
+ "#Substituting into equation 3.11.6, 3.11.7, 3.11.8, and solving by matrix method\n",
+ "A=[[1,-0.01452,-0.38548],[-0.01452,1,-0.38548],[0.0803,0.0803,-0.1606]]\n",
+ "C=[[1702.859718],[658.521014],[0]]\n",
+ "\n",
+ "B=linalg.solve(A, C) \n",
+ "H=F12*B.item(1)+F13*B.item(2);\n",
+ "q1=2*(B.item(0)-H);\n",
+ "\n",
+ "#result\n",
+ "print\"B1 =\",round(B.item(0),1),\"W/m^2\";\n",
+ "print\"B2 =\",round(B.item(1),1),\"W/m^2\";\n",
+ "print\"B3 =\",round(B.item(2),1),\"W/m^2\";\n",
+ "print\"Net radiative heat transfer =\",round(q1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B1 = 2482.5 W/m^2\n",
+ "B2 = 1453.1 W/m^2\n",
+ "B3 = 1967.8 W/m^2\n",
+ "Net radiative heat transfer = 1067.0 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_2.ipynb new file mode 100755 index 00000000..b531d4b6 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_2.ipynb @@ -0,0 +1,641 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3f494d977b9882173f1289b65c0c4b5e1b60b5511a2cd5bc368a603771906dc9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Thermal Radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 , Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T = 5779 ; #Temperature,in Kelvin\n",
+ "\n",
+ "#calculations\n",
+ "lambdam = 0.00290/ T ; #m\n",
+ "e = 2*(3.14) *0.596*(10** -16) /(((0.5018*10** -6) **5) *( math.exp(0.014387/0.00290) -1)) ; #W/m^2 m\n",
+ "eblmax = e / 10**6 ;\n",
+ "eearth = eblmax *((0.695*10**6) /(1.496*10**8) )**2 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Value of emissivity on sun surface is\",round(eblmax,4),\"W/m^2 um\";\n",
+ "print\"The value of emmissivity on earths surface is\",round(eearth,4),\"W/m^2 um\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of emissivity on sun surface is 82995768.8548 W/m^2 um\n",
+ "The value of emmissivity on earths surface is 1791.2755 W/m^2 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 , Page no:115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "T = 1500; #tempera ture is in kelvins\n",
+ "eb = ( Stefanconstt )*(T **(4) ); #energy radiated by blackbody\n",
+ "e = 0.9; #emissivity\n",
+ "lamda1 = 1; #wave lengthis in um\n",
+ "lamda2 = 0.3; #wave lengthis in um\n",
+ "D01 =0.5*(0.01972+0.00779) ;\n",
+ "D02 =0;\n",
+ "\n",
+ "#calculations\n",
+ "q = e*( D01 - D02 )* Stefanconstt *T **(4) ; #W/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"wavelength*temp=\",1*1500,\"um K\";\n",
+ "print\"wavelength*temp at\",0.3*1500,\"um K\";\n",
+ "print\"Required heat flux, q =\",round(q,0),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength*temp= 1500 um K\n",
+ "wavelength*temp at 450.0 um K\n",
+ "Required heat flux, q = 3553.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 , Page no:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a02 =1; #absorptivity\n",
+ "a24 =1; #absorptivity\n",
+ "a46 =0.5; #absorptivity\n",
+ "a68 =0.5; #absorptivity\n",
+ "a8 =0; #absorptivity\n",
+ "H02 =0; #Irradiationin W/m^2 um\n",
+ "H24 =750;#Irradiationin W/m^2 um\n",
+ "H46 =750;#Irradiationin W/m^2 um\n",
+ "H68 =750;#Irradiationin W/m^2 um\n",
+ "H8 =750;#Irradiationin W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "Absorbedradiantflux =1*0*(2 -0) +1*750*(4 -2)+0.5*750*(8 -4) +0;\n",
+ "H = 750*(8 -2) ; #Incident flux\n",
+ "a = Absorbedradiantflux /H;\n",
+ "p = 1-a;\n",
+ "\n",
+ "#result\n",
+ "print\"Absorbed radiant flux =\",Absorbedradiantflux,\"W/m^2\";\n",
+ "print\"Incident flux =\",H,\"W/m^2\";\n",
+ "print\"Absorptivity =\",round(a,3);\n",
+ "print\"Since the surf =\",round(p,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorbed radiant flux = 3000.0 W/m^2\n",
+ "Incident flux = 4500 W/m^2\n",
+ "Absorptivity = 0.667\n",
+ "Since the surf = 0.333\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(a) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "\n",
+ "#result\n",
+ "print\"Energy emitted =\",round(q,1),\"W/m^2\";\n",
+ "print\"Energy emitted normal to the surface =\",round(i_n,1),\"W/m^2 sr\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy emitted = 1857.9 W/m^2\n",
+ "Energy emitted normal to the surface = 591.7 W/m^2 sr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(b) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "#Radiant flux emitted in the cone 0<= pzi <= 50 degree, 0 <= theta <= 2*3.14\n",
+ "qcone =2*(3.14)*i_n *((- math.cos(math.radians(100))+(math.cos(math.radians(0))))/4);\n",
+ "Ratio = qcone /q;\n",
+ "\n",
+ "#result\n",
+ "print\"Radiant flux emitted in the cone =\",round(qcone,1),\"W/m^2\";\n",
+ "print\"Ratio =\",round(Ratio,3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiant flux emitted in the cone = 1090.3 W/m^2\n",
+ "Ratio = 0.587\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 , Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l1 = 0.5 ; #wavelength , [um]\n",
+ "l2 = 1.5 ; #wavelength , [um]\n",
+ "l3 = 2.5 ; #wavelength , [um]\n",
+ "l4 = 3.5 ; #wavelength , [um]\n",
+ "H1 = 2500 ; #W/m^2 um\n",
+ "H2 = 4000 ; #W/m^2 um\n",
+ "H3 = 2500 ; #W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "#Since the irridiation is diffuse, the spectral intensity\n",
+ "#Integrating i_lambda over the directions of the specified solid angle and using fig 3.12\n",
+ "flux = 3/4*( H1 *(l2 -l1)+H2 *(l3 -l2)+H3 *(l4 -l3) );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which radiation is incident on the surface =\",round(flux,3),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which radiation is incident on the surface = 6750.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 , Page no:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "F65 = 0.22;\n",
+ "F64 = 0.16;\n",
+ "F35 = 0.32;\n",
+ "F34 = 0.27;\n",
+ "A1 = 3; #m^ 2\n",
+ "A3 = 3; #m^ 2\n",
+ "A6 = 6; #m^ 2\n",
+ "\n",
+ "#calculations\n",
+ "#Using additive and reciprocal relations\n",
+ "F61 = F65 - F64 ;\n",
+ "F31 = F35 - F34 ;\n",
+ "F16 = A6/A1* F61 ;\n",
+ "F13 = A3/A1* F31 ;\n",
+ "F12 = F16 - F13;\n",
+ "\n",
+ "#result\n",
+ "print\"F1-2 =\",round(F12,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F1-2 = 0.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 , Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "sigma = 5.670*10** -8 ;\n",
+ "T1 = 473 ; #K\n",
+ "T2 = 373 ; #K\n",
+ "A1 = 1*2 ; #area,[m^ 2 ]\n",
+ "X = 0.25;\n",
+ "Y = 0.5 ;\n",
+ "\n",
+ "#calculations\n",
+ "F12 =(2/(3.14*X*Y))*math.log((((1+X**2)*(1+ Y**2))/(1+X**2+Y**2))**(1/2))+Y*((1+X**2)**(1/2))*math.atan((Y/((1+X**2)**(1/2))))+X*((1+Y**2)**(1/2))*math.atan((X/((1+Y**2)**(1/2))))-Y*math.atan(Y)-X*math.atan(X);\n",
+ "q1 = sigma *A1 *( T1 **4- T2 **4) *(1 - F12 **2) /(2*(1 - F12 ));\n",
+ "\n",
+ "#result\n",
+ "print\"Net radiative heat transfer from the surface =\",round(q1,1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net radiative heat transfer from the surface = 1795.1 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 , Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1 = 20; #W/m^2 K\n",
+ "w1 = 0.2; #m\n",
+ "k1 = 1; #W/m K\n",
+ "e1 = 0.5; #emmisivity at surfce 1\n",
+ "e2 = 0.4; #emmisivity at surfce 2\n",
+ "w2 = 0.3; #m\n",
+ "k2 = 0.5; #W/m K\n",
+ "h2 = 10; #W/m^2 K\n",
+ "T1 = 473.15; #Kelvin\n",
+ "T2 = 273.15+40; #Kelvin\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "stefan_cnst = 5.67*10**-8;\n",
+ "#q_A12=(T1-T_1)/(1/h1+w1/k1);for resistance 1&2\n",
+ "#q_A45=(T_2-T2)/(1/h2+w2/k2); for resistance 4&5\n",
+ "q_A=stefan_cnst*((T1-(1/h1+w1/k1))**4-(T2+(1/h1+w1/k1))**4)/(1/e1+1/e2-1)\n",
+ "#By solving trial and error method we can get q_A\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"Steady state heat flux q/A =\",round(q_A/4.7),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state heat flux q/A = 139.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 , Page no:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #C\n",
+ "T1 = 1000+273 ; #K\n",
+ "T2 = 27+273 ; #K\n",
+ "s = 5.670*10** -8 ; #stefansconstant\n",
+ "\n",
+ "#calculations\n",
+ "q = s*1* 3.14 *(( D/2) **2) *( T1 **4- T2 **4) ; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which heat is lost by radiation =\",round(q,6),\"W \";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which heat is lost by radiation = 46.610602 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 , Page no:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.32 ; #m\n",
+ "Ds = 0.36 ; #m\n",
+ "e = 0.02 ; #emissivity\n",
+ "l = 201 ; #kJ / kg\n",
+ "rho = 800 ; #kg /m^ 3\n",
+ "s = 5.670*10** -8 ; \n",
+ "T2 = 303 ; #K\n",
+ "T1 = 77 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "q1 = s*4*3.14*(( D/2) **2) *( T1 **4- T2 **4) /(1/ e +(( D/ Ds )**2)*(1/e -1)); #W\n",
+ "evap = abs(q1) *3600*24/( l *1000) ; #kg / day\n",
+ "mass = 4/3*3.14*(( D/2) **3) * rho ;\n",
+ "boiloff = evap / mass *100 ; #percent\n",
+ "Tdrop = (abs(q1)) /(4*3.14*(( D/2) **2) ) *(1/100) ; #C\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which nitrogen evaporates =\",round(evap,6),\"kg/day\";\n",
+ "print\"Boil-off rate =\",round(boiloff,4),\"percent\";\n",
+ "print\"Temperature drop between liquid Nitrogen and inner surface =\",round(Tdrop,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which nitrogen evaporates = 0.741453 kg/day\n",
+ "Boil-off rate = 5.4046 percent\n",
+ "Temperature drop between liquid Nitrogen and inner surface = 0.0536 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 , Page no:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 1 ; #m\n",
+ "r = 6250 ; #km\n",
+ "Dsurf = 300 ; #km\n",
+ "s = 5.670*10** -8;\n",
+ "e = 0.3 ;\n",
+ "Tc = -18+273 ; #K\n",
+ "Tsurf = 27+273 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "remission = 2*e*3.14 *(( D /2) **2)*s*Tc **4; #Rate o f emissino of radian tenergy from the two faces of satellited is c\n",
+ "sin_alpha = (r/(r+ Dsurf ));\n",
+ "F12 = sin_alpha**2;\n",
+ "rreceive = e*s*(3.14*(( D/2)**2))* F12 * Tsurf **4; #Rate at which the satellite receives and absorbs energy coming from eart h \n",
+ "rloss = remission - rreceive ;\n",
+ "\n",
+ "#result\n",
+ "print\"Net Rate at which energy is leaving the satellite =\",round(rloss,4),\"W\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net Rate at which energy is leaving the satellite = 14.441 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 , Page no:151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "\n",
+ "#Variable declaration\n",
+ "F12 = 0.0363;\n",
+ "F11 = 0;\n",
+ "F21 = 0.0363; #Similarly\n",
+ "F22 = 0;\n",
+ "F23 = 0.9637;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "F13 = 1-F11 - F12 ;\n",
+ "F31 = 2/24* F13; #F31 = A1/A3*F13\n",
+ "F32 = F31 ; #Therefore\n",
+ "F33 = 1-F31 - F32 ;\n",
+ "#Substituting into equation 3.11.6, 3.11.7, 3.11.8, and solving by matrix method\n",
+ "A=[[1,-0.01452,-0.38548],[-0.01452,1,-0.38548],[0.0803,0.0803,-0.1606]]\n",
+ "C=[[1702.859718],[658.521014],[0]]\n",
+ "\n",
+ "B=linalg.solve(A, C) \n",
+ "H=F12*B.item(1)+F13*B.item(2);\n",
+ "q1=2*(B.item(0)-H);\n",
+ "\n",
+ "#result\n",
+ "print\"B1 =\",round(B.item(0),1),\"W/m^2\";\n",
+ "print\"B2 =\",round(B.item(1),1),\"W/m^2\";\n",
+ "print\"B3 =\",round(B.item(2),1),\"W/m^2\";\n",
+ "print\"Net radiative heat transfer =\",round(q1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B1 = 2482.5 W/m^2\n",
+ "B2 = 1453.1 W/m^2\n",
+ "B3 = 1967.8 W/m^2\n",
+ "Net radiative heat transfer = 1067.0 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_3.ipynb new file mode 100755 index 00000000..b531d4b6 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_3.ipynb @@ -0,0 +1,641 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3f494d977b9882173f1289b65c0c4b5e1b60b5511a2cd5bc368a603771906dc9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Thermal Radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 , Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T = 5779 ; #Temperature,in Kelvin\n",
+ "\n",
+ "#calculations\n",
+ "lambdam = 0.00290/ T ; #m\n",
+ "e = 2*(3.14) *0.596*(10** -16) /(((0.5018*10** -6) **5) *( math.exp(0.014387/0.00290) -1)) ; #W/m^2 m\n",
+ "eblmax = e / 10**6 ;\n",
+ "eearth = eblmax *((0.695*10**6) /(1.496*10**8) )**2 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Value of emissivity on sun surface is\",round(eblmax,4),\"W/m^2 um\";\n",
+ "print\"The value of emmissivity on earths surface is\",round(eearth,4),\"W/m^2 um\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of emissivity on sun surface is 82995768.8548 W/m^2 um\n",
+ "The value of emmissivity on earths surface is 1791.2755 W/m^2 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 , Page no:115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "T = 1500; #tempera ture is in kelvins\n",
+ "eb = ( Stefanconstt )*(T **(4) ); #energy radiated by blackbody\n",
+ "e = 0.9; #emissivity\n",
+ "lamda1 = 1; #wave lengthis in um\n",
+ "lamda2 = 0.3; #wave lengthis in um\n",
+ "D01 =0.5*(0.01972+0.00779) ;\n",
+ "D02 =0;\n",
+ "\n",
+ "#calculations\n",
+ "q = e*( D01 - D02 )* Stefanconstt *T **(4) ; #W/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"wavelength*temp=\",1*1500,\"um K\";\n",
+ "print\"wavelength*temp at\",0.3*1500,\"um K\";\n",
+ "print\"Required heat flux, q =\",round(q,0),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength*temp= 1500 um K\n",
+ "wavelength*temp at 450.0 um K\n",
+ "Required heat flux, q = 3553.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 , Page no:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a02 =1; #absorptivity\n",
+ "a24 =1; #absorptivity\n",
+ "a46 =0.5; #absorptivity\n",
+ "a68 =0.5; #absorptivity\n",
+ "a8 =0; #absorptivity\n",
+ "H02 =0; #Irradiationin W/m^2 um\n",
+ "H24 =750;#Irradiationin W/m^2 um\n",
+ "H46 =750;#Irradiationin W/m^2 um\n",
+ "H68 =750;#Irradiationin W/m^2 um\n",
+ "H8 =750;#Irradiationin W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "Absorbedradiantflux =1*0*(2 -0) +1*750*(4 -2)+0.5*750*(8 -4) +0;\n",
+ "H = 750*(8 -2) ; #Incident flux\n",
+ "a = Absorbedradiantflux /H;\n",
+ "p = 1-a;\n",
+ "\n",
+ "#result\n",
+ "print\"Absorbed radiant flux =\",Absorbedradiantflux,\"W/m^2\";\n",
+ "print\"Incident flux =\",H,\"W/m^2\";\n",
+ "print\"Absorptivity =\",round(a,3);\n",
+ "print\"Since the surf =\",round(p,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorbed radiant flux = 3000.0 W/m^2\n",
+ "Incident flux = 4500 W/m^2\n",
+ "Absorptivity = 0.667\n",
+ "Since the surf = 0.333\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(a) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "\n",
+ "#result\n",
+ "print\"Energy emitted =\",round(q,1),\"W/m^2\";\n",
+ "print\"Energy emitted normal to the surface =\",round(i_n,1),\"W/m^2 sr\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy emitted = 1857.9 W/m^2\n",
+ "Energy emitted normal to the surface = 591.7 W/m^2 sr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(b) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "#Radiant flux emitted in the cone 0<= pzi <= 50 degree, 0 <= theta <= 2*3.14\n",
+ "qcone =2*(3.14)*i_n *((- math.cos(math.radians(100))+(math.cos(math.radians(0))))/4);\n",
+ "Ratio = qcone /q;\n",
+ "\n",
+ "#result\n",
+ "print\"Radiant flux emitted in the cone =\",round(qcone,1),\"W/m^2\";\n",
+ "print\"Ratio =\",round(Ratio,3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiant flux emitted in the cone = 1090.3 W/m^2\n",
+ "Ratio = 0.587\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 , Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l1 = 0.5 ; #wavelength , [um]\n",
+ "l2 = 1.5 ; #wavelength , [um]\n",
+ "l3 = 2.5 ; #wavelength , [um]\n",
+ "l4 = 3.5 ; #wavelength , [um]\n",
+ "H1 = 2500 ; #W/m^2 um\n",
+ "H2 = 4000 ; #W/m^2 um\n",
+ "H3 = 2500 ; #W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "#Since the irridiation is diffuse, the spectral intensity\n",
+ "#Integrating i_lambda over the directions of the specified solid angle and using fig 3.12\n",
+ "flux = 3/4*( H1 *(l2 -l1)+H2 *(l3 -l2)+H3 *(l4 -l3) );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which radiation is incident on the surface =\",round(flux,3),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which radiation is incident on the surface = 6750.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 , Page no:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "F65 = 0.22;\n",
+ "F64 = 0.16;\n",
+ "F35 = 0.32;\n",
+ "F34 = 0.27;\n",
+ "A1 = 3; #m^ 2\n",
+ "A3 = 3; #m^ 2\n",
+ "A6 = 6; #m^ 2\n",
+ "\n",
+ "#calculations\n",
+ "#Using additive and reciprocal relations\n",
+ "F61 = F65 - F64 ;\n",
+ "F31 = F35 - F34 ;\n",
+ "F16 = A6/A1* F61 ;\n",
+ "F13 = A3/A1* F31 ;\n",
+ "F12 = F16 - F13;\n",
+ "\n",
+ "#result\n",
+ "print\"F1-2 =\",round(F12,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F1-2 = 0.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 , Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "sigma = 5.670*10** -8 ;\n",
+ "T1 = 473 ; #K\n",
+ "T2 = 373 ; #K\n",
+ "A1 = 1*2 ; #area,[m^ 2 ]\n",
+ "X = 0.25;\n",
+ "Y = 0.5 ;\n",
+ "\n",
+ "#calculations\n",
+ "F12 =(2/(3.14*X*Y))*math.log((((1+X**2)*(1+ Y**2))/(1+X**2+Y**2))**(1/2))+Y*((1+X**2)**(1/2))*math.atan((Y/((1+X**2)**(1/2))))+X*((1+Y**2)**(1/2))*math.atan((X/((1+Y**2)**(1/2))))-Y*math.atan(Y)-X*math.atan(X);\n",
+ "q1 = sigma *A1 *( T1 **4- T2 **4) *(1 - F12 **2) /(2*(1 - F12 ));\n",
+ "\n",
+ "#result\n",
+ "print\"Net radiative heat transfer from the surface =\",round(q1,1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net radiative heat transfer from the surface = 1795.1 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 , Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1 = 20; #W/m^2 K\n",
+ "w1 = 0.2; #m\n",
+ "k1 = 1; #W/m K\n",
+ "e1 = 0.5; #emmisivity at surfce 1\n",
+ "e2 = 0.4; #emmisivity at surfce 2\n",
+ "w2 = 0.3; #m\n",
+ "k2 = 0.5; #W/m K\n",
+ "h2 = 10; #W/m^2 K\n",
+ "T1 = 473.15; #Kelvin\n",
+ "T2 = 273.15+40; #Kelvin\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "stefan_cnst = 5.67*10**-8;\n",
+ "#q_A12=(T1-T_1)/(1/h1+w1/k1);for resistance 1&2\n",
+ "#q_A45=(T_2-T2)/(1/h2+w2/k2); for resistance 4&5\n",
+ "q_A=stefan_cnst*((T1-(1/h1+w1/k1))**4-(T2+(1/h1+w1/k1))**4)/(1/e1+1/e2-1)\n",
+ "#By solving trial and error method we can get q_A\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"Steady state heat flux q/A =\",round(q_A/4.7),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state heat flux q/A = 139.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 , Page no:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #C\n",
+ "T1 = 1000+273 ; #K\n",
+ "T2 = 27+273 ; #K\n",
+ "s = 5.670*10** -8 ; #stefansconstant\n",
+ "\n",
+ "#calculations\n",
+ "q = s*1* 3.14 *(( D/2) **2) *( T1 **4- T2 **4) ; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which heat is lost by radiation =\",round(q,6),\"W \";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which heat is lost by radiation = 46.610602 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 , Page no:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.32 ; #m\n",
+ "Ds = 0.36 ; #m\n",
+ "e = 0.02 ; #emissivity\n",
+ "l = 201 ; #kJ / kg\n",
+ "rho = 800 ; #kg /m^ 3\n",
+ "s = 5.670*10** -8 ; \n",
+ "T2 = 303 ; #K\n",
+ "T1 = 77 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "q1 = s*4*3.14*(( D/2) **2) *( T1 **4- T2 **4) /(1/ e +(( D/ Ds )**2)*(1/e -1)); #W\n",
+ "evap = abs(q1) *3600*24/( l *1000) ; #kg / day\n",
+ "mass = 4/3*3.14*(( D/2) **3) * rho ;\n",
+ "boiloff = evap / mass *100 ; #percent\n",
+ "Tdrop = (abs(q1)) /(4*3.14*(( D/2) **2) ) *(1/100) ; #C\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which nitrogen evaporates =\",round(evap,6),\"kg/day\";\n",
+ "print\"Boil-off rate =\",round(boiloff,4),\"percent\";\n",
+ "print\"Temperature drop between liquid Nitrogen and inner surface =\",round(Tdrop,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which nitrogen evaporates = 0.741453 kg/day\n",
+ "Boil-off rate = 5.4046 percent\n",
+ "Temperature drop between liquid Nitrogen and inner surface = 0.0536 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 , Page no:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 1 ; #m\n",
+ "r = 6250 ; #km\n",
+ "Dsurf = 300 ; #km\n",
+ "s = 5.670*10** -8;\n",
+ "e = 0.3 ;\n",
+ "Tc = -18+273 ; #K\n",
+ "Tsurf = 27+273 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "remission = 2*e*3.14 *(( D /2) **2)*s*Tc **4; #Rate o f emissino of radian tenergy from the two faces of satellited is c\n",
+ "sin_alpha = (r/(r+ Dsurf ));\n",
+ "F12 = sin_alpha**2;\n",
+ "rreceive = e*s*(3.14*(( D/2)**2))* F12 * Tsurf **4; #Rate at which the satellite receives and absorbs energy coming from eart h \n",
+ "rloss = remission - rreceive ;\n",
+ "\n",
+ "#result\n",
+ "print\"Net Rate at which energy is leaving the satellite =\",round(rloss,4),\"W\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net Rate at which energy is leaving the satellite = 14.441 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 , Page no:151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "\n",
+ "#Variable declaration\n",
+ "F12 = 0.0363;\n",
+ "F11 = 0;\n",
+ "F21 = 0.0363; #Similarly\n",
+ "F22 = 0;\n",
+ "F23 = 0.9637;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "F13 = 1-F11 - F12 ;\n",
+ "F31 = 2/24* F13; #F31 = A1/A3*F13\n",
+ "F32 = F31 ; #Therefore\n",
+ "F33 = 1-F31 - F32 ;\n",
+ "#Substituting into equation 3.11.6, 3.11.7, 3.11.8, and solving by matrix method\n",
+ "A=[[1,-0.01452,-0.38548],[-0.01452,1,-0.38548],[0.0803,0.0803,-0.1606]]\n",
+ "C=[[1702.859718],[658.521014],[0]]\n",
+ "\n",
+ "B=linalg.solve(A, C) \n",
+ "H=F12*B.item(1)+F13*B.item(2);\n",
+ "q1=2*(B.item(0)-H);\n",
+ "\n",
+ "#result\n",
+ "print\"B1 =\",round(B.item(0),1),\"W/m^2\";\n",
+ "print\"B2 =\",round(B.item(1),1),\"W/m^2\";\n",
+ "print\"B3 =\",round(B.item(2),1),\"W/m^2\";\n",
+ "print\"Net radiative heat transfer =\",round(q1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B1 = 2482.5 W/m^2\n",
+ "B2 = 1453.1 W/m^2\n",
+ "B3 = 1967.8 W/m^2\n",
+ "Net radiative heat transfer = 1067.0 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_4.ipynb new file mode 100755 index 00000000..b531d4b6 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_4.ipynb @@ -0,0 +1,641 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3f494d977b9882173f1289b65c0c4b5e1b60b5511a2cd5bc368a603771906dc9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Thermal Radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 , Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T = 5779 ; #Temperature,in Kelvin\n",
+ "\n",
+ "#calculations\n",
+ "lambdam = 0.00290/ T ; #m\n",
+ "e = 2*(3.14) *0.596*(10** -16) /(((0.5018*10** -6) **5) *( math.exp(0.014387/0.00290) -1)) ; #W/m^2 m\n",
+ "eblmax = e / 10**6 ;\n",
+ "eearth = eblmax *((0.695*10**6) /(1.496*10**8) )**2 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Value of emissivity on sun surface is\",round(eblmax,4),\"W/m^2 um\";\n",
+ "print\"The value of emmissivity on earths surface is\",round(eearth,4),\"W/m^2 um\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of emissivity on sun surface is 82995768.8548 W/m^2 um\n",
+ "The value of emmissivity on earths surface is 1791.2755 W/m^2 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 , Page no:115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "T = 1500; #tempera ture is in kelvins\n",
+ "eb = ( Stefanconstt )*(T **(4) ); #energy radiated by blackbody\n",
+ "e = 0.9; #emissivity\n",
+ "lamda1 = 1; #wave lengthis in um\n",
+ "lamda2 = 0.3; #wave lengthis in um\n",
+ "D01 =0.5*(0.01972+0.00779) ;\n",
+ "D02 =0;\n",
+ "\n",
+ "#calculations\n",
+ "q = e*( D01 - D02 )* Stefanconstt *T **(4) ; #W/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"wavelength*temp=\",1*1500,\"um K\";\n",
+ "print\"wavelength*temp at\",0.3*1500,\"um K\";\n",
+ "print\"Required heat flux, q =\",round(q,0),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength*temp= 1500 um K\n",
+ "wavelength*temp at 450.0 um K\n",
+ "Required heat flux, q = 3553.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 , Page no:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a02 =1; #absorptivity\n",
+ "a24 =1; #absorptivity\n",
+ "a46 =0.5; #absorptivity\n",
+ "a68 =0.5; #absorptivity\n",
+ "a8 =0; #absorptivity\n",
+ "H02 =0; #Irradiationin W/m^2 um\n",
+ "H24 =750;#Irradiationin W/m^2 um\n",
+ "H46 =750;#Irradiationin W/m^2 um\n",
+ "H68 =750;#Irradiationin W/m^2 um\n",
+ "H8 =750;#Irradiationin W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "Absorbedradiantflux =1*0*(2 -0) +1*750*(4 -2)+0.5*750*(8 -4) +0;\n",
+ "H = 750*(8 -2) ; #Incident flux\n",
+ "a = Absorbedradiantflux /H;\n",
+ "p = 1-a;\n",
+ "\n",
+ "#result\n",
+ "print\"Absorbed radiant flux =\",Absorbedradiantflux,\"W/m^2\";\n",
+ "print\"Incident flux =\",H,\"W/m^2\";\n",
+ "print\"Absorptivity =\",round(a,3);\n",
+ "print\"Since the surf =\",round(p,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorbed radiant flux = 3000.0 W/m^2\n",
+ "Incident flux = 4500 W/m^2\n",
+ "Absorptivity = 0.667\n",
+ "Since the surf = 0.333\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(a) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "\n",
+ "#result\n",
+ "print\"Energy emitted =\",round(q,1),\"W/m^2\";\n",
+ "print\"Energy emitted normal to the surface =\",round(i_n,1),\"W/m^2 sr\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy emitted = 1857.9 W/m^2\n",
+ "Energy emitted normal to the surface = 591.7 W/m^2 sr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(b) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "#Radiant flux emitted in the cone 0<= pzi <= 50 degree, 0 <= theta <= 2*3.14\n",
+ "qcone =2*(3.14)*i_n *((- math.cos(math.radians(100))+(math.cos(math.radians(0))))/4);\n",
+ "Ratio = qcone /q;\n",
+ "\n",
+ "#result\n",
+ "print\"Radiant flux emitted in the cone =\",round(qcone,1),\"W/m^2\";\n",
+ "print\"Ratio =\",round(Ratio,3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiant flux emitted in the cone = 1090.3 W/m^2\n",
+ "Ratio = 0.587\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 , Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l1 = 0.5 ; #wavelength , [um]\n",
+ "l2 = 1.5 ; #wavelength , [um]\n",
+ "l3 = 2.5 ; #wavelength , [um]\n",
+ "l4 = 3.5 ; #wavelength , [um]\n",
+ "H1 = 2500 ; #W/m^2 um\n",
+ "H2 = 4000 ; #W/m^2 um\n",
+ "H3 = 2500 ; #W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "#Since the irridiation is diffuse, the spectral intensity\n",
+ "#Integrating i_lambda over the directions of the specified solid angle and using fig 3.12\n",
+ "flux = 3/4*( H1 *(l2 -l1)+H2 *(l3 -l2)+H3 *(l4 -l3) );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which radiation is incident on the surface =\",round(flux,3),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which radiation is incident on the surface = 6750.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 , Page no:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "F65 = 0.22;\n",
+ "F64 = 0.16;\n",
+ "F35 = 0.32;\n",
+ "F34 = 0.27;\n",
+ "A1 = 3; #m^ 2\n",
+ "A3 = 3; #m^ 2\n",
+ "A6 = 6; #m^ 2\n",
+ "\n",
+ "#calculations\n",
+ "#Using additive and reciprocal relations\n",
+ "F61 = F65 - F64 ;\n",
+ "F31 = F35 - F34 ;\n",
+ "F16 = A6/A1* F61 ;\n",
+ "F13 = A3/A1* F31 ;\n",
+ "F12 = F16 - F13;\n",
+ "\n",
+ "#result\n",
+ "print\"F1-2 =\",round(F12,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F1-2 = 0.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 , Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "sigma = 5.670*10** -8 ;\n",
+ "T1 = 473 ; #K\n",
+ "T2 = 373 ; #K\n",
+ "A1 = 1*2 ; #area,[m^ 2 ]\n",
+ "X = 0.25;\n",
+ "Y = 0.5 ;\n",
+ "\n",
+ "#calculations\n",
+ "F12 =(2/(3.14*X*Y))*math.log((((1+X**2)*(1+ Y**2))/(1+X**2+Y**2))**(1/2))+Y*((1+X**2)**(1/2))*math.atan((Y/((1+X**2)**(1/2))))+X*((1+Y**2)**(1/2))*math.atan((X/((1+Y**2)**(1/2))))-Y*math.atan(Y)-X*math.atan(X);\n",
+ "q1 = sigma *A1 *( T1 **4- T2 **4) *(1 - F12 **2) /(2*(1 - F12 ));\n",
+ "\n",
+ "#result\n",
+ "print\"Net radiative heat transfer from the surface =\",round(q1,1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net radiative heat transfer from the surface = 1795.1 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 , Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1 = 20; #W/m^2 K\n",
+ "w1 = 0.2; #m\n",
+ "k1 = 1; #W/m K\n",
+ "e1 = 0.5; #emmisivity at surfce 1\n",
+ "e2 = 0.4; #emmisivity at surfce 2\n",
+ "w2 = 0.3; #m\n",
+ "k2 = 0.5; #W/m K\n",
+ "h2 = 10; #W/m^2 K\n",
+ "T1 = 473.15; #Kelvin\n",
+ "T2 = 273.15+40; #Kelvin\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "stefan_cnst = 5.67*10**-8;\n",
+ "#q_A12=(T1-T_1)/(1/h1+w1/k1);for resistance 1&2\n",
+ "#q_A45=(T_2-T2)/(1/h2+w2/k2); for resistance 4&5\n",
+ "q_A=stefan_cnst*((T1-(1/h1+w1/k1))**4-(T2+(1/h1+w1/k1))**4)/(1/e1+1/e2-1)\n",
+ "#By solving trial and error method we can get q_A\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"Steady state heat flux q/A =\",round(q_A/4.7),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state heat flux q/A = 139.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 , Page no:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #C\n",
+ "T1 = 1000+273 ; #K\n",
+ "T2 = 27+273 ; #K\n",
+ "s = 5.670*10** -8 ; #stefansconstant\n",
+ "\n",
+ "#calculations\n",
+ "q = s*1* 3.14 *(( D/2) **2) *( T1 **4- T2 **4) ; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which heat is lost by radiation =\",round(q,6),\"W \";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which heat is lost by radiation = 46.610602 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 , Page no:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.32 ; #m\n",
+ "Ds = 0.36 ; #m\n",
+ "e = 0.02 ; #emissivity\n",
+ "l = 201 ; #kJ / kg\n",
+ "rho = 800 ; #kg /m^ 3\n",
+ "s = 5.670*10** -8 ; \n",
+ "T2 = 303 ; #K\n",
+ "T1 = 77 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "q1 = s*4*3.14*(( D/2) **2) *( T1 **4- T2 **4) /(1/ e +(( D/ Ds )**2)*(1/e -1)); #W\n",
+ "evap = abs(q1) *3600*24/( l *1000) ; #kg / day\n",
+ "mass = 4/3*3.14*(( D/2) **3) * rho ;\n",
+ "boiloff = evap / mass *100 ; #percent\n",
+ "Tdrop = (abs(q1)) /(4*3.14*(( D/2) **2) ) *(1/100) ; #C\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which nitrogen evaporates =\",round(evap,6),\"kg/day\";\n",
+ "print\"Boil-off rate =\",round(boiloff,4),\"percent\";\n",
+ "print\"Temperature drop between liquid Nitrogen and inner surface =\",round(Tdrop,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which nitrogen evaporates = 0.741453 kg/day\n",
+ "Boil-off rate = 5.4046 percent\n",
+ "Temperature drop between liquid Nitrogen and inner surface = 0.0536 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 , Page no:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 1 ; #m\n",
+ "r = 6250 ; #km\n",
+ "Dsurf = 300 ; #km\n",
+ "s = 5.670*10** -8;\n",
+ "e = 0.3 ;\n",
+ "Tc = -18+273 ; #K\n",
+ "Tsurf = 27+273 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "remission = 2*e*3.14 *(( D /2) **2)*s*Tc **4; #Rate o f emissino of radian tenergy from the two faces of satellited is c\n",
+ "sin_alpha = (r/(r+ Dsurf ));\n",
+ "F12 = sin_alpha**2;\n",
+ "rreceive = e*s*(3.14*(( D/2)**2))* F12 * Tsurf **4; #Rate at which the satellite receives and absorbs energy coming from eart h \n",
+ "rloss = remission - rreceive ;\n",
+ "\n",
+ "#result\n",
+ "print\"Net Rate at which energy is leaving the satellite =\",round(rloss,4),\"W\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net Rate at which energy is leaving the satellite = 14.441 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 , Page no:151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "\n",
+ "#Variable declaration\n",
+ "F12 = 0.0363;\n",
+ "F11 = 0;\n",
+ "F21 = 0.0363; #Similarly\n",
+ "F22 = 0;\n",
+ "F23 = 0.9637;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "F13 = 1-F11 - F12 ;\n",
+ "F31 = 2/24* F13; #F31 = A1/A3*F13\n",
+ "F32 = F31 ; #Therefore\n",
+ "F33 = 1-F31 - F32 ;\n",
+ "#Substituting into equation 3.11.6, 3.11.7, 3.11.8, and solving by matrix method\n",
+ "A=[[1,-0.01452,-0.38548],[-0.01452,1,-0.38548],[0.0803,0.0803,-0.1606]]\n",
+ "C=[[1702.859718],[658.521014],[0]]\n",
+ "\n",
+ "B=linalg.solve(A, C) \n",
+ "H=F12*B.item(1)+F13*B.item(2);\n",
+ "q1=2*(B.item(0)-H);\n",
+ "\n",
+ "#result\n",
+ "print\"B1 =\",round(B.item(0),1),\"W/m^2\";\n",
+ "print\"B2 =\",round(B.item(1),1),\"W/m^2\";\n",
+ "print\"B3 =\",round(B.item(2),1),\"W/m^2\";\n",
+ "print\"Net radiative heat transfer =\",round(q1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B1 = 2482.5 W/m^2\n",
+ "B2 = 1453.1 W/m^2\n",
+ "B3 = 1967.8 W/m^2\n",
+ "Net radiative heat transfer = 1067.0 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_5.ipynb new file mode 100755 index 00000000..b531d4b6 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_5.ipynb @@ -0,0 +1,641 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3f494d977b9882173f1289b65c0c4b5e1b60b5511a2cd5bc368a603771906dc9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Thermal Radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 , Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T = 5779 ; #Temperature,in Kelvin\n",
+ "\n",
+ "#calculations\n",
+ "lambdam = 0.00290/ T ; #m\n",
+ "e = 2*(3.14) *0.596*(10** -16) /(((0.5018*10** -6) **5) *( math.exp(0.014387/0.00290) -1)) ; #W/m^2 m\n",
+ "eblmax = e / 10**6 ;\n",
+ "eearth = eblmax *((0.695*10**6) /(1.496*10**8) )**2 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Value of emissivity on sun surface is\",round(eblmax,4),\"W/m^2 um\";\n",
+ "print\"The value of emmissivity on earths surface is\",round(eearth,4),\"W/m^2 um\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of emissivity on sun surface is 82995768.8548 W/m^2 um\n",
+ "The value of emmissivity on earths surface is 1791.2755 W/m^2 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 , Page no:115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "T = 1500; #tempera ture is in kelvins\n",
+ "eb = ( Stefanconstt )*(T **(4) ); #energy radiated by blackbody\n",
+ "e = 0.9; #emissivity\n",
+ "lamda1 = 1; #wave lengthis in um\n",
+ "lamda2 = 0.3; #wave lengthis in um\n",
+ "D01 =0.5*(0.01972+0.00779) ;\n",
+ "D02 =0;\n",
+ "\n",
+ "#calculations\n",
+ "q = e*( D01 - D02 )* Stefanconstt *T **(4) ; #W/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"wavelength*temp=\",1*1500,\"um K\";\n",
+ "print\"wavelength*temp at\",0.3*1500,\"um K\";\n",
+ "print\"Required heat flux, q =\",round(q,0),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength*temp= 1500 um K\n",
+ "wavelength*temp at 450.0 um K\n",
+ "Required heat flux, q = 3553.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 , Page no:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a02 =1; #absorptivity\n",
+ "a24 =1; #absorptivity\n",
+ "a46 =0.5; #absorptivity\n",
+ "a68 =0.5; #absorptivity\n",
+ "a8 =0; #absorptivity\n",
+ "H02 =0; #Irradiationin W/m^2 um\n",
+ "H24 =750;#Irradiationin W/m^2 um\n",
+ "H46 =750;#Irradiationin W/m^2 um\n",
+ "H68 =750;#Irradiationin W/m^2 um\n",
+ "H8 =750;#Irradiationin W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "Absorbedradiantflux =1*0*(2 -0) +1*750*(4 -2)+0.5*750*(8 -4) +0;\n",
+ "H = 750*(8 -2) ; #Incident flux\n",
+ "a = Absorbedradiantflux /H;\n",
+ "p = 1-a;\n",
+ "\n",
+ "#result\n",
+ "print\"Absorbed radiant flux =\",Absorbedradiantflux,\"W/m^2\";\n",
+ "print\"Incident flux =\",H,\"W/m^2\";\n",
+ "print\"Absorptivity =\",round(a,3);\n",
+ "print\"Since the surf =\",round(p,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorbed radiant flux = 3000.0 W/m^2\n",
+ "Incident flux = 4500 W/m^2\n",
+ "Absorptivity = 0.667\n",
+ "Since the surf = 0.333\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(a) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "\n",
+ "#result\n",
+ "print\"Energy emitted =\",round(q,1),\"W/m^2\";\n",
+ "print\"Energy emitted normal to the surface =\",round(i_n,1),\"W/m^2 sr\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy emitted = 1857.9 W/m^2\n",
+ "Energy emitted normal to the surface = 591.7 W/m^2 sr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(b) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "#Radiant flux emitted in the cone 0<= pzi <= 50 degree, 0 <= theta <= 2*3.14\n",
+ "qcone =2*(3.14)*i_n *((- math.cos(math.radians(100))+(math.cos(math.radians(0))))/4);\n",
+ "Ratio = qcone /q;\n",
+ "\n",
+ "#result\n",
+ "print\"Radiant flux emitted in the cone =\",round(qcone,1),\"W/m^2\";\n",
+ "print\"Ratio =\",round(Ratio,3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiant flux emitted in the cone = 1090.3 W/m^2\n",
+ "Ratio = 0.587\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 , Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l1 = 0.5 ; #wavelength , [um]\n",
+ "l2 = 1.5 ; #wavelength , [um]\n",
+ "l3 = 2.5 ; #wavelength , [um]\n",
+ "l4 = 3.5 ; #wavelength , [um]\n",
+ "H1 = 2500 ; #W/m^2 um\n",
+ "H2 = 4000 ; #W/m^2 um\n",
+ "H3 = 2500 ; #W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "#Since the irridiation is diffuse, the spectral intensity\n",
+ "#Integrating i_lambda over the directions of the specified solid angle and using fig 3.12\n",
+ "flux = 3/4*( H1 *(l2 -l1)+H2 *(l3 -l2)+H3 *(l4 -l3) );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which radiation is incident on the surface =\",round(flux,3),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which radiation is incident on the surface = 6750.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 , Page no:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "F65 = 0.22;\n",
+ "F64 = 0.16;\n",
+ "F35 = 0.32;\n",
+ "F34 = 0.27;\n",
+ "A1 = 3; #m^ 2\n",
+ "A3 = 3; #m^ 2\n",
+ "A6 = 6; #m^ 2\n",
+ "\n",
+ "#calculations\n",
+ "#Using additive and reciprocal relations\n",
+ "F61 = F65 - F64 ;\n",
+ "F31 = F35 - F34 ;\n",
+ "F16 = A6/A1* F61 ;\n",
+ "F13 = A3/A1* F31 ;\n",
+ "F12 = F16 - F13;\n",
+ "\n",
+ "#result\n",
+ "print\"F1-2 =\",round(F12,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F1-2 = 0.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 , Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "sigma = 5.670*10** -8 ;\n",
+ "T1 = 473 ; #K\n",
+ "T2 = 373 ; #K\n",
+ "A1 = 1*2 ; #area,[m^ 2 ]\n",
+ "X = 0.25;\n",
+ "Y = 0.5 ;\n",
+ "\n",
+ "#calculations\n",
+ "F12 =(2/(3.14*X*Y))*math.log((((1+X**2)*(1+ Y**2))/(1+X**2+Y**2))**(1/2))+Y*((1+X**2)**(1/2))*math.atan((Y/((1+X**2)**(1/2))))+X*((1+Y**2)**(1/2))*math.atan((X/((1+Y**2)**(1/2))))-Y*math.atan(Y)-X*math.atan(X);\n",
+ "q1 = sigma *A1 *( T1 **4- T2 **4) *(1 - F12 **2) /(2*(1 - F12 ));\n",
+ "\n",
+ "#result\n",
+ "print\"Net radiative heat transfer from the surface =\",round(q1,1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net radiative heat transfer from the surface = 1795.1 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 , Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1 = 20; #W/m^2 K\n",
+ "w1 = 0.2; #m\n",
+ "k1 = 1; #W/m K\n",
+ "e1 = 0.5; #emmisivity at surfce 1\n",
+ "e2 = 0.4; #emmisivity at surfce 2\n",
+ "w2 = 0.3; #m\n",
+ "k2 = 0.5; #W/m K\n",
+ "h2 = 10; #W/m^2 K\n",
+ "T1 = 473.15; #Kelvin\n",
+ "T2 = 273.15+40; #Kelvin\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "stefan_cnst = 5.67*10**-8;\n",
+ "#q_A12=(T1-T_1)/(1/h1+w1/k1);for resistance 1&2\n",
+ "#q_A45=(T_2-T2)/(1/h2+w2/k2); for resistance 4&5\n",
+ "q_A=stefan_cnst*((T1-(1/h1+w1/k1))**4-(T2+(1/h1+w1/k1))**4)/(1/e1+1/e2-1)\n",
+ "#By solving trial and error method we can get q_A\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"Steady state heat flux q/A =\",round(q_A/4.7),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state heat flux q/A = 139.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 , Page no:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #C\n",
+ "T1 = 1000+273 ; #K\n",
+ "T2 = 27+273 ; #K\n",
+ "s = 5.670*10** -8 ; #stefansconstant\n",
+ "\n",
+ "#calculations\n",
+ "q = s*1* 3.14 *(( D/2) **2) *( T1 **4- T2 **4) ; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which heat is lost by radiation =\",round(q,6),\"W \";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which heat is lost by radiation = 46.610602 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 , Page no:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.32 ; #m\n",
+ "Ds = 0.36 ; #m\n",
+ "e = 0.02 ; #emissivity\n",
+ "l = 201 ; #kJ / kg\n",
+ "rho = 800 ; #kg /m^ 3\n",
+ "s = 5.670*10** -8 ; \n",
+ "T2 = 303 ; #K\n",
+ "T1 = 77 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "q1 = s*4*3.14*(( D/2) **2) *( T1 **4- T2 **4) /(1/ e +(( D/ Ds )**2)*(1/e -1)); #W\n",
+ "evap = abs(q1) *3600*24/( l *1000) ; #kg / day\n",
+ "mass = 4/3*3.14*(( D/2) **3) * rho ;\n",
+ "boiloff = evap / mass *100 ; #percent\n",
+ "Tdrop = (abs(q1)) /(4*3.14*(( D/2) **2) ) *(1/100) ; #C\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which nitrogen evaporates =\",round(evap,6),\"kg/day\";\n",
+ "print\"Boil-off rate =\",round(boiloff,4),\"percent\";\n",
+ "print\"Temperature drop between liquid Nitrogen and inner surface =\",round(Tdrop,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which nitrogen evaporates = 0.741453 kg/day\n",
+ "Boil-off rate = 5.4046 percent\n",
+ "Temperature drop between liquid Nitrogen and inner surface = 0.0536 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 , Page no:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 1 ; #m\n",
+ "r = 6250 ; #km\n",
+ "Dsurf = 300 ; #km\n",
+ "s = 5.670*10** -8;\n",
+ "e = 0.3 ;\n",
+ "Tc = -18+273 ; #K\n",
+ "Tsurf = 27+273 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "remission = 2*e*3.14 *(( D /2) **2)*s*Tc **4; #Rate o f emissino of radian tenergy from the two faces of satellited is c\n",
+ "sin_alpha = (r/(r+ Dsurf ));\n",
+ "F12 = sin_alpha**2;\n",
+ "rreceive = e*s*(3.14*(( D/2)**2))* F12 * Tsurf **4; #Rate at which the satellite receives and absorbs energy coming from eart h \n",
+ "rloss = remission - rreceive ;\n",
+ "\n",
+ "#result\n",
+ "print\"Net Rate at which energy is leaving the satellite =\",round(rloss,4),\"W\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net Rate at which energy is leaving the satellite = 14.441 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 , Page no:151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "\n",
+ "#Variable declaration\n",
+ "F12 = 0.0363;\n",
+ "F11 = 0;\n",
+ "F21 = 0.0363; #Similarly\n",
+ "F22 = 0;\n",
+ "F23 = 0.9637;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "F13 = 1-F11 - F12 ;\n",
+ "F31 = 2/24* F13; #F31 = A1/A3*F13\n",
+ "F32 = F31 ; #Therefore\n",
+ "F33 = 1-F31 - F32 ;\n",
+ "#Substituting into equation 3.11.6, 3.11.7, 3.11.8, and solving by matrix method\n",
+ "A=[[1,-0.01452,-0.38548],[-0.01452,1,-0.38548],[0.0803,0.0803,-0.1606]]\n",
+ "C=[[1702.859718],[658.521014],[0]]\n",
+ "\n",
+ "B=linalg.solve(A, C) \n",
+ "H=F12*B.item(1)+F13*B.item(2);\n",
+ "q1=2*(B.item(0)-H);\n",
+ "\n",
+ "#result\n",
+ "print\"B1 =\",round(B.item(0),1),\"W/m^2\";\n",
+ "print\"B2 =\",round(B.item(1),1),\"W/m^2\";\n",
+ "print\"B3 =\",round(B.item(2),1),\"W/m^2\";\n",
+ "print\"Net radiative heat transfer =\",round(q1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B1 = 2482.5 W/m^2\n",
+ "B2 = 1453.1 W/m^2\n",
+ "B3 = 1967.8 W/m^2\n",
+ "Net radiative heat transfer = 1067.0 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_6.ipynb new file mode 100755 index 00000000..b531d4b6 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_6.ipynb @@ -0,0 +1,641 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3f494d977b9882173f1289b65c0c4b5e1b60b5511a2cd5bc368a603771906dc9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Thermal Radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 , Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T = 5779 ; #Temperature,in Kelvin\n",
+ "\n",
+ "#calculations\n",
+ "lambdam = 0.00290/ T ; #m\n",
+ "e = 2*(3.14) *0.596*(10** -16) /(((0.5018*10** -6) **5) *( math.exp(0.014387/0.00290) -1)) ; #W/m^2 m\n",
+ "eblmax = e / 10**6 ;\n",
+ "eearth = eblmax *((0.695*10**6) /(1.496*10**8) )**2 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Value of emissivity on sun surface is\",round(eblmax,4),\"W/m^2 um\";\n",
+ "print\"The value of emmissivity on earths surface is\",round(eearth,4),\"W/m^2 um\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of emissivity on sun surface is 82995768.8548 W/m^2 um\n",
+ "The value of emmissivity on earths surface is 1791.2755 W/m^2 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 , Page no:115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "T = 1500; #tempera ture is in kelvins\n",
+ "eb = ( Stefanconstt )*(T **(4) ); #energy radiated by blackbody\n",
+ "e = 0.9; #emissivity\n",
+ "lamda1 = 1; #wave lengthis in um\n",
+ "lamda2 = 0.3; #wave lengthis in um\n",
+ "D01 =0.5*(0.01972+0.00779) ;\n",
+ "D02 =0;\n",
+ "\n",
+ "#calculations\n",
+ "q = e*( D01 - D02 )* Stefanconstt *T **(4) ; #W/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"wavelength*temp=\",1*1500,\"um K\";\n",
+ "print\"wavelength*temp at\",0.3*1500,\"um K\";\n",
+ "print\"Required heat flux, q =\",round(q,0),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength*temp= 1500 um K\n",
+ "wavelength*temp at 450.0 um K\n",
+ "Required heat flux, q = 3553.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 , Page no:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a02 =1; #absorptivity\n",
+ "a24 =1; #absorptivity\n",
+ "a46 =0.5; #absorptivity\n",
+ "a68 =0.5; #absorptivity\n",
+ "a8 =0; #absorptivity\n",
+ "H02 =0; #Irradiationin W/m^2 um\n",
+ "H24 =750;#Irradiationin W/m^2 um\n",
+ "H46 =750;#Irradiationin W/m^2 um\n",
+ "H68 =750;#Irradiationin W/m^2 um\n",
+ "H8 =750;#Irradiationin W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "Absorbedradiantflux =1*0*(2 -0) +1*750*(4 -2)+0.5*750*(8 -4) +0;\n",
+ "H = 750*(8 -2) ; #Incident flux\n",
+ "a = Absorbedradiantflux /H;\n",
+ "p = 1-a;\n",
+ "\n",
+ "#result\n",
+ "print\"Absorbed radiant flux =\",Absorbedradiantflux,\"W/m^2\";\n",
+ "print\"Incident flux =\",H,\"W/m^2\";\n",
+ "print\"Absorptivity =\",round(a,3);\n",
+ "print\"Since the surf =\",round(p,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorbed radiant flux = 3000.0 W/m^2\n",
+ "Incident flux = 4500 W/m^2\n",
+ "Absorptivity = 0.667\n",
+ "Since the surf = 0.333\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(a) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "\n",
+ "#result\n",
+ "print\"Energy emitted =\",round(q,1),\"W/m^2\";\n",
+ "print\"Energy emitted normal to the surface =\",round(i_n,1),\"W/m^2 sr\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy emitted = 1857.9 W/m^2\n",
+ "Energy emitted normal to the surface = 591.7 W/m^2 sr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(b) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "#Radiant flux emitted in the cone 0<= pzi <= 50 degree, 0 <= theta <= 2*3.14\n",
+ "qcone =2*(3.14)*i_n *((- math.cos(math.radians(100))+(math.cos(math.radians(0))))/4);\n",
+ "Ratio = qcone /q;\n",
+ "\n",
+ "#result\n",
+ "print\"Radiant flux emitted in the cone =\",round(qcone,1),\"W/m^2\";\n",
+ "print\"Ratio =\",round(Ratio,3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiant flux emitted in the cone = 1090.3 W/m^2\n",
+ "Ratio = 0.587\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 , Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l1 = 0.5 ; #wavelength , [um]\n",
+ "l2 = 1.5 ; #wavelength , [um]\n",
+ "l3 = 2.5 ; #wavelength , [um]\n",
+ "l4 = 3.5 ; #wavelength , [um]\n",
+ "H1 = 2500 ; #W/m^2 um\n",
+ "H2 = 4000 ; #W/m^2 um\n",
+ "H3 = 2500 ; #W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "#Since the irridiation is diffuse, the spectral intensity\n",
+ "#Integrating i_lambda over the directions of the specified solid angle and using fig 3.12\n",
+ "flux = 3/4*( H1 *(l2 -l1)+H2 *(l3 -l2)+H3 *(l4 -l3) );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which radiation is incident on the surface =\",round(flux,3),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which radiation is incident on the surface = 6750.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 , Page no:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "F65 = 0.22;\n",
+ "F64 = 0.16;\n",
+ "F35 = 0.32;\n",
+ "F34 = 0.27;\n",
+ "A1 = 3; #m^ 2\n",
+ "A3 = 3; #m^ 2\n",
+ "A6 = 6; #m^ 2\n",
+ "\n",
+ "#calculations\n",
+ "#Using additive and reciprocal relations\n",
+ "F61 = F65 - F64 ;\n",
+ "F31 = F35 - F34 ;\n",
+ "F16 = A6/A1* F61 ;\n",
+ "F13 = A3/A1* F31 ;\n",
+ "F12 = F16 - F13;\n",
+ "\n",
+ "#result\n",
+ "print\"F1-2 =\",round(F12,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F1-2 = 0.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 , Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "sigma = 5.670*10** -8 ;\n",
+ "T1 = 473 ; #K\n",
+ "T2 = 373 ; #K\n",
+ "A1 = 1*2 ; #area,[m^ 2 ]\n",
+ "X = 0.25;\n",
+ "Y = 0.5 ;\n",
+ "\n",
+ "#calculations\n",
+ "F12 =(2/(3.14*X*Y))*math.log((((1+X**2)*(1+ Y**2))/(1+X**2+Y**2))**(1/2))+Y*((1+X**2)**(1/2))*math.atan((Y/((1+X**2)**(1/2))))+X*((1+Y**2)**(1/2))*math.atan((X/((1+Y**2)**(1/2))))-Y*math.atan(Y)-X*math.atan(X);\n",
+ "q1 = sigma *A1 *( T1 **4- T2 **4) *(1 - F12 **2) /(2*(1 - F12 ));\n",
+ "\n",
+ "#result\n",
+ "print\"Net radiative heat transfer from the surface =\",round(q1,1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net radiative heat transfer from the surface = 1795.1 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 , Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1 = 20; #W/m^2 K\n",
+ "w1 = 0.2; #m\n",
+ "k1 = 1; #W/m K\n",
+ "e1 = 0.5; #emmisivity at surfce 1\n",
+ "e2 = 0.4; #emmisivity at surfce 2\n",
+ "w2 = 0.3; #m\n",
+ "k2 = 0.5; #W/m K\n",
+ "h2 = 10; #W/m^2 K\n",
+ "T1 = 473.15; #Kelvin\n",
+ "T2 = 273.15+40; #Kelvin\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "stefan_cnst = 5.67*10**-8;\n",
+ "#q_A12=(T1-T_1)/(1/h1+w1/k1);for resistance 1&2\n",
+ "#q_A45=(T_2-T2)/(1/h2+w2/k2); for resistance 4&5\n",
+ "q_A=stefan_cnst*((T1-(1/h1+w1/k1))**4-(T2+(1/h1+w1/k1))**4)/(1/e1+1/e2-1)\n",
+ "#By solving trial and error method we can get q_A\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"Steady state heat flux q/A =\",round(q_A/4.7),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state heat flux q/A = 139.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 , Page no:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #C\n",
+ "T1 = 1000+273 ; #K\n",
+ "T2 = 27+273 ; #K\n",
+ "s = 5.670*10** -8 ; #stefansconstant\n",
+ "\n",
+ "#calculations\n",
+ "q = s*1* 3.14 *(( D/2) **2) *( T1 **4- T2 **4) ; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which heat is lost by radiation =\",round(q,6),\"W \";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which heat is lost by radiation = 46.610602 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 , Page no:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.32 ; #m\n",
+ "Ds = 0.36 ; #m\n",
+ "e = 0.02 ; #emissivity\n",
+ "l = 201 ; #kJ / kg\n",
+ "rho = 800 ; #kg /m^ 3\n",
+ "s = 5.670*10** -8 ; \n",
+ "T2 = 303 ; #K\n",
+ "T1 = 77 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "q1 = s*4*3.14*(( D/2) **2) *( T1 **4- T2 **4) /(1/ e +(( D/ Ds )**2)*(1/e -1)); #W\n",
+ "evap = abs(q1) *3600*24/( l *1000) ; #kg / day\n",
+ "mass = 4/3*3.14*(( D/2) **3) * rho ;\n",
+ "boiloff = evap / mass *100 ; #percent\n",
+ "Tdrop = (abs(q1)) /(4*3.14*(( D/2) **2) ) *(1/100) ; #C\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which nitrogen evaporates =\",round(evap,6),\"kg/day\";\n",
+ "print\"Boil-off rate =\",round(boiloff,4),\"percent\";\n",
+ "print\"Temperature drop between liquid Nitrogen and inner surface =\",round(Tdrop,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which nitrogen evaporates = 0.741453 kg/day\n",
+ "Boil-off rate = 5.4046 percent\n",
+ "Temperature drop between liquid Nitrogen and inner surface = 0.0536 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 , Page no:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 1 ; #m\n",
+ "r = 6250 ; #km\n",
+ "Dsurf = 300 ; #km\n",
+ "s = 5.670*10** -8;\n",
+ "e = 0.3 ;\n",
+ "Tc = -18+273 ; #K\n",
+ "Tsurf = 27+273 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "remission = 2*e*3.14 *(( D /2) **2)*s*Tc **4; #Rate o f emissino of radian tenergy from the two faces of satellited is c\n",
+ "sin_alpha = (r/(r+ Dsurf ));\n",
+ "F12 = sin_alpha**2;\n",
+ "rreceive = e*s*(3.14*(( D/2)**2))* F12 * Tsurf **4; #Rate at which the satellite receives and absorbs energy coming from eart h \n",
+ "rloss = remission - rreceive ;\n",
+ "\n",
+ "#result\n",
+ "print\"Net Rate at which energy is leaving the satellite =\",round(rloss,4),\"W\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net Rate at which energy is leaving the satellite = 14.441 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 , Page no:151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "\n",
+ "#Variable declaration\n",
+ "F12 = 0.0363;\n",
+ "F11 = 0;\n",
+ "F21 = 0.0363; #Similarly\n",
+ "F22 = 0;\n",
+ "F23 = 0.9637;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "F13 = 1-F11 - F12 ;\n",
+ "F31 = 2/24* F13; #F31 = A1/A3*F13\n",
+ "F32 = F31 ; #Therefore\n",
+ "F33 = 1-F31 - F32 ;\n",
+ "#Substituting into equation 3.11.6, 3.11.7, 3.11.8, and solving by matrix method\n",
+ "A=[[1,-0.01452,-0.38548],[-0.01452,1,-0.38548],[0.0803,0.0803,-0.1606]]\n",
+ "C=[[1702.859718],[658.521014],[0]]\n",
+ "\n",
+ "B=linalg.solve(A, C) \n",
+ "H=F12*B.item(1)+F13*B.item(2);\n",
+ "q1=2*(B.item(0)-H);\n",
+ "\n",
+ "#result\n",
+ "print\"B1 =\",round(B.item(0),1),\"W/m^2\";\n",
+ "print\"B2 =\",round(B.item(1),1),\"W/m^2\";\n",
+ "print\"B3 =\",round(B.item(2),1),\"W/m^2\";\n",
+ "print\"Net radiative heat transfer =\",round(q1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B1 = 2482.5 W/m^2\n",
+ "B2 = 1453.1 W/m^2\n",
+ "B3 = 1967.8 W/m^2\n",
+ "Net radiative heat transfer = 1067.0 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_7.ipynb new file mode 100755 index 00000000..b531d4b6 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_7.ipynb @@ -0,0 +1,641 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3f494d977b9882173f1289b65c0c4b5e1b60b5511a2cd5bc368a603771906dc9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Thermal Radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 , Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T = 5779 ; #Temperature,in Kelvin\n",
+ "\n",
+ "#calculations\n",
+ "lambdam = 0.00290/ T ; #m\n",
+ "e = 2*(3.14) *0.596*(10** -16) /(((0.5018*10** -6) **5) *( math.exp(0.014387/0.00290) -1)) ; #W/m^2 m\n",
+ "eblmax = e / 10**6 ;\n",
+ "eearth = eblmax *((0.695*10**6) /(1.496*10**8) )**2 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Value of emissivity on sun surface is\",round(eblmax,4),\"W/m^2 um\";\n",
+ "print\"The value of emmissivity on earths surface is\",round(eearth,4),\"W/m^2 um\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of emissivity on sun surface is 82995768.8548 W/m^2 um\n",
+ "The value of emmissivity on earths surface is 1791.2755 W/m^2 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 , Page no:115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "T = 1500; #tempera ture is in kelvins\n",
+ "eb = ( Stefanconstt )*(T **(4) ); #energy radiated by blackbody\n",
+ "e = 0.9; #emissivity\n",
+ "lamda1 = 1; #wave lengthis in um\n",
+ "lamda2 = 0.3; #wave lengthis in um\n",
+ "D01 =0.5*(0.01972+0.00779) ;\n",
+ "D02 =0;\n",
+ "\n",
+ "#calculations\n",
+ "q = e*( D01 - D02 )* Stefanconstt *T **(4) ; #W/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"wavelength*temp=\",1*1500,\"um K\";\n",
+ "print\"wavelength*temp at\",0.3*1500,\"um K\";\n",
+ "print\"Required heat flux, q =\",round(q,0),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength*temp= 1500 um K\n",
+ "wavelength*temp at 450.0 um K\n",
+ "Required heat flux, q = 3553.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 , Page no:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a02 =1; #absorptivity\n",
+ "a24 =1; #absorptivity\n",
+ "a46 =0.5; #absorptivity\n",
+ "a68 =0.5; #absorptivity\n",
+ "a8 =0; #absorptivity\n",
+ "H02 =0; #Irradiationin W/m^2 um\n",
+ "H24 =750;#Irradiationin W/m^2 um\n",
+ "H46 =750;#Irradiationin W/m^2 um\n",
+ "H68 =750;#Irradiationin W/m^2 um\n",
+ "H8 =750;#Irradiationin W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "Absorbedradiantflux =1*0*(2 -0) +1*750*(4 -2)+0.5*750*(8 -4) +0;\n",
+ "H = 750*(8 -2) ; #Incident flux\n",
+ "a = Absorbedradiantflux /H;\n",
+ "p = 1-a;\n",
+ "\n",
+ "#result\n",
+ "print\"Absorbed radiant flux =\",Absorbedradiantflux,\"W/m^2\";\n",
+ "print\"Incident flux =\",H,\"W/m^2\";\n",
+ "print\"Absorptivity =\",round(a,3);\n",
+ "print\"Since the surf =\",round(p,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorbed radiant flux = 3000.0 W/m^2\n",
+ "Incident flux = 4500 W/m^2\n",
+ "Absorptivity = 0.667\n",
+ "Since the surf = 0.333\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(a) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "\n",
+ "#result\n",
+ "print\"Energy emitted =\",round(q,1),\"W/m^2\";\n",
+ "print\"Energy emitted normal to the surface =\",round(i_n,1),\"W/m^2 sr\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy emitted = 1857.9 W/m^2\n",
+ "Energy emitted normal to the surface = 591.7 W/m^2 sr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(b) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "#Radiant flux emitted in the cone 0<= pzi <= 50 degree, 0 <= theta <= 2*3.14\n",
+ "qcone =2*(3.14)*i_n *((- math.cos(math.radians(100))+(math.cos(math.radians(0))))/4);\n",
+ "Ratio = qcone /q;\n",
+ "\n",
+ "#result\n",
+ "print\"Radiant flux emitted in the cone =\",round(qcone,1),\"W/m^2\";\n",
+ "print\"Ratio =\",round(Ratio,3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiant flux emitted in the cone = 1090.3 W/m^2\n",
+ "Ratio = 0.587\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 , Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l1 = 0.5 ; #wavelength , [um]\n",
+ "l2 = 1.5 ; #wavelength , [um]\n",
+ "l3 = 2.5 ; #wavelength , [um]\n",
+ "l4 = 3.5 ; #wavelength , [um]\n",
+ "H1 = 2500 ; #W/m^2 um\n",
+ "H2 = 4000 ; #W/m^2 um\n",
+ "H3 = 2500 ; #W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "#Since the irridiation is diffuse, the spectral intensity\n",
+ "#Integrating i_lambda over the directions of the specified solid angle and using fig 3.12\n",
+ "flux = 3/4*( H1 *(l2 -l1)+H2 *(l3 -l2)+H3 *(l4 -l3) );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which radiation is incident on the surface =\",round(flux,3),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which radiation is incident on the surface = 6750.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 , Page no:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "F65 = 0.22;\n",
+ "F64 = 0.16;\n",
+ "F35 = 0.32;\n",
+ "F34 = 0.27;\n",
+ "A1 = 3; #m^ 2\n",
+ "A3 = 3; #m^ 2\n",
+ "A6 = 6; #m^ 2\n",
+ "\n",
+ "#calculations\n",
+ "#Using additive and reciprocal relations\n",
+ "F61 = F65 - F64 ;\n",
+ "F31 = F35 - F34 ;\n",
+ "F16 = A6/A1* F61 ;\n",
+ "F13 = A3/A1* F31 ;\n",
+ "F12 = F16 - F13;\n",
+ "\n",
+ "#result\n",
+ "print\"F1-2 =\",round(F12,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F1-2 = 0.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 , Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "sigma = 5.670*10** -8 ;\n",
+ "T1 = 473 ; #K\n",
+ "T2 = 373 ; #K\n",
+ "A1 = 1*2 ; #area,[m^ 2 ]\n",
+ "X = 0.25;\n",
+ "Y = 0.5 ;\n",
+ "\n",
+ "#calculations\n",
+ "F12 =(2/(3.14*X*Y))*math.log((((1+X**2)*(1+ Y**2))/(1+X**2+Y**2))**(1/2))+Y*((1+X**2)**(1/2))*math.atan((Y/((1+X**2)**(1/2))))+X*((1+Y**2)**(1/2))*math.atan((X/((1+Y**2)**(1/2))))-Y*math.atan(Y)-X*math.atan(X);\n",
+ "q1 = sigma *A1 *( T1 **4- T2 **4) *(1 - F12 **2) /(2*(1 - F12 ));\n",
+ "\n",
+ "#result\n",
+ "print\"Net radiative heat transfer from the surface =\",round(q1,1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net radiative heat transfer from the surface = 1795.1 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 , Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1 = 20; #W/m^2 K\n",
+ "w1 = 0.2; #m\n",
+ "k1 = 1; #W/m K\n",
+ "e1 = 0.5; #emmisivity at surfce 1\n",
+ "e2 = 0.4; #emmisivity at surfce 2\n",
+ "w2 = 0.3; #m\n",
+ "k2 = 0.5; #W/m K\n",
+ "h2 = 10; #W/m^2 K\n",
+ "T1 = 473.15; #Kelvin\n",
+ "T2 = 273.15+40; #Kelvin\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "stefan_cnst = 5.67*10**-8;\n",
+ "#q_A12=(T1-T_1)/(1/h1+w1/k1);for resistance 1&2\n",
+ "#q_A45=(T_2-T2)/(1/h2+w2/k2); for resistance 4&5\n",
+ "q_A=stefan_cnst*((T1-(1/h1+w1/k1))**4-(T2+(1/h1+w1/k1))**4)/(1/e1+1/e2-1)\n",
+ "#By solving trial and error method we can get q_A\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"Steady state heat flux q/A =\",round(q_A/4.7),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state heat flux q/A = 139.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 , Page no:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #C\n",
+ "T1 = 1000+273 ; #K\n",
+ "T2 = 27+273 ; #K\n",
+ "s = 5.670*10** -8 ; #stefansconstant\n",
+ "\n",
+ "#calculations\n",
+ "q = s*1* 3.14 *(( D/2) **2) *( T1 **4- T2 **4) ; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which heat is lost by radiation =\",round(q,6),\"W \";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which heat is lost by radiation = 46.610602 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 , Page no:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.32 ; #m\n",
+ "Ds = 0.36 ; #m\n",
+ "e = 0.02 ; #emissivity\n",
+ "l = 201 ; #kJ / kg\n",
+ "rho = 800 ; #kg /m^ 3\n",
+ "s = 5.670*10** -8 ; \n",
+ "T2 = 303 ; #K\n",
+ "T1 = 77 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "q1 = s*4*3.14*(( D/2) **2) *( T1 **4- T2 **4) /(1/ e +(( D/ Ds )**2)*(1/e -1)); #W\n",
+ "evap = abs(q1) *3600*24/( l *1000) ; #kg / day\n",
+ "mass = 4/3*3.14*(( D/2) **3) * rho ;\n",
+ "boiloff = evap / mass *100 ; #percent\n",
+ "Tdrop = (abs(q1)) /(4*3.14*(( D/2) **2) ) *(1/100) ; #C\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which nitrogen evaporates =\",round(evap,6),\"kg/day\";\n",
+ "print\"Boil-off rate =\",round(boiloff,4),\"percent\";\n",
+ "print\"Temperature drop between liquid Nitrogen and inner surface =\",round(Tdrop,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which nitrogen evaporates = 0.741453 kg/day\n",
+ "Boil-off rate = 5.4046 percent\n",
+ "Temperature drop between liquid Nitrogen and inner surface = 0.0536 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 , Page no:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 1 ; #m\n",
+ "r = 6250 ; #km\n",
+ "Dsurf = 300 ; #km\n",
+ "s = 5.670*10** -8;\n",
+ "e = 0.3 ;\n",
+ "Tc = -18+273 ; #K\n",
+ "Tsurf = 27+273 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "remission = 2*e*3.14 *(( D /2) **2)*s*Tc **4; #Rate o f emissino of radian tenergy from the two faces of satellited is c\n",
+ "sin_alpha = (r/(r+ Dsurf ));\n",
+ "F12 = sin_alpha**2;\n",
+ "rreceive = e*s*(3.14*(( D/2)**2))* F12 * Tsurf **4; #Rate at which the satellite receives and absorbs energy coming from eart h \n",
+ "rloss = remission - rreceive ;\n",
+ "\n",
+ "#result\n",
+ "print\"Net Rate at which energy is leaving the satellite =\",round(rloss,4),\"W\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net Rate at which energy is leaving the satellite = 14.441 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 , Page no:151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "\n",
+ "#Variable declaration\n",
+ "F12 = 0.0363;\n",
+ "F11 = 0;\n",
+ "F21 = 0.0363; #Similarly\n",
+ "F22 = 0;\n",
+ "F23 = 0.9637;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "F13 = 1-F11 - F12 ;\n",
+ "F31 = 2/24* F13; #F31 = A1/A3*F13\n",
+ "F32 = F31 ; #Therefore\n",
+ "F33 = 1-F31 - F32 ;\n",
+ "#Substituting into equation 3.11.6, 3.11.7, 3.11.8, and solving by matrix method\n",
+ "A=[[1,-0.01452,-0.38548],[-0.01452,1,-0.38548],[0.0803,0.0803,-0.1606]]\n",
+ "C=[[1702.859718],[658.521014],[0]]\n",
+ "\n",
+ "B=linalg.solve(A, C) \n",
+ "H=F12*B.item(1)+F13*B.item(2);\n",
+ "q1=2*(B.item(0)-H);\n",
+ "\n",
+ "#result\n",
+ "print\"B1 =\",round(B.item(0),1),\"W/m^2\";\n",
+ "print\"B2 =\",round(B.item(1),1),\"W/m^2\";\n",
+ "print\"B3 =\",round(B.item(2),1),\"W/m^2\";\n",
+ "print\"Net radiative heat transfer =\",round(q1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B1 = 2482.5 W/m^2\n",
+ "B2 = 1453.1 W/m^2\n",
+ "B3 = 1967.8 W/m^2\n",
+ "Net radiative heat transfer = 1067.0 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_8.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_8.ipynb new file mode 100755 index 00000000..b531d4b6 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_3_Thermal_Radiation_8.ipynb @@ -0,0 +1,641 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3f494d977b9882173f1289b65c0c4b5e1b60b5511a2cd5bc368a603771906dc9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Thermal Radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 , Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T = 5779 ; #Temperature,in Kelvin\n",
+ "\n",
+ "#calculations\n",
+ "lambdam = 0.00290/ T ; #m\n",
+ "e = 2*(3.14) *0.596*(10** -16) /(((0.5018*10** -6) **5) *( math.exp(0.014387/0.00290) -1)) ; #W/m^2 m\n",
+ "eblmax = e / 10**6 ;\n",
+ "eearth = eblmax *((0.695*10**6) /(1.496*10**8) )**2 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Value of emissivity on sun surface is\",round(eblmax,4),\"W/m^2 um\";\n",
+ "print\"The value of emmissivity on earths surface is\",round(eearth,4),\"W/m^2 um\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of emissivity on sun surface is 82995768.8548 W/m^2 um\n",
+ "The value of emmissivity on earths surface is 1791.2755 W/m^2 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 , Page no:115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "T = 1500; #tempera ture is in kelvins\n",
+ "eb = ( Stefanconstt )*(T **(4) ); #energy radiated by blackbody\n",
+ "e = 0.9; #emissivity\n",
+ "lamda1 = 1; #wave lengthis in um\n",
+ "lamda2 = 0.3; #wave lengthis in um\n",
+ "D01 =0.5*(0.01972+0.00779) ;\n",
+ "D02 =0;\n",
+ "\n",
+ "#calculations\n",
+ "q = e*( D01 - D02 )* Stefanconstt *T **(4) ; #W/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"wavelength*temp=\",1*1500,\"um K\";\n",
+ "print\"wavelength*temp at\",0.3*1500,\"um K\";\n",
+ "print\"Required heat flux, q =\",round(q,0),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength*temp= 1500 um K\n",
+ "wavelength*temp at 450.0 um K\n",
+ "Required heat flux, q = 3553.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 , Page no:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a02 =1; #absorptivity\n",
+ "a24 =1; #absorptivity\n",
+ "a46 =0.5; #absorptivity\n",
+ "a68 =0.5; #absorptivity\n",
+ "a8 =0; #absorptivity\n",
+ "H02 =0; #Irradiationin W/m^2 um\n",
+ "H24 =750;#Irradiationin W/m^2 um\n",
+ "H46 =750;#Irradiationin W/m^2 um\n",
+ "H68 =750;#Irradiationin W/m^2 um\n",
+ "H8 =750;#Irradiationin W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "Absorbedradiantflux =1*0*(2 -0) +1*750*(4 -2)+0.5*750*(8 -4) +0;\n",
+ "H = 750*(8 -2) ; #Incident flux\n",
+ "a = Absorbedradiantflux /H;\n",
+ "p = 1-a;\n",
+ "\n",
+ "#result\n",
+ "print\"Absorbed radiant flux =\",Absorbedradiantflux,\"W/m^2\";\n",
+ "print\"Incident flux =\",H,\"W/m^2\";\n",
+ "print\"Absorptivity =\",round(a,3);\n",
+ "print\"Since the surf =\",round(p,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorbed radiant flux = 3000.0 W/m^2\n",
+ "Incident flux = 4500 W/m^2\n",
+ "Absorptivity = 0.667\n",
+ "Since the surf = 0.333\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(a) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "\n",
+ "#result\n",
+ "print\"Energy emitted =\",round(q,1),\"W/m^2\";\n",
+ "print\"Energy emitted normal to the surface =\",round(i_n,1),\"W/m^2 sr\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy emitted = 1857.9 W/m^2\n",
+ "Energy emitted normal to the surface = 591.7 W/m^2 sr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4(b) , Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 0.08; #emissivity\n",
+ "T = 800; #temperature,[K]\n",
+ "\n",
+ "#calculations\n",
+ "Stefanconstt = 5.67*10**( -8) ; #W/m^ 2 .K^ 4 \n",
+ "q = e* Stefanconstt *T **4; #W/m^ 2\n",
+ "i_n = (q/(3.14));\n",
+ "#Radiant flux emitted in the cone 0<= pzi <= 50 degree, 0 <= theta <= 2*3.14\n",
+ "qcone =2*(3.14)*i_n *((- math.cos(math.radians(100))+(math.cos(math.radians(0))))/4);\n",
+ "Ratio = qcone /q;\n",
+ "\n",
+ "#result\n",
+ "print\"Radiant flux emitted in the cone =\",round(qcone,1),\"W/m^2\";\n",
+ "print\"Ratio =\",round(Ratio,3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiant flux emitted in the cone = 1090.3 W/m^2\n",
+ "Ratio = 0.587\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 , Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l1 = 0.5 ; #wavelength , [um]\n",
+ "l2 = 1.5 ; #wavelength , [um]\n",
+ "l3 = 2.5 ; #wavelength , [um]\n",
+ "l4 = 3.5 ; #wavelength , [um]\n",
+ "H1 = 2500 ; #W/m^2 um\n",
+ "H2 = 4000 ; #W/m^2 um\n",
+ "H3 = 2500 ; #W/m^2 um\n",
+ "\n",
+ "#calculations\n",
+ "#Since the irridiation is diffuse, the spectral intensity\n",
+ "#Integrating i_lambda over the directions of the specified solid angle and using fig 3.12\n",
+ "flux = 3/4*( H1 *(l2 -l1)+H2 *(l3 -l2)+H3 *(l4 -l3) );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which radiation is incident on the surface =\",round(flux,3),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which radiation is incident on the surface = 6750.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 , Page no:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "F65 = 0.22;\n",
+ "F64 = 0.16;\n",
+ "F35 = 0.32;\n",
+ "F34 = 0.27;\n",
+ "A1 = 3; #m^ 2\n",
+ "A3 = 3; #m^ 2\n",
+ "A6 = 6; #m^ 2\n",
+ "\n",
+ "#calculations\n",
+ "#Using additive and reciprocal relations\n",
+ "F61 = F65 - F64 ;\n",
+ "F31 = F35 - F34 ;\n",
+ "F16 = A6/A1* F61 ;\n",
+ "F13 = A3/A1* F31 ;\n",
+ "F12 = F16 - F13;\n",
+ "\n",
+ "#result\n",
+ "print\"F1-2 =\",round(F12,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F1-2 = 0.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 , Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "sigma = 5.670*10** -8 ;\n",
+ "T1 = 473 ; #K\n",
+ "T2 = 373 ; #K\n",
+ "A1 = 1*2 ; #area,[m^ 2 ]\n",
+ "X = 0.25;\n",
+ "Y = 0.5 ;\n",
+ "\n",
+ "#calculations\n",
+ "F12 =(2/(3.14*X*Y))*math.log((((1+X**2)*(1+ Y**2))/(1+X**2+Y**2))**(1/2))+Y*((1+X**2)**(1/2))*math.atan((Y/((1+X**2)**(1/2))))+X*((1+Y**2)**(1/2))*math.atan((X/((1+Y**2)**(1/2))))-Y*math.atan(Y)-X*math.atan(X);\n",
+ "q1 = sigma *A1 *( T1 **4- T2 **4) *(1 - F12 **2) /(2*(1 - F12 ));\n",
+ "\n",
+ "#result\n",
+ "print\"Net radiative heat transfer from the surface =\",round(q1,1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net radiative heat transfer from the surface = 1795.1 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 , Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h1 = 20; #W/m^2 K\n",
+ "w1 = 0.2; #m\n",
+ "k1 = 1; #W/m K\n",
+ "e1 = 0.5; #emmisivity at surfce 1\n",
+ "e2 = 0.4; #emmisivity at surfce 2\n",
+ "w2 = 0.3; #m\n",
+ "k2 = 0.5; #W/m K\n",
+ "h2 = 10; #W/m^2 K\n",
+ "T1 = 473.15; #Kelvin\n",
+ "T2 = 273.15+40; #Kelvin\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "stefan_cnst = 5.67*10**-8;\n",
+ "#q_A12=(T1-T_1)/(1/h1+w1/k1);for resistance 1&2\n",
+ "#q_A45=(T_2-T2)/(1/h2+w2/k2); for resistance 4&5\n",
+ "q_A=stefan_cnst*((T1-(1/h1+w1/k1))**4-(T2+(1/h1+w1/k1))**4)/(1/e1+1/e2-1)\n",
+ "#By solving trial and error method we can get q_A\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"Steady state heat flux q/A =\",round(q_A/4.7),\"W/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state heat flux q/A = 139.0 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 , Page no:145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #C\n",
+ "T1 = 1000+273 ; #K\n",
+ "T2 = 27+273 ; #K\n",
+ "s = 5.670*10** -8 ; #stefansconstant\n",
+ "\n",
+ "#calculations\n",
+ "q = s*1* 3.14 *(( D/2) **2) *( T1 **4- T2 **4) ; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which heat is lost by radiation =\",round(q,6),\"W \";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which heat is lost by radiation = 46.610602 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 , Page no:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.32 ; #m\n",
+ "Ds = 0.36 ; #m\n",
+ "e = 0.02 ; #emissivity\n",
+ "l = 201 ; #kJ / kg\n",
+ "rho = 800 ; #kg /m^ 3\n",
+ "s = 5.670*10** -8 ; \n",
+ "T2 = 303 ; #K\n",
+ "T1 = 77 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "q1 = s*4*3.14*(( D/2) **2) *( T1 **4- T2 **4) /(1/ e +(( D/ Ds )**2)*(1/e -1)); #W\n",
+ "evap = abs(q1) *3600*24/( l *1000) ; #kg / day\n",
+ "mass = 4/3*3.14*(( D/2) **3) * rho ;\n",
+ "boiloff = evap / mass *100 ; #percent\n",
+ "Tdrop = (abs(q1)) /(4*3.14*(( D/2) **2) ) *(1/100) ; #C\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which nitrogen evaporates =\",round(evap,6),\"kg/day\";\n",
+ "print\"Boil-off rate =\",round(boiloff,4),\"percent\";\n",
+ "print\"Temperature drop between liquid Nitrogen and inner surface =\",round(Tdrop,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which nitrogen evaporates = 0.741453 kg/day\n",
+ "Boil-off rate = 5.4046 percent\n",
+ "Temperature drop between liquid Nitrogen and inner surface = 0.0536 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 , Page no:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 1 ; #m\n",
+ "r = 6250 ; #km\n",
+ "Dsurf = 300 ; #km\n",
+ "s = 5.670*10** -8;\n",
+ "e = 0.3 ;\n",
+ "Tc = -18+273 ; #K\n",
+ "Tsurf = 27+273 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "remission = 2*e*3.14 *(( D /2) **2)*s*Tc **4; #Rate o f emissino of radian tenergy from the two faces of satellited is c\n",
+ "sin_alpha = (r/(r+ Dsurf ));\n",
+ "F12 = sin_alpha**2;\n",
+ "rreceive = e*s*(3.14*(( D/2)**2))* F12 * Tsurf **4; #Rate at which the satellite receives and absorbs energy coming from eart h \n",
+ "rloss = remission - rreceive ;\n",
+ "\n",
+ "#result\n",
+ "print\"Net Rate at which energy is leaving the satellite =\",round(rloss,4),\"W\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net Rate at which energy is leaving the satellite = 14.441 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 , Page no:151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "\n",
+ "#Variable declaration\n",
+ "F12 = 0.0363;\n",
+ "F11 = 0;\n",
+ "F21 = 0.0363; #Similarly\n",
+ "F22 = 0;\n",
+ "F23 = 0.9637;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "F13 = 1-F11 - F12 ;\n",
+ "F31 = 2/24* F13; #F31 = A1/A3*F13\n",
+ "F32 = F31 ; #Therefore\n",
+ "F33 = 1-F31 - F32 ;\n",
+ "#Substituting into equation 3.11.6, 3.11.7, 3.11.8, and solving by matrix method\n",
+ "A=[[1,-0.01452,-0.38548],[-0.01452,1,-0.38548],[0.0803,0.0803,-0.1606]]\n",
+ "C=[[1702.859718],[658.521014],[0]]\n",
+ "\n",
+ "B=linalg.solve(A, C) \n",
+ "H=F12*B.item(1)+F13*B.item(2);\n",
+ "q1=2*(B.item(0)-H);\n",
+ "\n",
+ "#result\n",
+ "print\"B1 =\",round(B.item(0),1),\"W/m^2\";\n",
+ "print\"B2 =\",round(B.item(1),1),\"W/m^2\";\n",
+ "print\"B3 =\",round(B.item(2),1),\"W/m^2\";\n",
+ "print\"Net radiative heat transfer =\",round(q1),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B1 = 2482.5 W/m^2\n",
+ "B2 = 1453.1 W/m^2\n",
+ "B3 = 1967.8 W/m^2\n",
+ "Net radiative heat transfer = 1067.0 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_1.ipynb new file mode 100755 index 00000000..ed17906e --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_1.ipynb @@ -0,0 +1,333 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c0b8814a6ac7ab401db03352df216c35ffd27c0ad0849fd68734e0e65b766ec4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 , Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #Length\n",
+ "D = 0.01 ; #ID\n",
+ "V = 0.2 ; #Average Velocity\n",
+ "rho =999.7 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v =1.306 * 10** -6 ; #m^2/ s\n",
+ "ReD =0.2*0.01/(1.306*10** -6) ;\n",
+ "f = 16/ ReD ;\n",
+ "deltap = 4*f*(L/D)*( rho*V **2) /2;\n",
+ "Vmax = 2*V;\n",
+ "\n",
+ "#result\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Maximum velocity is\",round(Vmax,3),\"m/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop is 250.6768 Pa\n",
+ "Maximum velocity is 0.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(a) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ;#m/ s\n",
+ "rho = 971.8 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.365 * 10** -6 ; #m^2/ s\n",
+ "ReD = D*V/v;\n",
+ "f =0.079*( ReD )**( -0.25) ;\n",
+ "deltap = (4*f*L* rho *V**2) /(D *2) ;\n",
+ "x = ((f/2) **0.5) *V ;\n",
+ "yplus = 0.005* x /(0.365*10** -6) ;\n",
+ "Vmax = x *(2.5* math.log ( yplus ) + 5.5) ;\n",
+ "ratio = Vmax /V;\n",
+ "\n",
+ "#result\n",
+ "print\"(a) If the temperature of water is increased to 80 degree C\";\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Vmax =\",round(Vmax,4),\"m/s\";\n",
+ "print\"Vmax/Vbar =\",round(ratio,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If the temperature of water is increased to 80 degree C\n",
+ "Pressure drop is 214.1563 Pa\n",
+ "Vmax = 0.2515 m/s\n",
+ "Vmax/Vbar = 1.2575\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(b) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ; #m/s\n",
+ "V1 =0.7;\n",
+ "v1 = 1.306 * 10** -6 ; #m^2/ s\n",
+ "V1 =0.7; #m/ s\n",
+ "\n",
+ "#calculations\n",
+ "ReD1 =V1*D /(1.306*10** -6) ;\n",
+ "f1 = 0.079*( ReD1 )**( -0.25) ;\n",
+ "deltap1 = (4* f1*L *999.7*0.7**2) /(0.01*2) ;\n",
+ "x1 = (( f1 /2)**0.5) *V1 ;\n",
+ "y1plus = 0.005* x1 /( v1);\n",
+ "Vmax1 = x1 *(2.5* math.log ( y1plus ) + 5.5) ;\n",
+ "ratio1 = Vmax1 /V1;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) If the velocity is increased to 0.7 \";\n",
+ "print\"Reynolds no is\",round(ReD1,4);\n",
+ "print\"Pressure drop is\",round(deltap1,4),\"pa\";\n",
+ "print\"y+ at centre line =\",round(y1plus,4);\n",
+ "print\"Vmax is\",round(Vmax1,4),\"pa\";\n",
+ "print\"Vmax/Vbar =\",round(ratio1,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) If the velocity is increased to 0.7 \n",
+ "Reynolds no is 5359.8775\n",
+ "Pressure drop is 2713.6598 pa\n",
+ "y+ at centre line = 182.087\n",
+ "Vmax is 0.8804 pa\n",
+ "Vmax/Vbar = 1.2577\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 , Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 80 * 10**3 ; #Pa\n",
+ "L = 10 ; #m\n",
+ "Vbar = 1.9 ; #m/s\n",
+ "l = 0.25 ; #m\n",
+ "b = 0.15 ; #m\n",
+ "rho = 1.185 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.35 * 10** -6 ; #kg /m s\n",
+ "rho1 = rho *(80/101.3) ; #kg /m^ 3\n",
+ "r = b/l;\n",
+ "De = (4* l/2*b /2) /(l/2 + b /2) ;\n",
+ "Dl = (2/3 + 11/24*0.6*(2 -0.6)) * De ;\n",
+ "Re = rho1 * Dl * Vbar / mew ;\n",
+ "f = 0.079*( Re ** -0.25) ;\n",
+ "deltaP = 4*f*(L/ Dl )*( rho1 *( Vbar **2) /2) ;\n",
+ "power = deltaP *( Vbar *l*b)\n",
+ "\n",
+ "#result\n",
+ "print\"Reynolds no =\",round(Re,4);\n",
+ "print\"f =\",round(f,4);\n",
+ "print\"Pressure drop =\",round(deltaP,4),\"Pa\";\n",
+ "print\"Power required =\",round(power,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds no = 19107.1453\n",
+ "f = 0.0067\n",
+ "Pressure drop = 2.3024 Pa\n",
+ "Power required = 0.164 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 , Page no:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "b = 1 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "rho = 1.060 ; #kg /m^ 3\n",
+ "x = 1.5 ; #m^2/s\n",
+ "\n",
+ "#calculations\n",
+ "v = 18.97 * 10** -6 ;\n",
+ "Re = V*x/v; #Reynolds number\n",
+ "d = 5*x/( Re **(1/2) ) *1000 ;\n",
+ "Rel = V*l/v;\n",
+ "cf = 1.328* Rel** -(1/2) ; #drag coefficient\n",
+ "Fd = 0.00409*(1/2) *rho *(2* l*b) *1**2;\n",
+ "\n",
+ "#result\n",
+ "print\"Thickness of Boundary layer at x =1.5 is \",round(d,4),\"mm\"\n",
+ "print\"Drag Coefficient cf =\",round(cf,5);\n",
+ "print\"Drag Force FD =\",round(Fd,6),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of Boundary layer at x =1.5 is 26.6716 mm\n",
+ "Drag Coefficient cf = 0.00409\n",
+ "Drag Force FD = 0.008671 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 , Page no:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "v = 4 ; #m/s\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.1*10** -6; #N s /m^ 2\n",
+ "rho = 1.205*1.5; #kg /m^ 3\n",
+ "Rel = rho*v*l/ mew ;\n",
+ "Cf = 0.074*(7.989*10**5) **( -0.2) - 1050/ Rel ;\n",
+ "Df = Cf *1/2* rho*l*v **2;\n",
+ "x = 3*10**5 * (18.1*10** -6) /(1.808*4) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Drag coefficieent is\",round(Cf,6);\n",
+ "print\"Drag force per meter width =\",round(Df,6),\"N\";\n",
+ "print\"Value of xc is\",round(x,6),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag coefficieent is 0.003569\n",
+ "Drag force per meter width = 0.103221 N\n",
+ "Value of xc is 0.75083 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_2.ipynb new file mode 100755 index 00000000..ed17906e --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_2.ipynb @@ -0,0 +1,333 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c0b8814a6ac7ab401db03352df216c35ffd27c0ad0849fd68734e0e65b766ec4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 , Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #Length\n",
+ "D = 0.01 ; #ID\n",
+ "V = 0.2 ; #Average Velocity\n",
+ "rho =999.7 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v =1.306 * 10** -6 ; #m^2/ s\n",
+ "ReD =0.2*0.01/(1.306*10** -6) ;\n",
+ "f = 16/ ReD ;\n",
+ "deltap = 4*f*(L/D)*( rho*V **2) /2;\n",
+ "Vmax = 2*V;\n",
+ "\n",
+ "#result\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Maximum velocity is\",round(Vmax,3),\"m/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop is 250.6768 Pa\n",
+ "Maximum velocity is 0.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(a) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ;#m/ s\n",
+ "rho = 971.8 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.365 * 10** -6 ; #m^2/ s\n",
+ "ReD = D*V/v;\n",
+ "f =0.079*( ReD )**( -0.25) ;\n",
+ "deltap = (4*f*L* rho *V**2) /(D *2) ;\n",
+ "x = ((f/2) **0.5) *V ;\n",
+ "yplus = 0.005* x /(0.365*10** -6) ;\n",
+ "Vmax = x *(2.5* math.log ( yplus ) + 5.5) ;\n",
+ "ratio = Vmax /V;\n",
+ "\n",
+ "#result\n",
+ "print\"(a) If the temperature of water is increased to 80 degree C\";\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Vmax =\",round(Vmax,4),\"m/s\";\n",
+ "print\"Vmax/Vbar =\",round(ratio,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If the temperature of water is increased to 80 degree C\n",
+ "Pressure drop is 214.1563 Pa\n",
+ "Vmax = 0.2515 m/s\n",
+ "Vmax/Vbar = 1.2575\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(b) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ; #m/s\n",
+ "V1 =0.7;\n",
+ "v1 = 1.306 * 10** -6 ; #m^2/ s\n",
+ "V1 =0.7; #m/ s\n",
+ "\n",
+ "#calculations\n",
+ "ReD1 =V1*D /(1.306*10** -6) ;\n",
+ "f1 = 0.079*( ReD1 )**( -0.25) ;\n",
+ "deltap1 = (4* f1*L *999.7*0.7**2) /(0.01*2) ;\n",
+ "x1 = (( f1 /2)**0.5) *V1 ;\n",
+ "y1plus = 0.005* x1 /( v1);\n",
+ "Vmax1 = x1 *(2.5* math.log ( y1plus ) + 5.5) ;\n",
+ "ratio1 = Vmax1 /V1;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) If the velocity is increased to 0.7 \";\n",
+ "print\"Reynolds no is\",round(ReD1,4);\n",
+ "print\"Pressure drop is\",round(deltap1,4),\"pa\";\n",
+ "print\"y+ at centre line =\",round(y1plus,4);\n",
+ "print\"Vmax is\",round(Vmax1,4),\"pa\";\n",
+ "print\"Vmax/Vbar =\",round(ratio1,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) If the velocity is increased to 0.7 \n",
+ "Reynolds no is 5359.8775\n",
+ "Pressure drop is 2713.6598 pa\n",
+ "y+ at centre line = 182.087\n",
+ "Vmax is 0.8804 pa\n",
+ "Vmax/Vbar = 1.2577\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 , Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 80 * 10**3 ; #Pa\n",
+ "L = 10 ; #m\n",
+ "Vbar = 1.9 ; #m/s\n",
+ "l = 0.25 ; #m\n",
+ "b = 0.15 ; #m\n",
+ "rho = 1.185 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.35 * 10** -6 ; #kg /m s\n",
+ "rho1 = rho *(80/101.3) ; #kg /m^ 3\n",
+ "r = b/l;\n",
+ "De = (4* l/2*b /2) /(l/2 + b /2) ;\n",
+ "Dl = (2/3 + 11/24*0.6*(2 -0.6)) * De ;\n",
+ "Re = rho1 * Dl * Vbar / mew ;\n",
+ "f = 0.079*( Re ** -0.25) ;\n",
+ "deltaP = 4*f*(L/ Dl )*( rho1 *( Vbar **2) /2) ;\n",
+ "power = deltaP *( Vbar *l*b)\n",
+ "\n",
+ "#result\n",
+ "print\"Reynolds no =\",round(Re,4);\n",
+ "print\"f =\",round(f,4);\n",
+ "print\"Pressure drop =\",round(deltaP,4),\"Pa\";\n",
+ "print\"Power required =\",round(power,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds no = 19107.1453\n",
+ "f = 0.0067\n",
+ "Pressure drop = 2.3024 Pa\n",
+ "Power required = 0.164 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 , Page no:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "b = 1 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "rho = 1.060 ; #kg /m^ 3\n",
+ "x = 1.5 ; #m^2/s\n",
+ "\n",
+ "#calculations\n",
+ "v = 18.97 * 10** -6 ;\n",
+ "Re = V*x/v; #Reynolds number\n",
+ "d = 5*x/( Re **(1/2) ) *1000 ;\n",
+ "Rel = V*l/v;\n",
+ "cf = 1.328* Rel** -(1/2) ; #drag coefficient\n",
+ "Fd = 0.00409*(1/2) *rho *(2* l*b) *1**2;\n",
+ "\n",
+ "#result\n",
+ "print\"Thickness of Boundary layer at x =1.5 is \",round(d,4),\"mm\"\n",
+ "print\"Drag Coefficient cf =\",round(cf,5);\n",
+ "print\"Drag Force FD =\",round(Fd,6),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of Boundary layer at x =1.5 is 26.6716 mm\n",
+ "Drag Coefficient cf = 0.00409\n",
+ "Drag Force FD = 0.008671 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 , Page no:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "v = 4 ; #m/s\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.1*10** -6; #N s /m^ 2\n",
+ "rho = 1.205*1.5; #kg /m^ 3\n",
+ "Rel = rho*v*l/ mew ;\n",
+ "Cf = 0.074*(7.989*10**5) **( -0.2) - 1050/ Rel ;\n",
+ "Df = Cf *1/2* rho*l*v **2;\n",
+ "x = 3*10**5 * (18.1*10** -6) /(1.808*4) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Drag coefficieent is\",round(Cf,6);\n",
+ "print\"Drag force per meter width =\",round(Df,6),\"N\";\n",
+ "print\"Value of xc is\",round(x,6),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag coefficieent is 0.003569\n",
+ "Drag force per meter width = 0.103221 N\n",
+ "Value of xc is 0.75083 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_3.ipynb new file mode 100755 index 00000000..ed17906e --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_3.ipynb @@ -0,0 +1,333 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c0b8814a6ac7ab401db03352df216c35ffd27c0ad0849fd68734e0e65b766ec4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 , Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #Length\n",
+ "D = 0.01 ; #ID\n",
+ "V = 0.2 ; #Average Velocity\n",
+ "rho =999.7 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v =1.306 * 10** -6 ; #m^2/ s\n",
+ "ReD =0.2*0.01/(1.306*10** -6) ;\n",
+ "f = 16/ ReD ;\n",
+ "deltap = 4*f*(L/D)*( rho*V **2) /2;\n",
+ "Vmax = 2*V;\n",
+ "\n",
+ "#result\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Maximum velocity is\",round(Vmax,3),\"m/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop is 250.6768 Pa\n",
+ "Maximum velocity is 0.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(a) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ;#m/ s\n",
+ "rho = 971.8 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.365 * 10** -6 ; #m^2/ s\n",
+ "ReD = D*V/v;\n",
+ "f =0.079*( ReD )**( -0.25) ;\n",
+ "deltap = (4*f*L* rho *V**2) /(D *2) ;\n",
+ "x = ((f/2) **0.5) *V ;\n",
+ "yplus = 0.005* x /(0.365*10** -6) ;\n",
+ "Vmax = x *(2.5* math.log ( yplus ) + 5.5) ;\n",
+ "ratio = Vmax /V;\n",
+ "\n",
+ "#result\n",
+ "print\"(a) If the temperature of water is increased to 80 degree C\";\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Vmax =\",round(Vmax,4),\"m/s\";\n",
+ "print\"Vmax/Vbar =\",round(ratio,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If the temperature of water is increased to 80 degree C\n",
+ "Pressure drop is 214.1563 Pa\n",
+ "Vmax = 0.2515 m/s\n",
+ "Vmax/Vbar = 1.2575\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(b) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ; #m/s\n",
+ "V1 =0.7;\n",
+ "v1 = 1.306 * 10** -6 ; #m^2/ s\n",
+ "V1 =0.7; #m/ s\n",
+ "\n",
+ "#calculations\n",
+ "ReD1 =V1*D /(1.306*10** -6) ;\n",
+ "f1 = 0.079*( ReD1 )**( -0.25) ;\n",
+ "deltap1 = (4* f1*L *999.7*0.7**2) /(0.01*2) ;\n",
+ "x1 = (( f1 /2)**0.5) *V1 ;\n",
+ "y1plus = 0.005* x1 /( v1);\n",
+ "Vmax1 = x1 *(2.5* math.log ( y1plus ) + 5.5) ;\n",
+ "ratio1 = Vmax1 /V1;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) If the velocity is increased to 0.7 \";\n",
+ "print\"Reynolds no is\",round(ReD1,4);\n",
+ "print\"Pressure drop is\",round(deltap1,4),\"pa\";\n",
+ "print\"y+ at centre line =\",round(y1plus,4);\n",
+ "print\"Vmax is\",round(Vmax1,4),\"pa\";\n",
+ "print\"Vmax/Vbar =\",round(ratio1,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) If the velocity is increased to 0.7 \n",
+ "Reynolds no is 5359.8775\n",
+ "Pressure drop is 2713.6598 pa\n",
+ "y+ at centre line = 182.087\n",
+ "Vmax is 0.8804 pa\n",
+ "Vmax/Vbar = 1.2577\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 , Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 80 * 10**3 ; #Pa\n",
+ "L = 10 ; #m\n",
+ "Vbar = 1.9 ; #m/s\n",
+ "l = 0.25 ; #m\n",
+ "b = 0.15 ; #m\n",
+ "rho = 1.185 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.35 * 10** -6 ; #kg /m s\n",
+ "rho1 = rho *(80/101.3) ; #kg /m^ 3\n",
+ "r = b/l;\n",
+ "De = (4* l/2*b /2) /(l/2 + b /2) ;\n",
+ "Dl = (2/3 + 11/24*0.6*(2 -0.6)) * De ;\n",
+ "Re = rho1 * Dl * Vbar / mew ;\n",
+ "f = 0.079*( Re ** -0.25) ;\n",
+ "deltaP = 4*f*(L/ Dl )*( rho1 *( Vbar **2) /2) ;\n",
+ "power = deltaP *( Vbar *l*b)\n",
+ "\n",
+ "#result\n",
+ "print\"Reynolds no =\",round(Re,4);\n",
+ "print\"f =\",round(f,4);\n",
+ "print\"Pressure drop =\",round(deltaP,4),\"Pa\";\n",
+ "print\"Power required =\",round(power,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds no = 19107.1453\n",
+ "f = 0.0067\n",
+ "Pressure drop = 2.3024 Pa\n",
+ "Power required = 0.164 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 , Page no:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "b = 1 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "rho = 1.060 ; #kg /m^ 3\n",
+ "x = 1.5 ; #m^2/s\n",
+ "\n",
+ "#calculations\n",
+ "v = 18.97 * 10** -6 ;\n",
+ "Re = V*x/v; #Reynolds number\n",
+ "d = 5*x/( Re **(1/2) ) *1000 ;\n",
+ "Rel = V*l/v;\n",
+ "cf = 1.328* Rel** -(1/2) ; #drag coefficient\n",
+ "Fd = 0.00409*(1/2) *rho *(2* l*b) *1**2;\n",
+ "\n",
+ "#result\n",
+ "print\"Thickness of Boundary layer at x =1.5 is \",round(d,4),\"mm\"\n",
+ "print\"Drag Coefficient cf =\",round(cf,5);\n",
+ "print\"Drag Force FD =\",round(Fd,6),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of Boundary layer at x =1.5 is 26.6716 mm\n",
+ "Drag Coefficient cf = 0.00409\n",
+ "Drag Force FD = 0.008671 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 , Page no:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "v = 4 ; #m/s\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.1*10** -6; #N s /m^ 2\n",
+ "rho = 1.205*1.5; #kg /m^ 3\n",
+ "Rel = rho*v*l/ mew ;\n",
+ "Cf = 0.074*(7.989*10**5) **( -0.2) - 1050/ Rel ;\n",
+ "Df = Cf *1/2* rho*l*v **2;\n",
+ "x = 3*10**5 * (18.1*10** -6) /(1.808*4) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Drag coefficieent is\",round(Cf,6);\n",
+ "print\"Drag force per meter width =\",round(Df,6),\"N\";\n",
+ "print\"Value of xc is\",round(x,6),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag coefficieent is 0.003569\n",
+ "Drag force per meter width = 0.103221 N\n",
+ "Value of xc is 0.75083 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_4.ipynb new file mode 100755 index 00000000..ed17906e --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_4.ipynb @@ -0,0 +1,333 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c0b8814a6ac7ab401db03352df216c35ffd27c0ad0849fd68734e0e65b766ec4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 , Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #Length\n",
+ "D = 0.01 ; #ID\n",
+ "V = 0.2 ; #Average Velocity\n",
+ "rho =999.7 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v =1.306 * 10** -6 ; #m^2/ s\n",
+ "ReD =0.2*0.01/(1.306*10** -6) ;\n",
+ "f = 16/ ReD ;\n",
+ "deltap = 4*f*(L/D)*( rho*V **2) /2;\n",
+ "Vmax = 2*V;\n",
+ "\n",
+ "#result\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Maximum velocity is\",round(Vmax,3),\"m/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop is 250.6768 Pa\n",
+ "Maximum velocity is 0.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(a) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ;#m/ s\n",
+ "rho = 971.8 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.365 * 10** -6 ; #m^2/ s\n",
+ "ReD = D*V/v;\n",
+ "f =0.079*( ReD )**( -0.25) ;\n",
+ "deltap = (4*f*L* rho *V**2) /(D *2) ;\n",
+ "x = ((f/2) **0.5) *V ;\n",
+ "yplus = 0.005* x /(0.365*10** -6) ;\n",
+ "Vmax = x *(2.5* math.log ( yplus ) + 5.5) ;\n",
+ "ratio = Vmax /V;\n",
+ "\n",
+ "#result\n",
+ "print\"(a) If the temperature of water is increased to 80 degree C\";\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Vmax =\",round(Vmax,4),\"m/s\";\n",
+ "print\"Vmax/Vbar =\",round(ratio,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If the temperature of water is increased to 80 degree C\n",
+ "Pressure drop is 214.1563 Pa\n",
+ "Vmax = 0.2515 m/s\n",
+ "Vmax/Vbar = 1.2575\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(b) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ; #m/s\n",
+ "V1 =0.7;\n",
+ "v1 = 1.306 * 10** -6 ; #m^2/ s\n",
+ "V1 =0.7; #m/ s\n",
+ "\n",
+ "#calculations\n",
+ "ReD1 =V1*D /(1.306*10** -6) ;\n",
+ "f1 = 0.079*( ReD1 )**( -0.25) ;\n",
+ "deltap1 = (4* f1*L *999.7*0.7**2) /(0.01*2) ;\n",
+ "x1 = (( f1 /2)**0.5) *V1 ;\n",
+ "y1plus = 0.005* x1 /( v1);\n",
+ "Vmax1 = x1 *(2.5* math.log ( y1plus ) + 5.5) ;\n",
+ "ratio1 = Vmax1 /V1;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) If the velocity is increased to 0.7 \";\n",
+ "print\"Reynolds no is\",round(ReD1,4);\n",
+ "print\"Pressure drop is\",round(deltap1,4),\"pa\";\n",
+ "print\"y+ at centre line =\",round(y1plus,4);\n",
+ "print\"Vmax is\",round(Vmax1,4),\"pa\";\n",
+ "print\"Vmax/Vbar =\",round(ratio1,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) If the velocity is increased to 0.7 \n",
+ "Reynolds no is 5359.8775\n",
+ "Pressure drop is 2713.6598 pa\n",
+ "y+ at centre line = 182.087\n",
+ "Vmax is 0.8804 pa\n",
+ "Vmax/Vbar = 1.2577\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 , Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 80 * 10**3 ; #Pa\n",
+ "L = 10 ; #m\n",
+ "Vbar = 1.9 ; #m/s\n",
+ "l = 0.25 ; #m\n",
+ "b = 0.15 ; #m\n",
+ "rho = 1.185 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.35 * 10** -6 ; #kg /m s\n",
+ "rho1 = rho *(80/101.3) ; #kg /m^ 3\n",
+ "r = b/l;\n",
+ "De = (4* l/2*b /2) /(l/2 + b /2) ;\n",
+ "Dl = (2/3 + 11/24*0.6*(2 -0.6)) * De ;\n",
+ "Re = rho1 * Dl * Vbar / mew ;\n",
+ "f = 0.079*( Re ** -0.25) ;\n",
+ "deltaP = 4*f*(L/ Dl )*( rho1 *( Vbar **2) /2) ;\n",
+ "power = deltaP *( Vbar *l*b)\n",
+ "\n",
+ "#result\n",
+ "print\"Reynolds no =\",round(Re,4);\n",
+ "print\"f =\",round(f,4);\n",
+ "print\"Pressure drop =\",round(deltaP,4),\"Pa\";\n",
+ "print\"Power required =\",round(power,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds no = 19107.1453\n",
+ "f = 0.0067\n",
+ "Pressure drop = 2.3024 Pa\n",
+ "Power required = 0.164 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 , Page no:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "b = 1 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "rho = 1.060 ; #kg /m^ 3\n",
+ "x = 1.5 ; #m^2/s\n",
+ "\n",
+ "#calculations\n",
+ "v = 18.97 * 10** -6 ;\n",
+ "Re = V*x/v; #Reynolds number\n",
+ "d = 5*x/( Re **(1/2) ) *1000 ;\n",
+ "Rel = V*l/v;\n",
+ "cf = 1.328* Rel** -(1/2) ; #drag coefficient\n",
+ "Fd = 0.00409*(1/2) *rho *(2* l*b) *1**2;\n",
+ "\n",
+ "#result\n",
+ "print\"Thickness of Boundary layer at x =1.5 is \",round(d,4),\"mm\"\n",
+ "print\"Drag Coefficient cf =\",round(cf,5);\n",
+ "print\"Drag Force FD =\",round(Fd,6),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of Boundary layer at x =1.5 is 26.6716 mm\n",
+ "Drag Coefficient cf = 0.00409\n",
+ "Drag Force FD = 0.008671 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 , Page no:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "v = 4 ; #m/s\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.1*10** -6; #N s /m^ 2\n",
+ "rho = 1.205*1.5; #kg /m^ 3\n",
+ "Rel = rho*v*l/ mew ;\n",
+ "Cf = 0.074*(7.989*10**5) **( -0.2) - 1050/ Rel ;\n",
+ "Df = Cf *1/2* rho*l*v **2;\n",
+ "x = 3*10**5 * (18.1*10** -6) /(1.808*4) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Drag coefficieent is\",round(Cf,6);\n",
+ "print\"Drag force per meter width =\",round(Df,6),\"N\";\n",
+ "print\"Value of xc is\",round(x,6),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag coefficieent is 0.003569\n",
+ "Drag force per meter width = 0.103221 N\n",
+ "Value of xc is 0.75083 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_5.ipynb new file mode 100755 index 00000000..ed17906e --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_5.ipynb @@ -0,0 +1,333 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c0b8814a6ac7ab401db03352df216c35ffd27c0ad0849fd68734e0e65b766ec4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 , Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #Length\n",
+ "D = 0.01 ; #ID\n",
+ "V = 0.2 ; #Average Velocity\n",
+ "rho =999.7 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v =1.306 * 10** -6 ; #m^2/ s\n",
+ "ReD =0.2*0.01/(1.306*10** -6) ;\n",
+ "f = 16/ ReD ;\n",
+ "deltap = 4*f*(L/D)*( rho*V **2) /2;\n",
+ "Vmax = 2*V;\n",
+ "\n",
+ "#result\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Maximum velocity is\",round(Vmax,3),\"m/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop is 250.6768 Pa\n",
+ "Maximum velocity is 0.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(a) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ;#m/ s\n",
+ "rho = 971.8 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.365 * 10** -6 ; #m^2/ s\n",
+ "ReD = D*V/v;\n",
+ "f =0.079*( ReD )**( -0.25) ;\n",
+ "deltap = (4*f*L* rho *V**2) /(D *2) ;\n",
+ "x = ((f/2) **0.5) *V ;\n",
+ "yplus = 0.005* x /(0.365*10** -6) ;\n",
+ "Vmax = x *(2.5* math.log ( yplus ) + 5.5) ;\n",
+ "ratio = Vmax /V;\n",
+ "\n",
+ "#result\n",
+ "print\"(a) If the temperature of water is increased to 80 degree C\";\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Vmax =\",round(Vmax,4),\"m/s\";\n",
+ "print\"Vmax/Vbar =\",round(ratio,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If the temperature of water is increased to 80 degree C\n",
+ "Pressure drop is 214.1563 Pa\n",
+ "Vmax = 0.2515 m/s\n",
+ "Vmax/Vbar = 1.2575\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(b) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ; #m/s\n",
+ "V1 =0.7;\n",
+ "v1 = 1.306 * 10** -6 ; #m^2/ s\n",
+ "V1 =0.7; #m/ s\n",
+ "\n",
+ "#calculations\n",
+ "ReD1 =V1*D /(1.306*10** -6) ;\n",
+ "f1 = 0.079*( ReD1 )**( -0.25) ;\n",
+ "deltap1 = (4* f1*L *999.7*0.7**2) /(0.01*2) ;\n",
+ "x1 = (( f1 /2)**0.5) *V1 ;\n",
+ "y1plus = 0.005* x1 /( v1);\n",
+ "Vmax1 = x1 *(2.5* math.log ( y1plus ) + 5.5) ;\n",
+ "ratio1 = Vmax1 /V1;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) If the velocity is increased to 0.7 \";\n",
+ "print\"Reynolds no is\",round(ReD1,4);\n",
+ "print\"Pressure drop is\",round(deltap1,4),\"pa\";\n",
+ "print\"y+ at centre line =\",round(y1plus,4);\n",
+ "print\"Vmax is\",round(Vmax1,4),\"pa\";\n",
+ "print\"Vmax/Vbar =\",round(ratio1,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) If the velocity is increased to 0.7 \n",
+ "Reynolds no is 5359.8775\n",
+ "Pressure drop is 2713.6598 pa\n",
+ "y+ at centre line = 182.087\n",
+ "Vmax is 0.8804 pa\n",
+ "Vmax/Vbar = 1.2577\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 , Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 80 * 10**3 ; #Pa\n",
+ "L = 10 ; #m\n",
+ "Vbar = 1.9 ; #m/s\n",
+ "l = 0.25 ; #m\n",
+ "b = 0.15 ; #m\n",
+ "rho = 1.185 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.35 * 10** -6 ; #kg /m s\n",
+ "rho1 = rho *(80/101.3) ; #kg /m^ 3\n",
+ "r = b/l;\n",
+ "De = (4* l/2*b /2) /(l/2 + b /2) ;\n",
+ "Dl = (2/3 + 11/24*0.6*(2 -0.6)) * De ;\n",
+ "Re = rho1 * Dl * Vbar / mew ;\n",
+ "f = 0.079*( Re ** -0.25) ;\n",
+ "deltaP = 4*f*(L/ Dl )*( rho1 *( Vbar **2) /2) ;\n",
+ "power = deltaP *( Vbar *l*b)\n",
+ "\n",
+ "#result\n",
+ "print\"Reynolds no =\",round(Re,4);\n",
+ "print\"f =\",round(f,4);\n",
+ "print\"Pressure drop =\",round(deltaP,4),\"Pa\";\n",
+ "print\"Power required =\",round(power,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds no = 19107.1453\n",
+ "f = 0.0067\n",
+ "Pressure drop = 2.3024 Pa\n",
+ "Power required = 0.164 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 , Page no:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "b = 1 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "rho = 1.060 ; #kg /m^ 3\n",
+ "x = 1.5 ; #m^2/s\n",
+ "\n",
+ "#calculations\n",
+ "v = 18.97 * 10** -6 ;\n",
+ "Re = V*x/v; #Reynolds number\n",
+ "d = 5*x/( Re **(1/2) ) *1000 ;\n",
+ "Rel = V*l/v;\n",
+ "cf = 1.328* Rel** -(1/2) ; #drag coefficient\n",
+ "Fd = 0.00409*(1/2) *rho *(2* l*b) *1**2;\n",
+ "\n",
+ "#result\n",
+ "print\"Thickness of Boundary layer at x =1.5 is \",round(d,4),\"mm\"\n",
+ "print\"Drag Coefficient cf =\",round(cf,5);\n",
+ "print\"Drag Force FD =\",round(Fd,6),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of Boundary layer at x =1.5 is 26.6716 mm\n",
+ "Drag Coefficient cf = 0.00409\n",
+ "Drag Force FD = 0.008671 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 , Page no:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "v = 4 ; #m/s\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.1*10** -6; #N s /m^ 2\n",
+ "rho = 1.205*1.5; #kg /m^ 3\n",
+ "Rel = rho*v*l/ mew ;\n",
+ "Cf = 0.074*(7.989*10**5) **( -0.2) - 1050/ Rel ;\n",
+ "Df = Cf *1/2* rho*l*v **2;\n",
+ "x = 3*10**5 * (18.1*10** -6) /(1.808*4) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Drag coefficieent is\",round(Cf,6);\n",
+ "print\"Drag force per meter width =\",round(Df,6),\"N\";\n",
+ "print\"Value of xc is\",round(x,6),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag coefficieent is 0.003569\n",
+ "Drag force per meter width = 0.103221 N\n",
+ "Value of xc is 0.75083 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_6.ipynb new file mode 100755 index 00000000..ed17906e --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_6.ipynb @@ -0,0 +1,333 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c0b8814a6ac7ab401db03352df216c35ffd27c0ad0849fd68734e0e65b766ec4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 , Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #Length\n",
+ "D = 0.01 ; #ID\n",
+ "V = 0.2 ; #Average Velocity\n",
+ "rho =999.7 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v =1.306 * 10** -6 ; #m^2/ s\n",
+ "ReD =0.2*0.01/(1.306*10** -6) ;\n",
+ "f = 16/ ReD ;\n",
+ "deltap = 4*f*(L/D)*( rho*V **2) /2;\n",
+ "Vmax = 2*V;\n",
+ "\n",
+ "#result\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Maximum velocity is\",round(Vmax,3),\"m/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop is 250.6768 Pa\n",
+ "Maximum velocity is 0.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(a) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ;#m/ s\n",
+ "rho = 971.8 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.365 * 10** -6 ; #m^2/ s\n",
+ "ReD = D*V/v;\n",
+ "f =0.079*( ReD )**( -0.25) ;\n",
+ "deltap = (4*f*L* rho *V**2) /(D *2) ;\n",
+ "x = ((f/2) **0.5) *V ;\n",
+ "yplus = 0.005* x /(0.365*10** -6) ;\n",
+ "Vmax = x *(2.5* math.log ( yplus ) + 5.5) ;\n",
+ "ratio = Vmax /V;\n",
+ "\n",
+ "#result\n",
+ "print\"(a) If the temperature of water is increased to 80 degree C\";\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Vmax =\",round(Vmax,4),\"m/s\";\n",
+ "print\"Vmax/Vbar =\",round(ratio,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If the temperature of water is increased to 80 degree C\n",
+ "Pressure drop is 214.1563 Pa\n",
+ "Vmax = 0.2515 m/s\n",
+ "Vmax/Vbar = 1.2575\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(b) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ; #m/s\n",
+ "V1 =0.7;\n",
+ "v1 = 1.306 * 10** -6 ; #m^2/ s\n",
+ "V1 =0.7; #m/ s\n",
+ "\n",
+ "#calculations\n",
+ "ReD1 =V1*D /(1.306*10** -6) ;\n",
+ "f1 = 0.079*( ReD1 )**( -0.25) ;\n",
+ "deltap1 = (4* f1*L *999.7*0.7**2) /(0.01*2) ;\n",
+ "x1 = (( f1 /2)**0.5) *V1 ;\n",
+ "y1plus = 0.005* x1 /( v1);\n",
+ "Vmax1 = x1 *(2.5* math.log ( y1plus ) + 5.5) ;\n",
+ "ratio1 = Vmax1 /V1;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) If the velocity is increased to 0.7 \";\n",
+ "print\"Reynolds no is\",round(ReD1,4);\n",
+ "print\"Pressure drop is\",round(deltap1,4),\"pa\";\n",
+ "print\"y+ at centre line =\",round(y1plus,4);\n",
+ "print\"Vmax is\",round(Vmax1,4),\"pa\";\n",
+ "print\"Vmax/Vbar =\",round(ratio1,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) If the velocity is increased to 0.7 \n",
+ "Reynolds no is 5359.8775\n",
+ "Pressure drop is 2713.6598 pa\n",
+ "y+ at centre line = 182.087\n",
+ "Vmax is 0.8804 pa\n",
+ "Vmax/Vbar = 1.2577\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 , Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 80 * 10**3 ; #Pa\n",
+ "L = 10 ; #m\n",
+ "Vbar = 1.9 ; #m/s\n",
+ "l = 0.25 ; #m\n",
+ "b = 0.15 ; #m\n",
+ "rho = 1.185 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.35 * 10** -6 ; #kg /m s\n",
+ "rho1 = rho *(80/101.3) ; #kg /m^ 3\n",
+ "r = b/l;\n",
+ "De = (4* l/2*b /2) /(l/2 + b /2) ;\n",
+ "Dl = (2/3 + 11/24*0.6*(2 -0.6)) * De ;\n",
+ "Re = rho1 * Dl * Vbar / mew ;\n",
+ "f = 0.079*( Re ** -0.25) ;\n",
+ "deltaP = 4*f*(L/ Dl )*( rho1 *( Vbar **2) /2) ;\n",
+ "power = deltaP *( Vbar *l*b)\n",
+ "\n",
+ "#result\n",
+ "print\"Reynolds no =\",round(Re,4);\n",
+ "print\"f =\",round(f,4);\n",
+ "print\"Pressure drop =\",round(deltaP,4),\"Pa\";\n",
+ "print\"Power required =\",round(power,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds no = 19107.1453\n",
+ "f = 0.0067\n",
+ "Pressure drop = 2.3024 Pa\n",
+ "Power required = 0.164 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 , Page no:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "b = 1 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "rho = 1.060 ; #kg /m^ 3\n",
+ "x = 1.5 ; #m^2/s\n",
+ "\n",
+ "#calculations\n",
+ "v = 18.97 * 10** -6 ;\n",
+ "Re = V*x/v; #Reynolds number\n",
+ "d = 5*x/( Re **(1/2) ) *1000 ;\n",
+ "Rel = V*l/v;\n",
+ "cf = 1.328* Rel** -(1/2) ; #drag coefficient\n",
+ "Fd = 0.00409*(1/2) *rho *(2* l*b) *1**2;\n",
+ "\n",
+ "#result\n",
+ "print\"Thickness of Boundary layer at x =1.5 is \",round(d,4),\"mm\"\n",
+ "print\"Drag Coefficient cf =\",round(cf,5);\n",
+ "print\"Drag Force FD =\",round(Fd,6),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of Boundary layer at x =1.5 is 26.6716 mm\n",
+ "Drag Coefficient cf = 0.00409\n",
+ "Drag Force FD = 0.008671 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 , Page no:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "v = 4 ; #m/s\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.1*10** -6; #N s /m^ 2\n",
+ "rho = 1.205*1.5; #kg /m^ 3\n",
+ "Rel = rho*v*l/ mew ;\n",
+ "Cf = 0.074*(7.989*10**5) **( -0.2) - 1050/ Rel ;\n",
+ "Df = Cf *1/2* rho*l*v **2;\n",
+ "x = 3*10**5 * (18.1*10** -6) /(1.808*4) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Drag coefficieent is\",round(Cf,6);\n",
+ "print\"Drag force per meter width =\",round(Df,6),\"N\";\n",
+ "print\"Value of xc is\",round(x,6),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag coefficieent is 0.003569\n",
+ "Drag force per meter width = 0.103221 N\n",
+ "Value of xc is 0.75083 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_7.ipynb new file mode 100755 index 00000000..ed17906e --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_7.ipynb @@ -0,0 +1,333 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c0b8814a6ac7ab401db03352df216c35ffd27c0ad0849fd68734e0e65b766ec4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 , Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #Length\n",
+ "D = 0.01 ; #ID\n",
+ "V = 0.2 ; #Average Velocity\n",
+ "rho =999.7 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v =1.306 * 10** -6 ; #m^2/ s\n",
+ "ReD =0.2*0.01/(1.306*10** -6) ;\n",
+ "f = 16/ ReD ;\n",
+ "deltap = 4*f*(L/D)*( rho*V **2) /2;\n",
+ "Vmax = 2*V;\n",
+ "\n",
+ "#result\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Maximum velocity is\",round(Vmax,3),\"m/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop is 250.6768 Pa\n",
+ "Maximum velocity is 0.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(a) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ;#m/ s\n",
+ "rho = 971.8 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.365 * 10** -6 ; #m^2/ s\n",
+ "ReD = D*V/v;\n",
+ "f =0.079*( ReD )**( -0.25) ;\n",
+ "deltap = (4*f*L* rho *V**2) /(D *2) ;\n",
+ "x = ((f/2) **0.5) *V ;\n",
+ "yplus = 0.005* x /(0.365*10** -6) ;\n",
+ "Vmax = x *(2.5* math.log ( yplus ) + 5.5) ;\n",
+ "ratio = Vmax /V;\n",
+ "\n",
+ "#result\n",
+ "print\"(a) If the temperature of water is increased to 80 degree C\";\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Vmax =\",round(Vmax,4),\"m/s\";\n",
+ "print\"Vmax/Vbar =\",round(ratio,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If the temperature of water is increased to 80 degree C\n",
+ "Pressure drop is 214.1563 Pa\n",
+ "Vmax = 0.2515 m/s\n",
+ "Vmax/Vbar = 1.2575\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(b) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ; #m/s\n",
+ "V1 =0.7;\n",
+ "v1 = 1.306 * 10** -6 ; #m^2/ s\n",
+ "V1 =0.7; #m/ s\n",
+ "\n",
+ "#calculations\n",
+ "ReD1 =V1*D /(1.306*10** -6) ;\n",
+ "f1 = 0.079*( ReD1 )**( -0.25) ;\n",
+ "deltap1 = (4* f1*L *999.7*0.7**2) /(0.01*2) ;\n",
+ "x1 = (( f1 /2)**0.5) *V1 ;\n",
+ "y1plus = 0.005* x1 /( v1);\n",
+ "Vmax1 = x1 *(2.5* math.log ( y1plus ) + 5.5) ;\n",
+ "ratio1 = Vmax1 /V1;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) If the velocity is increased to 0.7 \";\n",
+ "print\"Reynolds no is\",round(ReD1,4);\n",
+ "print\"Pressure drop is\",round(deltap1,4),\"pa\";\n",
+ "print\"y+ at centre line =\",round(y1plus,4);\n",
+ "print\"Vmax is\",round(Vmax1,4),\"pa\";\n",
+ "print\"Vmax/Vbar =\",round(ratio1,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) If the velocity is increased to 0.7 \n",
+ "Reynolds no is 5359.8775\n",
+ "Pressure drop is 2713.6598 pa\n",
+ "y+ at centre line = 182.087\n",
+ "Vmax is 0.8804 pa\n",
+ "Vmax/Vbar = 1.2577\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 , Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 80 * 10**3 ; #Pa\n",
+ "L = 10 ; #m\n",
+ "Vbar = 1.9 ; #m/s\n",
+ "l = 0.25 ; #m\n",
+ "b = 0.15 ; #m\n",
+ "rho = 1.185 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.35 * 10** -6 ; #kg /m s\n",
+ "rho1 = rho *(80/101.3) ; #kg /m^ 3\n",
+ "r = b/l;\n",
+ "De = (4* l/2*b /2) /(l/2 + b /2) ;\n",
+ "Dl = (2/3 + 11/24*0.6*(2 -0.6)) * De ;\n",
+ "Re = rho1 * Dl * Vbar / mew ;\n",
+ "f = 0.079*( Re ** -0.25) ;\n",
+ "deltaP = 4*f*(L/ Dl )*( rho1 *( Vbar **2) /2) ;\n",
+ "power = deltaP *( Vbar *l*b)\n",
+ "\n",
+ "#result\n",
+ "print\"Reynolds no =\",round(Re,4);\n",
+ "print\"f =\",round(f,4);\n",
+ "print\"Pressure drop =\",round(deltaP,4),\"Pa\";\n",
+ "print\"Power required =\",round(power,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds no = 19107.1453\n",
+ "f = 0.0067\n",
+ "Pressure drop = 2.3024 Pa\n",
+ "Power required = 0.164 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 , Page no:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "b = 1 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "rho = 1.060 ; #kg /m^ 3\n",
+ "x = 1.5 ; #m^2/s\n",
+ "\n",
+ "#calculations\n",
+ "v = 18.97 * 10** -6 ;\n",
+ "Re = V*x/v; #Reynolds number\n",
+ "d = 5*x/( Re **(1/2) ) *1000 ;\n",
+ "Rel = V*l/v;\n",
+ "cf = 1.328* Rel** -(1/2) ; #drag coefficient\n",
+ "Fd = 0.00409*(1/2) *rho *(2* l*b) *1**2;\n",
+ "\n",
+ "#result\n",
+ "print\"Thickness of Boundary layer at x =1.5 is \",round(d,4),\"mm\"\n",
+ "print\"Drag Coefficient cf =\",round(cf,5);\n",
+ "print\"Drag Force FD =\",round(Fd,6),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of Boundary layer at x =1.5 is 26.6716 mm\n",
+ "Drag Coefficient cf = 0.00409\n",
+ "Drag Force FD = 0.008671 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 , Page no:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "v = 4 ; #m/s\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.1*10** -6; #N s /m^ 2\n",
+ "rho = 1.205*1.5; #kg /m^ 3\n",
+ "Rel = rho*v*l/ mew ;\n",
+ "Cf = 0.074*(7.989*10**5) **( -0.2) - 1050/ Rel ;\n",
+ "Df = Cf *1/2* rho*l*v **2;\n",
+ "x = 3*10**5 * (18.1*10** -6) /(1.808*4) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Drag coefficieent is\",round(Cf,6);\n",
+ "print\"Drag force per meter width =\",round(Df,6),\"N\";\n",
+ "print\"Value of xc is\",round(x,6),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag coefficieent is 0.003569\n",
+ "Drag force per meter width = 0.103221 N\n",
+ "Value of xc is 0.75083 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_8.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_8.ipynb new file mode 100755 index 00000000..ed17906e --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_4_Principles_of_Fluid_Flow_8.ipynb @@ -0,0 +1,333 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c0b8814a6ac7ab401db03352df216c35ffd27c0ad0849fd68734e0e65b766ec4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 , Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #Length\n",
+ "D = 0.01 ; #ID\n",
+ "V = 0.2 ; #Average Velocity\n",
+ "rho =999.7 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v =1.306 * 10** -6 ; #m^2/ s\n",
+ "ReD =0.2*0.01/(1.306*10** -6) ;\n",
+ "f = 16/ ReD ;\n",
+ "deltap = 4*f*(L/D)*( rho*V **2) /2;\n",
+ "Vmax = 2*V;\n",
+ "\n",
+ "#result\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Maximum velocity is\",round(Vmax,3),\"m/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop is 250.6768 Pa\n",
+ "Maximum velocity is 0.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(a) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ;#m/ s\n",
+ "rho = 971.8 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.365 * 10** -6 ; #m^2/ s\n",
+ "ReD = D*V/v;\n",
+ "f =0.079*( ReD )**( -0.25) ;\n",
+ "deltap = (4*f*L* rho *V**2) /(D *2) ;\n",
+ "x = ((f/2) **0.5) *V ;\n",
+ "yplus = 0.005* x /(0.365*10** -6) ;\n",
+ "Vmax = x *(2.5* math.log ( yplus ) + 5.5) ;\n",
+ "ratio = Vmax /V;\n",
+ "\n",
+ "#result\n",
+ "print\"(a) If the temperature of water is increased to 80 degree C\";\n",
+ "print\"Pressure drop is\",round(deltap,4),\"Pa\";\n",
+ "print\"Vmax =\",round(Vmax,4),\"m/s\";\n",
+ "print\"Vmax/Vbar =\",round(ratio,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If the temperature of water is increased to 80 degree C\n",
+ "Pressure drop is 214.1563 Pa\n",
+ "Vmax = 0.2515 m/s\n",
+ "Vmax/Vbar = 1.2575\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2(b) , Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 3 ; #m\n",
+ "D = 0.01 ; #m\n",
+ "V = 0.2 ; #m/s\n",
+ "V1 =0.7;\n",
+ "v1 = 1.306 * 10** -6 ; #m^2/ s\n",
+ "V1 =0.7; #m/ s\n",
+ "\n",
+ "#calculations\n",
+ "ReD1 =V1*D /(1.306*10** -6) ;\n",
+ "f1 = 0.079*( ReD1 )**( -0.25) ;\n",
+ "deltap1 = (4* f1*L *999.7*0.7**2) /(0.01*2) ;\n",
+ "x1 = (( f1 /2)**0.5) *V1 ;\n",
+ "y1plus = 0.005* x1 /( v1);\n",
+ "Vmax1 = x1 *(2.5* math.log ( y1plus ) + 5.5) ;\n",
+ "ratio1 = Vmax1 /V1;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) If the velocity is increased to 0.7 \";\n",
+ "print\"Reynolds no is\",round(ReD1,4);\n",
+ "print\"Pressure drop is\",round(deltap1,4),\"pa\";\n",
+ "print\"y+ at centre line =\",round(y1plus,4);\n",
+ "print\"Vmax is\",round(Vmax1,4),\"pa\";\n",
+ "print\"Vmax/Vbar =\",round(ratio1,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) If the velocity is increased to 0.7 \n",
+ "Reynolds no is 5359.8775\n",
+ "Pressure drop is 2713.6598 pa\n",
+ "y+ at centre line = 182.087\n",
+ "Vmax is 0.8804 pa\n",
+ "Vmax/Vbar = 1.2577\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 , Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 80 * 10**3 ; #Pa\n",
+ "L = 10 ; #m\n",
+ "Vbar = 1.9 ; #m/s\n",
+ "l = 0.25 ; #m\n",
+ "b = 0.15 ; #m\n",
+ "rho = 1.185 ; #kg /m^ 3\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.35 * 10** -6 ; #kg /m s\n",
+ "rho1 = rho *(80/101.3) ; #kg /m^ 3\n",
+ "r = b/l;\n",
+ "De = (4* l/2*b /2) /(l/2 + b /2) ;\n",
+ "Dl = (2/3 + 11/24*0.6*(2 -0.6)) * De ;\n",
+ "Re = rho1 * Dl * Vbar / mew ;\n",
+ "f = 0.079*( Re ** -0.25) ;\n",
+ "deltaP = 4*f*(L/ Dl )*( rho1 *( Vbar **2) /2) ;\n",
+ "power = deltaP *( Vbar *l*b)\n",
+ "\n",
+ "#result\n",
+ "print\"Reynolds no =\",round(Re,4);\n",
+ "print\"f =\",round(f,4);\n",
+ "print\"Pressure drop =\",round(deltaP,4),\"Pa\";\n",
+ "print\"Power required =\",round(power,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds no = 19107.1453\n",
+ "f = 0.0067\n",
+ "Pressure drop = 2.3024 Pa\n",
+ "Power required = 0.164 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 , Page no:189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "b = 1 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "rho = 1.060 ; #kg /m^ 3\n",
+ "x = 1.5 ; #m^2/s\n",
+ "\n",
+ "#calculations\n",
+ "v = 18.97 * 10** -6 ;\n",
+ "Re = V*x/v; #Reynolds number\n",
+ "d = 5*x/( Re **(1/2) ) *1000 ;\n",
+ "Rel = V*l/v;\n",
+ "cf = 1.328* Rel** -(1/2) ; #drag coefficient\n",
+ "Fd = 0.00409*(1/2) *rho *(2* l*b) *1**2;\n",
+ "\n",
+ "#result\n",
+ "print\"Thickness of Boundary layer at x =1.5 is \",round(d,4),\"mm\"\n",
+ "print\"Drag Coefficient cf =\",round(cf,5);\n",
+ "print\"Drag Force FD =\",round(Fd,6),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of Boundary layer at x =1.5 is 26.6716 mm\n",
+ "Drag Coefficient cf = 0.00409\n",
+ "Drag Force FD = 0.008671 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 , Page no:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 2 ; #m\n",
+ "v = 4 ; #m/s\n",
+ "\n",
+ "#calculations\n",
+ "mew = 18.1*10** -6; #N s /m^ 2\n",
+ "rho = 1.205*1.5; #kg /m^ 3\n",
+ "Rel = rho*v*l/ mew ;\n",
+ "Cf = 0.074*(7.989*10**5) **( -0.2) - 1050/ Rel ;\n",
+ "Df = Cf *1/2* rho*l*v **2;\n",
+ "x = 3*10**5 * (18.1*10** -6) /(1.808*4) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Drag coefficieent is\",round(Cf,6);\n",
+ "print\"Drag force per meter width =\",round(Df,6),\"N\";\n",
+ "print\"Value of xc is\",round(x,6),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag coefficieent is 0.003569\n",
+ "Drag force per meter width = 0.103221 N\n",
+ "Value of xc is 0.75083 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_1.ipynb new file mode 100755 index 00000000..d16fb965 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_1.ipynb @@ -0,0 +1,673 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f52bfd7811201b97d412b52a8226e438de6bc215828a85347af9b46efb493219"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Heat Transfer by Forced Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(a) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^ 2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/ s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Local heat transfer coefficient is\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Local heat transfer coefficient is 184.4517 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(b) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D;\n",
+ "Tw = H/h + Tb; #the local wal to bulk mean temperature difference\n",
+ "\n",
+ "#result\n",
+ "print\"(b) Wall Temperature Tw =\",round(Tw,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Wall Temperature Tw = 45.4215 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 , Page no:213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr1=0.01;\n",
+ "Pr2=0.1;\n",
+ "Pr3=100;\n",
+ "\n",
+ "#Calculation\n",
+ "T1 = 0.04305* Pr1 /0.0575; #For Pr = 0.01\n",
+ "T2 = 0.04305* Pr2 /0.0575; #For Pr = 0.1\n",
+ "T3 = 0.04305* Pr3 /0.0575 ; #For Pr = 100\n",
+ "\n",
+ "#result\n",
+ "print\"Lth/Le at Pr =0.01 is\",round(T1,4);\n",
+ "print\"Lth/Le at Pr = 1 is\",round(T2,4);\n",
+ "print\"Lth/Le at Pr = 100 is\",round(T3,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lth/Le at Pr =0.01 is 0.0075\n",
+ "Lth/Le at Pr = 1 is 0.0749\n",
+ "Lth/Le at Pr = 100 is 74.8696\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(i) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2) **(1/2) *(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)*( math.log ((Tw - Tmi )/(Tw - Tmo )) /(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14)); #the energy equation\n",
+ "\n",
+ "#result\n",
+ "print\"The length of tube if the exit water temperature is 65 degree C =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of tube if the exit water temperature is 65 degree C = 1.0876 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(ii) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "Tmo = 70 ; #degree C\n",
+ "Tb = 60 ; #degree C\n",
+ "k1 = 0.659 ; #W/m K\n",
+ "rho1 = 983.2 ;#kg/m^3\n",
+ "Cp1 = 4179 ;#J/kg K\n",
+ "Pr1 = 2.98 ;\n",
+ "f1 = 0.005928;\n",
+ "Nud = 154.97; #the Gnielinski Eqn\n",
+ "Tmo1 = 73.4 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2)**(1/2) *(( Pr**(2/3) ) -1) ); #W/m^2 K\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)* math.log ((Tw - Tmi )/(Tw - Tmo ))/(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14); #the energy equation\n",
+ "v1 = 0.478 * 10**-6 ; #m^2/s\n",
+ "Re1 = 4* mdot /(3.14*D* rho1 *v1);\n",
+ "h = Nud *k1/D ; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"Trial and error method\";\n",
+ "print\"Trial 1\";\n",
+ "print\"Assumed value of Tmo =70 degree C\";\n",
+ "print\"Value of Tmo obtained =73.4 degree C\";\n",
+ "print\"Trial 2\";\n",
+ "print\"Assume Tmo =73.4 degree C\";\n",
+ "print\"Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial and error method\n",
+ "Trial 1\n",
+ "Assumed value of Tmo =70 degree C\n",
+ "Value of Tmo obtained =73.4 degree C\n",
+ "Trial 2\n",
+ "Assume Tmo =73.4 degree C\n",
+ "Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 , Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Di = 0.05 ; #m\n",
+ "m = 300 ; #kg/min\n",
+ "m1 = m/60 ; #kg/sec\n",
+ "rho = 846.7 ; #kg/m^3\n",
+ "k = 68.34 ; #W/m K\n",
+ "c = 1274; #J/kg K\n",
+ "Pr = 0.00468 ;\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.2937*10**-6 ; #m^2/s\n",
+ "ReD = 4* m1 /(3.14*Di* rho *v);\n",
+ "NuD = 6.3 + 0.0167*( ReD**0.85) *( Pr**0.93) ; #Assuming both temperature and velocity profile are fully developed over the length of tube\n",
+ "h = NuD *k/ Di ;\n",
+ "L = 300/60*1274*(500 -400) /(h*3.14* Di *30); #Equating the heat transferred through the wall of the tube to the change of enthalpy pf sodium\n",
+ "\n",
+ "#result\n",
+ "print\"Length of tube over which the temperature rise occurs =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tube over which the temperature rise occurs = 6.8659 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 , Page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 15 ; #m/s\n",
+ "s =0.2 ; #m\n",
+ "rho = 1.128 ; #kg/m^3\n",
+ "k = 0.0276; #W/m K\n",
+ "Pr = 0.699;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (20+60) /2; ##degree C\n",
+ "v = 16.96*10**-6; #m^2/s\n",
+ "A=s**2;\n",
+ "ReL = V *0.2/ v;\n",
+ "Cf = 1.328/( ReL )**0.5; #the boundary layer may be assumed to be laminar over the entire length.\n",
+ "Fd = 2* Cf *1/2* rho*A*V**2;\n",
+ "Nul = 0.664*( Pr**(1/3) )*( ReL**(1/2) );\n",
+ "h = Nul *k/s;\n",
+ "q = 2*A*h *(60 -20) ; #rate of heat transfer q is\n",
+ "Cf1 = 0.074*( ReL )**( -0.2) ; #boundary layer from leading edge, the drag coefficient is\n",
+ "Fd1 = 2* Cf1 *1/2* rho *A*V**2;\n",
+ "Nul1 = 0.0366*(0.699**(1/3) )*( ReL**(0.8) );\n",
+ "h1 = Nul1 *k/s; #W/m^2 K\n",
+ "q1 = 2*A*h1 *(60 -20) ;\n",
+ "\n",
+ "#result\n",
+ "print\"For Laminar Boundary Layer\";\n",
+ "print\"Rate of Heat transfer =\",round(q,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd,4),\"N\";\n",
+ "print\"For Turbulent Boundary Layer from the leading edge\";\n",
+ "print\"Rate of Heat transfer =\",round(q1,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd1,4),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Laminar Boundary Layer\n",
+ "Rate of Heat transfer = 109.447 W\n",
+ "Drag force = 0.0321 N\n",
+ "For Turbulent Boundary Layer from the leading edge\n",
+ "Rate of Heat transfer = 226.3735 W\n",
+ "Drag force = 0.067 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(i) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**(1/2) )*( Pr**(1/3) ))/((1+((0.4/ Pr)**(2/3) ))**(1/4)))*((1+(( ReD/282000)**(5/8)))**(4/5));\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "q = flux *3.14*D *1; #W/m\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate per unit length =\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate per unit length = 258.8849 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(ii) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "k = 0.0290 ;\n",
+ "Pr = 0.696 ;\n",
+ "Tassumd = 130 ; #degree C\n",
+ "Tm = 75 ; #degree C\n",
+ "k1 = 0.0301 ; #W/m K\n",
+ "Pr1 = 0.693 ;\n",
+ "Nu1 = 33.99;\n",
+ "Tavgcalc = 129.9 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**0.5) *( Pr**(1/3) )) /((1+((0.4/Pr)**(2/3) ))**(1/4)))*(1+( ReD /282000)**(5/8) )**(5/8);\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "Tavg = 1500/ flux *( Tsurface - Tair );\n",
+ "v1 = 20.56*10** -6 ; #m^2/s\n",
+ "ReD1 = V*D/v1;\n",
+ "h = Nu1*k1/D;\n",
+ "Tdiff = 1500/ h; #degree C\n",
+ "\n",
+ "#result\n",
+ "print\"Assumed average wall temperature =\",round(Tassumd,4),\"degree C\";\n",
+ "print\"Calculated average wall Temperature =\",round(Tavgcalc,4),\"degree C\";\n",
+ "print\"Hence,Average wall Temperature =\",round(Tavgcalc,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumed average wall temperature = 130.0 degree C\n",
+ "Calculated average wall Temperature = 129.9 degree C\n",
+ "Hence,Average wall Temperature = 129.9 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(i) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #v\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "Cp = 1.005 ; #kJ/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "\n",
+ "#calculations\n",
+ "v = 16.00 *10**-6 ; #m^2/s\n",
+ "Vmax = ST /(SL -D)* Vinf ; #m/s\n",
+ "Re = Vmax *D/v ;\n",
+ "f = 0.37/4;\n",
+ "deltaP = 4*f*N*X*( rho * Vmax**2) /2 ; #N/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"(i) Pressure drop of air across the bank is\",round(deltaP,4),\"N/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure drop of air across the bank is 38.7945 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(ii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "v = 16.00 *10**-6 ; #[m^2/s]\n",
+ "Cp = 1.005*1000 ; #J/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "\n",
+ "#calculations\n",
+ "#sub all value in the following expression\n",
+ "# q=h*(3.14*D*L)*50*((Tw-Tmi)-(Tw-Tmo))/log((Tw-Tmi)/(Tw-Tmo))-mdot*Cp*(Tmo-Tmi), we get\n",
+ "Tmo=70-40/(math.exp (190.8604/439.064));\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print\"Tmo =\",round(Tmo,2),\"oC\"\n",
+ "print\"(ii) Exit temperature of air =\",round(Tmo,4),\"oC\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tmo = 44.1 oC\n",
+ "(ii) Exit temperature of air = 44.1016 oC\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(iii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "Tmo = 44.10; #in oC\n",
+ "\n",
+ "#calculations\n",
+ "q=439.064*(40-(70-Tmo)); #Heat transfer rate per unit length to air\n",
+ "\n",
+ "#result\n",
+ "print\"(iii) Heat transfer rate per unit length to air =\",round(q,2),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(iii) Heat transfer rate per unit length to air = 6190.8 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_2.ipynb new file mode 100755 index 00000000..d16fb965 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_2.ipynb @@ -0,0 +1,673 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f52bfd7811201b97d412b52a8226e438de6bc215828a85347af9b46efb493219"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Heat Transfer by Forced Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(a) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^ 2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/ s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Local heat transfer coefficient is\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Local heat transfer coefficient is 184.4517 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(b) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D;\n",
+ "Tw = H/h + Tb; #the local wal to bulk mean temperature difference\n",
+ "\n",
+ "#result\n",
+ "print\"(b) Wall Temperature Tw =\",round(Tw,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Wall Temperature Tw = 45.4215 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 , Page no:213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr1=0.01;\n",
+ "Pr2=0.1;\n",
+ "Pr3=100;\n",
+ "\n",
+ "#Calculation\n",
+ "T1 = 0.04305* Pr1 /0.0575; #For Pr = 0.01\n",
+ "T2 = 0.04305* Pr2 /0.0575; #For Pr = 0.1\n",
+ "T3 = 0.04305* Pr3 /0.0575 ; #For Pr = 100\n",
+ "\n",
+ "#result\n",
+ "print\"Lth/Le at Pr =0.01 is\",round(T1,4);\n",
+ "print\"Lth/Le at Pr = 1 is\",round(T2,4);\n",
+ "print\"Lth/Le at Pr = 100 is\",round(T3,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lth/Le at Pr =0.01 is 0.0075\n",
+ "Lth/Le at Pr = 1 is 0.0749\n",
+ "Lth/Le at Pr = 100 is 74.8696\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(i) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2) **(1/2) *(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)*( math.log ((Tw - Tmi )/(Tw - Tmo )) /(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14)); #the energy equation\n",
+ "\n",
+ "#result\n",
+ "print\"The length of tube if the exit water temperature is 65 degree C =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of tube if the exit water temperature is 65 degree C = 1.0876 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(ii) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "Tmo = 70 ; #degree C\n",
+ "Tb = 60 ; #degree C\n",
+ "k1 = 0.659 ; #W/m K\n",
+ "rho1 = 983.2 ;#kg/m^3\n",
+ "Cp1 = 4179 ;#J/kg K\n",
+ "Pr1 = 2.98 ;\n",
+ "f1 = 0.005928;\n",
+ "Nud = 154.97; #the Gnielinski Eqn\n",
+ "Tmo1 = 73.4 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2)**(1/2) *(( Pr**(2/3) ) -1) ); #W/m^2 K\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)* math.log ((Tw - Tmi )/(Tw - Tmo ))/(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14); #the energy equation\n",
+ "v1 = 0.478 * 10**-6 ; #m^2/s\n",
+ "Re1 = 4* mdot /(3.14*D* rho1 *v1);\n",
+ "h = Nud *k1/D ; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"Trial and error method\";\n",
+ "print\"Trial 1\";\n",
+ "print\"Assumed value of Tmo =70 degree C\";\n",
+ "print\"Value of Tmo obtained =73.4 degree C\";\n",
+ "print\"Trial 2\";\n",
+ "print\"Assume Tmo =73.4 degree C\";\n",
+ "print\"Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial and error method\n",
+ "Trial 1\n",
+ "Assumed value of Tmo =70 degree C\n",
+ "Value of Tmo obtained =73.4 degree C\n",
+ "Trial 2\n",
+ "Assume Tmo =73.4 degree C\n",
+ "Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 , Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Di = 0.05 ; #m\n",
+ "m = 300 ; #kg/min\n",
+ "m1 = m/60 ; #kg/sec\n",
+ "rho = 846.7 ; #kg/m^3\n",
+ "k = 68.34 ; #W/m K\n",
+ "c = 1274; #J/kg K\n",
+ "Pr = 0.00468 ;\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.2937*10**-6 ; #m^2/s\n",
+ "ReD = 4* m1 /(3.14*Di* rho *v);\n",
+ "NuD = 6.3 + 0.0167*( ReD**0.85) *( Pr**0.93) ; #Assuming both temperature and velocity profile are fully developed over the length of tube\n",
+ "h = NuD *k/ Di ;\n",
+ "L = 300/60*1274*(500 -400) /(h*3.14* Di *30); #Equating the heat transferred through the wall of the tube to the change of enthalpy pf sodium\n",
+ "\n",
+ "#result\n",
+ "print\"Length of tube over which the temperature rise occurs =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tube over which the temperature rise occurs = 6.8659 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 , Page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 15 ; #m/s\n",
+ "s =0.2 ; #m\n",
+ "rho = 1.128 ; #kg/m^3\n",
+ "k = 0.0276; #W/m K\n",
+ "Pr = 0.699;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (20+60) /2; ##degree C\n",
+ "v = 16.96*10**-6; #m^2/s\n",
+ "A=s**2;\n",
+ "ReL = V *0.2/ v;\n",
+ "Cf = 1.328/( ReL )**0.5; #the boundary layer may be assumed to be laminar over the entire length.\n",
+ "Fd = 2* Cf *1/2* rho*A*V**2;\n",
+ "Nul = 0.664*( Pr**(1/3) )*( ReL**(1/2) );\n",
+ "h = Nul *k/s;\n",
+ "q = 2*A*h *(60 -20) ; #rate of heat transfer q is\n",
+ "Cf1 = 0.074*( ReL )**( -0.2) ; #boundary layer from leading edge, the drag coefficient is\n",
+ "Fd1 = 2* Cf1 *1/2* rho *A*V**2;\n",
+ "Nul1 = 0.0366*(0.699**(1/3) )*( ReL**(0.8) );\n",
+ "h1 = Nul1 *k/s; #W/m^2 K\n",
+ "q1 = 2*A*h1 *(60 -20) ;\n",
+ "\n",
+ "#result\n",
+ "print\"For Laminar Boundary Layer\";\n",
+ "print\"Rate of Heat transfer =\",round(q,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd,4),\"N\";\n",
+ "print\"For Turbulent Boundary Layer from the leading edge\";\n",
+ "print\"Rate of Heat transfer =\",round(q1,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd1,4),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Laminar Boundary Layer\n",
+ "Rate of Heat transfer = 109.447 W\n",
+ "Drag force = 0.0321 N\n",
+ "For Turbulent Boundary Layer from the leading edge\n",
+ "Rate of Heat transfer = 226.3735 W\n",
+ "Drag force = 0.067 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(i) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**(1/2) )*( Pr**(1/3) ))/((1+((0.4/ Pr)**(2/3) ))**(1/4)))*((1+(( ReD/282000)**(5/8)))**(4/5));\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "q = flux *3.14*D *1; #W/m\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate per unit length =\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate per unit length = 258.8849 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(ii) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "k = 0.0290 ;\n",
+ "Pr = 0.696 ;\n",
+ "Tassumd = 130 ; #degree C\n",
+ "Tm = 75 ; #degree C\n",
+ "k1 = 0.0301 ; #W/m K\n",
+ "Pr1 = 0.693 ;\n",
+ "Nu1 = 33.99;\n",
+ "Tavgcalc = 129.9 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**0.5) *( Pr**(1/3) )) /((1+((0.4/Pr)**(2/3) ))**(1/4)))*(1+( ReD /282000)**(5/8) )**(5/8);\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "Tavg = 1500/ flux *( Tsurface - Tair );\n",
+ "v1 = 20.56*10** -6 ; #m^2/s\n",
+ "ReD1 = V*D/v1;\n",
+ "h = Nu1*k1/D;\n",
+ "Tdiff = 1500/ h; #degree C\n",
+ "\n",
+ "#result\n",
+ "print\"Assumed average wall temperature =\",round(Tassumd,4),\"degree C\";\n",
+ "print\"Calculated average wall Temperature =\",round(Tavgcalc,4),\"degree C\";\n",
+ "print\"Hence,Average wall Temperature =\",round(Tavgcalc,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumed average wall temperature = 130.0 degree C\n",
+ "Calculated average wall Temperature = 129.9 degree C\n",
+ "Hence,Average wall Temperature = 129.9 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(i) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #v\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "Cp = 1.005 ; #kJ/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "\n",
+ "#calculations\n",
+ "v = 16.00 *10**-6 ; #m^2/s\n",
+ "Vmax = ST /(SL -D)* Vinf ; #m/s\n",
+ "Re = Vmax *D/v ;\n",
+ "f = 0.37/4;\n",
+ "deltaP = 4*f*N*X*( rho * Vmax**2) /2 ; #N/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"(i) Pressure drop of air across the bank is\",round(deltaP,4),\"N/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure drop of air across the bank is 38.7945 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(ii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "v = 16.00 *10**-6 ; #[m^2/s]\n",
+ "Cp = 1.005*1000 ; #J/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "\n",
+ "#calculations\n",
+ "#sub all value in the following expression\n",
+ "# q=h*(3.14*D*L)*50*((Tw-Tmi)-(Tw-Tmo))/log((Tw-Tmi)/(Tw-Tmo))-mdot*Cp*(Tmo-Tmi), we get\n",
+ "Tmo=70-40/(math.exp (190.8604/439.064));\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print\"Tmo =\",round(Tmo,2),\"oC\"\n",
+ "print\"(ii) Exit temperature of air =\",round(Tmo,4),\"oC\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tmo = 44.1 oC\n",
+ "(ii) Exit temperature of air = 44.1016 oC\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(iii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "Tmo = 44.10; #in oC\n",
+ "\n",
+ "#calculations\n",
+ "q=439.064*(40-(70-Tmo)); #Heat transfer rate per unit length to air\n",
+ "\n",
+ "#result\n",
+ "print\"(iii) Heat transfer rate per unit length to air =\",round(q,2),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(iii) Heat transfer rate per unit length to air = 6190.8 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_3.ipynb new file mode 100755 index 00000000..d16fb965 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_3.ipynb @@ -0,0 +1,673 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f52bfd7811201b97d412b52a8226e438de6bc215828a85347af9b46efb493219"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Heat Transfer by Forced Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(a) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^ 2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/ s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Local heat transfer coefficient is\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Local heat transfer coefficient is 184.4517 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(b) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D;\n",
+ "Tw = H/h + Tb; #the local wal to bulk mean temperature difference\n",
+ "\n",
+ "#result\n",
+ "print\"(b) Wall Temperature Tw =\",round(Tw,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Wall Temperature Tw = 45.4215 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 , Page no:213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr1=0.01;\n",
+ "Pr2=0.1;\n",
+ "Pr3=100;\n",
+ "\n",
+ "#Calculation\n",
+ "T1 = 0.04305* Pr1 /0.0575; #For Pr = 0.01\n",
+ "T2 = 0.04305* Pr2 /0.0575; #For Pr = 0.1\n",
+ "T3 = 0.04305* Pr3 /0.0575 ; #For Pr = 100\n",
+ "\n",
+ "#result\n",
+ "print\"Lth/Le at Pr =0.01 is\",round(T1,4);\n",
+ "print\"Lth/Le at Pr = 1 is\",round(T2,4);\n",
+ "print\"Lth/Le at Pr = 100 is\",round(T3,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lth/Le at Pr =0.01 is 0.0075\n",
+ "Lth/Le at Pr = 1 is 0.0749\n",
+ "Lth/Le at Pr = 100 is 74.8696\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(i) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2) **(1/2) *(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)*( math.log ((Tw - Tmi )/(Tw - Tmo )) /(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14)); #the energy equation\n",
+ "\n",
+ "#result\n",
+ "print\"The length of tube if the exit water temperature is 65 degree C =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of tube if the exit water temperature is 65 degree C = 1.0876 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(ii) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "Tmo = 70 ; #degree C\n",
+ "Tb = 60 ; #degree C\n",
+ "k1 = 0.659 ; #W/m K\n",
+ "rho1 = 983.2 ;#kg/m^3\n",
+ "Cp1 = 4179 ;#J/kg K\n",
+ "Pr1 = 2.98 ;\n",
+ "f1 = 0.005928;\n",
+ "Nud = 154.97; #the Gnielinski Eqn\n",
+ "Tmo1 = 73.4 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2)**(1/2) *(( Pr**(2/3) ) -1) ); #W/m^2 K\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)* math.log ((Tw - Tmi )/(Tw - Tmo ))/(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14); #the energy equation\n",
+ "v1 = 0.478 * 10**-6 ; #m^2/s\n",
+ "Re1 = 4* mdot /(3.14*D* rho1 *v1);\n",
+ "h = Nud *k1/D ; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"Trial and error method\";\n",
+ "print\"Trial 1\";\n",
+ "print\"Assumed value of Tmo =70 degree C\";\n",
+ "print\"Value of Tmo obtained =73.4 degree C\";\n",
+ "print\"Trial 2\";\n",
+ "print\"Assume Tmo =73.4 degree C\";\n",
+ "print\"Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial and error method\n",
+ "Trial 1\n",
+ "Assumed value of Tmo =70 degree C\n",
+ "Value of Tmo obtained =73.4 degree C\n",
+ "Trial 2\n",
+ "Assume Tmo =73.4 degree C\n",
+ "Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 , Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Di = 0.05 ; #m\n",
+ "m = 300 ; #kg/min\n",
+ "m1 = m/60 ; #kg/sec\n",
+ "rho = 846.7 ; #kg/m^3\n",
+ "k = 68.34 ; #W/m K\n",
+ "c = 1274; #J/kg K\n",
+ "Pr = 0.00468 ;\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.2937*10**-6 ; #m^2/s\n",
+ "ReD = 4* m1 /(3.14*Di* rho *v);\n",
+ "NuD = 6.3 + 0.0167*( ReD**0.85) *( Pr**0.93) ; #Assuming both temperature and velocity profile are fully developed over the length of tube\n",
+ "h = NuD *k/ Di ;\n",
+ "L = 300/60*1274*(500 -400) /(h*3.14* Di *30); #Equating the heat transferred through the wall of the tube to the change of enthalpy pf sodium\n",
+ "\n",
+ "#result\n",
+ "print\"Length of tube over which the temperature rise occurs =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tube over which the temperature rise occurs = 6.8659 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 , Page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 15 ; #m/s\n",
+ "s =0.2 ; #m\n",
+ "rho = 1.128 ; #kg/m^3\n",
+ "k = 0.0276; #W/m K\n",
+ "Pr = 0.699;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (20+60) /2; ##degree C\n",
+ "v = 16.96*10**-6; #m^2/s\n",
+ "A=s**2;\n",
+ "ReL = V *0.2/ v;\n",
+ "Cf = 1.328/( ReL )**0.5; #the boundary layer may be assumed to be laminar over the entire length.\n",
+ "Fd = 2* Cf *1/2* rho*A*V**2;\n",
+ "Nul = 0.664*( Pr**(1/3) )*( ReL**(1/2) );\n",
+ "h = Nul *k/s;\n",
+ "q = 2*A*h *(60 -20) ; #rate of heat transfer q is\n",
+ "Cf1 = 0.074*( ReL )**( -0.2) ; #boundary layer from leading edge, the drag coefficient is\n",
+ "Fd1 = 2* Cf1 *1/2* rho *A*V**2;\n",
+ "Nul1 = 0.0366*(0.699**(1/3) )*( ReL**(0.8) );\n",
+ "h1 = Nul1 *k/s; #W/m^2 K\n",
+ "q1 = 2*A*h1 *(60 -20) ;\n",
+ "\n",
+ "#result\n",
+ "print\"For Laminar Boundary Layer\";\n",
+ "print\"Rate of Heat transfer =\",round(q,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd,4),\"N\";\n",
+ "print\"For Turbulent Boundary Layer from the leading edge\";\n",
+ "print\"Rate of Heat transfer =\",round(q1,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd1,4),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Laminar Boundary Layer\n",
+ "Rate of Heat transfer = 109.447 W\n",
+ "Drag force = 0.0321 N\n",
+ "For Turbulent Boundary Layer from the leading edge\n",
+ "Rate of Heat transfer = 226.3735 W\n",
+ "Drag force = 0.067 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(i) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**(1/2) )*( Pr**(1/3) ))/((1+((0.4/ Pr)**(2/3) ))**(1/4)))*((1+(( ReD/282000)**(5/8)))**(4/5));\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "q = flux *3.14*D *1; #W/m\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate per unit length =\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate per unit length = 258.8849 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(ii) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "k = 0.0290 ;\n",
+ "Pr = 0.696 ;\n",
+ "Tassumd = 130 ; #degree C\n",
+ "Tm = 75 ; #degree C\n",
+ "k1 = 0.0301 ; #W/m K\n",
+ "Pr1 = 0.693 ;\n",
+ "Nu1 = 33.99;\n",
+ "Tavgcalc = 129.9 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**0.5) *( Pr**(1/3) )) /((1+((0.4/Pr)**(2/3) ))**(1/4)))*(1+( ReD /282000)**(5/8) )**(5/8);\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "Tavg = 1500/ flux *( Tsurface - Tair );\n",
+ "v1 = 20.56*10** -6 ; #m^2/s\n",
+ "ReD1 = V*D/v1;\n",
+ "h = Nu1*k1/D;\n",
+ "Tdiff = 1500/ h; #degree C\n",
+ "\n",
+ "#result\n",
+ "print\"Assumed average wall temperature =\",round(Tassumd,4),\"degree C\";\n",
+ "print\"Calculated average wall Temperature =\",round(Tavgcalc,4),\"degree C\";\n",
+ "print\"Hence,Average wall Temperature =\",round(Tavgcalc,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumed average wall temperature = 130.0 degree C\n",
+ "Calculated average wall Temperature = 129.9 degree C\n",
+ "Hence,Average wall Temperature = 129.9 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(i) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #v\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "Cp = 1.005 ; #kJ/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "\n",
+ "#calculations\n",
+ "v = 16.00 *10**-6 ; #m^2/s\n",
+ "Vmax = ST /(SL -D)* Vinf ; #m/s\n",
+ "Re = Vmax *D/v ;\n",
+ "f = 0.37/4;\n",
+ "deltaP = 4*f*N*X*( rho * Vmax**2) /2 ; #N/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"(i) Pressure drop of air across the bank is\",round(deltaP,4),\"N/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure drop of air across the bank is 38.7945 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(ii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "v = 16.00 *10**-6 ; #[m^2/s]\n",
+ "Cp = 1.005*1000 ; #J/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "\n",
+ "#calculations\n",
+ "#sub all value in the following expression\n",
+ "# q=h*(3.14*D*L)*50*((Tw-Tmi)-(Tw-Tmo))/log((Tw-Tmi)/(Tw-Tmo))-mdot*Cp*(Tmo-Tmi), we get\n",
+ "Tmo=70-40/(math.exp (190.8604/439.064));\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print\"Tmo =\",round(Tmo,2),\"oC\"\n",
+ "print\"(ii) Exit temperature of air =\",round(Tmo,4),\"oC\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tmo = 44.1 oC\n",
+ "(ii) Exit temperature of air = 44.1016 oC\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(iii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "Tmo = 44.10; #in oC\n",
+ "\n",
+ "#calculations\n",
+ "q=439.064*(40-(70-Tmo)); #Heat transfer rate per unit length to air\n",
+ "\n",
+ "#result\n",
+ "print\"(iii) Heat transfer rate per unit length to air =\",round(q,2),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(iii) Heat transfer rate per unit length to air = 6190.8 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_4.ipynb new file mode 100755 index 00000000..d16fb965 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_4.ipynb @@ -0,0 +1,673 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f52bfd7811201b97d412b52a8226e438de6bc215828a85347af9b46efb493219"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Heat Transfer by Forced Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(a) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^ 2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/ s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Local heat transfer coefficient is\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Local heat transfer coefficient is 184.4517 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(b) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D;\n",
+ "Tw = H/h + Tb; #the local wal to bulk mean temperature difference\n",
+ "\n",
+ "#result\n",
+ "print\"(b) Wall Temperature Tw =\",round(Tw,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Wall Temperature Tw = 45.4215 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 , Page no:213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr1=0.01;\n",
+ "Pr2=0.1;\n",
+ "Pr3=100;\n",
+ "\n",
+ "#Calculation\n",
+ "T1 = 0.04305* Pr1 /0.0575; #For Pr = 0.01\n",
+ "T2 = 0.04305* Pr2 /0.0575; #For Pr = 0.1\n",
+ "T3 = 0.04305* Pr3 /0.0575 ; #For Pr = 100\n",
+ "\n",
+ "#result\n",
+ "print\"Lth/Le at Pr =0.01 is\",round(T1,4);\n",
+ "print\"Lth/Le at Pr = 1 is\",round(T2,4);\n",
+ "print\"Lth/Le at Pr = 100 is\",round(T3,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lth/Le at Pr =0.01 is 0.0075\n",
+ "Lth/Le at Pr = 1 is 0.0749\n",
+ "Lth/Le at Pr = 100 is 74.8696\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(i) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2) **(1/2) *(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)*( math.log ((Tw - Tmi )/(Tw - Tmo )) /(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14)); #the energy equation\n",
+ "\n",
+ "#result\n",
+ "print\"The length of tube if the exit water temperature is 65 degree C =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of tube if the exit water temperature is 65 degree C = 1.0876 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(ii) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "Tmo = 70 ; #degree C\n",
+ "Tb = 60 ; #degree C\n",
+ "k1 = 0.659 ; #W/m K\n",
+ "rho1 = 983.2 ;#kg/m^3\n",
+ "Cp1 = 4179 ;#J/kg K\n",
+ "Pr1 = 2.98 ;\n",
+ "f1 = 0.005928;\n",
+ "Nud = 154.97; #the Gnielinski Eqn\n",
+ "Tmo1 = 73.4 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2)**(1/2) *(( Pr**(2/3) ) -1) ); #W/m^2 K\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)* math.log ((Tw - Tmi )/(Tw - Tmo ))/(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14); #the energy equation\n",
+ "v1 = 0.478 * 10**-6 ; #m^2/s\n",
+ "Re1 = 4* mdot /(3.14*D* rho1 *v1);\n",
+ "h = Nud *k1/D ; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"Trial and error method\";\n",
+ "print\"Trial 1\";\n",
+ "print\"Assumed value of Tmo =70 degree C\";\n",
+ "print\"Value of Tmo obtained =73.4 degree C\";\n",
+ "print\"Trial 2\";\n",
+ "print\"Assume Tmo =73.4 degree C\";\n",
+ "print\"Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial and error method\n",
+ "Trial 1\n",
+ "Assumed value of Tmo =70 degree C\n",
+ "Value of Tmo obtained =73.4 degree C\n",
+ "Trial 2\n",
+ "Assume Tmo =73.4 degree C\n",
+ "Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 , Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Di = 0.05 ; #m\n",
+ "m = 300 ; #kg/min\n",
+ "m1 = m/60 ; #kg/sec\n",
+ "rho = 846.7 ; #kg/m^3\n",
+ "k = 68.34 ; #W/m K\n",
+ "c = 1274; #J/kg K\n",
+ "Pr = 0.00468 ;\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.2937*10**-6 ; #m^2/s\n",
+ "ReD = 4* m1 /(3.14*Di* rho *v);\n",
+ "NuD = 6.3 + 0.0167*( ReD**0.85) *( Pr**0.93) ; #Assuming both temperature and velocity profile are fully developed over the length of tube\n",
+ "h = NuD *k/ Di ;\n",
+ "L = 300/60*1274*(500 -400) /(h*3.14* Di *30); #Equating the heat transferred through the wall of the tube to the change of enthalpy pf sodium\n",
+ "\n",
+ "#result\n",
+ "print\"Length of tube over which the temperature rise occurs =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tube over which the temperature rise occurs = 6.8659 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 , Page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 15 ; #m/s\n",
+ "s =0.2 ; #m\n",
+ "rho = 1.128 ; #kg/m^3\n",
+ "k = 0.0276; #W/m K\n",
+ "Pr = 0.699;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (20+60) /2; ##degree C\n",
+ "v = 16.96*10**-6; #m^2/s\n",
+ "A=s**2;\n",
+ "ReL = V *0.2/ v;\n",
+ "Cf = 1.328/( ReL )**0.5; #the boundary layer may be assumed to be laminar over the entire length.\n",
+ "Fd = 2* Cf *1/2* rho*A*V**2;\n",
+ "Nul = 0.664*( Pr**(1/3) )*( ReL**(1/2) );\n",
+ "h = Nul *k/s;\n",
+ "q = 2*A*h *(60 -20) ; #rate of heat transfer q is\n",
+ "Cf1 = 0.074*( ReL )**( -0.2) ; #boundary layer from leading edge, the drag coefficient is\n",
+ "Fd1 = 2* Cf1 *1/2* rho *A*V**2;\n",
+ "Nul1 = 0.0366*(0.699**(1/3) )*( ReL**(0.8) );\n",
+ "h1 = Nul1 *k/s; #W/m^2 K\n",
+ "q1 = 2*A*h1 *(60 -20) ;\n",
+ "\n",
+ "#result\n",
+ "print\"For Laminar Boundary Layer\";\n",
+ "print\"Rate of Heat transfer =\",round(q,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd,4),\"N\";\n",
+ "print\"For Turbulent Boundary Layer from the leading edge\";\n",
+ "print\"Rate of Heat transfer =\",round(q1,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd1,4),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Laminar Boundary Layer\n",
+ "Rate of Heat transfer = 109.447 W\n",
+ "Drag force = 0.0321 N\n",
+ "For Turbulent Boundary Layer from the leading edge\n",
+ "Rate of Heat transfer = 226.3735 W\n",
+ "Drag force = 0.067 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(i) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**(1/2) )*( Pr**(1/3) ))/((1+((0.4/ Pr)**(2/3) ))**(1/4)))*((1+(( ReD/282000)**(5/8)))**(4/5));\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "q = flux *3.14*D *1; #W/m\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate per unit length =\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate per unit length = 258.8849 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(ii) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "k = 0.0290 ;\n",
+ "Pr = 0.696 ;\n",
+ "Tassumd = 130 ; #degree C\n",
+ "Tm = 75 ; #degree C\n",
+ "k1 = 0.0301 ; #W/m K\n",
+ "Pr1 = 0.693 ;\n",
+ "Nu1 = 33.99;\n",
+ "Tavgcalc = 129.9 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**0.5) *( Pr**(1/3) )) /((1+((0.4/Pr)**(2/3) ))**(1/4)))*(1+( ReD /282000)**(5/8) )**(5/8);\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "Tavg = 1500/ flux *( Tsurface - Tair );\n",
+ "v1 = 20.56*10** -6 ; #m^2/s\n",
+ "ReD1 = V*D/v1;\n",
+ "h = Nu1*k1/D;\n",
+ "Tdiff = 1500/ h; #degree C\n",
+ "\n",
+ "#result\n",
+ "print\"Assumed average wall temperature =\",round(Tassumd,4),\"degree C\";\n",
+ "print\"Calculated average wall Temperature =\",round(Tavgcalc,4),\"degree C\";\n",
+ "print\"Hence,Average wall Temperature =\",round(Tavgcalc,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumed average wall temperature = 130.0 degree C\n",
+ "Calculated average wall Temperature = 129.9 degree C\n",
+ "Hence,Average wall Temperature = 129.9 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(i) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #v\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "Cp = 1.005 ; #kJ/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "\n",
+ "#calculations\n",
+ "v = 16.00 *10**-6 ; #m^2/s\n",
+ "Vmax = ST /(SL -D)* Vinf ; #m/s\n",
+ "Re = Vmax *D/v ;\n",
+ "f = 0.37/4;\n",
+ "deltaP = 4*f*N*X*( rho * Vmax**2) /2 ; #N/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"(i) Pressure drop of air across the bank is\",round(deltaP,4),\"N/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure drop of air across the bank is 38.7945 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(ii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "v = 16.00 *10**-6 ; #[m^2/s]\n",
+ "Cp = 1.005*1000 ; #J/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "\n",
+ "#calculations\n",
+ "#sub all value in the following expression\n",
+ "# q=h*(3.14*D*L)*50*((Tw-Tmi)-(Tw-Tmo))/log((Tw-Tmi)/(Tw-Tmo))-mdot*Cp*(Tmo-Tmi), we get\n",
+ "Tmo=70-40/(math.exp (190.8604/439.064));\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print\"Tmo =\",round(Tmo,2),\"oC\"\n",
+ "print\"(ii) Exit temperature of air =\",round(Tmo,4),\"oC\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tmo = 44.1 oC\n",
+ "(ii) Exit temperature of air = 44.1016 oC\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(iii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "Tmo = 44.10; #in oC\n",
+ "\n",
+ "#calculations\n",
+ "q=439.064*(40-(70-Tmo)); #Heat transfer rate per unit length to air\n",
+ "\n",
+ "#result\n",
+ "print\"(iii) Heat transfer rate per unit length to air =\",round(q,2),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(iii) Heat transfer rate per unit length to air = 6190.8 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_5.ipynb new file mode 100755 index 00000000..d16fb965 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_5.ipynb @@ -0,0 +1,673 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f52bfd7811201b97d412b52a8226e438de6bc215828a85347af9b46efb493219"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Heat Transfer by Forced Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(a) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^ 2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/ s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Local heat transfer coefficient is\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Local heat transfer coefficient is 184.4517 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(b) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D;\n",
+ "Tw = H/h + Tb; #the local wal to bulk mean temperature difference\n",
+ "\n",
+ "#result\n",
+ "print\"(b) Wall Temperature Tw =\",round(Tw,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Wall Temperature Tw = 45.4215 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 , Page no:213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr1=0.01;\n",
+ "Pr2=0.1;\n",
+ "Pr3=100;\n",
+ "\n",
+ "#Calculation\n",
+ "T1 = 0.04305* Pr1 /0.0575; #For Pr = 0.01\n",
+ "T2 = 0.04305* Pr2 /0.0575; #For Pr = 0.1\n",
+ "T3 = 0.04305* Pr3 /0.0575 ; #For Pr = 100\n",
+ "\n",
+ "#result\n",
+ "print\"Lth/Le at Pr =0.01 is\",round(T1,4);\n",
+ "print\"Lth/Le at Pr = 1 is\",round(T2,4);\n",
+ "print\"Lth/Le at Pr = 100 is\",round(T3,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lth/Le at Pr =0.01 is 0.0075\n",
+ "Lth/Le at Pr = 1 is 0.0749\n",
+ "Lth/Le at Pr = 100 is 74.8696\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(i) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2) **(1/2) *(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)*( math.log ((Tw - Tmi )/(Tw - Tmo )) /(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14)); #the energy equation\n",
+ "\n",
+ "#result\n",
+ "print\"The length of tube if the exit water temperature is 65 degree C =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of tube if the exit water temperature is 65 degree C = 1.0876 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(ii) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "Tmo = 70 ; #degree C\n",
+ "Tb = 60 ; #degree C\n",
+ "k1 = 0.659 ; #W/m K\n",
+ "rho1 = 983.2 ;#kg/m^3\n",
+ "Cp1 = 4179 ;#J/kg K\n",
+ "Pr1 = 2.98 ;\n",
+ "f1 = 0.005928;\n",
+ "Nud = 154.97; #the Gnielinski Eqn\n",
+ "Tmo1 = 73.4 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2)**(1/2) *(( Pr**(2/3) ) -1) ); #W/m^2 K\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)* math.log ((Tw - Tmi )/(Tw - Tmo ))/(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14); #the energy equation\n",
+ "v1 = 0.478 * 10**-6 ; #m^2/s\n",
+ "Re1 = 4* mdot /(3.14*D* rho1 *v1);\n",
+ "h = Nud *k1/D ; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"Trial and error method\";\n",
+ "print\"Trial 1\";\n",
+ "print\"Assumed value of Tmo =70 degree C\";\n",
+ "print\"Value of Tmo obtained =73.4 degree C\";\n",
+ "print\"Trial 2\";\n",
+ "print\"Assume Tmo =73.4 degree C\";\n",
+ "print\"Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial and error method\n",
+ "Trial 1\n",
+ "Assumed value of Tmo =70 degree C\n",
+ "Value of Tmo obtained =73.4 degree C\n",
+ "Trial 2\n",
+ "Assume Tmo =73.4 degree C\n",
+ "Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 , Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Di = 0.05 ; #m\n",
+ "m = 300 ; #kg/min\n",
+ "m1 = m/60 ; #kg/sec\n",
+ "rho = 846.7 ; #kg/m^3\n",
+ "k = 68.34 ; #W/m K\n",
+ "c = 1274; #J/kg K\n",
+ "Pr = 0.00468 ;\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.2937*10**-6 ; #m^2/s\n",
+ "ReD = 4* m1 /(3.14*Di* rho *v);\n",
+ "NuD = 6.3 + 0.0167*( ReD**0.85) *( Pr**0.93) ; #Assuming both temperature and velocity profile are fully developed over the length of tube\n",
+ "h = NuD *k/ Di ;\n",
+ "L = 300/60*1274*(500 -400) /(h*3.14* Di *30); #Equating the heat transferred through the wall of the tube to the change of enthalpy pf sodium\n",
+ "\n",
+ "#result\n",
+ "print\"Length of tube over which the temperature rise occurs =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tube over which the temperature rise occurs = 6.8659 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 , Page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 15 ; #m/s\n",
+ "s =0.2 ; #m\n",
+ "rho = 1.128 ; #kg/m^3\n",
+ "k = 0.0276; #W/m K\n",
+ "Pr = 0.699;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (20+60) /2; ##degree C\n",
+ "v = 16.96*10**-6; #m^2/s\n",
+ "A=s**2;\n",
+ "ReL = V *0.2/ v;\n",
+ "Cf = 1.328/( ReL )**0.5; #the boundary layer may be assumed to be laminar over the entire length.\n",
+ "Fd = 2* Cf *1/2* rho*A*V**2;\n",
+ "Nul = 0.664*( Pr**(1/3) )*( ReL**(1/2) );\n",
+ "h = Nul *k/s;\n",
+ "q = 2*A*h *(60 -20) ; #rate of heat transfer q is\n",
+ "Cf1 = 0.074*( ReL )**( -0.2) ; #boundary layer from leading edge, the drag coefficient is\n",
+ "Fd1 = 2* Cf1 *1/2* rho *A*V**2;\n",
+ "Nul1 = 0.0366*(0.699**(1/3) )*( ReL**(0.8) );\n",
+ "h1 = Nul1 *k/s; #W/m^2 K\n",
+ "q1 = 2*A*h1 *(60 -20) ;\n",
+ "\n",
+ "#result\n",
+ "print\"For Laminar Boundary Layer\";\n",
+ "print\"Rate of Heat transfer =\",round(q,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd,4),\"N\";\n",
+ "print\"For Turbulent Boundary Layer from the leading edge\";\n",
+ "print\"Rate of Heat transfer =\",round(q1,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd1,4),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Laminar Boundary Layer\n",
+ "Rate of Heat transfer = 109.447 W\n",
+ "Drag force = 0.0321 N\n",
+ "For Turbulent Boundary Layer from the leading edge\n",
+ "Rate of Heat transfer = 226.3735 W\n",
+ "Drag force = 0.067 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(i) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**(1/2) )*( Pr**(1/3) ))/((1+((0.4/ Pr)**(2/3) ))**(1/4)))*((1+(( ReD/282000)**(5/8)))**(4/5));\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "q = flux *3.14*D *1; #W/m\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate per unit length =\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate per unit length = 258.8849 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(ii) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "k = 0.0290 ;\n",
+ "Pr = 0.696 ;\n",
+ "Tassumd = 130 ; #degree C\n",
+ "Tm = 75 ; #degree C\n",
+ "k1 = 0.0301 ; #W/m K\n",
+ "Pr1 = 0.693 ;\n",
+ "Nu1 = 33.99;\n",
+ "Tavgcalc = 129.9 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**0.5) *( Pr**(1/3) )) /((1+((0.4/Pr)**(2/3) ))**(1/4)))*(1+( ReD /282000)**(5/8) )**(5/8);\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "Tavg = 1500/ flux *( Tsurface - Tair );\n",
+ "v1 = 20.56*10** -6 ; #m^2/s\n",
+ "ReD1 = V*D/v1;\n",
+ "h = Nu1*k1/D;\n",
+ "Tdiff = 1500/ h; #degree C\n",
+ "\n",
+ "#result\n",
+ "print\"Assumed average wall temperature =\",round(Tassumd,4),\"degree C\";\n",
+ "print\"Calculated average wall Temperature =\",round(Tavgcalc,4),\"degree C\";\n",
+ "print\"Hence,Average wall Temperature =\",round(Tavgcalc,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumed average wall temperature = 130.0 degree C\n",
+ "Calculated average wall Temperature = 129.9 degree C\n",
+ "Hence,Average wall Temperature = 129.9 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(i) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #v\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "Cp = 1.005 ; #kJ/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "\n",
+ "#calculations\n",
+ "v = 16.00 *10**-6 ; #m^2/s\n",
+ "Vmax = ST /(SL -D)* Vinf ; #m/s\n",
+ "Re = Vmax *D/v ;\n",
+ "f = 0.37/4;\n",
+ "deltaP = 4*f*N*X*( rho * Vmax**2) /2 ; #N/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"(i) Pressure drop of air across the bank is\",round(deltaP,4),\"N/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure drop of air across the bank is 38.7945 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(ii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "v = 16.00 *10**-6 ; #[m^2/s]\n",
+ "Cp = 1.005*1000 ; #J/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "\n",
+ "#calculations\n",
+ "#sub all value in the following expression\n",
+ "# q=h*(3.14*D*L)*50*((Tw-Tmi)-(Tw-Tmo))/log((Tw-Tmi)/(Tw-Tmo))-mdot*Cp*(Tmo-Tmi), we get\n",
+ "Tmo=70-40/(math.exp (190.8604/439.064));\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print\"Tmo =\",round(Tmo,2),\"oC\"\n",
+ "print\"(ii) Exit temperature of air =\",round(Tmo,4),\"oC\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tmo = 44.1 oC\n",
+ "(ii) Exit temperature of air = 44.1016 oC\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(iii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "Tmo = 44.10; #in oC\n",
+ "\n",
+ "#calculations\n",
+ "q=439.064*(40-(70-Tmo)); #Heat transfer rate per unit length to air\n",
+ "\n",
+ "#result\n",
+ "print\"(iii) Heat transfer rate per unit length to air =\",round(q,2),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(iii) Heat transfer rate per unit length to air = 6190.8 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_6.ipynb new file mode 100755 index 00000000..d16fb965 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_6.ipynb @@ -0,0 +1,673 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f52bfd7811201b97d412b52a8226e438de6bc215828a85347af9b46efb493219"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Heat Transfer by Forced Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(a) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^ 2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/ s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Local heat transfer coefficient is\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Local heat transfer coefficient is 184.4517 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(b) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D;\n",
+ "Tw = H/h + Tb; #the local wal to bulk mean temperature difference\n",
+ "\n",
+ "#result\n",
+ "print\"(b) Wall Temperature Tw =\",round(Tw,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Wall Temperature Tw = 45.4215 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 , Page no:213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr1=0.01;\n",
+ "Pr2=0.1;\n",
+ "Pr3=100;\n",
+ "\n",
+ "#Calculation\n",
+ "T1 = 0.04305* Pr1 /0.0575; #For Pr = 0.01\n",
+ "T2 = 0.04305* Pr2 /0.0575; #For Pr = 0.1\n",
+ "T3 = 0.04305* Pr3 /0.0575 ; #For Pr = 100\n",
+ "\n",
+ "#result\n",
+ "print\"Lth/Le at Pr =0.01 is\",round(T1,4);\n",
+ "print\"Lth/Le at Pr = 1 is\",round(T2,4);\n",
+ "print\"Lth/Le at Pr = 100 is\",round(T3,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lth/Le at Pr =0.01 is 0.0075\n",
+ "Lth/Le at Pr = 1 is 0.0749\n",
+ "Lth/Le at Pr = 100 is 74.8696\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(i) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2) **(1/2) *(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)*( math.log ((Tw - Tmi )/(Tw - Tmo )) /(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14)); #the energy equation\n",
+ "\n",
+ "#result\n",
+ "print\"The length of tube if the exit water temperature is 65 degree C =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of tube if the exit water temperature is 65 degree C = 1.0876 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(ii) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "Tmo = 70 ; #degree C\n",
+ "Tb = 60 ; #degree C\n",
+ "k1 = 0.659 ; #W/m K\n",
+ "rho1 = 983.2 ;#kg/m^3\n",
+ "Cp1 = 4179 ;#J/kg K\n",
+ "Pr1 = 2.98 ;\n",
+ "f1 = 0.005928;\n",
+ "Nud = 154.97; #the Gnielinski Eqn\n",
+ "Tmo1 = 73.4 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2)**(1/2) *(( Pr**(2/3) ) -1) ); #W/m^2 K\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)* math.log ((Tw - Tmi )/(Tw - Tmo ))/(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14); #the energy equation\n",
+ "v1 = 0.478 * 10**-6 ; #m^2/s\n",
+ "Re1 = 4* mdot /(3.14*D* rho1 *v1);\n",
+ "h = Nud *k1/D ; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"Trial and error method\";\n",
+ "print\"Trial 1\";\n",
+ "print\"Assumed value of Tmo =70 degree C\";\n",
+ "print\"Value of Tmo obtained =73.4 degree C\";\n",
+ "print\"Trial 2\";\n",
+ "print\"Assume Tmo =73.4 degree C\";\n",
+ "print\"Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial and error method\n",
+ "Trial 1\n",
+ "Assumed value of Tmo =70 degree C\n",
+ "Value of Tmo obtained =73.4 degree C\n",
+ "Trial 2\n",
+ "Assume Tmo =73.4 degree C\n",
+ "Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 , Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Di = 0.05 ; #m\n",
+ "m = 300 ; #kg/min\n",
+ "m1 = m/60 ; #kg/sec\n",
+ "rho = 846.7 ; #kg/m^3\n",
+ "k = 68.34 ; #W/m K\n",
+ "c = 1274; #J/kg K\n",
+ "Pr = 0.00468 ;\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.2937*10**-6 ; #m^2/s\n",
+ "ReD = 4* m1 /(3.14*Di* rho *v);\n",
+ "NuD = 6.3 + 0.0167*( ReD**0.85) *( Pr**0.93) ; #Assuming both temperature and velocity profile are fully developed over the length of tube\n",
+ "h = NuD *k/ Di ;\n",
+ "L = 300/60*1274*(500 -400) /(h*3.14* Di *30); #Equating the heat transferred through the wall of the tube to the change of enthalpy pf sodium\n",
+ "\n",
+ "#result\n",
+ "print\"Length of tube over which the temperature rise occurs =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tube over which the temperature rise occurs = 6.8659 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 , Page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 15 ; #m/s\n",
+ "s =0.2 ; #m\n",
+ "rho = 1.128 ; #kg/m^3\n",
+ "k = 0.0276; #W/m K\n",
+ "Pr = 0.699;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (20+60) /2; ##degree C\n",
+ "v = 16.96*10**-6; #m^2/s\n",
+ "A=s**2;\n",
+ "ReL = V *0.2/ v;\n",
+ "Cf = 1.328/( ReL )**0.5; #the boundary layer may be assumed to be laminar over the entire length.\n",
+ "Fd = 2* Cf *1/2* rho*A*V**2;\n",
+ "Nul = 0.664*( Pr**(1/3) )*( ReL**(1/2) );\n",
+ "h = Nul *k/s;\n",
+ "q = 2*A*h *(60 -20) ; #rate of heat transfer q is\n",
+ "Cf1 = 0.074*( ReL )**( -0.2) ; #boundary layer from leading edge, the drag coefficient is\n",
+ "Fd1 = 2* Cf1 *1/2* rho *A*V**2;\n",
+ "Nul1 = 0.0366*(0.699**(1/3) )*( ReL**(0.8) );\n",
+ "h1 = Nul1 *k/s; #W/m^2 K\n",
+ "q1 = 2*A*h1 *(60 -20) ;\n",
+ "\n",
+ "#result\n",
+ "print\"For Laminar Boundary Layer\";\n",
+ "print\"Rate of Heat transfer =\",round(q,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd,4),\"N\";\n",
+ "print\"For Turbulent Boundary Layer from the leading edge\";\n",
+ "print\"Rate of Heat transfer =\",round(q1,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd1,4),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Laminar Boundary Layer\n",
+ "Rate of Heat transfer = 109.447 W\n",
+ "Drag force = 0.0321 N\n",
+ "For Turbulent Boundary Layer from the leading edge\n",
+ "Rate of Heat transfer = 226.3735 W\n",
+ "Drag force = 0.067 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(i) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**(1/2) )*( Pr**(1/3) ))/((1+((0.4/ Pr)**(2/3) ))**(1/4)))*((1+(( ReD/282000)**(5/8)))**(4/5));\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "q = flux *3.14*D *1; #W/m\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate per unit length =\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate per unit length = 258.8849 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(ii) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "k = 0.0290 ;\n",
+ "Pr = 0.696 ;\n",
+ "Tassumd = 130 ; #degree C\n",
+ "Tm = 75 ; #degree C\n",
+ "k1 = 0.0301 ; #W/m K\n",
+ "Pr1 = 0.693 ;\n",
+ "Nu1 = 33.99;\n",
+ "Tavgcalc = 129.9 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**0.5) *( Pr**(1/3) )) /((1+((0.4/Pr)**(2/3) ))**(1/4)))*(1+( ReD /282000)**(5/8) )**(5/8);\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "Tavg = 1500/ flux *( Tsurface - Tair );\n",
+ "v1 = 20.56*10** -6 ; #m^2/s\n",
+ "ReD1 = V*D/v1;\n",
+ "h = Nu1*k1/D;\n",
+ "Tdiff = 1500/ h; #degree C\n",
+ "\n",
+ "#result\n",
+ "print\"Assumed average wall temperature =\",round(Tassumd,4),\"degree C\";\n",
+ "print\"Calculated average wall Temperature =\",round(Tavgcalc,4),\"degree C\";\n",
+ "print\"Hence,Average wall Temperature =\",round(Tavgcalc,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumed average wall temperature = 130.0 degree C\n",
+ "Calculated average wall Temperature = 129.9 degree C\n",
+ "Hence,Average wall Temperature = 129.9 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(i) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #v\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "Cp = 1.005 ; #kJ/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "\n",
+ "#calculations\n",
+ "v = 16.00 *10**-6 ; #m^2/s\n",
+ "Vmax = ST /(SL -D)* Vinf ; #m/s\n",
+ "Re = Vmax *D/v ;\n",
+ "f = 0.37/4;\n",
+ "deltaP = 4*f*N*X*( rho * Vmax**2) /2 ; #N/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"(i) Pressure drop of air across the bank is\",round(deltaP,4),\"N/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure drop of air across the bank is 38.7945 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(ii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "v = 16.00 *10**-6 ; #[m^2/s]\n",
+ "Cp = 1.005*1000 ; #J/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "\n",
+ "#calculations\n",
+ "#sub all value in the following expression\n",
+ "# q=h*(3.14*D*L)*50*((Tw-Tmi)-(Tw-Tmo))/log((Tw-Tmi)/(Tw-Tmo))-mdot*Cp*(Tmo-Tmi), we get\n",
+ "Tmo=70-40/(math.exp (190.8604/439.064));\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print\"Tmo =\",round(Tmo,2),\"oC\"\n",
+ "print\"(ii) Exit temperature of air =\",round(Tmo,4),\"oC\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tmo = 44.1 oC\n",
+ "(ii) Exit temperature of air = 44.1016 oC\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(iii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "Tmo = 44.10; #in oC\n",
+ "\n",
+ "#calculations\n",
+ "q=439.064*(40-(70-Tmo)); #Heat transfer rate per unit length to air\n",
+ "\n",
+ "#result\n",
+ "print\"(iii) Heat transfer rate per unit length to air =\",round(q,2),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(iii) Heat transfer rate per unit length to air = 6190.8 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_7.ipynb new file mode 100755 index 00000000..d16fb965 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_7.ipynb @@ -0,0 +1,673 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f52bfd7811201b97d412b52a8226e438de6bc215828a85347af9b46efb493219"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Heat Transfer by Forced Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(a) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^ 2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/ s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Local heat transfer coefficient is\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Local heat transfer coefficient is 184.4517 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(b) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D;\n",
+ "Tw = H/h + Tb; #the local wal to bulk mean temperature difference\n",
+ "\n",
+ "#result\n",
+ "print\"(b) Wall Temperature Tw =\",round(Tw,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Wall Temperature Tw = 45.4215 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 , Page no:213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr1=0.01;\n",
+ "Pr2=0.1;\n",
+ "Pr3=100;\n",
+ "\n",
+ "#Calculation\n",
+ "T1 = 0.04305* Pr1 /0.0575; #For Pr = 0.01\n",
+ "T2 = 0.04305* Pr2 /0.0575; #For Pr = 0.1\n",
+ "T3 = 0.04305* Pr3 /0.0575 ; #For Pr = 100\n",
+ "\n",
+ "#result\n",
+ "print\"Lth/Le at Pr =0.01 is\",round(T1,4);\n",
+ "print\"Lth/Le at Pr = 1 is\",round(T2,4);\n",
+ "print\"Lth/Le at Pr = 100 is\",round(T3,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lth/Le at Pr =0.01 is 0.0075\n",
+ "Lth/Le at Pr = 1 is 0.0749\n",
+ "Lth/Le at Pr = 100 is 74.8696\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(i) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2) **(1/2) *(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)*( math.log ((Tw - Tmi )/(Tw - Tmo )) /(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14)); #the energy equation\n",
+ "\n",
+ "#result\n",
+ "print\"The length of tube if the exit water temperature is 65 degree C =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of tube if the exit water temperature is 65 degree C = 1.0876 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(ii) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "Tmo = 70 ; #degree C\n",
+ "Tb = 60 ; #degree C\n",
+ "k1 = 0.659 ; #W/m K\n",
+ "rho1 = 983.2 ;#kg/m^3\n",
+ "Cp1 = 4179 ;#J/kg K\n",
+ "Pr1 = 2.98 ;\n",
+ "f1 = 0.005928;\n",
+ "Nud = 154.97; #the Gnielinski Eqn\n",
+ "Tmo1 = 73.4 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2)**(1/2) *(( Pr**(2/3) ) -1) ); #W/m^2 K\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)* math.log ((Tw - Tmi )/(Tw - Tmo ))/(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14); #the energy equation\n",
+ "v1 = 0.478 * 10**-6 ; #m^2/s\n",
+ "Re1 = 4* mdot /(3.14*D* rho1 *v1);\n",
+ "h = Nud *k1/D ; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"Trial and error method\";\n",
+ "print\"Trial 1\";\n",
+ "print\"Assumed value of Tmo =70 degree C\";\n",
+ "print\"Value of Tmo obtained =73.4 degree C\";\n",
+ "print\"Trial 2\";\n",
+ "print\"Assume Tmo =73.4 degree C\";\n",
+ "print\"Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial and error method\n",
+ "Trial 1\n",
+ "Assumed value of Tmo =70 degree C\n",
+ "Value of Tmo obtained =73.4 degree C\n",
+ "Trial 2\n",
+ "Assume Tmo =73.4 degree C\n",
+ "Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 , Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Di = 0.05 ; #m\n",
+ "m = 300 ; #kg/min\n",
+ "m1 = m/60 ; #kg/sec\n",
+ "rho = 846.7 ; #kg/m^3\n",
+ "k = 68.34 ; #W/m K\n",
+ "c = 1274; #J/kg K\n",
+ "Pr = 0.00468 ;\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.2937*10**-6 ; #m^2/s\n",
+ "ReD = 4* m1 /(3.14*Di* rho *v);\n",
+ "NuD = 6.3 + 0.0167*( ReD**0.85) *( Pr**0.93) ; #Assuming both temperature and velocity profile are fully developed over the length of tube\n",
+ "h = NuD *k/ Di ;\n",
+ "L = 300/60*1274*(500 -400) /(h*3.14* Di *30); #Equating the heat transferred through the wall of the tube to the change of enthalpy pf sodium\n",
+ "\n",
+ "#result\n",
+ "print\"Length of tube over which the temperature rise occurs =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tube over which the temperature rise occurs = 6.8659 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 , Page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 15 ; #m/s\n",
+ "s =0.2 ; #m\n",
+ "rho = 1.128 ; #kg/m^3\n",
+ "k = 0.0276; #W/m K\n",
+ "Pr = 0.699;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (20+60) /2; ##degree C\n",
+ "v = 16.96*10**-6; #m^2/s\n",
+ "A=s**2;\n",
+ "ReL = V *0.2/ v;\n",
+ "Cf = 1.328/( ReL )**0.5; #the boundary layer may be assumed to be laminar over the entire length.\n",
+ "Fd = 2* Cf *1/2* rho*A*V**2;\n",
+ "Nul = 0.664*( Pr**(1/3) )*( ReL**(1/2) );\n",
+ "h = Nul *k/s;\n",
+ "q = 2*A*h *(60 -20) ; #rate of heat transfer q is\n",
+ "Cf1 = 0.074*( ReL )**( -0.2) ; #boundary layer from leading edge, the drag coefficient is\n",
+ "Fd1 = 2* Cf1 *1/2* rho *A*V**2;\n",
+ "Nul1 = 0.0366*(0.699**(1/3) )*( ReL**(0.8) );\n",
+ "h1 = Nul1 *k/s; #W/m^2 K\n",
+ "q1 = 2*A*h1 *(60 -20) ;\n",
+ "\n",
+ "#result\n",
+ "print\"For Laminar Boundary Layer\";\n",
+ "print\"Rate of Heat transfer =\",round(q,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd,4),\"N\";\n",
+ "print\"For Turbulent Boundary Layer from the leading edge\";\n",
+ "print\"Rate of Heat transfer =\",round(q1,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd1,4),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Laminar Boundary Layer\n",
+ "Rate of Heat transfer = 109.447 W\n",
+ "Drag force = 0.0321 N\n",
+ "For Turbulent Boundary Layer from the leading edge\n",
+ "Rate of Heat transfer = 226.3735 W\n",
+ "Drag force = 0.067 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(i) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**(1/2) )*( Pr**(1/3) ))/((1+((0.4/ Pr)**(2/3) ))**(1/4)))*((1+(( ReD/282000)**(5/8)))**(4/5));\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "q = flux *3.14*D *1; #W/m\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate per unit length =\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate per unit length = 258.8849 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(ii) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "k = 0.0290 ;\n",
+ "Pr = 0.696 ;\n",
+ "Tassumd = 130 ; #degree C\n",
+ "Tm = 75 ; #degree C\n",
+ "k1 = 0.0301 ; #W/m K\n",
+ "Pr1 = 0.693 ;\n",
+ "Nu1 = 33.99;\n",
+ "Tavgcalc = 129.9 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**0.5) *( Pr**(1/3) )) /((1+((0.4/Pr)**(2/3) ))**(1/4)))*(1+( ReD /282000)**(5/8) )**(5/8);\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "Tavg = 1500/ flux *( Tsurface - Tair );\n",
+ "v1 = 20.56*10** -6 ; #m^2/s\n",
+ "ReD1 = V*D/v1;\n",
+ "h = Nu1*k1/D;\n",
+ "Tdiff = 1500/ h; #degree C\n",
+ "\n",
+ "#result\n",
+ "print\"Assumed average wall temperature =\",round(Tassumd,4),\"degree C\";\n",
+ "print\"Calculated average wall Temperature =\",round(Tavgcalc,4),\"degree C\";\n",
+ "print\"Hence,Average wall Temperature =\",round(Tavgcalc,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumed average wall temperature = 130.0 degree C\n",
+ "Calculated average wall Temperature = 129.9 degree C\n",
+ "Hence,Average wall Temperature = 129.9 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(i) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #v\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "Cp = 1.005 ; #kJ/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "\n",
+ "#calculations\n",
+ "v = 16.00 *10**-6 ; #m^2/s\n",
+ "Vmax = ST /(SL -D)* Vinf ; #m/s\n",
+ "Re = Vmax *D/v ;\n",
+ "f = 0.37/4;\n",
+ "deltaP = 4*f*N*X*( rho * Vmax**2) /2 ; #N/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"(i) Pressure drop of air across the bank is\",round(deltaP,4),\"N/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure drop of air across the bank is 38.7945 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(ii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "v = 16.00 *10**-6 ; #[m^2/s]\n",
+ "Cp = 1.005*1000 ; #J/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "\n",
+ "#calculations\n",
+ "#sub all value in the following expression\n",
+ "# q=h*(3.14*D*L)*50*((Tw-Tmi)-(Tw-Tmo))/log((Tw-Tmi)/(Tw-Tmo))-mdot*Cp*(Tmo-Tmi), we get\n",
+ "Tmo=70-40/(math.exp (190.8604/439.064));\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print\"Tmo =\",round(Tmo,2),\"oC\"\n",
+ "print\"(ii) Exit temperature of air =\",round(Tmo,4),\"oC\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tmo = 44.1 oC\n",
+ "(ii) Exit temperature of air = 44.1016 oC\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(iii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "Tmo = 44.10; #in oC\n",
+ "\n",
+ "#calculations\n",
+ "q=439.064*(40-(70-Tmo)); #Heat transfer rate per unit length to air\n",
+ "\n",
+ "#result\n",
+ "print\"(iii) Heat transfer rate per unit length to air =\",round(q,2),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(iii) Heat transfer rate per unit length to air = 6190.8 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_8.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_8.ipynb new file mode 100755 index 00000000..d16fb965 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_5_Heat_Transfer_by_Forced_Convection_8.ipynb @@ -0,0 +1,673 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f52bfd7811201b97d412b52a8226e438de6bc215828a85347af9b46efb493219"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Heat Transfer by Forced Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(a) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^ 2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/ s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Local heat transfer coefficient is\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Local heat transfer coefficient is 184.4517 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1(b) , Page no:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "Q = 0.05 ; #m^3/h\n",
+ "H = 1000 ; #W/m^2\n",
+ "Tb = 40 ; #degree C\n",
+ "k = 0.634 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.659*10**-6 ; #m^2/s\n",
+ "Vbar = 4*Q /((3.14)*D**2) ;\n",
+ "ReD = Vbar *D/v;\n",
+ "h = 4.364* k/D;\n",
+ "Tw = H/h + Tb; #the local wal to bulk mean temperature difference\n",
+ "\n",
+ "#result\n",
+ "print\"(b) Wall Temperature Tw =\",round(Tw,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Wall Temperature Tw = 45.4215 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 , Page no:213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr1=0.01;\n",
+ "Pr2=0.1;\n",
+ "Pr3=100;\n",
+ "\n",
+ "#Calculation\n",
+ "T1 = 0.04305* Pr1 /0.0575; #For Pr = 0.01\n",
+ "T2 = 0.04305* Pr2 /0.0575; #For Pr = 0.1\n",
+ "T3 = 0.04305* Pr3 /0.0575 ; #For Pr = 100\n",
+ "\n",
+ "#result\n",
+ "print\"Lth/Le at Pr =0.01 is\",round(T1,4);\n",
+ "print\"Lth/Le at Pr = 1 is\",round(T2,4);\n",
+ "print\"Lth/Le at Pr = 100 is\",round(T3,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lth/Le at Pr =0.01 is 0.0075\n",
+ "Lth/Le at Pr = 1 is 0.0749\n",
+ "Lth/Le at Pr = 100 is 74.8696\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(i) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2) **(1/2) *(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)*( math.log ((Tw - Tmi )/(Tw - Tmo )) /(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14)); #the energy equation\n",
+ "\n",
+ "#result\n",
+ "print\"The length of tube if the exit water temperature is 65 degree C =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of tube if the exit water temperature is 65 degree C = 1.0876 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3(ii) , Page no:215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.015 ; #m\n",
+ "V = 1 ; #m/s\n",
+ "Tw = 90 ; #degree C\n",
+ "Tmi = 50 ; #degree C\n",
+ "Tmo = 65 ; #degree C\n",
+ "k = 0.656 ; #W/m K\n",
+ "rho = 984.4 ; #kg/m^3\n",
+ "Cp = 4178 ; #J/kg K\n",
+ "Pr = 3.12 ;\n",
+ "rhoin = 988.1 ; #kg/m^3\n",
+ "Tmo = 70 ; #degree C\n",
+ "Tb = 60 ; #degree C\n",
+ "k1 = 0.659 ; #W/m K\n",
+ "rho1 = 983.2 ;#kg/m^3\n",
+ "Cp1 = 4179 ;#J/kg K\n",
+ "Pr1 = 2.98 ;\n",
+ "f1 = 0.005928;\n",
+ "Nud = 154.97; #the Gnielinski Eqn\n",
+ "Tmo1 = 73.4 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.497 * 10**-6 ; #m^2/s\n",
+ "mdot =3.14*(D**2)* rhoin *V/4 ; #kg/s\n",
+ "Re = 4* mdot /(3.14*D* rho *v) ;\n",
+ "f = 0.079*( Re)** -0.25 ;\n",
+ "Nu = (f /2) *(Re -1000) *Pr /(1+12.7*( f /2)**(1/2) *(( Pr**(2/3) ) -1) ); #W/m^2 K\n",
+ "h = Nu*k/D;\n",
+ "L = mdot *Cp *( Tmo -Tmi)* math.log ((Tw - Tmi )/(Tw - Tmo ))/(((Tw -Tmi) -(Tw - Tmo ))*h*D*3.14); #the energy equation\n",
+ "v1 = 0.478 * 10**-6 ; #m^2/s\n",
+ "Re1 = 4* mdot /(3.14*D* rho1 *v1);\n",
+ "h = Nud *k1/D ; #W/m^2 K\n",
+ "\n",
+ "#result\n",
+ "print\"Trial and error method\";\n",
+ "print\"Trial 1\";\n",
+ "print\"Assumed value of Tmo =70 degree C\";\n",
+ "print\"Value of Tmo obtained =73.4 degree C\";\n",
+ "print\"Trial 2\";\n",
+ "print\"Assume Tmo =73.4 degree C\";\n",
+ "print\"Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial and error method\n",
+ "Trial 1\n",
+ "Assumed value of Tmo =70 degree C\n",
+ "Value of Tmo obtained =73.4 degree C\n",
+ "Trial 2\n",
+ "Assume Tmo =73.4 degree C\n",
+ "Value of Tmo obtained = 73.6 degree C which is in reasonably close agreement with assumed value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 , Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Di = 0.05 ; #m\n",
+ "m = 300 ; #kg/min\n",
+ "m1 = m/60 ; #kg/sec\n",
+ "rho = 846.7 ; #kg/m^3\n",
+ "k = 68.34 ; #W/m K\n",
+ "c = 1274; #J/kg K\n",
+ "Pr = 0.00468 ;\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.2937*10**-6 ; #m^2/s\n",
+ "ReD = 4* m1 /(3.14*Di* rho *v);\n",
+ "NuD = 6.3 + 0.0167*( ReD**0.85) *( Pr**0.93) ; #Assuming both temperature and velocity profile are fully developed over the length of tube\n",
+ "h = NuD *k/ Di ;\n",
+ "L = 300/60*1274*(500 -400) /(h*3.14* Di *30); #Equating the heat transferred through the wall of the tube to the change of enthalpy pf sodium\n",
+ "\n",
+ "#result\n",
+ "print\"Length of tube over which the temperature rise occurs =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tube over which the temperature rise occurs = 6.8659 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 , Page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 15 ; #m/s\n",
+ "s =0.2 ; #m\n",
+ "rho = 1.128 ; #kg/m^3\n",
+ "k = 0.0276; #W/m K\n",
+ "Pr = 0.699;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (20+60) /2; ##degree C\n",
+ "v = 16.96*10**-6; #m^2/s\n",
+ "A=s**2;\n",
+ "ReL = V *0.2/ v;\n",
+ "Cf = 1.328/( ReL )**0.5; #the boundary layer may be assumed to be laminar over the entire length.\n",
+ "Fd = 2* Cf *1/2* rho*A*V**2;\n",
+ "Nul = 0.664*( Pr**(1/3) )*( ReL**(1/2) );\n",
+ "h = Nul *k/s;\n",
+ "q = 2*A*h *(60 -20) ; #rate of heat transfer q is\n",
+ "Cf1 = 0.074*( ReL )**( -0.2) ; #boundary layer from leading edge, the drag coefficient is\n",
+ "Fd1 = 2* Cf1 *1/2* rho *A*V**2;\n",
+ "Nul1 = 0.0366*(0.699**(1/3) )*( ReL**(0.8) );\n",
+ "h1 = Nul1 *k/s; #W/m^2 K\n",
+ "q1 = 2*A*h1 *(60 -20) ;\n",
+ "\n",
+ "#result\n",
+ "print\"For Laminar Boundary Layer\";\n",
+ "print\"Rate of Heat transfer =\",round(q,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd,4),\"N\";\n",
+ "print\"For Turbulent Boundary Layer from the leading edge\";\n",
+ "print\"Rate of Heat transfer =\",round(q1,4),\"W\";\n",
+ "print\"Drag force =\",round(Fd1,4),\"N\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Laminar Boundary Layer\n",
+ "Rate of Heat transfer = 109.447 W\n",
+ "Drag force = 0.0321 N\n",
+ "For Turbulent Boundary Layer from the leading edge\n",
+ "Rate of Heat transfer = 226.3735 W\n",
+ "Drag force = 0.067 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(i) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**(1/2) )*( Pr**(1/3) ))/((1+((0.4/ Pr)**(2/3) ))**(1/4)))*((1+(( ReD/282000)**(5/8)))**(4/5));\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "q = flux *3.14*D *1; #W/m\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate per unit length =\",round(q,4),\"W/m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate per unit length = 258.8849 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6(ii) , Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.075 ; #m\n",
+ "V = 1.2 ; #m/s\n",
+ "Tair = 20 ; #degree C\n",
+ "Tsurface = 100 ; #degree C\n",
+ "k = 0.0290 ; #W/m K\n",
+ "Pr = 0.696 ;\n",
+ "k = 0.0290 ;\n",
+ "Pr = 0.696 ;\n",
+ "Tassumd = 130 ; #degree C\n",
+ "Tm = 75 ; #degree C\n",
+ "k1 = 0.0301 ; #W/m K\n",
+ "Pr1 = 0.693 ;\n",
+ "Nu1 = 33.99;\n",
+ "Tavgcalc = 129.9 ; #degree C\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Tsurface ) /2;\n",
+ "v = 18.97*10**-6 ; #m^2/s\n",
+ "ReD = V*D/v;\n",
+ "Nu = 0.3 +((0.62*( ReD**0.5) *( Pr**(1/3) )) /((1+((0.4/Pr)**(2/3) ))**(1/4)))*(1+( ReD /282000)**(5/8) )**(5/8);\n",
+ "h = Nu*k/D ; #W/m^2 K\n",
+ "flux = h*( Tsurface - Tair ); #W/m^2\n",
+ "Tavg = 1500/ flux *( Tsurface - Tair );\n",
+ "v1 = 20.56*10** -6 ; #m^2/s\n",
+ "ReD1 = V*D/v1;\n",
+ "h = Nu1*k1/D;\n",
+ "Tdiff = 1500/ h; #degree C\n",
+ "\n",
+ "#result\n",
+ "print\"Assumed average wall temperature =\",round(Tassumd,4),\"degree C\";\n",
+ "print\"Calculated average wall Temperature =\",round(Tavgcalc,4),\"degree C\";\n",
+ "print\"Hence,Average wall Temperature =\",round(Tavgcalc,4),\"degree C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumed average wall temperature = 130.0 degree C\n",
+ "Calculated average wall Temperature = 129.9 degree C\n",
+ "Hence,Average wall Temperature = 129.9 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(i) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #v\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "Cp = 1.005 ; #kJ/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "\n",
+ "#calculations\n",
+ "v = 16.00 *10**-6 ; #m^2/s\n",
+ "Vmax = ST /(SL -D)* Vinf ; #m/s\n",
+ "Re = Vmax *D/v ;\n",
+ "f = 0.37/4;\n",
+ "deltaP = 4*f*N*X*( rho * Vmax**2) /2 ; #N/m^2\n",
+ "\n",
+ "#result\n",
+ "print\"(i) Pressure drop of air across the bank is\",round(deltaP,4),\"N/m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure drop of air across the bank is 38.7945 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(ii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "v = 16.00 *10**-6 ; #[m^2/s]\n",
+ "Cp = 1.005*1000 ; #J/kg K\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "\n",
+ "#calculations\n",
+ "#sub all value in the following expression\n",
+ "# q=h*(3.14*D*L)*50*((Tw-Tmi)-(Tw-Tmo))/log((Tw-Tmi)/(Tw-Tmo))-mdot*Cp*(Tmo-Tmi), we get\n",
+ "Tmo=70-40/(math.exp (190.8604/439.064));\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print\"Tmo =\",round(Tmo,2),\"oC\"\n",
+ "print\"(ii) Exit temperature of air =\",round(Tmo,4),\"oC\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tmo = 44.1 oC\n",
+ "(ii) Exit temperature of air = 44.1016 oC\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7(iii) , Page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.0125 ; #m\n",
+ "ST = 1.5* D ;\n",
+ "SL = 1.5* D ;\n",
+ "Vinf = 2 ; #m/s\n",
+ "N = 5;\n",
+ "Tw = 70; #degree C\n",
+ "Tmi = 30; #degree C\n",
+ "L = 1; #m\n",
+ "rho = 1.165 ; #kg/m^3\n",
+ "k = 0.0267 ; #W/m K\n",
+ "Pr = 0.701;\n",
+ "X = 1; #tube arrangement is square\n",
+ "Pr1 = 0.694 ; #At 70 degree C\n",
+ "C1 = 0.27;\n",
+ "m = 0.63;\n",
+ "C2 = 0.93;\n",
+ "Tmo = 44.10; #in oC\n",
+ "\n",
+ "#calculations\n",
+ "q=439.064*(40-(70-Tmo)); #Heat transfer rate per unit length to air\n",
+ "\n",
+ "#result\n",
+ "print\"(iii) Heat transfer rate per unit length to air =\",round(q,2),\"W (roundoff error)\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(iii) Heat transfer rate per unit length to air = 6190.8 W (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_1.ipynb new file mode 100755 index 00000000..8e90d8f1 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_1.ipynb @@ -0,0 +1,344 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaada7e9a1621c5448fcc2c4bafb69518918476f74efee2f04521ed97f085e1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Heat Transfer by Natural convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page no:258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H = 0.5 ; #m\n",
+ "Th = 100; #degree C\n",
+ "Tl = 40; #degree C\n",
+ "Pr = 0.694;\n",
+ "k = 0.0297; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 20.02*10**-6 ; #m/s\n",
+ "T = (Th+ Tl )/2 + 273 ; #K\n",
+ "B = 1/T;\n",
+ "Gr = 9.81* B *(( Th - Tl )*H**3) /(v**2) ;\n",
+ "Ra = Gr*Pr;\n",
+ "Nua = 0.64*( Gr**(1/4) )*( Pr**0.5) *((0.861+ Pr)**( -1/4) ); #Exact analysis\n",
+ "Nub = 0.68*( Gr**(1/4) )*( Pr**0.5) *((0.952+ Pr)**( -1/4) ); #Integral method\n",
+ "Nuc = 0.59*( Ra)**(1/4) ; #McAdams correlation\n",
+ "Nud = 0.68 + 0.670*( Ra**(1/4) ) /(1+(0.492/ Pr)**(9/16))**(4/9) ; #Churchill and Chu correlation\n",
+ "\n",
+ "#result\n",
+ "print\"Mean film temperature =\",round(T,4),\"K\";\n",
+ "print\" ( a ) \";\n",
+ "print\"Exact analysis\";\n",
+ "print\"NuL =\",round(Nua,4);\n",
+ "print\"\\n ( b ) \";\n",
+ "print\"Integral method\";\n",
+ "print\"NuL =\",round(Nub,4);\n",
+ "print\"\\n ( c ) \";\n",
+ "print\"McAdams correlation\";\n",
+ "print\"NuL =\",round(Nuc,4);\n",
+ "print\"\\n ( d ) \";\n",
+ "print\"Churchill and Chu correlation\";\n",
+ "print\"NuL =\",round(Nud,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean film temperature = 343.0 K\n",
+ " ( a ) \n",
+ "Exact analysis\n",
+ "NuL = 72.6196\n",
+ "\n",
+ " ( b ) \n",
+ "Integral method\n",
+ "NuL = 76.0691\n",
+ "\n",
+ " ( c ) \n",
+ "McAdams correlation\n",
+ "NuL = 81.9066\n",
+ "\n",
+ " ( d ) \n",
+ "Churchill and Chu correlation\n",
+ "NuL = 71.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0.2 ; #m\n",
+ "d = 0.005 ; #m\n",
+ "rho = 7900 ; #kg/m^3\n",
+ "Cp = 460 ; #J/kg K\n",
+ "Tair = 20 ; #C\n",
+ "Tavg = 380 ; #C\n",
+ "Pr = 0.680 ;\n",
+ "k = 0.0393 ; #W/m K\n",
+ "h2 = 7.348 ; #W/m^2 K\n",
+ "h3 = 6.780; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tavg + Tair )/2 ; #C\n",
+ "v = 34.85*10**-6 ; #m^2/s\n",
+ "Re = 9.81*1/(273+ Tm)*( Tavg - Tair )*(s**3) /(v**2) *Pr;\n",
+ "Nu = 0.68 + 0.670*( Re**(1/4) ) /(1+(0.492/ Pr)**(4/9))**(4/9) ;\n",
+ "h = Nu*k/s; #W/m^2 K\n",
+ "t1 = rho*s*s*d*Cp /(( s**2) *2*h)* math.log ((430 - Tair )/(330 -Tair )); #s\n",
+ "t2 = rho*s*s*d*Cp /(( s**2) *2* h2)* math.log ((330 - Tair )/(230 -Tair )); #s\n",
+ "t3 = rho*s*s*d*Cp /(( s**2) *2* h3)* math.log ((230 - Tair )/(130 -Tair )); #s\n",
+ "time = t1+t2+t3; #Total time\n",
+ "minute = time /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time required for the plate to cool from 430 C to 330 C is\",round(t1,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 330 C to 230 C is\",round(t2,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 230 C to 130 C is\",round(t3,4),\"s\";\n",
+ "print\"Hence, time required for the plate to cool from 430 C to 130 C\";\n",
+ "print\" =\",round(time,4),\"s\";\n",
+ "print\" =\",round(minute,4),\"min\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the plate to cool from 430 C to 330 C is 328.9673 s\n",
+ "Time required for the plate to cool from 330 C to 230 C is 481.5307 s\n",
+ "Time required for the plate to cool from 230 C to 130 C is 866.4613 s\n",
+ "Hence, time required for the plate to cool from 430 C to 130 C\n",
+ " = 1676.9593 s\n",
+ " = 27.9493 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page no:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.006 ; #m\n",
+ "e = 0.1 ;\n",
+ "Ti = 800 ; #C\n",
+ "Ta = 1000 ; #C\n",
+ "k = 0.0763 ; #W/m K\n",
+ "Pr = 0.717 ;\n",
+ "Ra2 = 6.42 ;\n",
+ "Nu2 = 0.9841 ;\n",
+ "h2 = 12.15 ;\n",
+ "Ra3 = 6.93 ;\n",
+ "Nu3 = 0.9963 ;\n",
+ "h3 = 12.33 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ta+Ti) /2;\n",
+ "v = 155.1*10**-6 ; #m^2/s\n",
+ "Gr = 9.81*1/1173*(200* D**3) /(v**2) ;\n",
+ "Ra = Gr*Pr ;\n",
+ "Nu = 0.36 + 0.518*( Ra**(1/4) ) /(1+(0.559/ Pr)**(9/16))**(4/9) ;\n",
+ "h = Nu*k/D;\n",
+ "x = h*(Ta -Ti); #W/m^2\n",
+ "x2 = h2 *(900 -800) ;\n",
+ "x3 = h3 *(910 -800) ;\n",
+ "T = 900 + (910 -900) *(1306 - x2)/(x3 -x2); #Interpolation\n",
+ "\n",
+ "#result\n",
+ "print\"Trial 1\";\n",
+ "print\"Let Ta =10000 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x,4),\"W/m^2, which is much larger than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 2\";\n",
+ "print\"Let Ta = 900 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x2,4),\"W/m^2, which is a little less than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 3\";\n",
+ "print\"Let Ta = 910 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x3,4),\"W/m^2 \\nThis value is little more than the required value of 1306 W/m^2\";\n",
+ "print\"\\nThe correct value of Ta obtained by interpolation is\",round(T,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial 1\n",
+ "Let Ta =10000 C\n",
+ "Value of h(Ta-800) = 2722.8585 W/m^2, which is much larger than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 2\n",
+ "Let Ta = 900 C\n",
+ "Value of h(Ta-800) = 1215.0 W/m^2, which is a little less than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 3\n",
+ "Let Ta = 910 C\n",
+ "Value of h(Ta-800) = 1356.3 W/m^2 \n",
+ "This value is little more than the required value of 1306 W/m^2\n",
+ "\n",
+ "The correct value of Ta obtained by interpolation is 906.4402 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page no:269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tp = 75 ; #Temperature of absorber plate , degree C\n",
+ "Tc = 55 ; #Temperature of glass cover , degree C\n",
+ "L = 0.025 ; #m\n",
+ "H = 2 ; #m\n",
+ "Y = 70 ; #degree\n",
+ "k = 0.0294 ; #W/m K\n",
+ "Pr = 0.695 ;\n",
+ "\n",
+ "#calculations\n",
+ "a = 19/180*3.14 ; #Radians\n",
+ "r = H/L ;\n",
+ "Tavg = ( Tp +Tc) /2+273 ; #K\n",
+ "v = 19.50*10**-6 ; #m^2/s\n",
+ "Ra = 9.81*(1/ Tavg )*( Tp -Tc)*(L**3) /(v**2) *Pr*math.cos(a);\n",
+ "Nu = 0.229*( Ra)**0.252;\n",
+ "h = Nu*k/L ; #W/m^2 K\n",
+ "Rate = h *2*1*( Tp -Tc); #W\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate = 122.8843 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page no:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tair = 30 ;\n",
+ "D = 0.04 ;\n",
+ "Ts = 70 ;\n",
+ "V = 0.3 ;\n",
+ "Pr = 0.698 ;\n",
+ "k = 0.0283 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Ts )/2 ;\n",
+ "v = 17.95*10**-6 ;\n",
+ "Gr = 9.81*1/323*( Ts - Tair )*(D**3) /v**2;\n",
+ "Re = V*D/v ;\n",
+ "X = Gr/Re**2 ;\n",
+ "Nuforced = 0.3 + 0.62*( Re**0.5) *( Pr**(1/3) ) /((1+(0.4/Pr)**(2/3) )**(1/4))*(1+( Re /282000)**(5/8))**(4/5) ;\n",
+ "Nu = Nuforced *(1+6.275*( X)**(7/4))**(1/7) ;\n",
+ "h = Nu *(k/D);\n",
+ "\n",
+ "#result\n",
+ "print\"Since Gr/Re^2 =\",round(X,4),\"is > 0.2, we have a combined convection situation.\";\n",
+ "print\"The Average heat transfer coefficient =\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since Gr/Re^2 = 0.5399 is > 0.2, we have a combined convection situation.\n",
+ "The Average heat transfer coefficient = 10.8276 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_2.ipynb new file mode 100755 index 00000000..8e90d8f1 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_2.ipynb @@ -0,0 +1,344 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaada7e9a1621c5448fcc2c4bafb69518918476f74efee2f04521ed97f085e1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Heat Transfer by Natural convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page no:258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H = 0.5 ; #m\n",
+ "Th = 100; #degree C\n",
+ "Tl = 40; #degree C\n",
+ "Pr = 0.694;\n",
+ "k = 0.0297; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 20.02*10**-6 ; #m/s\n",
+ "T = (Th+ Tl )/2 + 273 ; #K\n",
+ "B = 1/T;\n",
+ "Gr = 9.81* B *(( Th - Tl )*H**3) /(v**2) ;\n",
+ "Ra = Gr*Pr;\n",
+ "Nua = 0.64*( Gr**(1/4) )*( Pr**0.5) *((0.861+ Pr)**( -1/4) ); #Exact analysis\n",
+ "Nub = 0.68*( Gr**(1/4) )*( Pr**0.5) *((0.952+ Pr)**( -1/4) ); #Integral method\n",
+ "Nuc = 0.59*( Ra)**(1/4) ; #McAdams correlation\n",
+ "Nud = 0.68 + 0.670*( Ra**(1/4) ) /(1+(0.492/ Pr)**(9/16))**(4/9) ; #Churchill and Chu correlation\n",
+ "\n",
+ "#result\n",
+ "print\"Mean film temperature =\",round(T,4),\"K\";\n",
+ "print\" ( a ) \";\n",
+ "print\"Exact analysis\";\n",
+ "print\"NuL =\",round(Nua,4);\n",
+ "print\"\\n ( b ) \";\n",
+ "print\"Integral method\";\n",
+ "print\"NuL =\",round(Nub,4);\n",
+ "print\"\\n ( c ) \";\n",
+ "print\"McAdams correlation\";\n",
+ "print\"NuL =\",round(Nuc,4);\n",
+ "print\"\\n ( d ) \";\n",
+ "print\"Churchill and Chu correlation\";\n",
+ "print\"NuL =\",round(Nud,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean film temperature = 343.0 K\n",
+ " ( a ) \n",
+ "Exact analysis\n",
+ "NuL = 72.6196\n",
+ "\n",
+ " ( b ) \n",
+ "Integral method\n",
+ "NuL = 76.0691\n",
+ "\n",
+ " ( c ) \n",
+ "McAdams correlation\n",
+ "NuL = 81.9066\n",
+ "\n",
+ " ( d ) \n",
+ "Churchill and Chu correlation\n",
+ "NuL = 71.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0.2 ; #m\n",
+ "d = 0.005 ; #m\n",
+ "rho = 7900 ; #kg/m^3\n",
+ "Cp = 460 ; #J/kg K\n",
+ "Tair = 20 ; #C\n",
+ "Tavg = 380 ; #C\n",
+ "Pr = 0.680 ;\n",
+ "k = 0.0393 ; #W/m K\n",
+ "h2 = 7.348 ; #W/m^2 K\n",
+ "h3 = 6.780; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tavg + Tair )/2 ; #C\n",
+ "v = 34.85*10**-6 ; #m^2/s\n",
+ "Re = 9.81*1/(273+ Tm)*( Tavg - Tair )*(s**3) /(v**2) *Pr;\n",
+ "Nu = 0.68 + 0.670*( Re**(1/4) ) /(1+(0.492/ Pr)**(4/9))**(4/9) ;\n",
+ "h = Nu*k/s; #W/m^2 K\n",
+ "t1 = rho*s*s*d*Cp /(( s**2) *2*h)* math.log ((430 - Tair )/(330 -Tair )); #s\n",
+ "t2 = rho*s*s*d*Cp /(( s**2) *2* h2)* math.log ((330 - Tair )/(230 -Tair )); #s\n",
+ "t3 = rho*s*s*d*Cp /(( s**2) *2* h3)* math.log ((230 - Tair )/(130 -Tair )); #s\n",
+ "time = t1+t2+t3; #Total time\n",
+ "minute = time /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time required for the plate to cool from 430 C to 330 C is\",round(t1,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 330 C to 230 C is\",round(t2,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 230 C to 130 C is\",round(t3,4),\"s\";\n",
+ "print\"Hence, time required for the plate to cool from 430 C to 130 C\";\n",
+ "print\" =\",round(time,4),\"s\";\n",
+ "print\" =\",round(minute,4),\"min\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the plate to cool from 430 C to 330 C is 328.9673 s\n",
+ "Time required for the plate to cool from 330 C to 230 C is 481.5307 s\n",
+ "Time required for the plate to cool from 230 C to 130 C is 866.4613 s\n",
+ "Hence, time required for the plate to cool from 430 C to 130 C\n",
+ " = 1676.9593 s\n",
+ " = 27.9493 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page no:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.006 ; #m\n",
+ "e = 0.1 ;\n",
+ "Ti = 800 ; #C\n",
+ "Ta = 1000 ; #C\n",
+ "k = 0.0763 ; #W/m K\n",
+ "Pr = 0.717 ;\n",
+ "Ra2 = 6.42 ;\n",
+ "Nu2 = 0.9841 ;\n",
+ "h2 = 12.15 ;\n",
+ "Ra3 = 6.93 ;\n",
+ "Nu3 = 0.9963 ;\n",
+ "h3 = 12.33 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ta+Ti) /2;\n",
+ "v = 155.1*10**-6 ; #m^2/s\n",
+ "Gr = 9.81*1/1173*(200* D**3) /(v**2) ;\n",
+ "Ra = Gr*Pr ;\n",
+ "Nu = 0.36 + 0.518*( Ra**(1/4) ) /(1+(0.559/ Pr)**(9/16))**(4/9) ;\n",
+ "h = Nu*k/D;\n",
+ "x = h*(Ta -Ti); #W/m^2\n",
+ "x2 = h2 *(900 -800) ;\n",
+ "x3 = h3 *(910 -800) ;\n",
+ "T = 900 + (910 -900) *(1306 - x2)/(x3 -x2); #Interpolation\n",
+ "\n",
+ "#result\n",
+ "print\"Trial 1\";\n",
+ "print\"Let Ta =10000 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x,4),\"W/m^2, which is much larger than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 2\";\n",
+ "print\"Let Ta = 900 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x2,4),\"W/m^2, which is a little less than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 3\";\n",
+ "print\"Let Ta = 910 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x3,4),\"W/m^2 \\nThis value is little more than the required value of 1306 W/m^2\";\n",
+ "print\"\\nThe correct value of Ta obtained by interpolation is\",round(T,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial 1\n",
+ "Let Ta =10000 C\n",
+ "Value of h(Ta-800) = 2722.8585 W/m^2, which is much larger than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 2\n",
+ "Let Ta = 900 C\n",
+ "Value of h(Ta-800) = 1215.0 W/m^2, which is a little less than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 3\n",
+ "Let Ta = 910 C\n",
+ "Value of h(Ta-800) = 1356.3 W/m^2 \n",
+ "This value is little more than the required value of 1306 W/m^2\n",
+ "\n",
+ "The correct value of Ta obtained by interpolation is 906.4402 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page no:269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tp = 75 ; #Temperature of absorber plate , degree C\n",
+ "Tc = 55 ; #Temperature of glass cover , degree C\n",
+ "L = 0.025 ; #m\n",
+ "H = 2 ; #m\n",
+ "Y = 70 ; #degree\n",
+ "k = 0.0294 ; #W/m K\n",
+ "Pr = 0.695 ;\n",
+ "\n",
+ "#calculations\n",
+ "a = 19/180*3.14 ; #Radians\n",
+ "r = H/L ;\n",
+ "Tavg = ( Tp +Tc) /2+273 ; #K\n",
+ "v = 19.50*10**-6 ; #m^2/s\n",
+ "Ra = 9.81*(1/ Tavg )*( Tp -Tc)*(L**3) /(v**2) *Pr*math.cos(a);\n",
+ "Nu = 0.229*( Ra)**0.252;\n",
+ "h = Nu*k/L ; #W/m^2 K\n",
+ "Rate = h *2*1*( Tp -Tc); #W\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate = 122.8843 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page no:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tair = 30 ;\n",
+ "D = 0.04 ;\n",
+ "Ts = 70 ;\n",
+ "V = 0.3 ;\n",
+ "Pr = 0.698 ;\n",
+ "k = 0.0283 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Ts )/2 ;\n",
+ "v = 17.95*10**-6 ;\n",
+ "Gr = 9.81*1/323*( Ts - Tair )*(D**3) /v**2;\n",
+ "Re = V*D/v ;\n",
+ "X = Gr/Re**2 ;\n",
+ "Nuforced = 0.3 + 0.62*( Re**0.5) *( Pr**(1/3) ) /((1+(0.4/Pr)**(2/3) )**(1/4))*(1+( Re /282000)**(5/8))**(4/5) ;\n",
+ "Nu = Nuforced *(1+6.275*( X)**(7/4))**(1/7) ;\n",
+ "h = Nu *(k/D);\n",
+ "\n",
+ "#result\n",
+ "print\"Since Gr/Re^2 =\",round(X,4),\"is > 0.2, we have a combined convection situation.\";\n",
+ "print\"The Average heat transfer coefficient =\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since Gr/Re^2 = 0.5399 is > 0.2, we have a combined convection situation.\n",
+ "The Average heat transfer coefficient = 10.8276 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_3.ipynb new file mode 100755 index 00000000..8e90d8f1 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_3.ipynb @@ -0,0 +1,344 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaada7e9a1621c5448fcc2c4bafb69518918476f74efee2f04521ed97f085e1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Heat Transfer by Natural convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page no:258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H = 0.5 ; #m\n",
+ "Th = 100; #degree C\n",
+ "Tl = 40; #degree C\n",
+ "Pr = 0.694;\n",
+ "k = 0.0297; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 20.02*10**-6 ; #m/s\n",
+ "T = (Th+ Tl )/2 + 273 ; #K\n",
+ "B = 1/T;\n",
+ "Gr = 9.81* B *(( Th - Tl )*H**3) /(v**2) ;\n",
+ "Ra = Gr*Pr;\n",
+ "Nua = 0.64*( Gr**(1/4) )*( Pr**0.5) *((0.861+ Pr)**( -1/4) ); #Exact analysis\n",
+ "Nub = 0.68*( Gr**(1/4) )*( Pr**0.5) *((0.952+ Pr)**( -1/4) ); #Integral method\n",
+ "Nuc = 0.59*( Ra)**(1/4) ; #McAdams correlation\n",
+ "Nud = 0.68 + 0.670*( Ra**(1/4) ) /(1+(0.492/ Pr)**(9/16))**(4/9) ; #Churchill and Chu correlation\n",
+ "\n",
+ "#result\n",
+ "print\"Mean film temperature =\",round(T,4),\"K\";\n",
+ "print\" ( a ) \";\n",
+ "print\"Exact analysis\";\n",
+ "print\"NuL =\",round(Nua,4);\n",
+ "print\"\\n ( b ) \";\n",
+ "print\"Integral method\";\n",
+ "print\"NuL =\",round(Nub,4);\n",
+ "print\"\\n ( c ) \";\n",
+ "print\"McAdams correlation\";\n",
+ "print\"NuL =\",round(Nuc,4);\n",
+ "print\"\\n ( d ) \";\n",
+ "print\"Churchill and Chu correlation\";\n",
+ "print\"NuL =\",round(Nud,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean film temperature = 343.0 K\n",
+ " ( a ) \n",
+ "Exact analysis\n",
+ "NuL = 72.6196\n",
+ "\n",
+ " ( b ) \n",
+ "Integral method\n",
+ "NuL = 76.0691\n",
+ "\n",
+ " ( c ) \n",
+ "McAdams correlation\n",
+ "NuL = 81.9066\n",
+ "\n",
+ " ( d ) \n",
+ "Churchill and Chu correlation\n",
+ "NuL = 71.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0.2 ; #m\n",
+ "d = 0.005 ; #m\n",
+ "rho = 7900 ; #kg/m^3\n",
+ "Cp = 460 ; #J/kg K\n",
+ "Tair = 20 ; #C\n",
+ "Tavg = 380 ; #C\n",
+ "Pr = 0.680 ;\n",
+ "k = 0.0393 ; #W/m K\n",
+ "h2 = 7.348 ; #W/m^2 K\n",
+ "h3 = 6.780; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tavg + Tair )/2 ; #C\n",
+ "v = 34.85*10**-6 ; #m^2/s\n",
+ "Re = 9.81*1/(273+ Tm)*( Tavg - Tair )*(s**3) /(v**2) *Pr;\n",
+ "Nu = 0.68 + 0.670*( Re**(1/4) ) /(1+(0.492/ Pr)**(4/9))**(4/9) ;\n",
+ "h = Nu*k/s; #W/m^2 K\n",
+ "t1 = rho*s*s*d*Cp /(( s**2) *2*h)* math.log ((430 - Tair )/(330 -Tair )); #s\n",
+ "t2 = rho*s*s*d*Cp /(( s**2) *2* h2)* math.log ((330 - Tair )/(230 -Tair )); #s\n",
+ "t3 = rho*s*s*d*Cp /(( s**2) *2* h3)* math.log ((230 - Tair )/(130 -Tair )); #s\n",
+ "time = t1+t2+t3; #Total time\n",
+ "minute = time /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time required for the plate to cool from 430 C to 330 C is\",round(t1,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 330 C to 230 C is\",round(t2,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 230 C to 130 C is\",round(t3,4),\"s\";\n",
+ "print\"Hence, time required for the plate to cool from 430 C to 130 C\";\n",
+ "print\" =\",round(time,4),\"s\";\n",
+ "print\" =\",round(minute,4),\"min\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the plate to cool from 430 C to 330 C is 328.9673 s\n",
+ "Time required for the plate to cool from 330 C to 230 C is 481.5307 s\n",
+ "Time required for the plate to cool from 230 C to 130 C is 866.4613 s\n",
+ "Hence, time required for the plate to cool from 430 C to 130 C\n",
+ " = 1676.9593 s\n",
+ " = 27.9493 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page no:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.006 ; #m\n",
+ "e = 0.1 ;\n",
+ "Ti = 800 ; #C\n",
+ "Ta = 1000 ; #C\n",
+ "k = 0.0763 ; #W/m K\n",
+ "Pr = 0.717 ;\n",
+ "Ra2 = 6.42 ;\n",
+ "Nu2 = 0.9841 ;\n",
+ "h2 = 12.15 ;\n",
+ "Ra3 = 6.93 ;\n",
+ "Nu3 = 0.9963 ;\n",
+ "h3 = 12.33 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ta+Ti) /2;\n",
+ "v = 155.1*10**-6 ; #m^2/s\n",
+ "Gr = 9.81*1/1173*(200* D**3) /(v**2) ;\n",
+ "Ra = Gr*Pr ;\n",
+ "Nu = 0.36 + 0.518*( Ra**(1/4) ) /(1+(0.559/ Pr)**(9/16))**(4/9) ;\n",
+ "h = Nu*k/D;\n",
+ "x = h*(Ta -Ti); #W/m^2\n",
+ "x2 = h2 *(900 -800) ;\n",
+ "x3 = h3 *(910 -800) ;\n",
+ "T = 900 + (910 -900) *(1306 - x2)/(x3 -x2); #Interpolation\n",
+ "\n",
+ "#result\n",
+ "print\"Trial 1\";\n",
+ "print\"Let Ta =10000 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x,4),\"W/m^2, which is much larger than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 2\";\n",
+ "print\"Let Ta = 900 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x2,4),\"W/m^2, which is a little less than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 3\";\n",
+ "print\"Let Ta = 910 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x3,4),\"W/m^2 \\nThis value is little more than the required value of 1306 W/m^2\";\n",
+ "print\"\\nThe correct value of Ta obtained by interpolation is\",round(T,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial 1\n",
+ "Let Ta =10000 C\n",
+ "Value of h(Ta-800) = 2722.8585 W/m^2, which is much larger than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 2\n",
+ "Let Ta = 900 C\n",
+ "Value of h(Ta-800) = 1215.0 W/m^2, which is a little less than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 3\n",
+ "Let Ta = 910 C\n",
+ "Value of h(Ta-800) = 1356.3 W/m^2 \n",
+ "This value is little more than the required value of 1306 W/m^2\n",
+ "\n",
+ "The correct value of Ta obtained by interpolation is 906.4402 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page no:269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tp = 75 ; #Temperature of absorber plate , degree C\n",
+ "Tc = 55 ; #Temperature of glass cover , degree C\n",
+ "L = 0.025 ; #m\n",
+ "H = 2 ; #m\n",
+ "Y = 70 ; #degree\n",
+ "k = 0.0294 ; #W/m K\n",
+ "Pr = 0.695 ;\n",
+ "\n",
+ "#calculations\n",
+ "a = 19/180*3.14 ; #Radians\n",
+ "r = H/L ;\n",
+ "Tavg = ( Tp +Tc) /2+273 ; #K\n",
+ "v = 19.50*10**-6 ; #m^2/s\n",
+ "Ra = 9.81*(1/ Tavg )*( Tp -Tc)*(L**3) /(v**2) *Pr*math.cos(a);\n",
+ "Nu = 0.229*( Ra)**0.252;\n",
+ "h = Nu*k/L ; #W/m^2 K\n",
+ "Rate = h *2*1*( Tp -Tc); #W\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate = 122.8843 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page no:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tair = 30 ;\n",
+ "D = 0.04 ;\n",
+ "Ts = 70 ;\n",
+ "V = 0.3 ;\n",
+ "Pr = 0.698 ;\n",
+ "k = 0.0283 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Ts )/2 ;\n",
+ "v = 17.95*10**-6 ;\n",
+ "Gr = 9.81*1/323*( Ts - Tair )*(D**3) /v**2;\n",
+ "Re = V*D/v ;\n",
+ "X = Gr/Re**2 ;\n",
+ "Nuforced = 0.3 + 0.62*( Re**0.5) *( Pr**(1/3) ) /((1+(0.4/Pr)**(2/3) )**(1/4))*(1+( Re /282000)**(5/8))**(4/5) ;\n",
+ "Nu = Nuforced *(1+6.275*( X)**(7/4))**(1/7) ;\n",
+ "h = Nu *(k/D);\n",
+ "\n",
+ "#result\n",
+ "print\"Since Gr/Re^2 =\",round(X,4),\"is > 0.2, we have a combined convection situation.\";\n",
+ "print\"The Average heat transfer coefficient =\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since Gr/Re^2 = 0.5399 is > 0.2, we have a combined convection situation.\n",
+ "The Average heat transfer coefficient = 10.8276 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_4.ipynb new file mode 100755 index 00000000..8e90d8f1 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_4.ipynb @@ -0,0 +1,344 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaada7e9a1621c5448fcc2c4bafb69518918476f74efee2f04521ed97f085e1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Heat Transfer by Natural convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page no:258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H = 0.5 ; #m\n",
+ "Th = 100; #degree C\n",
+ "Tl = 40; #degree C\n",
+ "Pr = 0.694;\n",
+ "k = 0.0297; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 20.02*10**-6 ; #m/s\n",
+ "T = (Th+ Tl )/2 + 273 ; #K\n",
+ "B = 1/T;\n",
+ "Gr = 9.81* B *(( Th - Tl )*H**3) /(v**2) ;\n",
+ "Ra = Gr*Pr;\n",
+ "Nua = 0.64*( Gr**(1/4) )*( Pr**0.5) *((0.861+ Pr)**( -1/4) ); #Exact analysis\n",
+ "Nub = 0.68*( Gr**(1/4) )*( Pr**0.5) *((0.952+ Pr)**( -1/4) ); #Integral method\n",
+ "Nuc = 0.59*( Ra)**(1/4) ; #McAdams correlation\n",
+ "Nud = 0.68 + 0.670*( Ra**(1/4) ) /(1+(0.492/ Pr)**(9/16))**(4/9) ; #Churchill and Chu correlation\n",
+ "\n",
+ "#result\n",
+ "print\"Mean film temperature =\",round(T,4),\"K\";\n",
+ "print\" ( a ) \";\n",
+ "print\"Exact analysis\";\n",
+ "print\"NuL =\",round(Nua,4);\n",
+ "print\"\\n ( b ) \";\n",
+ "print\"Integral method\";\n",
+ "print\"NuL =\",round(Nub,4);\n",
+ "print\"\\n ( c ) \";\n",
+ "print\"McAdams correlation\";\n",
+ "print\"NuL =\",round(Nuc,4);\n",
+ "print\"\\n ( d ) \";\n",
+ "print\"Churchill and Chu correlation\";\n",
+ "print\"NuL =\",round(Nud,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean film temperature = 343.0 K\n",
+ " ( a ) \n",
+ "Exact analysis\n",
+ "NuL = 72.6196\n",
+ "\n",
+ " ( b ) \n",
+ "Integral method\n",
+ "NuL = 76.0691\n",
+ "\n",
+ " ( c ) \n",
+ "McAdams correlation\n",
+ "NuL = 81.9066\n",
+ "\n",
+ " ( d ) \n",
+ "Churchill and Chu correlation\n",
+ "NuL = 71.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0.2 ; #m\n",
+ "d = 0.005 ; #m\n",
+ "rho = 7900 ; #kg/m^3\n",
+ "Cp = 460 ; #J/kg K\n",
+ "Tair = 20 ; #C\n",
+ "Tavg = 380 ; #C\n",
+ "Pr = 0.680 ;\n",
+ "k = 0.0393 ; #W/m K\n",
+ "h2 = 7.348 ; #W/m^2 K\n",
+ "h3 = 6.780; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tavg + Tair )/2 ; #C\n",
+ "v = 34.85*10**-6 ; #m^2/s\n",
+ "Re = 9.81*1/(273+ Tm)*( Tavg - Tair )*(s**3) /(v**2) *Pr;\n",
+ "Nu = 0.68 + 0.670*( Re**(1/4) ) /(1+(0.492/ Pr)**(4/9))**(4/9) ;\n",
+ "h = Nu*k/s; #W/m^2 K\n",
+ "t1 = rho*s*s*d*Cp /(( s**2) *2*h)* math.log ((430 - Tair )/(330 -Tair )); #s\n",
+ "t2 = rho*s*s*d*Cp /(( s**2) *2* h2)* math.log ((330 - Tair )/(230 -Tair )); #s\n",
+ "t3 = rho*s*s*d*Cp /(( s**2) *2* h3)* math.log ((230 - Tair )/(130 -Tair )); #s\n",
+ "time = t1+t2+t3; #Total time\n",
+ "minute = time /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time required for the plate to cool from 430 C to 330 C is\",round(t1,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 330 C to 230 C is\",round(t2,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 230 C to 130 C is\",round(t3,4),\"s\";\n",
+ "print\"Hence, time required for the plate to cool from 430 C to 130 C\";\n",
+ "print\" =\",round(time,4),\"s\";\n",
+ "print\" =\",round(minute,4),\"min\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the plate to cool from 430 C to 330 C is 328.9673 s\n",
+ "Time required for the plate to cool from 330 C to 230 C is 481.5307 s\n",
+ "Time required for the plate to cool from 230 C to 130 C is 866.4613 s\n",
+ "Hence, time required for the plate to cool from 430 C to 130 C\n",
+ " = 1676.9593 s\n",
+ " = 27.9493 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page no:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.006 ; #m\n",
+ "e = 0.1 ;\n",
+ "Ti = 800 ; #C\n",
+ "Ta = 1000 ; #C\n",
+ "k = 0.0763 ; #W/m K\n",
+ "Pr = 0.717 ;\n",
+ "Ra2 = 6.42 ;\n",
+ "Nu2 = 0.9841 ;\n",
+ "h2 = 12.15 ;\n",
+ "Ra3 = 6.93 ;\n",
+ "Nu3 = 0.9963 ;\n",
+ "h3 = 12.33 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ta+Ti) /2;\n",
+ "v = 155.1*10**-6 ; #m^2/s\n",
+ "Gr = 9.81*1/1173*(200* D**3) /(v**2) ;\n",
+ "Ra = Gr*Pr ;\n",
+ "Nu = 0.36 + 0.518*( Ra**(1/4) ) /(1+(0.559/ Pr)**(9/16))**(4/9) ;\n",
+ "h = Nu*k/D;\n",
+ "x = h*(Ta -Ti); #W/m^2\n",
+ "x2 = h2 *(900 -800) ;\n",
+ "x3 = h3 *(910 -800) ;\n",
+ "T = 900 + (910 -900) *(1306 - x2)/(x3 -x2); #Interpolation\n",
+ "\n",
+ "#result\n",
+ "print\"Trial 1\";\n",
+ "print\"Let Ta =10000 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x,4),\"W/m^2, which is much larger than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 2\";\n",
+ "print\"Let Ta = 900 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x2,4),\"W/m^2, which is a little less than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 3\";\n",
+ "print\"Let Ta = 910 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x3,4),\"W/m^2 \\nThis value is little more than the required value of 1306 W/m^2\";\n",
+ "print\"\\nThe correct value of Ta obtained by interpolation is\",round(T,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial 1\n",
+ "Let Ta =10000 C\n",
+ "Value of h(Ta-800) = 2722.8585 W/m^2, which is much larger than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 2\n",
+ "Let Ta = 900 C\n",
+ "Value of h(Ta-800) = 1215.0 W/m^2, which is a little less than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 3\n",
+ "Let Ta = 910 C\n",
+ "Value of h(Ta-800) = 1356.3 W/m^2 \n",
+ "This value is little more than the required value of 1306 W/m^2\n",
+ "\n",
+ "The correct value of Ta obtained by interpolation is 906.4402 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page no:269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tp = 75 ; #Temperature of absorber plate , degree C\n",
+ "Tc = 55 ; #Temperature of glass cover , degree C\n",
+ "L = 0.025 ; #m\n",
+ "H = 2 ; #m\n",
+ "Y = 70 ; #degree\n",
+ "k = 0.0294 ; #W/m K\n",
+ "Pr = 0.695 ;\n",
+ "\n",
+ "#calculations\n",
+ "a = 19/180*3.14 ; #Radians\n",
+ "r = H/L ;\n",
+ "Tavg = ( Tp +Tc) /2+273 ; #K\n",
+ "v = 19.50*10**-6 ; #m^2/s\n",
+ "Ra = 9.81*(1/ Tavg )*( Tp -Tc)*(L**3) /(v**2) *Pr*math.cos(a);\n",
+ "Nu = 0.229*( Ra)**0.252;\n",
+ "h = Nu*k/L ; #W/m^2 K\n",
+ "Rate = h *2*1*( Tp -Tc); #W\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate = 122.8843 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page no:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tair = 30 ;\n",
+ "D = 0.04 ;\n",
+ "Ts = 70 ;\n",
+ "V = 0.3 ;\n",
+ "Pr = 0.698 ;\n",
+ "k = 0.0283 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Ts )/2 ;\n",
+ "v = 17.95*10**-6 ;\n",
+ "Gr = 9.81*1/323*( Ts - Tair )*(D**3) /v**2;\n",
+ "Re = V*D/v ;\n",
+ "X = Gr/Re**2 ;\n",
+ "Nuforced = 0.3 + 0.62*( Re**0.5) *( Pr**(1/3) ) /((1+(0.4/Pr)**(2/3) )**(1/4))*(1+( Re /282000)**(5/8))**(4/5) ;\n",
+ "Nu = Nuforced *(1+6.275*( X)**(7/4))**(1/7) ;\n",
+ "h = Nu *(k/D);\n",
+ "\n",
+ "#result\n",
+ "print\"Since Gr/Re^2 =\",round(X,4),\"is > 0.2, we have a combined convection situation.\";\n",
+ "print\"The Average heat transfer coefficient =\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since Gr/Re^2 = 0.5399 is > 0.2, we have a combined convection situation.\n",
+ "The Average heat transfer coefficient = 10.8276 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_5.ipynb new file mode 100755 index 00000000..8e90d8f1 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_5.ipynb @@ -0,0 +1,344 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaada7e9a1621c5448fcc2c4bafb69518918476f74efee2f04521ed97f085e1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Heat Transfer by Natural convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page no:258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H = 0.5 ; #m\n",
+ "Th = 100; #degree C\n",
+ "Tl = 40; #degree C\n",
+ "Pr = 0.694;\n",
+ "k = 0.0297; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 20.02*10**-6 ; #m/s\n",
+ "T = (Th+ Tl )/2 + 273 ; #K\n",
+ "B = 1/T;\n",
+ "Gr = 9.81* B *(( Th - Tl )*H**3) /(v**2) ;\n",
+ "Ra = Gr*Pr;\n",
+ "Nua = 0.64*( Gr**(1/4) )*( Pr**0.5) *((0.861+ Pr)**( -1/4) ); #Exact analysis\n",
+ "Nub = 0.68*( Gr**(1/4) )*( Pr**0.5) *((0.952+ Pr)**( -1/4) ); #Integral method\n",
+ "Nuc = 0.59*( Ra)**(1/4) ; #McAdams correlation\n",
+ "Nud = 0.68 + 0.670*( Ra**(1/4) ) /(1+(0.492/ Pr)**(9/16))**(4/9) ; #Churchill and Chu correlation\n",
+ "\n",
+ "#result\n",
+ "print\"Mean film temperature =\",round(T,4),\"K\";\n",
+ "print\" ( a ) \";\n",
+ "print\"Exact analysis\";\n",
+ "print\"NuL =\",round(Nua,4);\n",
+ "print\"\\n ( b ) \";\n",
+ "print\"Integral method\";\n",
+ "print\"NuL =\",round(Nub,4);\n",
+ "print\"\\n ( c ) \";\n",
+ "print\"McAdams correlation\";\n",
+ "print\"NuL =\",round(Nuc,4);\n",
+ "print\"\\n ( d ) \";\n",
+ "print\"Churchill and Chu correlation\";\n",
+ "print\"NuL =\",round(Nud,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean film temperature = 343.0 K\n",
+ " ( a ) \n",
+ "Exact analysis\n",
+ "NuL = 72.6196\n",
+ "\n",
+ " ( b ) \n",
+ "Integral method\n",
+ "NuL = 76.0691\n",
+ "\n",
+ " ( c ) \n",
+ "McAdams correlation\n",
+ "NuL = 81.9066\n",
+ "\n",
+ " ( d ) \n",
+ "Churchill and Chu correlation\n",
+ "NuL = 71.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0.2 ; #m\n",
+ "d = 0.005 ; #m\n",
+ "rho = 7900 ; #kg/m^3\n",
+ "Cp = 460 ; #J/kg K\n",
+ "Tair = 20 ; #C\n",
+ "Tavg = 380 ; #C\n",
+ "Pr = 0.680 ;\n",
+ "k = 0.0393 ; #W/m K\n",
+ "h2 = 7.348 ; #W/m^2 K\n",
+ "h3 = 6.780; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tavg + Tair )/2 ; #C\n",
+ "v = 34.85*10**-6 ; #m^2/s\n",
+ "Re = 9.81*1/(273+ Tm)*( Tavg - Tair )*(s**3) /(v**2) *Pr;\n",
+ "Nu = 0.68 + 0.670*( Re**(1/4) ) /(1+(0.492/ Pr)**(4/9))**(4/9) ;\n",
+ "h = Nu*k/s; #W/m^2 K\n",
+ "t1 = rho*s*s*d*Cp /(( s**2) *2*h)* math.log ((430 - Tair )/(330 -Tair )); #s\n",
+ "t2 = rho*s*s*d*Cp /(( s**2) *2* h2)* math.log ((330 - Tair )/(230 -Tair )); #s\n",
+ "t3 = rho*s*s*d*Cp /(( s**2) *2* h3)* math.log ((230 - Tair )/(130 -Tair )); #s\n",
+ "time = t1+t2+t3; #Total time\n",
+ "minute = time /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time required for the plate to cool from 430 C to 330 C is\",round(t1,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 330 C to 230 C is\",round(t2,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 230 C to 130 C is\",round(t3,4),\"s\";\n",
+ "print\"Hence, time required for the plate to cool from 430 C to 130 C\";\n",
+ "print\" =\",round(time,4),\"s\";\n",
+ "print\" =\",round(minute,4),\"min\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the plate to cool from 430 C to 330 C is 328.9673 s\n",
+ "Time required for the plate to cool from 330 C to 230 C is 481.5307 s\n",
+ "Time required for the plate to cool from 230 C to 130 C is 866.4613 s\n",
+ "Hence, time required for the plate to cool from 430 C to 130 C\n",
+ " = 1676.9593 s\n",
+ " = 27.9493 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page no:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.006 ; #m\n",
+ "e = 0.1 ;\n",
+ "Ti = 800 ; #C\n",
+ "Ta = 1000 ; #C\n",
+ "k = 0.0763 ; #W/m K\n",
+ "Pr = 0.717 ;\n",
+ "Ra2 = 6.42 ;\n",
+ "Nu2 = 0.9841 ;\n",
+ "h2 = 12.15 ;\n",
+ "Ra3 = 6.93 ;\n",
+ "Nu3 = 0.9963 ;\n",
+ "h3 = 12.33 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ta+Ti) /2;\n",
+ "v = 155.1*10**-6 ; #m^2/s\n",
+ "Gr = 9.81*1/1173*(200* D**3) /(v**2) ;\n",
+ "Ra = Gr*Pr ;\n",
+ "Nu = 0.36 + 0.518*( Ra**(1/4) ) /(1+(0.559/ Pr)**(9/16))**(4/9) ;\n",
+ "h = Nu*k/D;\n",
+ "x = h*(Ta -Ti); #W/m^2\n",
+ "x2 = h2 *(900 -800) ;\n",
+ "x3 = h3 *(910 -800) ;\n",
+ "T = 900 + (910 -900) *(1306 - x2)/(x3 -x2); #Interpolation\n",
+ "\n",
+ "#result\n",
+ "print\"Trial 1\";\n",
+ "print\"Let Ta =10000 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x,4),\"W/m^2, which is much larger than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 2\";\n",
+ "print\"Let Ta = 900 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x2,4),\"W/m^2, which is a little less than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 3\";\n",
+ "print\"Let Ta = 910 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x3,4),\"W/m^2 \\nThis value is little more than the required value of 1306 W/m^2\";\n",
+ "print\"\\nThe correct value of Ta obtained by interpolation is\",round(T,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial 1\n",
+ "Let Ta =10000 C\n",
+ "Value of h(Ta-800) = 2722.8585 W/m^2, which is much larger than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 2\n",
+ "Let Ta = 900 C\n",
+ "Value of h(Ta-800) = 1215.0 W/m^2, which is a little less than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 3\n",
+ "Let Ta = 910 C\n",
+ "Value of h(Ta-800) = 1356.3 W/m^2 \n",
+ "This value is little more than the required value of 1306 W/m^2\n",
+ "\n",
+ "The correct value of Ta obtained by interpolation is 906.4402 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page no:269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tp = 75 ; #Temperature of absorber plate , degree C\n",
+ "Tc = 55 ; #Temperature of glass cover , degree C\n",
+ "L = 0.025 ; #m\n",
+ "H = 2 ; #m\n",
+ "Y = 70 ; #degree\n",
+ "k = 0.0294 ; #W/m K\n",
+ "Pr = 0.695 ;\n",
+ "\n",
+ "#calculations\n",
+ "a = 19/180*3.14 ; #Radians\n",
+ "r = H/L ;\n",
+ "Tavg = ( Tp +Tc) /2+273 ; #K\n",
+ "v = 19.50*10**-6 ; #m^2/s\n",
+ "Ra = 9.81*(1/ Tavg )*( Tp -Tc)*(L**3) /(v**2) *Pr*math.cos(a);\n",
+ "Nu = 0.229*( Ra)**0.252;\n",
+ "h = Nu*k/L ; #W/m^2 K\n",
+ "Rate = h *2*1*( Tp -Tc); #W\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate = 122.8843 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page no:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tair = 30 ;\n",
+ "D = 0.04 ;\n",
+ "Ts = 70 ;\n",
+ "V = 0.3 ;\n",
+ "Pr = 0.698 ;\n",
+ "k = 0.0283 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Ts )/2 ;\n",
+ "v = 17.95*10**-6 ;\n",
+ "Gr = 9.81*1/323*( Ts - Tair )*(D**3) /v**2;\n",
+ "Re = V*D/v ;\n",
+ "X = Gr/Re**2 ;\n",
+ "Nuforced = 0.3 + 0.62*( Re**0.5) *( Pr**(1/3) ) /((1+(0.4/Pr)**(2/3) )**(1/4))*(1+( Re /282000)**(5/8))**(4/5) ;\n",
+ "Nu = Nuforced *(1+6.275*( X)**(7/4))**(1/7) ;\n",
+ "h = Nu *(k/D);\n",
+ "\n",
+ "#result\n",
+ "print\"Since Gr/Re^2 =\",round(X,4),\"is > 0.2, we have a combined convection situation.\";\n",
+ "print\"The Average heat transfer coefficient =\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since Gr/Re^2 = 0.5399 is > 0.2, we have a combined convection situation.\n",
+ "The Average heat transfer coefficient = 10.8276 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_6.ipynb new file mode 100755 index 00000000..8e90d8f1 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_6.ipynb @@ -0,0 +1,344 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaada7e9a1621c5448fcc2c4bafb69518918476f74efee2f04521ed97f085e1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Heat Transfer by Natural convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page no:258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H = 0.5 ; #m\n",
+ "Th = 100; #degree C\n",
+ "Tl = 40; #degree C\n",
+ "Pr = 0.694;\n",
+ "k = 0.0297; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 20.02*10**-6 ; #m/s\n",
+ "T = (Th+ Tl )/2 + 273 ; #K\n",
+ "B = 1/T;\n",
+ "Gr = 9.81* B *(( Th - Tl )*H**3) /(v**2) ;\n",
+ "Ra = Gr*Pr;\n",
+ "Nua = 0.64*( Gr**(1/4) )*( Pr**0.5) *((0.861+ Pr)**( -1/4) ); #Exact analysis\n",
+ "Nub = 0.68*( Gr**(1/4) )*( Pr**0.5) *((0.952+ Pr)**( -1/4) ); #Integral method\n",
+ "Nuc = 0.59*( Ra)**(1/4) ; #McAdams correlation\n",
+ "Nud = 0.68 + 0.670*( Ra**(1/4) ) /(1+(0.492/ Pr)**(9/16))**(4/9) ; #Churchill and Chu correlation\n",
+ "\n",
+ "#result\n",
+ "print\"Mean film temperature =\",round(T,4),\"K\";\n",
+ "print\" ( a ) \";\n",
+ "print\"Exact analysis\";\n",
+ "print\"NuL =\",round(Nua,4);\n",
+ "print\"\\n ( b ) \";\n",
+ "print\"Integral method\";\n",
+ "print\"NuL =\",round(Nub,4);\n",
+ "print\"\\n ( c ) \";\n",
+ "print\"McAdams correlation\";\n",
+ "print\"NuL =\",round(Nuc,4);\n",
+ "print\"\\n ( d ) \";\n",
+ "print\"Churchill and Chu correlation\";\n",
+ "print\"NuL =\",round(Nud,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean film temperature = 343.0 K\n",
+ " ( a ) \n",
+ "Exact analysis\n",
+ "NuL = 72.6196\n",
+ "\n",
+ " ( b ) \n",
+ "Integral method\n",
+ "NuL = 76.0691\n",
+ "\n",
+ " ( c ) \n",
+ "McAdams correlation\n",
+ "NuL = 81.9066\n",
+ "\n",
+ " ( d ) \n",
+ "Churchill and Chu correlation\n",
+ "NuL = 71.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0.2 ; #m\n",
+ "d = 0.005 ; #m\n",
+ "rho = 7900 ; #kg/m^3\n",
+ "Cp = 460 ; #J/kg K\n",
+ "Tair = 20 ; #C\n",
+ "Tavg = 380 ; #C\n",
+ "Pr = 0.680 ;\n",
+ "k = 0.0393 ; #W/m K\n",
+ "h2 = 7.348 ; #W/m^2 K\n",
+ "h3 = 6.780; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tavg + Tair )/2 ; #C\n",
+ "v = 34.85*10**-6 ; #m^2/s\n",
+ "Re = 9.81*1/(273+ Tm)*( Tavg - Tair )*(s**3) /(v**2) *Pr;\n",
+ "Nu = 0.68 + 0.670*( Re**(1/4) ) /(1+(0.492/ Pr)**(4/9))**(4/9) ;\n",
+ "h = Nu*k/s; #W/m^2 K\n",
+ "t1 = rho*s*s*d*Cp /(( s**2) *2*h)* math.log ((430 - Tair )/(330 -Tair )); #s\n",
+ "t2 = rho*s*s*d*Cp /(( s**2) *2* h2)* math.log ((330 - Tair )/(230 -Tair )); #s\n",
+ "t3 = rho*s*s*d*Cp /(( s**2) *2* h3)* math.log ((230 - Tair )/(130 -Tair )); #s\n",
+ "time = t1+t2+t3; #Total time\n",
+ "minute = time /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time required for the plate to cool from 430 C to 330 C is\",round(t1,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 330 C to 230 C is\",round(t2,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 230 C to 130 C is\",round(t3,4),\"s\";\n",
+ "print\"Hence, time required for the plate to cool from 430 C to 130 C\";\n",
+ "print\" =\",round(time,4),\"s\";\n",
+ "print\" =\",round(minute,4),\"min\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the plate to cool from 430 C to 330 C is 328.9673 s\n",
+ "Time required for the plate to cool from 330 C to 230 C is 481.5307 s\n",
+ "Time required for the plate to cool from 230 C to 130 C is 866.4613 s\n",
+ "Hence, time required for the plate to cool from 430 C to 130 C\n",
+ " = 1676.9593 s\n",
+ " = 27.9493 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page no:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.006 ; #m\n",
+ "e = 0.1 ;\n",
+ "Ti = 800 ; #C\n",
+ "Ta = 1000 ; #C\n",
+ "k = 0.0763 ; #W/m K\n",
+ "Pr = 0.717 ;\n",
+ "Ra2 = 6.42 ;\n",
+ "Nu2 = 0.9841 ;\n",
+ "h2 = 12.15 ;\n",
+ "Ra3 = 6.93 ;\n",
+ "Nu3 = 0.9963 ;\n",
+ "h3 = 12.33 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ta+Ti) /2;\n",
+ "v = 155.1*10**-6 ; #m^2/s\n",
+ "Gr = 9.81*1/1173*(200* D**3) /(v**2) ;\n",
+ "Ra = Gr*Pr ;\n",
+ "Nu = 0.36 + 0.518*( Ra**(1/4) ) /(1+(0.559/ Pr)**(9/16))**(4/9) ;\n",
+ "h = Nu*k/D;\n",
+ "x = h*(Ta -Ti); #W/m^2\n",
+ "x2 = h2 *(900 -800) ;\n",
+ "x3 = h3 *(910 -800) ;\n",
+ "T = 900 + (910 -900) *(1306 - x2)/(x3 -x2); #Interpolation\n",
+ "\n",
+ "#result\n",
+ "print\"Trial 1\";\n",
+ "print\"Let Ta =10000 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x,4),\"W/m^2, which is much larger than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 2\";\n",
+ "print\"Let Ta = 900 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x2,4),\"W/m^2, which is a little less than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 3\";\n",
+ "print\"Let Ta = 910 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x3,4),\"W/m^2 \\nThis value is little more than the required value of 1306 W/m^2\";\n",
+ "print\"\\nThe correct value of Ta obtained by interpolation is\",round(T,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial 1\n",
+ "Let Ta =10000 C\n",
+ "Value of h(Ta-800) = 2722.8585 W/m^2, which is much larger than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 2\n",
+ "Let Ta = 900 C\n",
+ "Value of h(Ta-800) = 1215.0 W/m^2, which is a little less than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 3\n",
+ "Let Ta = 910 C\n",
+ "Value of h(Ta-800) = 1356.3 W/m^2 \n",
+ "This value is little more than the required value of 1306 W/m^2\n",
+ "\n",
+ "The correct value of Ta obtained by interpolation is 906.4402 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page no:269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tp = 75 ; #Temperature of absorber plate , degree C\n",
+ "Tc = 55 ; #Temperature of glass cover , degree C\n",
+ "L = 0.025 ; #m\n",
+ "H = 2 ; #m\n",
+ "Y = 70 ; #degree\n",
+ "k = 0.0294 ; #W/m K\n",
+ "Pr = 0.695 ;\n",
+ "\n",
+ "#calculations\n",
+ "a = 19/180*3.14 ; #Radians\n",
+ "r = H/L ;\n",
+ "Tavg = ( Tp +Tc) /2+273 ; #K\n",
+ "v = 19.50*10**-6 ; #m^2/s\n",
+ "Ra = 9.81*(1/ Tavg )*( Tp -Tc)*(L**3) /(v**2) *Pr*math.cos(a);\n",
+ "Nu = 0.229*( Ra)**0.252;\n",
+ "h = Nu*k/L ; #W/m^2 K\n",
+ "Rate = h *2*1*( Tp -Tc); #W\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate = 122.8843 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page no:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tair = 30 ;\n",
+ "D = 0.04 ;\n",
+ "Ts = 70 ;\n",
+ "V = 0.3 ;\n",
+ "Pr = 0.698 ;\n",
+ "k = 0.0283 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Ts )/2 ;\n",
+ "v = 17.95*10**-6 ;\n",
+ "Gr = 9.81*1/323*( Ts - Tair )*(D**3) /v**2;\n",
+ "Re = V*D/v ;\n",
+ "X = Gr/Re**2 ;\n",
+ "Nuforced = 0.3 + 0.62*( Re**0.5) *( Pr**(1/3) ) /((1+(0.4/Pr)**(2/3) )**(1/4))*(1+( Re /282000)**(5/8))**(4/5) ;\n",
+ "Nu = Nuforced *(1+6.275*( X)**(7/4))**(1/7) ;\n",
+ "h = Nu *(k/D);\n",
+ "\n",
+ "#result\n",
+ "print\"Since Gr/Re^2 =\",round(X,4),\"is > 0.2, we have a combined convection situation.\";\n",
+ "print\"The Average heat transfer coefficient =\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since Gr/Re^2 = 0.5399 is > 0.2, we have a combined convection situation.\n",
+ "The Average heat transfer coefficient = 10.8276 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_7.ipynb new file mode 100755 index 00000000..8e90d8f1 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_7.ipynb @@ -0,0 +1,344 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaada7e9a1621c5448fcc2c4bafb69518918476f74efee2f04521ed97f085e1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Heat Transfer by Natural convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page no:258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H = 0.5 ; #m\n",
+ "Th = 100; #degree C\n",
+ "Tl = 40; #degree C\n",
+ "Pr = 0.694;\n",
+ "k = 0.0297; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 20.02*10**-6 ; #m/s\n",
+ "T = (Th+ Tl )/2 + 273 ; #K\n",
+ "B = 1/T;\n",
+ "Gr = 9.81* B *(( Th - Tl )*H**3) /(v**2) ;\n",
+ "Ra = Gr*Pr;\n",
+ "Nua = 0.64*( Gr**(1/4) )*( Pr**0.5) *((0.861+ Pr)**( -1/4) ); #Exact analysis\n",
+ "Nub = 0.68*( Gr**(1/4) )*( Pr**0.5) *((0.952+ Pr)**( -1/4) ); #Integral method\n",
+ "Nuc = 0.59*( Ra)**(1/4) ; #McAdams correlation\n",
+ "Nud = 0.68 + 0.670*( Ra**(1/4) ) /(1+(0.492/ Pr)**(9/16))**(4/9) ; #Churchill and Chu correlation\n",
+ "\n",
+ "#result\n",
+ "print\"Mean film temperature =\",round(T,4),\"K\";\n",
+ "print\" ( a ) \";\n",
+ "print\"Exact analysis\";\n",
+ "print\"NuL =\",round(Nua,4);\n",
+ "print\"\\n ( b ) \";\n",
+ "print\"Integral method\";\n",
+ "print\"NuL =\",round(Nub,4);\n",
+ "print\"\\n ( c ) \";\n",
+ "print\"McAdams correlation\";\n",
+ "print\"NuL =\",round(Nuc,4);\n",
+ "print\"\\n ( d ) \";\n",
+ "print\"Churchill and Chu correlation\";\n",
+ "print\"NuL =\",round(Nud,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean film temperature = 343.0 K\n",
+ " ( a ) \n",
+ "Exact analysis\n",
+ "NuL = 72.6196\n",
+ "\n",
+ " ( b ) \n",
+ "Integral method\n",
+ "NuL = 76.0691\n",
+ "\n",
+ " ( c ) \n",
+ "McAdams correlation\n",
+ "NuL = 81.9066\n",
+ "\n",
+ " ( d ) \n",
+ "Churchill and Chu correlation\n",
+ "NuL = 71.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0.2 ; #m\n",
+ "d = 0.005 ; #m\n",
+ "rho = 7900 ; #kg/m^3\n",
+ "Cp = 460 ; #J/kg K\n",
+ "Tair = 20 ; #C\n",
+ "Tavg = 380 ; #C\n",
+ "Pr = 0.680 ;\n",
+ "k = 0.0393 ; #W/m K\n",
+ "h2 = 7.348 ; #W/m^2 K\n",
+ "h3 = 6.780; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tavg + Tair )/2 ; #C\n",
+ "v = 34.85*10**-6 ; #m^2/s\n",
+ "Re = 9.81*1/(273+ Tm)*( Tavg - Tair )*(s**3) /(v**2) *Pr;\n",
+ "Nu = 0.68 + 0.670*( Re**(1/4) ) /(1+(0.492/ Pr)**(4/9))**(4/9) ;\n",
+ "h = Nu*k/s; #W/m^2 K\n",
+ "t1 = rho*s*s*d*Cp /(( s**2) *2*h)* math.log ((430 - Tair )/(330 -Tair )); #s\n",
+ "t2 = rho*s*s*d*Cp /(( s**2) *2* h2)* math.log ((330 - Tair )/(230 -Tair )); #s\n",
+ "t3 = rho*s*s*d*Cp /(( s**2) *2* h3)* math.log ((230 - Tair )/(130 -Tair )); #s\n",
+ "time = t1+t2+t3; #Total time\n",
+ "minute = time /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time required for the plate to cool from 430 C to 330 C is\",round(t1,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 330 C to 230 C is\",round(t2,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 230 C to 130 C is\",round(t3,4),\"s\";\n",
+ "print\"Hence, time required for the plate to cool from 430 C to 130 C\";\n",
+ "print\" =\",round(time,4),\"s\";\n",
+ "print\" =\",round(minute,4),\"min\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the plate to cool from 430 C to 330 C is 328.9673 s\n",
+ "Time required for the plate to cool from 330 C to 230 C is 481.5307 s\n",
+ "Time required for the plate to cool from 230 C to 130 C is 866.4613 s\n",
+ "Hence, time required for the plate to cool from 430 C to 130 C\n",
+ " = 1676.9593 s\n",
+ " = 27.9493 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page no:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.006 ; #m\n",
+ "e = 0.1 ;\n",
+ "Ti = 800 ; #C\n",
+ "Ta = 1000 ; #C\n",
+ "k = 0.0763 ; #W/m K\n",
+ "Pr = 0.717 ;\n",
+ "Ra2 = 6.42 ;\n",
+ "Nu2 = 0.9841 ;\n",
+ "h2 = 12.15 ;\n",
+ "Ra3 = 6.93 ;\n",
+ "Nu3 = 0.9963 ;\n",
+ "h3 = 12.33 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ta+Ti) /2;\n",
+ "v = 155.1*10**-6 ; #m^2/s\n",
+ "Gr = 9.81*1/1173*(200* D**3) /(v**2) ;\n",
+ "Ra = Gr*Pr ;\n",
+ "Nu = 0.36 + 0.518*( Ra**(1/4) ) /(1+(0.559/ Pr)**(9/16))**(4/9) ;\n",
+ "h = Nu*k/D;\n",
+ "x = h*(Ta -Ti); #W/m^2\n",
+ "x2 = h2 *(900 -800) ;\n",
+ "x3 = h3 *(910 -800) ;\n",
+ "T = 900 + (910 -900) *(1306 - x2)/(x3 -x2); #Interpolation\n",
+ "\n",
+ "#result\n",
+ "print\"Trial 1\";\n",
+ "print\"Let Ta =10000 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x,4),\"W/m^2, which is much larger than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 2\";\n",
+ "print\"Let Ta = 900 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x2,4),\"W/m^2, which is a little less than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 3\";\n",
+ "print\"Let Ta = 910 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x3,4),\"W/m^2 \\nThis value is little more than the required value of 1306 W/m^2\";\n",
+ "print\"\\nThe correct value of Ta obtained by interpolation is\",round(T,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial 1\n",
+ "Let Ta =10000 C\n",
+ "Value of h(Ta-800) = 2722.8585 W/m^2, which is much larger than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 2\n",
+ "Let Ta = 900 C\n",
+ "Value of h(Ta-800) = 1215.0 W/m^2, which is a little less than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 3\n",
+ "Let Ta = 910 C\n",
+ "Value of h(Ta-800) = 1356.3 W/m^2 \n",
+ "This value is little more than the required value of 1306 W/m^2\n",
+ "\n",
+ "The correct value of Ta obtained by interpolation is 906.4402 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page no:269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tp = 75 ; #Temperature of absorber plate , degree C\n",
+ "Tc = 55 ; #Temperature of glass cover , degree C\n",
+ "L = 0.025 ; #m\n",
+ "H = 2 ; #m\n",
+ "Y = 70 ; #degree\n",
+ "k = 0.0294 ; #W/m K\n",
+ "Pr = 0.695 ;\n",
+ "\n",
+ "#calculations\n",
+ "a = 19/180*3.14 ; #Radians\n",
+ "r = H/L ;\n",
+ "Tavg = ( Tp +Tc) /2+273 ; #K\n",
+ "v = 19.50*10**-6 ; #m^2/s\n",
+ "Ra = 9.81*(1/ Tavg )*( Tp -Tc)*(L**3) /(v**2) *Pr*math.cos(a);\n",
+ "Nu = 0.229*( Ra)**0.252;\n",
+ "h = Nu*k/L ; #W/m^2 K\n",
+ "Rate = h *2*1*( Tp -Tc); #W\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate = 122.8843 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page no:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tair = 30 ;\n",
+ "D = 0.04 ;\n",
+ "Ts = 70 ;\n",
+ "V = 0.3 ;\n",
+ "Pr = 0.698 ;\n",
+ "k = 0.0283 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Ts )/2 ;\n",
+ "v = 17.95*10**-6 ;\n",
+ "Gr = 9.81*1/323*( Ts - Tair )*(D**3) /v**2;\n",
+ "Re = V*D/v ;\n",
+ "X = Gr/Re**2 ;\n",
+ "Nuforced = 0.3 + 0.62*( Re**0.5) *( Pr**(1/3) ) /((1+(0.4/Pr)**(2/3) )**(1/4))*(1+( Re /282000)**(5/8))**(4/5) ;\n",
+ "Nu = Nuforced *(1+6.275*( X)**(7/4))**(1/7) ;\n",
+ "h = Nu *(k/D);\n",
+ "\n",
+ "#result\n",
+ "print\"Since Gr/Re^2 =\",round(X,4),\"is > 0.2, we have a combined convection situation.\";\n",
+ "print\"The Average heat transfer coefficient =\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since Gr/Re^2 = 0.5399 is > 0.2, we have a combined convection situation.\n",
+ "The Average heat transfer coefficient = 10.8276 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_8.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_8.ipynb new file mode 100755 index 00000000..8e90d8f1 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_6_Heat_Transfer_by_Natural_convection_8.ipynb @@ -0,0 +1,344 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaada7e9a1621c5448fcc2c4bafb69518918476f74efee2f04521ed97f085e1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Heat Transfer by Natural convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page no:258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H = 0.5 ; #m\n",
+ "Th = 100; #degree C\n",
+ "Tl = 40; #degree C\n",
+ "Pr = 0.694;\n",
+ "k = 0.0297; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "v = 20.02*10**-6 ; #m/s\n",
+ "T = (Th+ Tl )/2 + 273 ; #K\n",
+ "B = 1/T;\n",
+ "Gr = 9.81* B *(( Th - Tl )*H**3) /(v**2) ;\n",
+ "Ra = Gr*Pr;\n",
+ "Nua = 0.64*( Gr**(1/4) )*( Pr**0.5) *((0.861+ Pr)**( -1/4) ); #Exact analysis\n",
+ "Nub = 0.68*( Gr**(1/4) )*( Pr**0.5) *((0.952+ Pr)**( -1/4) ); #Integral method\n",
+ "Nuc = 0.59*( Ra)**(1/4) ; #McAdams correlation\n",
+ "Nud = 0.68 + 0.670*( Ra**(1/4) ) /(1+(0.492/ Pr)**(9/16))**(4/9) ; #Churchill and Chu correlation\n",
+ "\n",
+ "#result\n",
+ "print\"Mean film temperature =\",round(T,4),\"K\";\n",
+ "print\" ( a ) \";\n",
+ "print\"Exact analysis\";\n",
+ "print\"NuL =\",round(Nua,4);\n",
+ "print\"\\n ( b ) \";\n",
+ "print\"Integral method\";\n",
+ "print\"NuL =\",round(Nub,4);\n",
+ "print\"\\n ( c ) \";\n",
+ "print\"McAdams correlation\";\n",
+ "print\"NuL =\",round(Nuc,4);\n",
+ "print\"\\n ( d ) \";\n",
+ "print\"Churchill and Chu correlation\";\n",
+ "print\"NuL =\",round(Nud,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean film temperature = 343.0 K\n",
+ " ( a ) \n",
+ "Exact analysis\n",
+ "NuL = 72.6196\n",
+ "\n",
+ " ( b ) \n",
+ "Integral method\n",
+ "NuL = 76.0691\n",
+ "\n",
+ " ( c ) \n",
+ "McAdams correlation\n",
+ "NuL = 81.9066\n",
+ "\n",
+ " ( d ) \n",
+ "Churchill and Chu correlation\n",
+ "NuL = 71.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0.2 ; #m\n",
+ "d = 0.005 ; #m\n",
+ "rho = 7900 ; #kg/m^3\n",
+ "Cp = 460 ; #J/kg K\n",
+ "Tair = 20 ; #C\n",
+ "Tavg = 380 ; #C\n",
+ "Pr = 0.680 ;\n",
+ "k = 0.0393 ; #W/m K\n",
+ "h2 = 7.348 ; #W/m^2 K\n",
+ "h3 = 6.780; #W/m^2 K\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tavg + Tair )/2 ; #C\n",
+ "v = 34.85*10**-6 ; #m^2/s\n",
+ "Re = 9.81*1/(273+ Tm)*( Tavg - Tair )*(s**3) /(v**2) *Pr;\n",
+ "Nu = 0.68 + 0.670*( Re**(1/4) ) /(1+(0.492/ Pr)**(4/9))**(4/9) ;\n",
+ "h = Nu*k/s; #W/m^2 K\n",
+ "t1 = rho*s*s*d*Cp /(( s**2) *2*h)* math.log ((430 - Tair )/(330 -Tair )); #s\n",
+ "t2 = rho*s*s*d*Cp /(( s**2) *2* h2)* math.log ((330 - Tair )/(230 -Tair )); #s\n",
+ "t3 = rho*s*s*d*Cp /(( s**2) *2* h3)* math.log ((230 - Tair )/(130 -Tair )); #s\n",
+ "time = t1+t2+t3; #Total time\n",
+ "minute = time /60;\n",
+ "\n",
+ "#result\n",
+ "print\"Time required for the plate to cool from 430 C to 330 C is\",round(t1,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 330 C to 230 C is\",round(t2,4),\"s\";\n",
+ "print\"Time required for the plate to cool from 230 C to 130 C is\",round(t3,4),\"s\";\n",
+ "print\"Hence, time required for the plate to cool from 430 C to 130 C\";\n",
+ "print\" =\",round(time,4),\"s\";\n",
+ "print\" =\",round(minute,4),\"min\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the plate to cool from 430 C to 330 C is 328.9673 s\n",
+ "Time required for the plate to cool from 330 C to 230 C is 481.5307 s\n",
+ "Time required for the plate to cool from 230 C to 130 C is 866.4613 s\n",
+ "Hence, time required for the plate to cool from 430 C to 130 C\n",
+ " = 1676.9593 s\n",
+ " = 27.9493 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page no:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.006 ; #m\n",
+ "e = 0.1 ;\n",
+ "Ti = 800 ; #C\n",
+ "Ta = 1000 ; #C\n",
+ "k = 0.0763 ; #W/m K\n",
+ "Pr = 0.717 ;\n",
+ "Ra2 = 6.42 ;\n",
+ "Nu2 = 0.9841 ;\n",
+ "h2 = 12.15 ;\n",
+ "Ra3 = 6.93 ;\n",
+ "Nu3 = 0.9963 ;\n",
+ "h3 = 12.33 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ta+Ti) /2;\n",
+ "v = 155.1*10**-6 ; #m^2/s\n",
+ "Gr = 9.81*1/1173*(200* D**3) /(v**2) ;\n",
+ "Ra = Gr*Pr ;\n",
+ "Nu = 0.36 + 0.518*( Ra**(1/4) ) /(1+(0.559/ Pr)**(9/16))**(4/9) ;\n",
+ "h = Nu*k/D;\n",
+ "x = h*(Ta -Ti); #W/m^2\n",
+ "x2 = h2 *(900 -800) ;\n",
+ "x3 = h3 *(910 -800) ;\n",
+ "T = 900 + (910 -900) *(1306 - x2)/(x3 -x2); #Interpolation\n",
+ "\n",
+ "#result\n",
+ "print\"Trial 1\";\n",
+ "print\"Let Ta =10000 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x,4),\"W/m^2, which is much larger than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 2\";\n",
+ "print\"Let Ta = 900 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x2,4),\"W/m^2, which is a little less than the required value of 1306 W/m^2\";\n",
+ "print\"\\nTrial 3\";\n",
+ "print\"Let Ta = 910 C\";\n",
+ "print\"Value of h(Ta-800) =\",round(x3,4),\"W/m^2 \\nThis value is little more than the required value of 1306 W/m^2\";\n",
+ "print\"\\nThe correct value of Ta obtained by interpolation is\",round(T,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Trial 1\n",
+ "Let Ta =10000 C\n",
+ "Value of h(Ta-800) = 2722.8585 W/m^2, which is much larger than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 2\n",
+ "Let Ta = 900 C\n",
+ "Value of h(Ta-800) = 1215.0 W/m^2, which is a little less than the required value of 1306 W/m^2\n",
+ "\n",
+ "Trial 3\n",
+ "Let Ta = 910 C\n",
+ "Value of h(Ta-800) = 1356.3 W/m^2 \n",
+ "This value is little more than the required value of 1306 W/m^2\n",
+ "\n",
+ "The correct value of Ta obtained by interpolation is 906.4402 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page no:269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tp = 75 ; #Temperature of absorber plate , degree C\n",
+ "Tc = 55 ; #Temperature of glass cover , degree C\n",
+ "L = 0.025 ; #m\n",
+ "H = 2 ; #m\n",
+ "Y = 70 ; #degree\n",
+ "k = 0.0294 ; #W/m K\n",
+ "Pr = 0.695 ;\n",
+ "\n",
+ "#calculations\n",
+ "a = 19/180*3.14 ; #Radians\n",
+ "r = H/L ;\n",
+ "Tavg = ( Tp +Tc) /2+273 ; #K\n",
+ "v = 19.50*10**-6 ; #m^2/s\n",
+ "Ra = 9.81*(1/ Tavg )*( Tp -Tc)*(L**3) /(v**2) *Pr*math.cos(a);\n",
+ "Nu = 0.229*( Ra)**0.252;\n",
+ "h = Nu*k/L ; #W/m^2 K\n",
+ "Rate = h *2*1*( Tp -Tc); #W\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer rate = 122.8843 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page no:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tair = 30 ;\n",
+ "D = 0.04 ;\n",
+ "Ts = 70 ;\n",
+ "V = 0.3 ;\n",
+ "Pr = 0.698 ;\n",
+ "k = 0.0283 ;\n",
+ "\n",
+ "#calculations\n",
+ "Tm = ( Tair + Ts )/2 ;\n",
+ "v = 17.95*10**-6 ;\n",
+ "Gr = 9.81*1/323*( Ts - Tair )*(D**3) /v**2;\n",
+ "Re = V*D/v ;\n",
+ "X = Gr/Re**2 ;\n",
+ "Nuforced = 0.3 + 0.62*( Re**0.5) *( Pr**(1/3) ) /((1+(0.4/Pr)**(2/3) )**(1/4))*(1+( Re /282000)**(5/8))**(4/5) ;\n",
+ "Nu = Nuforced *(1+6.275*( X)**(7/4))**(1/7) ;\n",
+ "h = Nu *(k/D);\n",
+ "\n",
+ "#result\n",
+ "print\"Since Gr/Re^2 =\",round(X,4),\"is > 0.2, we have a combined convection situation.\";\n",
+ "print\"The Average heat transfer coefficient =\",round(h,4),\"W/m^2 K\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since Gr/Re^2 = 0.5399 is > 0.2, we have a combined convection situation.\n",
+ "The Average heat transfer coefficient = 10.8276 W/m^2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_1.ipynb new file mode 100755 index 00000000..792546a8 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_1.ipynb @@ -0,0 +1,437 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7298a6e927860b27b9f6a568bbab1f848676757d89a8929c4d46b14437989042"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page no:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 2000 ; #W/m^2 K\n",
+ "#From Table 7.1\n",
+ "Uf = 0.0001 ; #fouling factor, m^2K/W\n",
+ "\n",
+ "#calculations\n",
+ "hf = 1/(1/ h+ Uf );\n",
+ "p = (h-hf)/h *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient including the effect of foulung =\",round(hf,4),\"W/m^2 K\";\n",
+ "print\"Percentage reduction =\",round(p,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient including the effect of foulung = 1666.6667 W/m^2 K\n",
+ "Percentage reduction = 16.6667\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page no:294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 1000 ; #kg/h\n",
+ "Thi = 50 ; #C\n",
+ "The = 40 ; #C\n",
+ "Tci = 35 ; #C\n",
+ "Tce = 40 ; #C\n",
+ "U = 1000 ; #OHTC, W/m^2 K\n",
+ "#From fig 7.15,\n",
+ "F =0.91 ;\n",
+ "#Again from fig 7.15,\n",
+ "F =0.91 ;\n",
+ "\n",
+ "#calculations\n",
+ "#Using Eqn 7.5.25\n",
+ "q = m /3600*4174*( Thi - The ) ; #W\n",
+ "deltaT = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi -Tce)/( The -Tci )); #C\n",
+ "#T1 = Th and T2 = Tc\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#Alternatively, taking T1 = Tc and T2 = Th\n",
+ "R2 = (Tci - Tce )/( The - Thi );\n",
+ "S2 = (The - Thi )/( Tci - Thi );\n",
+ "A = q/(U*F* deltaT );\n",
+ "\n",
+ "#result\n",
+ "print\"delta T =\",round(deltaT,4);\n",
+ "print\"\\nTaking T1 = Th and T2 = Tc\";\n",
+ "print\"R=\",round(R,4), \"S=\",round(S,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nTaking T1 = Tc and T2 = Th\";\n",
+ "print\"R2=\",round(R2,4),\"S2=\",round(S2,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nArea =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delta T = 7.2135\n",
+ "\n",
+ "Taking T1 = Th and T2 = Tc\n",
+ "R= 2.0 S= 0.3333\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Taking T1 = Tc and T2 = Th\n",
+ "R2= 0.5 S2= 0.6667\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Area = 1.7663 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page no:295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Because of change of phase , Thi = The\n",
+ "Thi = 100 ; #[C], Saturated steam\n",
+ "The = 100 ; #[C], Condensed steam\n",
+ "Tci = 30 ; #[C], Cooling water inlet\n",
+ "Tce = 70 ; #[C], cooling water outlet\n",
+ "#From fig 7.16\n",
+ "F = 1;\n",
+ "\n",
+ "#calculations\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#For counter flow arrangement\n",
+ "Tmcounter = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi - Tce )/(The - Tci )); #For counter flow arrangement\n",
+ "#Therefore\n",
+ "Tm = F* Tmcounter ;\n",
+ "\n",
+ "#result\n",
+ "print\"Mean Temperaature Difference =\",round(Tm,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Temperaature Difference = 47.2089 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(a), Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot /60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ; #C\n",
+ "#Using equation 7.5.13\n",
+ "Tm = (( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce)); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "\n",
+ "#result\n",
+ "print\"(a)\";\n",
+ "print\"Mean Temperature Difference =\",round(Tm,4),\"C\";\n",
+ "print\"Area of Heat Exchanger =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Mean Temperature Difference = 28.7569 C\n",
+ "Area of Heat Exchanger = 0.6055 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(b) , Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "mhot1 = 20 ; #kg/min\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot/60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ;\n",
+ "# Using equation 7.5.13\n",
+ "Tm = ((( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce))); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "#Flow rate on hot side i.e. 'hh' is doubled\n",
+ "hh1 = 1600*2**0.8 ; #W/m^2 K\n",
+ "U1 = 1/(1/ hh1 + 1/ hc); #W/m^2 K\n",
+ "mhCph = mhot1 /60*4179 ; #W/K\n",
+ "mcCpc = mcold /60*4174 ; #W/K\n",
+ "#Therefore\n",
+ "C = mhCph / mcCpc ;\n",
+ "ntu = U1*A/ mhCph ;\n",
+ "e = (1 - math.exp ( -(1+C)*ntu) )/(1+ C) ;\n",
+ "#Therefore (Thi - The)/(Thi - Tci) = e , we get\n",
+ "The = Thi - e*( Thi - Tci );\n",
+ "#Equating the heat lost by water to heat gained by cold water , we get\n",
+ "Tce = Tci + ( mhCph *( Thi - The ))/ mcCpc ;\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\\nNTU =\",round(ntu,4);\n",
+ "print\"Exit temperature of cold and hot stream are\",round(Tce,4),\"C and\",round(The,4),\"C respectively.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "NTU = 0.4418\n",
+ "Exit temperature of cold and hot stream are 35.981 C and 56.2901 C respectively.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 , Page no:304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mc = 2000 ; # [kg/h]\n",
+ "Tce = 40 ; # [C]\n",
+ "Tci = 15 ; # [C]\n",
+ "Thi = 80 ; # [C]\n",
+ "U = 50 ; # OHTC, [W/m**2 K]\n",
+ "A = 10 ; # Area, [m**2]\n",
+ "\n",
+ "#Calculations\n",
+ "# Using effective NTU method\n",
+ "# Assuming m_c*C_pc = (m*C_p)s\n",
+ "NTU = U*A/(mc*1005/3600);\n",
+ "e = (Tce-Tci)/(Thi-Tci);\n",
+ "# From fig 7.23, no value of C is found corresponding to the above values, hence assumption was wrong.\n",
+ "# So, m_h*C_ph must be equal to (m*C_p)s, proceeding by trail and error method\n",
+ "\n",
+ "mh_1 = 200\n",
+ "NTU_1 = U*A/(mh_1*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .416;\n",
+ "e = .78;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_1 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_1 = Thi - mc*1005/3600*(Tce-Tci)/(mh_1*1.161);\n",
+ "\n",
+ "mh_2 = 250\n",
+ "NTU_2 = U*A/(mh_2*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .520;\n",
+ "e = .69;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_2 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_2 = Thi - mc*1005/3600*(Tce-Tci)/(mh_2*1.161);\n",
+ "\n",
+ "mh_3 = 300\n",
+ "NTU_3 = U*A/(mh_3*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .624;\n",
+ "e = .625;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_3 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_3 = Thi - mc*1005/3600*(Tce-Tci)/(mh_3*1.161);\n",
+ "\n",
+ "mh_4 = 350\n",
+ "NTU_4 = U*A/(mh_4*1.161);#Corresponding Values of C and e from fig 7.23\n",
+ "C = .728;\n",
+ "e = .57;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_4 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_4 = Thi - mc*1005/3600*(Tce-Tci)/(mh_4*1.161);\n",
+ "\n",
+ "mh_5 = 400\n",
+ "NTU_5 = U*A/(mh_5*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .832;\n",
+ "e = .51;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_5 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_5 = Thi - mc*1005/3600*(Tce-Tci)/(mh_5*1.161);\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print (\"m_h(kg/h) \\t NTU \\t\\t C \\t\\t e \\t T_he(C) \\t\\t T_he(C)(Heat Balance)\");\n",
+ "print mh_1,\"\\t\\t\",round(NTU_1,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_1,1),\"\\t\\t\\t\",round(The2_1,1);\n",
+ "print mh_2,\"\\t\\t\",round(NTU_2,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_2,1),\"\\t\\t\\t\",round(The2_2,1);\n",
+ "print mh_3,\"\\t\\t\",round(NTU_3,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_3,1),\"\\t\\t\\t\",round(The2_3,1);\n",
+ "print mh_4,\"\\t\\t\",round(NTU_4,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_4,1),\"\\t\\t\\t\",round(The2_4,1);\n",
+ "print mh_5,\"\\t\\t\",round(NTU_5,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_5,1),\"\\t\\t\\t\",round(The2_5,1);\n",
+ "\n",
+ "#Graph\n",
+ "mh=[200,250,300,350,400];\n",
+ "The=[29.3,35.2,39.4,43,46.9];\n",
+ "The2=[19.9,31.9,39.9,45.7,50];\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "%matplotlib inline\n",
+ "\n",
+ "plt.plot (mh,The,'b',mh,The2,'r',[295,295,200],[0,39.2,39.2],'k');\n",
+ "plt.title (\"mh vs The\");\n",
+ "plt.xlabel(\" mh \");\n",
+ "plt.ylabel(\" The \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m_h(kg/h) \t NTU \t\t C \t\t e \t T_he(C) \t\t T_he(C)(Heat Balance)\n",
+ "200 \t\t2.153 \t\t0.832 \t\t0.51 \t\t 29.3 \t\t\t19.9\n",
+ "250 \t\t1.723 \t\t0.832 \t\t0.51 \t\t 35.2 \t\t\t31.9\n",
+ "300 \t\t1.436 \t\t0.832 \t\t0.51 \t\t 39.4 \t\t\t39.9\n",
+ "350 \t\t1.23 \t\t0.832 \t\t0.51 \t\t 43.0 \t\t\t45.6\n",
+ "400 \t\t1.077 \t\t0.832 \t\t0.51 \t\t 46.9 \t\t\t49.9\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEVCAYAAADtmeJyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNf5P/DP4IKiyFJlIKLihiDI4oZbIsagMSpgtCZo\nDGnNUhtJY1OXJO032l9b0UTTuDRpEtMSE01sowhucYkQ44YiuBu3IIswLgOCINvM/f1xemUwKAiz\nXe7n/XrdV1mGuSe343nuec65z9FIkgQiIlIvB1s3gIiIbIuBgIhI5RgIiIhUjoGAiEjlGAiIiFSO\ngYCISOUYCKjZysrK8nFwcDAajUa7+Zz7+Phk7dmzZ7St20Fkym7+gRAp3Zdffjnd2dm5xNnZucTJ\nyanMwcHBKH/foUOHYgDQaDSSRqPhwztkVxgIiMxk+vTpX5aUlDiXlJQ4b9++fVznzp3z5O+Li4s7\n2Lp9RPfDQECK4uPjk/Xee+/9ISgo6ISzs3PJzJkz1+h0Ou24ceO2u7i43IqIiNhVVFTkavo3X3zx\nxXPdunW70qlTp+t/+9vf3qrrfQ8fPhzm5eWVL0mSRv7Zpk2bJgUHBx8HgLS0tMEDBw486uLicsvT\n07PgjTfeWPagdpq+z70yMjJCg4ODj7u6uhY9++yzX1VUVDjKv9uyZcuEkJCQTDc3t8Lhw4fvP3ny\nZL+GXhuiRpMkiQcPxRw+Pj4/DR069MC1a9c65eXlPeLh4aELDQ09lpmZGVxeXu74+OOP71m0aNH/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ydfz6NGjA/n5fHgHDhwYlpSUFNm9e/efYmJi1n/33XePz5gxY61Z\nP5vWmugwGo2aGTNmfP7666+/b/rzuXPnLo2Pj58vSRIWL1684N4Jj4qKitaXL1/u3qNHj0tGo1Fj\n6wkbeznudz2vXr3qJX+9fPnyOTExMet4Pes/rl+/3rGwsNBVkiSUlZW1ffTRR7/fvXv3aH4+zXs9\n8/PzPeXX8PP58EdKSsrICRMmJEuSeftOq/0H7Nu3b4RGozEGBwdnhoSEZISEhGRs3779yZs3b7qP\nHj16d+/evc9HRETslD88kiThr3/961s9e/a82KdPn3M7duwYa+v/E+zpqOt6btu2bdyMGTM+79ev\n34mgoKDjUVFRiQUFBVpez/qPEydO9AsNDT0WHByc2a9fvxNLly6dK0kS+Pk07/Xk57NpR0pKykh5\n1ZA5P5saSWIajohIzbhDGRGRyjEQEBGpHAMBEZHKMRAQEakcAwFRI/373/9+IS4ubqWt20HUVAwE\nRI3EJ1+puWAgIKpD+/btb8+bN29pYGDgqYiIiF2HDh0aMnLkyNSePXteSk5Onii/7urVq4+MGzdu\nu6+v7/n58+cvsWWbiRrN1g9I8OBhj4dGozHKD+JMmjRpY0RExM7q6uoWx48fDwoJCcmQJAn/+te/\nXujRo8el4uJi5/Lycsdu3bpl5ebmdrZ123nweNjDajuUESlJ69atK8eOHfstAPTr1+9kmzZtylu0\naGEIDAw8lZWV5SO/bvTo0Xvk4ol9+/Y9k5WV5cMaOaQ0TA0R1aFVq1ZV8tcODg7G1q1bV8pfV1dX\n372BcnR0rJC/btGihcFgMLSwbkuJmo6BgMiMpPuUCSayZwwERHW4d0WQ6ffy13XVgOdKIlIiFp0j\nIlI5jgiIiFSOgYCISOUYCIiIVI6BgIhI5RgIiIhUjoGAiEjl/j9fZuqpxURX8wAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4dd1170>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_2.ipynb new file mode 100755 index 00000000..792546a8 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_2.ipynb @@ -0,0 +1,437 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7298a6e927860b27b9f6a568bbab1f848676757d89a8929c4d46b14437989042"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page no:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 2000 ; #W/m^2 K\n",
+ "#From Table 7.1\n",
+ "Uf = 0.0001 ; #fouling factor, m^2K/W\n",
+ "\n",
+ "#calculations\n",
+ "hf = 1/(1/ h+ Uf );\n",
+ "p = (h-hf)/h *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient including the effect of foulung =\",round(hf,4),\"W/m^2 K\";\n",
+ "print\"Percentage reduction =\",round(p,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient including the effect of foulung = 1666.6667 W/m^2 K\n",
+ "Percentage reduction = 16.6667\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page no:294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 1000 ; #kg/h\n",
+ "Thi = 50 ; #C\n",
+ "The = 40 ; #C\n",
+ "Tci = 35 ; #C\n",
+ "Tce = 40 ; #C\n",
+ "U = 1000 ; #OHTC, W/m^2 K\n",
+ "#From fig 7.15,\n",
+ "F =0.91 ;\n",
+ "#Again from fig 7.15,\n",
+ "F =0.91 ;\n",
+ "\n",
+ "#calculations\n",
+ "#Using Eqn 7.5.25\n",
+ "q = m /3600*4174*( Thi - The ) ; #W\n",
+ "deltaT = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi -Tce)/( The -Tci )); #C\n",
+ "#T1 = Th and T2 = Tc\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#Alternatively, taking T1 = Tc and T2 = Th\n",
+ "R2 = (Tci - Tce )/( The - Thi );\n",
+ "S2 = (The - Thi )/( Tci - Thi );\n",
+ "A = q/(U*F* deltaT );\n",
+ "\n",
+ "#result\n",
+ "print\"delta T =\",round(deltaT,4);\n",
+ "print\"\\nTaking T1 = Th and T2 = Tc\";\n",
+ "print\"R=\",round(R,4), \"S=\",round(S,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nTaking T1 = Tc and T2 = Th\";\n",
+ "print\"R2=\",round(R2,4),\"S2=\",round(S2,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nArea =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delta T = 7.2135\n",
+ "\n",
+ "Taking T1 = Th and T2 = Tc\n",
+ "R= 2.0 S= 0.3333\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Taking T1 = Tc and T2 = Th\n",
+ "R2= 0.5 S2= 0.6667\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Area = 1.7663 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page no:295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Because of change of phase , Thi = The\n",
+ "Thi = 100 ; #[C], Saturated steam\n",
+ "The = 100 ; #[C], Condensed steam\n",
+ "Tci = 30 ; #[C], Cooling water inlet\n",
+ "Tce = 70 ; #[C], cooling water outlet\n",
+ "#From fig 7.16\n",
+ "F = 1;\n",
+ "\n",
+ "#calculations\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#For counter flow arrangement\n",
+ "Tmcounter = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi - Tce )/(The - Tci )); #For counter flow arrangement\n",
+ "#Therefore\n",
+ "Tm = F* Tmcounter ;\n",
+ "\n",
+ "#result\n",
+ "print\"Mean Temperaature Difference =\",round(Tm,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Temperaature Difference = 47.2089 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(a), Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot /60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ; #C\n",
+ "#Using equation 7.5.13\n",
+ "Tm = (( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce)); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "\n",
+ "#result\n",
+ "print\"(a)\";\n",
+ "print\"Mean Temperature Difference =\",round(Tm,4),\"C\";\n",
+ "print\"Area of Heat Exchanger =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Mean Temperature Difference = 28.7569 C\n",
+ "Area of Heat Exchanger = 0.6055 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(b) , Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "mhot1 = 20 ; #kg/min\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot/60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ;\n",
+ "# Using equation 7.5.13\n",
+ "Tm = ((( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce))); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "#Flow rate on hot side i.e. 'hh' is doubled\n",
+ "hh1 = 1600*2**0.8 ; #W/m^2 K\n",
+ "U1 = 1/(1/ hh1 + 1/ hc); #W/m^2 K\n",
+ "mhCph = mhot1 /60*4179 ; #W/K\n",
+ "mcCpc = mcold /60*4174 ; #W/K\n",
+ "#Therefore\n",
+ "C = mhCph / mcCpc ;\n",
+ "ntu = U1*A/ mhCph ;\n",
+ "e = (1 - math.exp ( -(1+C)*ntu) )/(1+ C) ;\n",
+ "#Therefore (Thi - The)/(Thi - Tci) = e , we get\n",
+ "The = Thi - e*( Thi - Tci );\n",
+ "#Equating the heat lost by water to heat gained by cold water , we get\n",
+ "Tce = Tci + ( mhCph *( Thi - The ))/ mcCpc ;\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\\nNTU =\",round(ntu,4);\n",
+ "print\"Exit temperature of cold and hot stream are\",round(Tce,4),\"C and\",round(The,4),\"C respectively.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "NTU = 0.4418\n",
+ "Exit temperature of cold and hot stream are 35.981 C and 56.2901 C respectively.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 , Page no:304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mc = 2000 ; # [kg/h]\n",
+ "Tce = 40 ; # [C]\n",
+ "Tci = 15 ; # [C]\n",
+ "Thi = 80 ; # [C]\n",
+ "U = 50 ; # OHTC, [W/m**2 K]\n",
+ "A = 10 ; # Area, [m**2]\n",
+ "\n",
+ "#Calculations\n",
+ "# Using effective NTU method\n",
+ "# Assuming m_c*C_pc = (m*C_p)s\n",
+ "NTU = U*A/(mc*1005/3600);\n",
+ "e = (Tce-Tci)/(Thi-Tci);\n",
+ "# From fig 7.23, no value of C is found corresponding to the above values, hence assumption was wrong.\n",
+ "# So, m_h*C_ph must be equal to (m*C_p)s, proceeding by trail and error method\n",
+ "\n",
+ "mh_1 = 200\n",
+ "NTU_1 = U*A/(mh_1*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .416;\n",
+ "e = .78;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_1 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_1 = Thi - mc*1005/3600*(Tce-Tci)/(mh_1*1.161);\n",
+ "\n",
+ "mh_2 = 250\n",
+ "NTU_2 = U*A/(mh_2*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .520;\n",
+ "e = .69;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_2 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_2 = Thi - mc*1005/3600*(Tce-Tci)/(mh_2*1.161);\n",
+ "\n",
+ "mh_3 = 300\n",
+ "NTU_3 = U*A/(mh_3*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .624;\n",
+ "e = .625;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_3 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_3 = Thi - mc*1005/3600*(Tce-Tci)/(mh_3*1.161);\n",
+ "\n",
+ "mh_4 = 350\n",
+ "NTU_4 = U*A/(mh_4*1.161);#Corresponding Values of C and e from fig 7.23\n",
+ "C = .728;\n",
+ "e = .57;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_4 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_4 = Thi - mc*1005/3600*(Tce-Tci)/(mh_4*1.161);\n",
+ "\n",
+ "mh_5 = 400\n",
+ "NTU_5 = U*A/(mh_5*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .832;\n",
+ "e = .51;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_5 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_5 = Thi - mc*1005/3600*(Tce-Tci)/(mh_5*1.161);\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print (\"m_h(kg/h) \\t NTU \\t\\t C \\t\\t e \\t T_he(C) \\t\\t T_he(C)(Heat Balance)\");\n",
+ "print mh_1,\"\\t\\t\",round(NTU_1,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_1,1),\"\\t\\t\\t\",round(The2_1,1);\n",
+ "print mh_2,\"\\t\\t\",round(NTU_2,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_2,1),\"\\t\\t\\t\",round(The2_2,1);\n",
+ "print mh_3,\"\\t\\t\",round(NTU_3,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_3,1),\"\\t\\t\\t\",round(The2_3,1);\n",
+ "print mh_4,\"\\t\\t\",round(NTU_4,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_4,1),\"\\t\\t\\t\",round(The2_4,1);\n",
+ "print mh_5,\"\\t\\t\",round(NTU_5,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_5,1),\"\\t\\t\\t\",round(The2_5,1);\n",
+ "\n",
+ "#Graph\n",
+ "mh=[200,250,300,350,400];\n",
+ "The=[29.3,35.2,39.4,43,46.9];\n",
+ "The2=[19.9,31.9,39.9,45.7,50];\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "%matplotlib inline\n",
+ "\n",
+ "plt.plot (mh,The,'b',mh,The2,'r',[295,295,200],[0,39.2,39.2],'k');\n",
+ "plt.title (\"mh vs The\");\n",
+ "plt.xlabel(\" mh \");\n",
+ "plt.ylabel(\" The \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m_h(kg/h) \t NTU \t\t C \t\t e \t T_he(C) \t\t T_he(C)(Heat Balance)\n",
+ "200 \t\t2.153 \t\t0.832 \t\t0.51 \t\t 29.3 \t\t\t19.9\n",
+ "250 \t\t1.723 \t\t0.832 \t\t0.51 \t\t 35.2 \t\t\t31.9\n",
+ "300 \t\t1.436 \t\t0.832 \t\t0.51 \t\t 39.4 \t\t\t39.9\n",
+ "350 \t\t1.23 \t\t0.832 \t\t0.51 \t\t 43.0 \t\t\t45.6\n",
+ "400 \t\t1.077 \t\t0.832 \t\t0.51 \t\t 46.9 \t\t\t49.9\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEVCAYAAADtmeJyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNf5P/DP4IKiyFJlIKLihiDI4oZbIsagMSpgtCZo\nDGnNUhtJY1OXJO032l9b0UTTuDRpEtMSE01sowhucYkQ44YiuBu3IIswLgOCINvM/f1xemUwKAiz\nXe7n/XrdV1mGuSe343nuec65z9FIkgQiIlIvB1s3gIiIbIuBgIhI5RgIiIhUjoGAiEjlGAiIiFSO\ngYCISOUYCKjZysrK8nFwcDAajUa7+Zz7+Phk7dmzZ7St20Fkym7+gRAp3Zdffjnd2dm5xNnZucTJ\nyanMwcHBKH/foUOHYgDQaDSSRqPhwztkVxgIiMxk+vTpX5aUlDiXlJQ4b9++fVznz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Xvk4ol9+/Y9k5WV5cMaOaQ0TA0R1aFVq1ZV8tcODg7G1q1bV8pfV1dX\n372BcnR0rJC/btGihcFgMLSwbkuJmo6BgMiMpPuUCSayZwwERHW4d0WQ6ffy13XVgOdKIlIiFp0j\nIlI5jgiIiFSOgYCISOUYCIiIVI6BgIhI5RgIiIhUjoGAiEjl/j9fZuqpxURX8wAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4dd1170>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_3.ipynb new file mode 100755 index 00000000..792546a8 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_3.ipynb @@ -0,0 +1,437 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7298a6e927860b27b9f6a568bbab1f848676757d89a8929c4d46b14437989042"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page no:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 2000 ; #W/m^2 K\n",
+ "#From Table 7.1\n",
+ "Uf = 0.0001 ; #fouling factor, m^2K/W\n",
+ "\n",
+ "#calculations\n",
+ "hf = 1/(1/ h+ Uf );\n",
+ "p = (h-hf)/h *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient including the effect of foulung =\",round(hf,4),\"W/m^2 K\";\n",
+ "print\"Percentage reduction =\",round(p,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient including the effect of foulung = 1666.6667 W/m^2 K\n",
+ "Percentage reduction = 16.6667\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page no:294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 1000 ; #kg/h\n",
+ "Thi = 50 ; #C\n",
+ "The = 40 ; #C\n",
+ "Tci = 35 ; #C\n",
+ "Tce = 40 ; #C\n",
+ "U = 1000 ; #OHTC, W/m^2 K\n",
+ "#From fig 7.15,\n",
+ "F =0.91 ;\n",
+ "#Again from fig 7.15,\n",
+ "F =0.91 ;\n",
+ "\n",
+ "#calculations\n",
+ "#Using Eqn 7.5.25\n",
+ "q = m /3600*4174*( Thi - The ) ; #W\n",
+ "deltaT = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi -Tce)/( The -Tci )); #C\n",
+ "#T1 = Th and T2 = Tc\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#Alternatively, taking T1 = Tc and T2 = Th\n",
+ "R2 = (Tci - Tce )/( The - Thi );\n",
+ "S2 = (The - Thi )/( Tci - Thi );\n",
+ "A = q/(U*F* deltaT );\n",
+ "\n",
+ "#result\n",
+ "print\"delta T =\",round(deltaT,4);\n",
+ "print\"\\nTaking T1 = Th and T2 = Tc\";\n",
+ "print\"R=\",round(R,4), \"S=\",round(S,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nTaking T1 = Tc and T2 = Th\";\n",
+ "print\"R2=\",round(R2,4),\"S2=\",round(S2,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nArea =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delta T = 7.2135\n",
+ "\n",
+ "Taking T1 = Th and T2 = Tc\n",
+ "R= 2.0 S= 0.3333\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Taking T1 = Tc and T2 = Th\n",
+ "R2= 0.5 S2= 0.6667\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Area = 1.7663 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page no:295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Because of change of phase , Thi = The\n",
+ "Thi = 100 ; #[C], Saturated steam\n",
+ "The = 100 ; #[C], Condensed steam\n",
+ "Tci = 30 ; #[C], Cooling water inlet\n",
+ "Tce = 70 ; #[C], cooling water outlet\n",
+ "#From fig 7.16\n",
+ "F = 1;\n",
+ "\n",
+ "#calculations\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#For counter flow arrangement\n",
+ "Tmcounter = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi - Tce )/(The - Tci )); #For counter flow arrangement\n",
+ "#Therefore\n",
+ "Tm = F* Tmcounter ;\n",
+ "\n",
+ "#result\n",
+ "print\"Mean Temperaature Difference =\",round(Tm,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Temperaature Difference = 47.2089 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(a), Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot /60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ; #C\n",
+ "#Using equation 7.5.13\n",
+ "Tm = (( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce)); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "\n",
+ "#result\n",
+ "print\"(a)\";\n",
+ "print\"Mean Temperature Difference =\",round(Tm,4),\"C\";\n",
+ "print\"Area of Heat Exchanger =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Mean Temperature Difference = 28.7569 C\n",
+ "Area of Heat Exchanger = 0.6055 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(b) , Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "mhot1 = 20 ; #kg/min\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot/60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ;\n",
+ "# Using equation 7.5.13\n",
+ "Tm = ((( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce))); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "#Flow rate on hot side i.e. 'hh' is doubled\n",
+ "hh1 = 1600*2**0.8 ; #W/m^2 K\n",
+ "U1 = 1/(1/ hh1 + 1/ hc); #W/m^2 K\n",
+ "mhCph = mhot1 /60*4179 ; #W/K\n",
+ "mcCpc = mcold /60*4174 ; #W/K\n",
+ "#Therefore\n",
+ "C = mhCph / mcCpc ;\n",
+ "ntu = U1*A/ mhCph ;\n",
+ "e = (1 - math.exp ( -(1+C)*ntu) )/(1+ C) ;\n",
+ "#Therefore (Thi - The)/(Thi - Tci) = e , we get\n",
+ "The = Thi - e*( Thi - Tci );\n",
+ "#Equating the heat lost by water to heat gained by cold water , we get\n",
+ "Tce = Tci + ( mhCph *( Thi - The ))/ mcCpc ;\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\\nNTU =\",round(ntu,4);\n",
+ "print\"Exit temperature of cold and hot stream are\",round(Tce,4),\"C and\",round(The,4),\"C respectively.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "NTU = 0.4418\n",
+ "Exit temperature of cold and hot stream are 35.981 C and 56.2901 C respectively.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 , Page no:304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mc = 2000 ; # [kg/h]\n",
+ "Tce = 40 ; # [C]\n",
+ "Tci = 15 ; # [C]\n",
+ "Thi = 80 ; # [C]\n",
+ "U = 50 ; # OHTC, [W/m**2 K]\n",
+ "A = 10 ; # Area, [m**2]\n",
+ "\n",
+ "#Calculations\n",
+ "# Using effective NTU method\n",
+ "# Assuming m_c*C_pc = (m*C_p)s\n",
+ "NTU = U*A/(mc*1005/3600);\n",
+ "e = (Tce-Tci)/(Thi-Tci);\n",
+ "# From fig 7.23, no value of C is found corresponding to the above values, hence assumption was wrong.\n",
+ "# So, m_h*C_ph must be equal to (m*C_p)s, proceeding by trail and error method\n",
+ "\n",
+ "mh_1 = 200\n",
+ "NTU_1 = U*A/(mh_1*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .416;\n",
+ "e = .78;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_1 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_1 = Thi - mc*1005/3600*(Tce-Tci)/(mh_1*1.161);\n",
+ "\n",
+ "mh_2 = 250\n",
+ "NTU_2 = U*A/(mh_2*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .520;\n",
+ "e = .69;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_2 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_2 = Thi - mc*1005/3600*(Tce-Tci)/(mh_2*1.161);\n",
+ "\n",
+ "mh_3 = 300\n",
+ "NTU_3 = U*A/(mh_3*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .624;\n",
+ "e = .625;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_3 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_3 = Thi - mc*1005/3600*(Tce-Tci)/(mh_3*1.161);\n",
+ "\n",
+ "mh_4 = 350\n",
+ "NTU_4 = U*A/(mh_4*1.161);#Corresponding Values of C and e from fig 7.23\n",
+ "C = .728;\n",
+ "e = .57;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_4 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_4 = Thi - mc*1005/3600*(Tce-Tci)/(mh_4*1.161);\n",
+ "\n",
+ "mh_5 = 400\n",
+ "NTU_5 = U*A/(mh_5*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .832;\n",
+ "e = .51;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_5 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_5 = Thi - mc*1005/3600*(Tce-Tci)/(mh_5*1.161);\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print (\"m_h(kg/h) \\t NTU \\t\\t C \\t\\t e \\t T_he(C) \\t\\t T_he(C)(Heat Balance)\");\n",
+ "print mh_1,\"\\t\\t\",round(NTU_1,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_1,1),\"\\t\\t\\t\",round(The2_1,1);\n",
+ "print mh_2,\"\\t\\t\",round(NTU_2,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_2,1),\"\\t\\t\\t\",round(The2_2,1);\n",
+ "print mh_3,\"\\t\\t\",round(NTU_3,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_3,1),\"\\t\\t\\t\",round(The2_3,1);\n",
+ "print mh_4,\"\\t\\t\",round(NTU_4,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_4,1),\"\\t\\t\\t\",round(The2_4,1);\n",
+ "print mh_5,\"\\t\\t\",round(NTU_5,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_5,1),\"\\t\\t\\t\",round(The2_5,1);\n",
+ "\n",
+ "#Graph\n",
+ "mh=[200,250,300,350,400];\n",
+ "The=[29.3,35.2,39.4,43,46.9];\n",
+ "The2=[19.9,31.9,39.9,45.7,50];\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "%matplotlib inline\n",
+ "\n",
+ "plt.plot (mh,The,'b',mh,The2,'r',[295,295,200],[0,39.2,39.2],'k');\n",
+ "plt.title (\"mh vs The\");\n",
+ "plt.xlabel(\" mh \");\n",
+ "plt.ylabel(\" The \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m_h(kg/h) \t NTU \t\t C \t\t e \t T_he(C) \t\t T_he(C)(Heat Balance)\n",
+ "200 \t\t2.153 \t\t0.832 \t\t0.51 \t\t 29.3 \t\t\t19.9\n",
+ "250 \t\t1.723 \t\t0.832 \t\t0.51 \t\t 35.2 \t\t\t31.9\n",
+ "300 \t\t1.436 \t\t0.832 \t\t0.51 \t\t 39.4 \t\t\t39.9\n",
+ "350 \t\t1.23 \t\t0.832 \t\t0.51 \t\t 43.0 \t\t\t45.6\n",
+ "400 \t\t1.077 \t\t0.832 \t\t0.51 \t\t 46.9 \t\t\t49.9\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEVCAYAAADtmeJyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNf5P/DP4I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h5\n1ZA5P5saSWIajohIzbhDGRGRyjEQEBGpHAMBEZHKMRAQEakcAwFRI/373/9+IS4ubqWt20HUVAwE\nRI3EJ1+puWAgIKpD+/btb8+bN29pYGDgqYiIiF2HDh0aMnLkyNSePXteSk5Onii/7urVq4+MGzdu\nu6+v7/n58+cvsWWbiRrN1g9I8OBhj4dGozHKD+JMmjRpY0RExM7q6uoWx48fDwoJCcmQJAn/+te/\nXujRo8el4uJi5/Lycsdu3bpl5ebmdrZ123nweNjDajuUESlJ69atK8eOHfstAPTr1+9kmzZtylu0\naGEIDAw8lZWV5SO/bvTo0Xvk4ol9+/Y9k5WV5cMaOaQ0TA0R1aFVq1ZV8tcODg7G1q1bV8pfV1dX\n372BcnR0rJC/btGihcFgMLSwbkuJmo6BgMiMpPuUCSayZwwERHW4d0WQ6ffy13XVgOdKIlIiFp0j\nIlI5jgiIiFSOgYCISOUYCIiIVI6BgIhI5RgIiIhUjoGAiEjl/j9fZuqpxURX8wAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4dd1170>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_4.ipynb new file mode 100755 index 00000000..792546a8 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_4.ipynb @@ -0,0 +1,437 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7298a6e927860b27b9f6a568bbab1f848676757d89a8929c4d46b14437989042"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page no:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 2000 ; #W/m^2 K\n",
+ "#From Table 7.1\n",
+ "Uf = 0.0001 ; #fouling factor, m^2K/W\n",
+ "\n",
+ "#calculations\n",
+ "hf = 1/(1/ h+ Uf );\n",
+ "p = (h-hf)/h *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient including the effect of foulung =\",round(hf,4),\"W/m^2 K\";\n",
+ "print\"Percentage reduction =\",round(p,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient including the effect of foulung = 1666.6667 W/m^2 K\n",
+ "Percentage reduction = 16.6667\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page no:294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 1000 ; #kg/h\n",
+ "Thi = 50 ; #C\n",
+ "The = 40 ; #C\n",
+ "Tci = 35 ; #C\n",
+ "Tce = 40 ; #C\n",
+ "U = 1000 ; #OHTC, W/m^2 K\n",
+ "#From fig 7.15,\n",
+ "F =0.91 ;\n",
+ "#Again from fig 7.15,\n",
+ "F =0.91 ;\n",
+ "\n",
+ "#calculations\n",
+ "#Using Eqn 7.5.25\n",
+ "q = m /3600*4174*( Thi - The ) ; #W\n",
+ "deltaT = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi -Tce)/( The -Tci )); #C\n",
+ "#T1 = Th and T2 = Tc\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#Alternatively, taking T1 = Tc and T2 = Th\n",
+ "R2 = (Tci - Tce )/( The - Thi );\n",
+ "S2 = (The - Thi )/( Tci - Thi );\n",
+ "A = q/(U*F* deltaT );\n",
+ "\n",
+ "#result\n",
+ "print\"delta T =\",round(deltaT,4);\n",
+ "print\"\\nTaking T1 = Th and T2 = Tc\";\n",
+ "print\"R=\",round(R,4), \"S=\",round(S,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nTaking T1 = Tc and T2 = Th\";\n",
+ "print\"R2=\",round(R2,4),\"S2=\",round(S2,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nArea =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delta T = 7.2135\n",
+ "\n",
+ "Taking T1 = Th and T2 = Tc\n",
+ "R= 2.0 S= 0.3333\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Taking T1 = Tc and T2 = Th\n",
+ "R2= 0.5 S2= 0.6667\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Area = 1.7663 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page no:295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Because of change of phase , Thi = The\n",
+ "Thi = 100 ; #[C], Saturated steam\n",
+ "The = 100 ; #[C], Condensed steam\n",
+ "Tci = 30 ; #[C], Cooling water inlet\n",
+ "Tce = 70 ; #[C], cooling water outlet\n",
+ "#From fig 7.16\n",
+ "F = 1;\n",
+ "\n",
+ "#calculations\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#For counter flow arrangement\n",
+ "Tmcounter = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi - Tce )/(The - Tci )); #For counter flow arrangement\n",
+ "#Therefore\n",
+ "Tm = F* Tmcounter ;\n",
+ "\n",
+ "#result\n",
+ "print\"Mean Temperaature Difference =\",round(Tm,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Temperaature Difference = 47.2089 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(a), Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot /60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ; #C\n",
+ "#Using equation 7.5.13\n",
+ "Tm = (( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce)); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "\n",
+ "#result\n",
+ "print\"(a)\";\n",
+ "print\"Mean Temperature Difference =\",round(Tm,4),\"C\";\n",
+ "print\"Area of Heat Exchanger =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Mean Temperature Difference = 28.7569 C\n",
+ "Area of Heat Exchanger = 0.6055 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(b) , Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "mhot1 = 20 ; #kg/min\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot/60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ;\n",
+ "# Using equation 7.5.13\n",
+ "Tm = ((( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce))); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "#Flow rate on hot side i.e. 'hh' is doubled\n",
+ "hh1 = 1600*2**0.8 ; #W/m^2 K\n",
+ "U1 = 1/(1/ hh1 + 1/ hc); #W/m^2 K\n",
+ "mhCph = mhot1 /60*4179 ; #W/K\n",
+ "mcCpc = mcold /60*4174 ; #W/K\n",
+ "#Therefore\n",
+ "C = mhCph / mcCpc ;\n",
+ "ntu = U1*A/ mhCph ;\n",
+ "e = (1 - math.exp ( -(1+C)*ntu) )/(1+ C) ;\n",
+ "#Therefore (Thi - The)/(Thi - Tci) = e , we get\n",
+ "The = Thi - e*( Thi - Tci );\n",
+ "#Equating the heat lost by water to heat gained by cold water , we get\n",
+ "Tce = Tci + ( mhCph *( Thi - The ))/ mcCpc ;\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\\nNTU =\",round(ntu,4);\n",
+ "print\"Exit temperature of cold and hot stream are\",round(Tce,4),\"C and\",round(The,4),\"C respectively.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "NTU = 0.4418\n",
+ "Exit temperature of cold and hot stream are 35.981 C and 56.2901 C respectively.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 , Page no:304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mc = 2000 ; # [kg/h]\n",
+ "Tce = 40 ; # [C]\n",
+ "Tci = 15 ; # [C]\n",
+ "Thi = 80 ; # [C]\n",
+ "U = 50 ; # OHTC, [W/m**2 K]\n",
+ "A = 10 ; # Area, [m**2]\n",
+ "\n",
+ "#Calculations\n",
+ "# Using effective NTU method\n",
+ "# Assuming m_c*C_pc = (m*C_p)s\n",
+ "NTU = U*A/(mc*1005/3600);\n",
+ "e = (Tce-Tci)/(Thi-Tci);\n",
+ "# From fig 7.23, no value of C is found corresponding to the above values, hence assumption was wrong.\n",
+ "# So, m_h*C_ph must be equal to (m*C_p)s, proceeding by trail and error method\n",
+ "\n",
+ "mh_1 = 200\n",
+ "NTU_1 = U*A/(mh_1*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .416;\n",
+ "e = .78;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_1 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_1 = Thi - mc*1005/3600*(Tce-Tci)/(mh_1*1.161);\n",
+ "\n",
+ "mh_2 = 250\n",
+ "NTU_2 = U*A/(mh_2*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .520;\n",
+ "e = .69;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_2 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_2 = Thi - mc*1005/3600*(Tce-Tci)/(mh_2*1.161);\n",
+ "\n",
+ "mh_3 = 300\n",
+ "NTU_3 = U*A/(mh_3*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .624;\n",
+ "e = .625;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_3 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_3 = Thi - mc*1005/3600*(Tce-Tci)/(mh_3*1.161);\n",
+ "\n",
+ "mh_4 = 350\n",
+ "NTU_4 = U*A/(mh_4*1.161);#Corresponding Values of C and e from fig 7.23\n",
+ "C = .728;\n",
+ "e = .57;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_4 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_4 = Thi - mc*1005/3600*(Tce-Tci)/(mh_4*1.161);\n",
+ "\n",
+ "mh_5 = 400\n",
+ "NTU_5 = U*A/(mh_5*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .832;\n",
+ "e = .51;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_5 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_5 = Thi - mc*1005/3600*(Tce-Tci)/(mh_5*1.161);\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print (\"m_h(kg/h) \\t NTU \\t\\t C \\t\\t e \\t T_he(C) \\t\\t T_he(C)(Heat Balance)\");\n",
+ "print mh_1,\"\\t\\t\",round(NTU_1,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_1,1),\"\\t\\t\\t\",round(The2_1,1);\n",
+ "print mh_2,\"\\t\\t\",round(NTU_2,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_2,1),\"\\t\\t\\t\",round(The2_2,1);\n",
+ "print mh_3,\"\\t\\t\",round(NTU_3,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_3,1),\"\\t\\t\\t\",round(The2_3,1);\n",
+ "print mh_4,\"\\t\\t\",round(NTU_4,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_4,1),\"\\t\\t\\t\",round(The2_4,1);\n",
+ "print mh_5,\"\\t\\t\",round(NTU_5,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_5,1),\"\\t\\t\\t\",round(The2_5,1);\n",
+ "\n",
+ "#Graph\n",
+ "mh=[200,250,300,350,400];\n",
+ "The=[29.3,35.2,39.4,43,46.9];\n",
+ "The2=[19.9,31.9,39.9,45.7,50];\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "%matplotlib inline\n",
+ "\n",
+ "plt.plot (mh,The,'b',mh,The2,'r',[295,295,200],[0,39.2,39.2],'k');\n",
+ "plt.title (\"mh vs The\");\n",
+ "plt.xlabel(\" mh \");\n",
+ "plt.ylabel(\" The \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m_h(kg/h) \t NTU \t\t C \t\t e \t T_he(C) \t\t T_he(C)(Heat Balance)\n",
+ "200 \t\t2.153 \t\t0.832 \t\t0.51 \t\t 29.3 \t\t\t19.9\n",
+ "250 \t\t1.723 \t\t0.832 \t\t0.51 \t\t 35.2 \t\t\t31.9\n",
+ "300 \t\t1.436 \t\t0.832 \t\t0.51 \t\t 39.4 \t\t\t39.9\n",
+ "350 \t\t1.23 \t\t0.832 \t\t0.51 \t\t 43.0 \t\t\t45.6\n",
+ "400 \t\t1.077 \t\t0.832 \t\t0.51 \t\t 46.9 \t\t\t49.9\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEVCAYAAADtmeJyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNf5P/DP4IKiyFJlIKLihiDI4oZbIsagMSpgtCZo\nDGnNUhtJY1OXJO032l9b0UTTuDRpEtMSE01sowhucYkQ44YiuBu3IIswLgOCINvM/f1xemUwKAiz\nXe7n/XrdV1mGuSe343nuec65z9FIkgQiIlIvB1s3gIiIbIuBgIhI5RgIiIhUjoGAiEjlGAiIiFSO\ngYCISOUYCKjZysrK8nFwcDAajUa7+Zz7+Phk7dmzZ7St20Fkym7+gRAp3Zdffjnd2dm5xNnZucTJ\nyanMwcHBKH/foUOHYgDQaDSSRqPhwztkVxgIiMxk+vTpX5aUlDiXlJQ4b9++fVznzp3z5O+Li4s7\n2Lp9RPfDQECK4uPjk/Xee+/9ISgo6ISzs3PJzJkz1+h0Ou24ceO2u7i43IqIiNhVVFTkavo3X3zx\nxXPdunW70qlTp+t/+9vf3qrrfQ8fPhzm5eWVL0mSRv7Zpk2bJgUHBx8HgLS0tMEDBw486uLicsvT\n07PgjTfeWPagdpq+z70yMjJCg4ODj7u6uhY9++yzX1VUVDjKv9uyZcuEkJCQTDc3t8Lhw4fvP3ny\nZL+GXhuiRpMkiQcPxRw+Pj4/DR069MC1a9c65eXlPeLh4aELDQ09lpmZGVxeXu74+OOP71m0aNH/\nSZKEn376yUej0Rhffvnlf5aXlzseP348yNHRsfzs2bN+db13z549L+7atesJ+fspU6b8Z8mSJfMk\nScKQIUMOfvHFF9MlSUJpaanToUOH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N4Jj4qKitaXL1/u3qNHj0tGo1Fj\n6wkbeznudz2vXr3qJX+9fPnyOTExMet4Pes/rl+/3rGwsNBVkiSUlZW1ffTRR7/fvXv3aH4+zXs9\n8/PzPeXX8PP58EdKSsrICRMmJEuSeftOq/0H7Nu3b4RGozEGBwdnhoSEZISEhGRs3779yZs3b7qP\nHj16d+/evc9HRETslD88kiThr3/961s9e/a82KdPn3M7duwYa+v/E+zpqOt6btu2bdyMGTM+79ev\n34mgoKDjUVFRiQUFBVpez/qPEydO9AsNDT0WHByc2a9fvxNLly6dK0kS+Pk07/Xk57NpR0pKykh5\n1ZA5P5saSWIajohIzbhDGRGRyjEQEBGpHAMBEZHKMRAQEakcAwFRI/373/9+IS4ubqWt20HUVAwE\nRI3EJ1+puWAgIKpD+/btb8+bN29pYGDgqYiIiF2HDh0aMnLkyNSePXteSk5Onii/7urVq4+MGzdu\nu6+v7/n58+cvsWWbiRrN1g9I8OBhj4dGozHKD+JMmjRpY0RExM7q6uoWx48fDwoJCcmQJAn/+te/\nXujRo8el4uJi5/Lycsdu3bpl5ebmdrZ123nweNjDajuUESlJ69atK8eOHfstAPTr1+9kmzZtylu0\naGEIDAw8lZWV5SO/bvTo0Xvk4ol9+/Y9k5WV5cMaOaQ0TA0R1aFVq1ZV8tcODg7G1q1bV8pfV1dX\n372BcnR0rJC/btGihcFgMLSwbkuJmo6BgMiMpPuUCSayZwwERHW4d0WQ6ffy13XVgOdKIlIiFp0j\nIlI5jgiIiFSOgYCISOUYCIiIVI6BgIhI5RgIiIhUjoGAiEjl/j9fZuqpxURX8wAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4dd1170>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_5.ipynb new file mode 100755 index 00000000..792546a8 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_5.ipynb @@ -0,0 +1,437 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7298a6e927860b27b9f6a568bbab1f848676757d89a8929c4d46b14437989042"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page no:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 2000 ; #W/m^2 K\n",
+ "#From Table 7.1\n",
+ "Uf = 0.0001 ; #fouling factor, m^2K/W\n",
+ "\n",
+ "#calculations\n",
+ "hf = 1/(1/ h+ Uf );\n",
+ "p = (h-hf)/h *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient including the effect of foulung =\",round(hf,4),\"W/m^2 K\";\n",
+ "print\"Percentage reduction =\",round(p,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient including the effect of foulung = 1666.6667 W/m^2 K\n",
+ "Percentage reduction = 16.6667\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page no:294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 1000 ; #kg/h\n",
+ "Thi = 50 ; #C\n",
+ "The = 40 ; #C\n",
+ "Tci = 35 ; #C\n",
+ "Tce = 40 ; #C\n",
+ "U = 1000 ; #OHTC, W/m^2 K\n",
+ "#From fig 7.15,\n",
+ "F =0.91 ;\n",
+ "#Again from fig 7.15,\n",
+ "F =0.91 ;\n",
+ "\n",
+ "#calculations\n",
+ "#Using Eqn 7.5.25\n",
+ "q = m /3600*4174*( Thi - The ) ; #W\n",
+ "deltaT = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi -Tce)/( The -Tci )); #C\n",
+ "#T1 = Th and T2 = Tc\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#Alternatively, taking T1 = Tc and T2 = Th\n",
+ "R2 = (Tci - Tce )/( The - Thi );\n",
+ "S2 = (The - Thi )/( Tci - Thi );\n",
+ "A = q/(U*F* deltaT );\n",
+ "\n",
+ "#result\n",
+ "print\"delta T =\",round(deltaT,4);\n",
+ "print\"\\nTaking T1 = Th and T2 = Tc\";\n",
+ "print\"R=\",round(R,4), \"S=\",round(S,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nTaking T1 = Tc and T2 = Th\";\n",
+ "print\"R2=\",round(R2,4),\"S2=\",round(S2,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nArea =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delta T = 7.2135\n",
+ "\n",
+ "Taking T1 = Th and T2 = Tc\n",
+ "R= 2.0 S= 0.3333\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Taking T1 = Tc and T2 = Th\n",
+ "R2= 0.5 S2= 0.6667\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Area = 1.7663 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page no:295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Because of change of phase , Thi = The\n",
+ "Thi = 100 ; #[C], Saturated steam\n",
+ "The = 100 ; #[C], Condensed steam\n",
+ "Tci = 30 ; #[C], Cooling water inlet\n",
+ "Tce = 70 ; #[C], cooling water outlet\n",
+ "#From fig 7.16\n",
+ "F = 1;\n",
+ "\n",
+ "#calculations\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#For counter flow arrangement\n",
+ "Tmcounter = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi - Tce )/(The - Tci )); #For counter flow arrangement\n",
+ "#Therefore\n",
+ "Tm = F* Tmcounter ;\n",
+ "\n",
+ "#result\n",
+ "print\"Mean Temperaature Difference =\",round(Tm,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Temperaature Difference = 47.2089 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(a), Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot /60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ; #C\n",
+ "#Using equation 7.5.13\n",
+ "Tm = (( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce)); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "\n",
+ "#result\n",
+ "print\"(a)\";\n",
+ "print\"Mean Temperature Difference =\",round(Tm,4),\"C\";\n",
+ "print\"Area of Heat Exchanger =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Mean Temperature Difference = 28.7569 C\n",
+ "Area of Heat Exchanger = 0.6055 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(b) , Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "mhot1 = 20 ; #kg/min\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot/60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ;\n",
+ "# Using equation 7.5.13\n",
+ "Tm = ((( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce))); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "#Flow rate on hot side i.e. 'hh' is doubled\n",
+ "hh1 = 1600*2**0.8 ; #W/m^2 K\n",
+ "U1 = 1/(1/ hh1 + 1/ hc); #W/m^2 K\n",
+ "mhCph = mhot1 /60*4179 ; #W/K\n",
+ "mcCpc = mcold /60*4174 ; #W/K\n",
+ "#Therefore\n",
+ "C = mhCph / mcCpc ;\n",
+ "ntu = U1*A/ mhCph ;\n",
+ "e = (1 - math.exp ( -(1+C)*ntu) )/(1+ C) ;\n",
+ "#Therefore (Thi - The)/(Thi - Tci) = e , we get\n",
+ "The = Thi - e*( Thi - Tci );\n",
+ "#Equating the heat lost by water to heat gained by cold water , we get\n",
+ "Tce = Tci + ( mhCph *( Thi - The ))/ mcCpc ;\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\\nNTU =\",round(ntu,4);\n",
+ "print\"Exit temperature of cold and hot stream are\",round(Tce,4),\"C and\",round(The,4),\"C respectively.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "NTU = 0.4418\n",
+ "Exit temperature of cold and hot stream are 35.981 C and 56.2901 C respectively.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 , Page no:304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mc = 2000 ; # [kg/h]\n",
+ "Tce = 40 ; # [C]\n",
+ "Tci = 15 ; # [C]\n",
+ "Thi = 80 ; # [C]\n",
+ "U = 50 ; # OHTC, [W/m**2 K]\n",
+ "A = 10 ; # Area, [m**2]\n",
+ "\n",
+ "#Calculations\n",
+ "# Using effective NTU method\n",
+ "# Assuming m_c*C_pc = (m*C_p)s\n",
+ "NTU = U*A/(mc*1005/3600);\n",
+ "e = (Tce-Tci)/(Thi-Tci);\n",
+ "# From fig 7.23, no value of C is found corresponding to the above values, hence assumption was wrong.\n",
+ "# So, m_h*C_ph must be equal to (m*C_p)s, proceeding by trail and error method\n",
+ "\n",
+ "mh_1 = 200\n",
+ "NTU_1 = U*A/(mh_1*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .416;\n",
+ "e = .78;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_1 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_1 = Thi - mc*1005/3600*(Tce-Tci)/(mh_1*1.161);\n",
+ "\n",
+ "mh_2 = 250\n",
+ "NTU_2 = U*A/(mh_2*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .520;\n",
+ "e = .69;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_2 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_2 = Thi - mc*1005/3600*(Tce-Tci)/(mh_2*1.161);\n",
+ "\n",
+ "mh_3 = 300\n",
+ "NTU_3 = U*A/(mh_3*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .624;\n",
+ "e = .625;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_3 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_3 = Thi - mc*1005/3600*(Tce-Tci)/(mh_3*1.161);\n",
+ "\n",
+ "mh_4 = 350\n",
+ "NTU_4 = U*A/(mh_4*1.161);#Corresponding Values of C and e from fig 7.23\n",
+ "C = .728;\n",
+ "e = .57;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_4 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_4 = Thi - mc*1005/3600*(Tce-Tci)/(mh_4*1.161);\n",
+ "\n",
+ "mh_5 = 400\n",
+ "NTU_5 = U*A/(mh_5*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .832;\n",
+ "e = .51;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_5 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_5 = Thi - mc*1005/3600*(Tce-Tci)/(mh_5*1.161);\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print (\"m_h(kg/h) \\t NTU \\t\\t C \\t\\t e \\t T_he(C) \\t\\t T_he(C)(Heat Balance)\");\n",
+ "print mh_1,\"\\t\\t\",round(NTU_1,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_1,1),\"\\t\\t\\t\",round(The2_1,1);\n",
+ "print mh_2,\"\\t\\t\",round(NTU_2,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_2,1),\"\\t\\t\\t\",round(The2_2,1);\n",
+ "print mh_3,\"\\t\\t\",round(NTU_3,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_3,1),\"\\t\\t\\t\",round(The2_3,1);\n",
+ "print mh_4,\"\\t\\t\",round(NTU_4,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_4,1),\"\\t\\t\\t\",round(The2_4,1);\n",
+ "print mh_5,\"\\t\\t\",round(NTU_5,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_5,1),\"\\t\\t\\t\",round(The2_5,1);\n",
+ "\n",
+ "#Graph\n",
+ "mh=[200,250,300,350,400];\n",
+ "The=[29.3,35.2,39.4,43,46.9];\n",
+ "The2=[19.9,31.9,39.9,45.7,50];\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "%matplotlib inline\n",
+ "\n",
+ "plt.plot (mh,The,'b',mh,The2,'r',[295,295,200],[0,39.2,39.2],'k');\n",
+ "plt.title (\"mh vs The\");\n",
+ "plt.xlabel(\" mh \");\n",
+ "plt.ylabel(\" The \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m_h(kg/h) \t NTU \t\t C \t\t e \t T_he(C) \t\t T_he(C)(Heat Balance)\n",
+ "200 \t\t2.153 \t\t0.832 \t\t0.51 \t\t 29.3 \t\t\t19.9\n",
+ "250 \t\t1.723 \t\t0.832 \t\t0.51 \t\t 35.2 \t\t\t31.9\n",
+ "300 \t\t1.436 \t\t0.832 \t\t0.51 \t\t 39.4 \t\t\t39.9\n",
+ "350 \t\t1.23 \t\t0.832 \t\t0.51 \t\t 43.0 \t\t\t45.6\n",
+ "400 \t\t1.077 \t\t0.832 \t\t0.51 \t\t 46.9 \t\t\t49.9\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEVCAYAAADtmeJyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNf5P/DP4IKiyFJlIKLihiDI4oZbIsagMSpgtCZo\nDGnNUhtJY1OXJO032l9b0UTTuDRpEtMSE01sowhucYkQ44YiuBu3IIswLgOCINvM/f1xemUwKAiz\nXe7n/XrdV1mGuSe343nuec65z9FIkgQiIlIvB1s3gIiIbIuBgIhI5RgIiIhUjoGAiEjlGAiIiFSO\ngYCISOUYCKjZysrK8nFwcDAajUa7+Zz7+Phk7dmzZ7St20Fkym7+gRAp3Zdffjnd2dm5xNnZucTJ\nyanMwcHBKH/foUOHYgDQaDSSRqPhwztkVxgIiMxk+vTpX5aUlDiXlJQ4b9++fVznzp3z5O+Li4s7\n2Lp9RPfDQECK4uPjk/Xee+/9ISgo6ISzs3PJzJkz1+h0Ou24ceO2u7i43IqIiNhVVFTkavo3X3zx\nxXPdun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uUCSayZwwERHW4d0WQ6ffy13XVgOdKIlIiFp0j\nIlI5jgiIiFSOgYCISOUYCIiIVI6BgIhI5RgIiIhUjoGAiEjl/j9fZuqpxURX8wAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4dd1170>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_6.ipynb new file mode 100755 index 00000000..792546a8 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_6.ipynb @@ -0,0 +1,437 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7298a6e927860b27b9f6a568bbab1f848676757d89a8929c4d46b14437989042"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page no:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 2000 ; #W/m^2 K\n",
+ "#From Table 7.1\n",
+ "Uf = 0.0001 ; #fouling factor, m^2K/W\n",
+ "\n",
+ "#calculations\n",
+ "hf = 1/(1/ h+ Uf );\n",
+ "p = (h-hf)/h *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient including the effect of foulung =\",round(hf,4),\"W/m^2 K\";\n",
+ "print\"Percentage reduction =\",round(p,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient including the effect of foulung = 1666.6667 W/m^2 K\n",
+ "Percentage reduction = 16.6667\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page no:294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 1000 ; #kg/h\n",
+ "Thi = 50 ; #C\n",
+ "The = 40 ; #C\n",
+ "Tci = 35 ; #C\n",
+ "Tce = 40 ; #C\n",
+ "U = 1000 ; #OHTC, W/m^2 K\n",
+ "#From fig 7.15,\n",
+ "F =0.91 ;\n",
+ "#Again from fig 7.15,\n",
+ "F =0.91 ;\n",
+ "\n",
+ "#calculations\n",
+ "#Using Eqn 7.5.25\n",
+ "q = m /3600*4174*( Thi - The ) ; #W\n",
+ "deltaT = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi -Tce)/( The -Tci )); #C\n",
+ "#T1 = Th and T2 = Tc\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#Alternatively, taking T1 = Tc and T2 = Th\n",
+ "R2 = (Tci - Tce )/( The - Thi );\n",
+ "S2 = (The - Thi )/( Tci - Thi );\n",
+ "A = q/(U*F* deltaT );\n",
+ "\n",
+ "#result\n",
+ "print\"delta T =\",round(deltaT,4);\n",
+ "print\"\\nTaking T1 = Th and T2 = Tc\";\n",
+ "print\"R=\",round(R,4), \"S=\",round(S,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nTaking T1 = Tc and T2 = Th\";\n",
+ "print\"R2=\",round(R2,4),\"S2=\",round(S2,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nArea =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delta T = 7.2135\n",
+ "\n",
+ "Taking T1 = Th and T2 = Tc\n",
+ "R= 2.0 S= 0.3333\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Taking T1 = Tc and T2 = Th\n",
+ "R2= 0.5 S2= 0.6667\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Area = 1.7663 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page no:295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Because of change of phase , Thi = The\n",
+ "Thi = 100 ; #[C], Saturated steam\n",
+ "The = 100 ; #[C], Condensed steam\n",
+ "Tci = 30 ; #[C], Cooling water inlet\n",
+ "Tce = 70 ; #[C], cooling water outlet\n",
+ "#From fig 7.16\n",
+ "F = 1;\n",
+ "\n",
+ "#calculations\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#For counter flow arrangement\n",
+ "Tmcounter = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi - Tce )/(The - Tci )); #For counter flow arrangement\n",
+ "#Therefore\n",
+ "Tm = F* Tmcounter ;\n",
+ "\n",
+ "#result\n",
+ "print\"Mean Temperaature Difference =\",round(Tm,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Temperaature Difference = 47.2089 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(a), Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot /60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ; #C\n",
+ "#Using equation 7.5.13\n",
+ "Tm = (( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce)); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "\n",
+ "#result\n",
+ "print\"(a)\";\n",
+ "print\"Mean Temperature Difference =\",round(Tm,4),\"C\";\n",
+ "print\"Area of Heat Exchanger =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Mean Temperature Difference = 28.7569 C\n",
+ "Area of Heat Exchanger = 0.6055 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(b) , Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "mhot1 = 20 ; #kg/min\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot/60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ;\n",
+ "# Using equation 7.5.13\n",
+ "Tm = ((( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce))); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "#Flow rate on hot side i.e. 'hh' is doubled\n",
+ "hh1 = 1600*2**0.8 ; #W/m^2 K\n",
+ "U1 = 1/(1/ hh1 + 1/ hc); #W/m^2 K\n",
+ "mhCph = mhot1 /60*4179 ; #W/K\n",
+ "mcCpc = mcold /60*4174 ; #W/K\n",
+ "#Therefore\n",
+ "C = mhCph / mcCpc ;\n",
+ "ntu = U1*A/ mhCph ;\n",
+ "e = (1 - math.exp ( -(1+C)*ntu) )/(1+ C) ;\n",
+ "#Therefore (Thi - The)/(Thi - Tci) = e , we get\n",
+ "The = Thi - e*( Thi - Tci );\n",
+ "#Equating the heat lost by water to heat gained by cold water , we get\n",
+ "Tce = Tci + ( mhCph *( Thi - The ))/ mcCpc ;\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\\nNTU =\",round(ntu,4);\n",
+ "print\"Exit temperature of cold and hot stream are\",round(Tce,4),\"C and\",round(The,4),\"C respectively.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "NTU = 0.4418\n",
+ "Exit temperature of cold and hot stream are 35.981 C and 56.2901 C respectively.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 , Page no:304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mc = 2000 ; # [kg/h]\n",
+ "Tce = 40 ; # [C]\n",
+ "Tci = 15 ; # [C]\n",
+ "Thi = 80 ; # [C]\n",
+ "U = 50 ; # OHTC, [W/m**2 K]\n",
+ "A = 10 ; # Area, [m**2]\n",
+ "\n",
+ "#Calculations\n",
+ "# Using effective NTU method\n",
+ "# Assuming m_c*C_pc = (m*C_p)s\n",
+ "NTU = U*A/(mc*1005/3600);\n",
+ "e = (Tce-Tci)/(Thi-Tci);\n",
+ "# From fig 7.23, no value of C is found corresponding to the above values, hence assumption was wrong.\n",
+ "# So, m_h*C_ph must be equal to (m*C_p)s, proceeding by trail and error method\n",
+ "\n",
+ "mh_1 = 200\n",
+ "NTU_1 = U*A/(mh_1*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .416;\n",
+ "e = .78;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_1 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_1 = Thi - mc*1005/3600*(Tce-Tci)/(mh_1*1.161);\n",
+ "\n",
+ "mh_2 = 250\n",
+ "NTU_2 = U*A/(mh_2*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .520;\n",
+ "e = .69;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_2 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_2 = Thi - mc*1005/3600*(Tce-Tci)/(mh_2*1.161);\n",
+ "\n",
+ "mh_3 = 300\n",
+ "NTU_3 = U*A/(mh_3*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .624;\n",
+ "e = .625;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_3 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_3 = Thi - mc*1005/3600*(Tce-Tci)/(mh_3*1.161);\n",
+ "\n",
+ "mh_4 = 350\n",
+ "NTU_4 = U*A/(mh_4*1.161);#Corresponding Values of C and e from fig 7.23\n",
+ "C = .728;\n",
+ "e = .57;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_4 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_4 = Thi - mc*1005/3600*(Tce-Tci)/(mh_4*1.161);\n",
+ "\n",
+ "mh_5 = 400\n",
+ "NTU_5 = U*A/(mh_5*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .832;\n",
+ "e = .51;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_5 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_5 = Thi - mc*1005/3600*(Tce-Tci)/(mh_5*1.161);\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print (\"m_h(kg/h) \\t NTU \\t\\t C \\t\\t e \\t T_he(C) \\t\\t T_he(C)(Heat Balance)\");\n",
+ "print mh_1,\"\\t\\t\",round(NTU_1,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_1,1),\"\\t\\t\\t\",round(The2_1,1);\n",
+ "print mh_2,\"\\t\\t\",round(NTU_2,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_2,1),\"\\t\\t\\t\",round(The2_2,1);\n",
+ "print mh_3,\"\\t\\t\",round(NTU_3,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_3,1),\"\\t\\t\\t\",round(The2_3,1);\n",
+ "print mh_4,\"\\t\\t\",round(NTU_4,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_4,1),\"\\t\\t\\t\",round(The2_4,1);\n",
+ "print mh_5,\"\\t\\t\",round(NTU_5,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_5,1),\"\\t\\t\\t\",round(The2_5,1);\n",
+ "\n",
+ "#Graph\n",
+ "mh=[200,250,300,350,400];\n",
+ "The=[29.3,35.2,39.4,43,46.9];\n",
+ "The2=[19.9,31.9,39.9,45.7,50];\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "%matplotlib inline\n",
+ "\n",
+ "plt.plot (mh,The,'b',mh,The2,'r',[295,295,200],[0,39.2,39.2],'k');\n",
+ "plt.title (\"mh vs The\");\n",
+ "plt.xlabel(\" mh \");\n",
+ "plt.ylabel(\" The \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m_h(kg/h) \t NTU \t\t C \t\t e \t T_he(C) \t\t T_he(C)(Heat Balance)\n",
+ "200 \t\t2.153 \t\t0.832 \t\t0.51 \t\t 29.3 \t\t\t19.9\n",
+ "250 \t\t1.723 \t\t0.832 \t\t0.51 \t\t 35.2 \t\t\t31.9\n",
+ "300 \t\t1.436 \t\t0.832 \t\t0.51 \t\t 39.4 \t\t\t39.9\n",
+ "350 \t\t1.23 \t\t0.832 \t\t0.51 \t\t 43.0 \t\t\t45.6\n",
+ "400 \t\t1.077 \t\t0.832 \t\t0.51 \t\t 46.9 \t\t\t49.9\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEVCAYAAADtmeJyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNf5P/DP4IKiyFJlIKLihiDI4oZbIsagMSpgtCZo\nDGnNUhtJY1OXJO032l9b0UTTuDRpEtMSE01sowhucYkQ44YiuBu3IIswLgOCINvM/f1xemUw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btb8+bN29pYGDgqYiIiF2HDh0aMnLkyNSePXteSk5Onii/7urVq4+MGzdu\nu6+v7/n58+cvsWWbiRrN1g9I8OBhj4dGozHKD+JMmjRpY0RExM7q6uoWx48fDwoJCcmQJAn/+te/\nXujRo8el4uJi5/Lycsdu3bpl5ebmdrZ123nweNjDajuUESlJ69atK8eOHfstAPTr1+9kmzZtylu0\naGEIDAw8lZWV5SO/bvTo0Xvk4ol9+/Y9k5WV5cMaOaQ0TA0R1aFVq1ZV8tcODg7G1q1bV8pfV1dX\n372BcnR0rJC/btGihcFgMLSwbkuJmo6BgMiMpPuUCSayZwwERHW4d0WQ6ffy13XVgOdKIlIiFp0j\nIlI5jgiIiFSOgYCISOUYCIiIVI6BgIhI5RgIiIhUjoGAiEjl/j9fZuqpxURX8wAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4dd1170>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_7.ipynb new file mode 100755 index 00000000..792546a8 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_7.ipynb @@ -0,0 +1,437 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7298a6e927860b27b9f6a568bbab1f848676757d89a8929c4d46b14437989042"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page no:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 2000 ; #W/m^2 K\n",
+ "#From Table 7.1\n",
+ "Uf = 0.0001 ; #fouling factor, m^2K/W\n",
+ "\n",
+ "#calculations\n",
+ "hf = 1/(1/ h+ Uf );\n",
+ "p = (h-hf)/h *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient including the effect of foulung =\",round(hf,4),\"W/m^2 K\";\n",
+ "print\"Percentage reduction =\",round(p,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient including the effect of foulung = 1666.6667 W/m^2 K\n",
+ "Percentage reduction = 16.6667\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page no:294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 1000 ; #kg/h\n",
+ "Thi = 50 ; #C\n",
+ "The = 40 ; #C\n",
+ "Tci = 35 ; #C\n",
+ "Tce = 40 ; #C\n",
+ "U = 1000 ; #OHTC, W/m^2 K\n",
+ "#From fig 7.15,\n",
+ "F =0.91 ;\n",
+ "#Again from fig 7.15,\n",
+ "F =0.91 ;\n",
+ "\n",
+ "#calculations\n",
+ "#Using Eqn 7.5.25\n",
+ "q = m /3600*4174*( Thi - The ) ; #W\n",
+ "deltaT = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi -Tce)/( The -Tci )); #C\n",
+ "#T1 = Th and T2 = Tc\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#Alternatively, taking T1 = Tc and T2 = Th\n",
+ "R2 = (Tci - Tce )/( The - Thi );\n",
+ "S2 = (The - Thi )/( Tci - Thi );\n",
+ "A = q/(U*F* deltaT );\n",
+ "\n",
+ "#result\n",
+ "print\"delta T =\",round(deltaT,4);\n",
+ "print\"\\nTaking T1 = Th and T2 = Tc\";\n",
+ "print\"R=\",round(R,4), \"S=\",round(S,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nTaking T1 = Tc and T2 = Th\";\n",
+ "print\"R2=\",round(R2,4),\"S2=\",round(S2,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nArea =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delta T = 7.2135\n",
+ "\n",
+ "Taking T1 = Th and T2 = Tc\n",
+ "R= 2.0 S= 0.3333\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Taking T1 = Tc and T2 = Th\n",
+ "R2= 0.5 S2= 0.6667\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Area = 1.7663 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page no:295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Because of change of phase , Thi = The\n",
+ "Thi = 100 ; #[C], Saturated steam\n",
+ "The = 100 ; #[C], Condensed steam\n",
+ "Tci = 30 ; #[C], Cooling water inlet\n",
+ "Tce = 70 ; #[C], cooling water outlet\n",
+ "#From fig 7.16\n",
+ "F = 1;\n",
+ "\n",
+ "#calculations\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#For counter flow arrangement\n",
+ "Tmcounter = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi - Tce )/(The - Tci )); #For counter flow arrangement\n",
+ "#Therefore\n",
+ "Tm = F* Tmcounter ;\n",
+ "\n",
+ "#result\n",
+ "print\"Mean Temperaature Difference =\",round(Tm,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Temperaature Difference = 47.2089 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(a), Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot /60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ; #C\n",
+ "#Using equation 7.5.13\n",
+ "Tm = (( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce)); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "\n",
+ "#result\n",
+ "print\"(a)\";\n",
+ "print\"Mean Temperature Difference =\",round(Tm,4),\"C\";\n",
+ "print\"Area of Heat Exchanger =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Mean Temperature Difference = 28.7569 C\n",
+ "Area of Heat Exchanger = 0.6055 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(b) , Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "mhot1 = 20 ; #kg/min\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot/60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ;\n",
+ "# Using equation 7.5.13\n",
+ "Tm = ((( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce))); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "#Flow rate on hot side i.e. 'hh' is doubled\n",
+ "hh1 = 1600*2**0.8 ; #W/m^2 K\n",
+ "U1 = 1/(1/ hh1 + 1/ hc); #W/m^2 K\n",
+ "mhCph = mhot1 /60*4179 ; #W/K\n",
+ "mcCpc = mcold /60*4174 ; #W/K\n",
+ "#Therefore\n",
+ "C = mhCph / mcCpc ;\n",
+ "ntu = U1*A/ mhCph ;\n",
+ "e = (1 - math.exp ( -(1+C)*ntu) )/(1+ C) ;\n",
+ "#Therefore (Thi - The)/(Thi - Tci) = e , we get\n",
+ "The = Thi - e*( Thi - Tci );\n",
+ "#Equating the heat lost by water to heat gained by cold water , we get\n",
+ "Tce = Tci + ( mhCph *( Thi - The ))/ mcCpc ;\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\\nNTU =\",round(ntu,4);\n",
+ "print\"Exit temperature of cold and hot stream are\",round(Tce,4),\"C and\",round(The,4),\"C respectively.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "NTU = 0.4418\n",
+ "Exit temperature of cold and hot stream are 35.981 C and 56.2901 C respectively.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 , Page no:304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mc = 2000 ; # [kg/h]\n",
+ "Tce = 40 ; # [C]\n",
+ "Tci = 15 ; # [C]\n",
+ "Thi = 80 ; # [C]\n",
+ "U = 50 ; # OHTC, [W/m**2 K]\n",
+ "A = 10 ; # Area, [m**2]\n",
+ "\n",
+ "#Calculations\n",
+ "# Using effective NTU method\n",
+ "# Assuming m_c*C_pc = (m*C_p)s\n",
+ "NTU = U*A/(mc*1005/3600);\n",
+ "e = (Tce-Tci)/(Thi-Tci);\n",
+ "# From fig 7.23, no value of C is found corresponding to the above values, hence assumption was wrong.\n",
+ "# So, m_h*C_ph must be equal to (m*C_p)s, proceeding by trail and error method\n",
+ "\n",
+ "mh_1 = 200\n",
+ "NTU_1 = U*A/(mh_1*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .416;\n",
+ "e = .78;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_1 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_1 = Thi - mc*1005/3600*(Tce-Tci)/(mh_1*1.161);\n",
+ "\n",
+ "mh_2 = 250\n",
+ "NTU_2 = U*A/(mh_2*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .520;\n",
+ "e = .69;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_2 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_2 = Thi - mc*1005/3600*(Tce-Tci)/(mh_2*1.161);\n",
+ "\n",
+ "mh_3 = 300\n",
+ "NTU_3 = U*A/(mh_3*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .624;\n",
+ "e = .625;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_3 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_3 = Thi - mc*1005/3600*(Tce-Tci)/(mh_3*1.161);\n",
+ "\n",
+ "mh_4 = 350\n",
+ "NTU_4 = U*A/(mh_4*1.161);#Corresponding Values of C and e from fig 7.23\n",
+ "C = .728;\n",
+ "e = .57;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_4 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_4 = Thi - mc*1005/3600*(Tce-Tci)/(mh_4*1.161);\n",
+ "\n",
+ "mh_5 = 400\n",
+ "NTU_5 = U*A/(mh_5*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .832;\n",
+ "e = .51;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_5 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_5 = Thi - mc*1005/3600*(Tce-Tci)/(mh_5*1.161);\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print (\"m_h(kg/h) \\t NTU \\t\\t C \\t\\t e \\t T_he(C) \\t\\t T_he(C)(Heat Balance)\");\n",
+ "print mh_1,\"\\t\\t\",round(NTU_1,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_1,1),\"\\t\\t\\t\",round(The2_1,1);\n",
+ "print mh_2,\"\\t\\t\",round(NTU_2,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_2,1),\"\\t\\t\\t\",round(The2_2,1);\n",
+ "print mh_3,\"\\t\\t\",round(NTU_3,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_3,1),\"\\t\\t\\t\",round(The2_3,1);\n",
+ "print mh_4,\"\\t\\t\",round(NTU_4,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_4,1),\"\\t\\t\\t\",round(The2_4,1);\n",
+ "print mh_5,\"\\t\\t\",round(NTU_5,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_5,1),\"\\t\\t\\t\",round(The2_5,1);\n",
+ "\n",
+ "#Graph\n",
+ "mh=[200,250,300,350,400];\n",
+ "The=[29.3,35.2,39.4,43,46.9];\n",
+ "The2=[19.9,31.9,39.9,45.7,50];\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "%matplotlib inline\n",
+ "\n",
+ "plt.plot (mh,The,'b',mh,The2,'r',[295,295,200],[0,39.2,39.2],'k');\n",
+ "plt.title (\"mh vs The\");\n",
+ "plt.xlabel(\" mh \");\n",
+ "plt.ylabel(\" The \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m_h(kg/h) \t NTU \t\t C \t\t e \t T_he(C) \t\t T_he(C)(Heat Balance)\n",
+ "200 \t\t2.153 \t\t0.832 \t\t0.51 \t\t 29.3 \t\t\t19.9\n",
+ "250 \t\t1.723 \t\t0.832 \t\t0.51 \t\t 35.2 \t\t\t31.9\n",
+ "300 \t\t1.436 \t\t0.832 \t\t0.51 \t\t 39.4 \t\t\t39.9\n",
+ "350 \t\t1.23 \t\t0.832 \t\t0.51 \t\t 43.0 \t\t\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aH4+zXs9\n8/PzPeXX8PP58EdKSsrICRMmJEuSeftOq/0H7Nu3b4RGozEGBwdnhoSEZISEhGRs3779yZs3b7qP\nHj16d+/evc9HRETslD88kiThr3/961s9e/a82KdPn3M7duwYa+v/E+zpqOt6btu2bdyMGTM+79ev\n34mgoKDjUVFRiQUFBVpez/qPEydO9AsNDT0WHByc2a9fvxNLly6dK0kS+Pk07/Xk57NpR0pKykh5\n1ZA5P5saSWIajohIzbhDGRGRyjEQEBGpHAMBEZHKMRAQEakcAwFRI/373/9+IS4ubqWt20HUVAwE\nRI3EJ1+puWAgIKpD+/btb8+bN29pYGDgqYiIiF2HDh0aMnLkyNSePXteSk5Onii/7urVq4+MGzdu\nu6+v7/n58+cvsWWbiRrN1g9I8OBhj4dGozHKD+JMmjRpY0RExM7q6uoWx48fDwoJCcmQJAn/+te/\nXujRo8el4uJi5/Lycsdu3bpl5ebmdrZ123nweNjDajuUESlJ69atK8eOHfstAPTr1+9kmzZtylu0\naGEIDAw8lZWV5SO/bvTo0Xvk4ol9+/Y9k5WV5cMaOaQ0TA0R1aFVq1ZV8tcODg7G1q1bV8pfV1dX\n372BcnR0rJC/btGihcFgMLSwbkuJmo6BgMiMpPuUCSayZwwERHW4d0WQ6ffy13XVgOdKIlIiFp0j\nIlI5jgiIiFSOgYCISOUYCIiIVI6BgIhI5RgIiIhUjoGAiEjl/j9fZuqpxURX8wAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4dd1170>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_8.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_8.ipynb new file mode 100755 index 00000000..792546a8 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_7_Heat_Exchangers_8.ipynb @@ -0,0 +1,437 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7298a6e927860b27b9f6a568bbab1f848676757d89a8929c4d46b14437989042"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page no:285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 2000 ; #W/m^2 K\n",
+ "#From Table 7.1\n",
+ "Uf = 0.0001 ; #fouling factor, m^2K/W\n",
+ "\n",
+ "#calculations\n",
+ "hf = 1/(1/ h+ Uf );\n",
+ "p = (h-hf)/h *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient including the effect of foulung =\",round(hf,4),\"W/m^2 K\";\n",
+ "print\"Percentage reduction =\",round(p,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient including the effect of foulung = 1666.6667 W/m^2 K\n",
+ "Percentage reduction = 16.6667\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page no:294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 1000 ; #kg/h\n",
+ "Thi = 50 ; #C\n",
+ "The = 40 ; #C\n",
+ "Tci = 35 ; #C\n",
+ "Tce = 40 ; #C\n",
+ "U = 1000 ; #OHTC, W/m^2 K\n",
+ "#From fig 7.15,\n",
+ "F =0.91 ;\n",
+ "#Again from fig 7.15,\n",
+ "F =0.91 ;\n",
+ "\n",
+ "#calculations\n",
+ "#Using Eqn 7.5.25\n",
+ "q = m /3600*4174*( Thi - The ) ; #W\n",
+ "deltaT = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi -Tce)/( The -Tci )); #C\n",
+ "#T1 = Th and T2 = Tc\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#Alternatively, taking T1 = Tc and T2 = Th\n",
+ "R2 = (Tci - Tce )/( The - Thi );\n",
+ "S2 = (The - Thi )/( Tci - Thi );\n",
+ "A = q/(U*F* deltaT );\n",
+ "\n",
+ "#result\n",
+ "print\"delta T =\",round(deltaT,4);\n",
+ "print\"\\nTaking T1 = Th and T2 = Tc\";\n",
+ "print\"R=\",round(R,4), \"S=\",round(S,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nTaking T1 = Tc and T2 = Th\";\n",
+ "print\"R2=\",round(R2,4),\"S2=\",round(S2,4);\n",
+ "print\"Hence, F =\",round(F,4);\n",
+ "print\"\\nArea =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delta T = 7.2135\n",
+ "\n",
+ "Taking T1 = Th and T2 = Tc\n",
+ "R= 2.0 S= 0.3333\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Taking T1 = Tc and T2 = Th\n",
+ "R2= 0.5 S2= 0.6667\n",
+ "Hence, F = 0.91\n",
+ "\n",
+ "Area = 1.7663 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page no:295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Because of change of phase , Thi = The\n",
+ "Thi = 100 ; #[C], Saturated steam\n",
+ "The = 100 ; #[C], Condensed steam\n",
+ "Tci = 30 ; #[C], Cooling water inlet\n",
+ "Tce = 70 ; #[C], cooling water outlet\n",
+ "#From fig 7.16\n",
+ "F = 1;\n",
+ "\n",
+ "#calculations\n",
+ "R = (Thi - The )/( Tce - Tci ) ;\n",
+ "S = (Tce - Tci )/( Thi - Tci ) ;\n",
+ "#For counter flow arrangement\n",
+ "Tmcounter = (( Thi - Tce ) -(The - Tci ))/math.log (( Thi - Tce )/(The - Tci )); #For counter flow arrangement\n",
+ "#Therefore\n",
+ "Tm = F* Tmcounter ;\n",
+ "\n",
+ "#result\n",
+ "print\"Mean Temperaature Difference =\",round(Tm,4),\"C\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Temperaature Difference = 47.2089 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(a), Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot /60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ; #C\n",
+ "#Using equation 7.5.13\n",
+ "Tm = (( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce)); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "\n",
+ "#result\n",
+ "print\"(a)\";\n",
+ "print\"Mean Temperature Difference =\",round(Tm,4),\"C\";\n",
+ "print\"Area of Heat Exchanger =\",round(A,4),\"m^2\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Mean Temperature Difference = 28.7569 C\n",
+ "Area of Heat Exchanger = 0.6055 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4(b) , Page no:302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "#Using Mean Temperature Difference approach\n",
+ "mhot = 10 ; #kg/min\n",
+ "mcold = 25 ; #kg/min\n",
+ "hh = 1600 ; #[W/m^2 K], Heat transfer coefficient on hot side\n",
+ "hc = 1600 ; #[W/m^2 K], Heat transfer coefficient on cold side\n",
+ "Thi = 70 ; #C\n",
+ "Tci = 25 ; #C\n",
+ "The = 50 ; #C\n",
+ "mhot1 = 20 ; #kg/min\n",
+ "\n",
+ "#calculations\n",
+ "#Heat Transfer Rate, q\n",
+ "q = mhot/60*4179*( Thi - The ); #W\n",
+ "#Heat gained by cold water = heat lost by the hot water\n",
+ "Tce = 25 + q *1/( mcold /60*4174) ;\n",
+ "# Using equation 7.5.13\n",
+ "Tm = ((( Thi - Tci ) -(The - Tce ))/math.log (( Thi -Tci)/( The -Tce))); #C\n",
+ "U = 1/(1/ hh + 1/ hc); #W/m^2 K\n",
+ "A = q/(U*Tm); #Area, [m^2]\n",
+ "#Flow rate on hot side i.e. 'hh' is doubled\n",
+ "hh1 = 1600*2**0.8 ; #W/m^2 K\n",
+ "U1 = 1/(1/ hh1 + 1/ hc); #W/m^2 K\n",
+ "mhCph = mhot1 /60*4179 ; #W/K\n",
+ "mcCpc = mcold /60*4174 ; #W/K\n",
+ "#Therefore\n",
+ "C = mhCph / mcCpc ;\n",
+ "ntu = U1*A/ mhCph ;\n",
+ "e = (1 - math.exp ( -(1+C)*ntu) )/(1+ C) ;\n",
+ "#Therefore (Thi - The)/(Thi - Tci) = e , we get\n",
+ "The = Thi - e*( Thi - Tci );\n",
+ "#Equating the heat lost by water to heat gained by cold water , we get\n",
+ "Tce = Tci + ( mhCph *( Thi - The ))/ mcCpc ;\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\\nNTU =\",round(ntu,4);\n",
+ "print\"Exit temperature of cold and hot stream are\",round(Tce,4),\"C and\",round(The,4),\"C respectively.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "NTU = 0.4418\n",
+ "Exit temperature of cold and hot stream are 35.981 C and 56.2901 C respectively.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 , Page no:304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mc = 2000 ; # [kg/h]\n",
+ "Tce = 40 ; # [C]\n",
+ "Tci = 15 ; # [C]\n",
+ "Thi = 80 ; # [C]\n",
+ "U = 50 ; # OHTC, [W/m**2 K]\n",
+ "A = 10 ; # Area, [m**2]\n",
+ "\n",
+ "#Calculations\n",
+ "# Using effective NTU method\n",
+ "# Assuming m_c*C_pc = (m*C_p)s\n",
+ "NTU = U*A/(mc*1005/3600);\n",
+ "e = (Tce-Tci)/(Thi-Tci);\n",
+ "# From fig 7.23, no value of C is found corresponding to the above values, hence assumption was wrong.\n",
+ "# So, m_h*C_ph must be equal to (m*C_p)s, proceeding by trail and error method\n",
+ "\n",
+ "mh_1 = 200\n",
+ "NTU_1 = U*A/(mh_1*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .416;\n",
+ "e = .78;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_1 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_1 = Thi - mc*1005/3600*(Tce-Tci)/(mh_1*1.161);\n",
+ "\n",
+ "mh_2 = 250\n",
+ "NTU_2 = U*A/(mh_2*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .520;\n",
+ "e = .69;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_2 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_2 = Thi - mc*1005/3600*(Tce-Tci)/(mh_2*1.161);\n",
+ "\n",
+ "mh_3 = 300\n",
+ "NTU_3 = U*A/(mh_3*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .624;\n",
+ "e = .625;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_3 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_3 = Thi - mc*1005/3600*(Tce-Tci)/(mh_3*1.161);\n",
+ "\n",
+ "mh_4 = 350\n",
+ "NTU_4 = U*A/(mh_4*1.161);#Corresponding Values of C and e from fig 7.23\n",
+ "C = .728;\n",
+ "e = .57;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_4 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_4 = Thi - mc*1005/3600*(Tce-Tci)/(mh_4*1.161);\n",
+ "\n",
+ "mh_5 = 400\n",
+ "NTU_5 = U*A/(mh_5*1.161);\n",
+ "#Corresponding Values of C and e from fig 7.23\n",
+ "C = .832;\n",
+ "e = .51;\n",
+ "#From Equation 7.6.2 Page 297\n",
+ "The_5 = Thi - e*(Thi-Tci)\n",
+ "#From Heat Balance\n",
+ "The2_5 = Thi - mc*1005/3600*(Tce-Tci)/(mh_5*1.161);\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print (\"m_h(kg/h) \\t NTU \\t\\t C \\t\\t e \\t T_he(C) \\t\\t T_he(C)(Heat Balance)\");\n",
+ "print mh_1,\"\\t\\t\",round(NTU_1,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_1,1),\"\\t\\t\\t\",round(The2_1,1);\n",
+ "print mh_2,\"\\t\\t\",round(NTU_2,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_2,1),\"\\t\\t\\t\",round(The2_2,1);\n",
+ "print mh_3,\"\\t\\t\",round(NTU_3,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_3,1),\"\\t\\t\\t\",round(The2_3,1);\n",
+ "print mh_4,\"\\t\\t\",round(NTU_4,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_4,1),\"\\t\\t\\t\",round(The2_4,1);\n",
+ "print mh_5,\"\\t\\t\",round(NTU_5,3),\"\\t\\t\",round(C,3),\"\\t\\t\",round(e,2),\"\\t\\t \",round(The_5,1),\"\\t\\t\\t\",round(The2_5,1);\n",
+ "\n",
+ "#Graph\n",
+ "mh=[200,250,300,350,400];\n",
+ "The=[29.3,35.2,39.4,43,46.9];\n",
+ "The2=[19.9,31.9,39.9,45.7,50];\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "%matplotlib inline\n",
+ "\n",
+ "plt.plot (mh,The,'b',mh,The2,'r',[295,295,200],[0,39.2,39.2],'k');\n",
+ "plt.title (\"mh vs The\");\n",
+ "plt.xlabel(\" mh \");\n",
+ "plt.ylabel(\" The \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m_h(kg/h) \t NTU \t\t C \t\t e \t T_he(C) \t\t T_he(C)(Heat Balance)\n",
+ "200 \t\t2.153 \t\t0.832 \t\t0.51 \t\t 29.3 \t\t\t19.9\n",
+ "250 \t\t1.723 \t\t0.832 \t\t0.51 \t\t 35.2 \t\t\t31.9\n",
+ "300 \t\t1.436 \t\t0.832 \t\t0.51 \t\t 39.4 \t\t\t39.9\n",
+ "350 \t\t1.23 \t\t0.832 \t\t0.51 \t\t 43.0 \t\t\t45.6\n",
+ "400 \t\t1.077 \t\t0.832 \t\t0.51 \t\t 46.9 \t\t\t49.9\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEVCAYAAADtmeJyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNf5P/DP4IKiyFJlIKLihiDI4oZbIsagMSpgtCZo\nDGnNUhtJY1OXJO032l9b0UTTuDRpEtMSE01sowhucYkQ44YiuBu3IIswLgOCINvM/f1xemUwKAiz\nXe7n/XrdV1mGuSe343nuec65z9FIkgQiIlIvB1s3gIiIbIuBgIhI5RgIiIhUjoGAiEjlGAiIiFSO\ngYCISOUYCKjZysrK8nFwcDAajUa7+Zz7+Phk7dmzZ7St20Fkym7+gRAp3Zdffjnd2dm5xNnZucTJ\nyanMwcHBKH/foUOHYgDQaDSSRqPhwztkVxgIiMxk+vTpX5aUlDiXlJQ4b9++fVznzp3z5O+Li4s7\n2Lp9RPfDQECK4uPjk/Xee+/9ISgo6ISzs3PJzJkz1+h0Ou24ceO2u7i43IqIiNhVVFTkavo3X3zx\nxXPdunW70qlTp+t/+9vf3qrrfQ8fPhzm5eWVL0mSRv7Zpk2bJgUHBx8HgLS0tMEDBw486uLicsvT\n07PgjTfeWPagdpq+z70yMjJCg4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URX8wAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4dd1170>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_1.ipynb new file mode 100755 index 00000000..d8b484bd --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_1.ipynb @@ -0,0 +1,495 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f7a2826bb5ef350cbea2514ac8a8b908a8de4a74e86c0b05c1c2aaabf919bcf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Condensation and boiling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 , Page no:318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 80 ; #C\n",
+ "Tw = 70 ; #C\n",
+ "L = 1 ; #m\n",
+ "g = 9.8 ; #m/s^2\n",
+ "#From table A.1\n",
+ "rho = 978.8 ; #kg/m^3\n",
+ "k = 0.672 ; #W/m K\n",
+ "hfg = 2309 ; #At 80 C,kJ/kg\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts + Tw)/2 ; #Assuming condensate film is laminar and Re < 30\n",
+ "u = 381 *10**-6 ; #kg/m s\n",
+ "v = u/rho ;\n",
+ "#Substituting in eqn 8.3.9, we get\n",
+ "h = 0.943*(( hfg *1000*( rho**2)*g*(k**3)) /(( Ts -Tw)*u*L) )**(1/4) ; #W/m^2 K\n",
+ "rate = h*L*(Ts -Tw)/( hfg *1000) ; #kg/m s\n",
+ "Re = 4* rate /u;\n",
+ "#Substituting h = Re*(lambda*1000)*u/(4*L*(Ts-Tw)), in eqn 8.3.12\n",
+ "Re_1 = (((4* L*(Ts -Tw)*k/( hfg *1000* u)*(g/(v**2) )**(1/3) )+5.2)/1.08)**(1/1.22) ; #Substituting h = Re*(hfg*1000)*u/(4*L*(Ts-Tw))\n",
+ "#From eqn 8.3.12\n",
+ "h_1 = ((Re /(1.08*( Re**1.22) -5.2) )*k *(( g/v**2)**(1/3) )); #W/m^2 K\n",
+ "m = h_1*L *10/( hfg *1000) ; #rate of condensation,kg/m s\n",
+ "\n",
+ "#result\n",
+ "print\"Assuming condensate film is laminar and Re < 30\";\n",
+ "print\"h =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"ReL =\",round(Re,4);\n",
+ "print\"Initial assumption was wrong, Now considering the effect of ripples, we get\";\n",
+ "print\"Re =\",round(Re_1,4);\n",
+ "print\"Heat Transfer Cofficient =\",round(h_1,4),\"W/m^2 K\";\n",
+ "print\"Rate of condensation =\",round(m,6),\"kg/m s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming condensate film is laminar and Re < 30\n",
+ "h = 6078.7864 W/m^2 K\n",
+ "ReL = 276.3936\n",
+ "Initial assumption was wrong, Now considering the effect of ripples, we get\n",
+ "Re = 320.4829\n",
+ "Heat Transfer Cofficient = 7287.8478 W/m^2 K\n",
+ "Rate of condensation = 0.031563 kg/m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 , Page no:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 262 ; #K\n",
+ "D = 0.022 ; #m\n",
+ "Tw = 258 ; #K\n",
+ "#Properties at Tm\n",
+ "rho = 1324 ; #kg/m^3\n",
+ "k = 0.1008 ; #W/m K\n",
+ "g = 9.81 ; #m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts+Tw) /2;\n",
+ "v = 1.90*10**-7 ; #m^2/s\n",
+ "hfg = 215.1*10**3 ; #J/kg\n",
+ "u = v*rho ; #Viscosity\n",
+ "#From eqn 8.4.1\n",
+ "h = 0.725*( hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*D))**(1/4) ;\n",
+ "rate = h*3.14*D*(Ts -Tw) / hfg ; #kg/s m\n",
+ "Re = 4* rate /u ;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"Condensation rate per unit length =\",round(rate,6),\"kg/s m\";\n",
+ "print\"Film Reynolds number =\",round(Re,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient = 2622.2475 W/m^2 K\n",
+ "Condensation rate per unit length = 0.003369 kg/s m\n",
+ "Film Reynolds number = 53.5629\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 25/60 ; #kg/sec\n",
+ "ID = 0.025 ; #m\n",
+ "OD = 0.029 ; #m\n",
+ "Tci = 30 ; #C\n",
+ "Tce = 70 ; #C\n",
+ "g = 9.8 ; #m/s^2\n",
+ "Ts = 100 ; #C\n",
+ "#Assuming 5.3.2 is valid, properties at 50 C\n",
+ "#Properties at Tm\n",
+ "rho = 988.1 ; #kg/m^3\n",
+ "k = 0.648 ; #W/m K\n",
+ "Pr = 3.54 ;\n",
+ "#From eqn 4.6.4a\n",
+ "f = 0.005635;\n",
+ "#From eqn 5.3.2\n",
+ "Nu = 198.39 ;\n",
+ "Tw = 90 ; #Assuming average wall temperature = 90 C\n",
+ "#Properties at Tm\n",
+ "#Properties at Tm\n",
+ "rho = 961.9 ; #kg/m^3\n",
+ "k = 0.682 ; #W/m K\n",
+ "l = 0; #initial guess, assumed value for fsolve function\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.556*10**-6; #m^2/s\n",
+ "Re = 4*m/(3.14*ID*rho *v);\n",
+ "h = Nu*k/ID ;\n",
+ "u = 298.6*10**-6 ; #kg/m s\n",
+ "hfg = 2257*10**3 ; #J/kg\n",
+ "#Equating the heat flow from the condensing steam to the tube wall, to the heat flow from the tube wall to the flowing water.\n",
+ "#Solving the simplified equation\n",
+ "h = 0.725*(hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*OD))**(1/4) ;\n",
+ "#By solving trial and error method, the temperature value we get\n",
+ "T=86.964984;# in oC\n",
+ "#Therefore\n",
+ "hc = 21338.77/(100 - T)**(1/4) ; #W/m^2 K\n",
+ "#Now, equating the heat flowing from the condensing steam to the tube wall to the heat gained by the water, we have\n",
+ "#Solving by trial and error method, we get\n",
+ "L=5.216152; #in meter\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature obtained from trial and error =\",round(T,4),\"oC\";\n",
+ "print\"hc =\",round(hc,4),\"W/m^2 K\";\n",
+ "print\"Length of the tube =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature obtained from trial and error = 86.965 oC\n",
+ "hc = 11230.3034 W/m^2 K\n",
+ "Length of the tube = 5.2162 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "#Properties at (Tw+Ts)/2 = 100.5 degree celsius\n",
+ "deltaT1 = 1; #in degree celsius\n",
+ "p1 = 7.55*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v1 = 0.294*10**-6; #[m^2/sec] viscosity at 100.5 degree celsius\n",
+ "k1 = 0.683; #[W/m-k]thermal conductivity\n",
+ "Pr1 = 1.74; #Prandtl number\n",
+ "g = 9.81; #acceleration due to gravity\n",
+ "L = 0.14*10**-2; #diameter in meters\n",
+ "#Properties at (Tw+Ts)/2 =102.5\n",
+ "deltaT2 = 5; #in degree celsius\n",
+ "p2 = 7.66*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v2 = 0.289*10**-6; #[m^2/sec] viscosity at 102.5 degree celsius \n",
+ "k2 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr2 = 1.71; #Prandtl number \n",
+ "#Properties at (Tw+Ts)/2 =105\n",
+ "deltaT3 = 10; #in degree celsius\n",
+ "p3 = 7.80*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v3 = 0.284*10**-6; #[m^2/sec] viscosity at 105 degree celsius \n",
+ "k3 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr3 = 1.68; #Prandtl number\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ra1 = ((p1*g*deltaT1*L**3)/(v1**2))*Pr1;\n",
+ "q1=(k1/L)*(deltaT1)*(0.36+(0.518*Ra1**(1/4))/(1+(0.559/Pr1)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra2 = ((p2*g*deltaT2*L**3)/(v2**2))*Pr2;\n",
+ "q2=(k2/L)*(deltaT2)*(0.36+(0.518*Ra2**(1/4))/(1+(0.559/Pr2)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra3 = ((p3*g*deltaT3*L**3)/(v3**2))*Pr3;\n",
+ "q3=(k3/L)*(deltaT3)*(0.36+(0.518*Ra3**(1/4))/(1+(0.559/Pr3)**(9/16))**(4/9))\n",
+ "\n",
+ "#At 100 degree celsius\n",
+ "Cpl = 4.220; #[kJ/kg]\n",
+ "lamda = 2257; #[kJ/kg]\n",
+ "ul = 282.4*10**-6; #viscosity is in kg/m-sec\n",
+ "sigma = 589*10**-4; #Surface tension is in N/m\n",
+ "pl = 958.4; #density in kg/m^3\n",
+ "pv =0.598; #density of vapour in kg/m^3\n",
+ "deltap = pl-pv;\n",
+ "Prl = 1.75; #Prandtl no. of liquid\n",
+ "Ksf = 0.013;\n",
+ "deltaT11=5;\n",
+ "deltaT12=10;\n",
+ "deltaT13=20;\n",
+ "q11=141.32*deltaT11**3\n",
+ "q12=141.32*deltaT12**3\n",
+ "q13=141.32*deltaT13**3\n",
+ "\n",
+ "\n",
+ "L1 = (L/2)*(g*(pl-pv)/sigma)**(1/2);\n",
+ "f_L = 0.89+2.27*math.exp(-3.44*L1**(0.5));\n",
+ "q2 = f_L*((3.14/24)*lamda*10**(3)*pv**(0.5)*(sigma*g*(pl-pv))**(0.25));\n",
+ "\n",
+ "Tn=pow(q2/141.32,1/3)\n",
+ "q3 = 0.09*lamda*10**3*pv*(sigma*g*(pl-pv)/(pl+pv)**(2))**(0.25);\n",
+ "Ts1 = 140; #surface temperature in degree celsius\n",
+ "Ts2 = 200; #surface temperature in degree celsius\n",
+ "Ts3 = 600; #surface temperature in degree celsius\n",
+ "Twm1 = (140+100)/2; #Mean film temperature\n",
+ "#properties of steam at 120 degree celsius and 1.013 bar\n",
+ "kv = 0.02558; #thermal conductivity in W/mK\n",
+ "pv1 = 0.5654; #vapor density in kg/m**3\n",
+ "uv=13.185*10**(-6); #viscosity of vapour in kg/m sec\n",
+ "lamda1 = (2716.1-419.1)*10**(3);#Latent heat of fusion in J/kg\n",
+ "hc = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(140-100)))**(0.25);\n",
+ "qrad = 5.67*10**(-8)*(413**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr = qrad/(413-373);\n",
+ "h = hc + 0.75*hr;\n",
+ "\n",
+ "hc_200 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(200-100)))**(0.25);\n",
+ "qrad1 = 5.67*10**(-8)*(473**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_200 = qrad1/(200-100);\n",
+ "h_200 = hc_200 +0.75*hr_200;\n",
+ "hc_600 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(600-100)))**(0.25);\n",
+ "qrad2 = 5.67*10**(-8)*(873**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_600 = qrad1/(600-100)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"\\n q/A = \",round(q1,2),\" W/m^2 at (Tw-Ts)=1\";\n",
+ "print \"\\n q/A = \",round(q2,2),\" W/m^2 at (Tw-Ts)=5\";\n",
+ "print \"\\n q/A = \",round(q3,2),\" W/m^2 at (Tw-Ts)=10\";\n",
+ "print \"\\n q/A at deltaT = 5 degree celsius = \",q11,\" W/m^2\";\n",
+ "print \"\\nq/A at deltaT = 10 degree celsius = \",q12,\" W/m^2\";\n",
+ "print \"\\n q/A at deltaT =20 degree celsius = \",q13,\" W/m^2\";\n",
+ "print \"\\n Peak heat flux L = \",round(L1,2); \n",
+ "print \"\\n f(l) = \",round(f_L,2);\n",
+ "print \"\\n q/A = \",q2,\" W/m^2\";\n",
+ "print \"Tw-Ts = \",Tn,\" degree celsius\"\n",
+ "print \"\\n\\n Minimum heat flux\";\n",
+ "print \"\\n q/A \",q3, \"W/m^2\"\n",
+ "print \"\\n\\n Stable film boiling\"\n",
+ "print \"\\n hc = \",hc,\" W/m^2\"\n",
+ "print \"\\n q/A due to radiation = \",qrad,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr,\" W/m^2 K \";\n",
+ "print \"\\n Since hr<hc \";\n",
+ "print \"\\n The total heat transfer coefficient \";\n",
+ "print \" h = \",h,\" W/m^2 K\";\n",
+ "print \"\\n Total heat flux \",h*(140-100),\" W/m^2 K\";\n",
+ "print \"\\n\\n hc = \",hc_200,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_200,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad1,\" W/m^2\";\n",
+ "print \"\\n Total heat flux = \",h_200*100,\" W/m^2\";\n",
+ "print \"\\n\\n hc = \",hc_600,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_600,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad2,\" W/m^2\";\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "q = [q11, q12, q13];\n",
+ "plt.plot ([1, 5, 10],q);\n",
+ "deltaT=linspace(1,10,10);\n",
+ "q1=141.32*deltaT**3;\n",
+ "plt.plot (deltaT,q1)\n",
+ "plt.title (\"Boiling curve\");\n",
+ "plt.xlabel(\" (Tw - Ts)degree celsius \");\n",
+ "plt.ylabel(\" Heat flux,(q/A)W/m^2 \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " q/A = 1116.99 W/m^2 at (Tw-Ts)=1\n",
+ "\n",
+ " q/A = 1393519.91 W/m^2 at (Tw-Ts)=5\n",
+ "\n",
+ " q/A = 19025.3 W/m^2 at (Tw-Ts)=10\n",
+ "\n",
+ " q/A at deltaT = 5 degree celsius = 17665.0 W/m^2\n",
+ "\n",
+ "q/A at deltaT = 10 degree celsius = 141320.0 W/m^2\n",
+ "\n",
+ " q/A at deltaT =20 degree celsius = 1130560.0 W/m^2\n",
+ "\n",
+ " Peak heat flux L = 0.28\n",
+ "\n",
+ " f(l) = 1.26\n",
+ "\n",
+ " q/A = 1393519.90741 W/m^2\n",
+ "Tw-Ts = 21.4438708455 degree celsius\n",
+ "\n",
+ "\n",
+ " Minimum heat flux\n",
+ "\n",
+ " q/A 19025.295556 W/m^2\n",
+ "\n",
+ "\n",
+ " Stable film boiling\n",
+ "\n",
+ " hc = 455.986290831 W/m^2\n",
+ "\n",
+ " q/A due to radiation = 496.874268274 W/m^2\n",
+ "\n",
+ " hr = 12.4218567068 W/m^2 K \n",
+ "\n",
+ " Since hr<hc \n",
+ "\n",
+ " The total heat transfer coefficient \n",
+ " h = 465.302683361 W/m^2 K\n",
+ "\n",
+ " Total heat flux 18612.1073344 W/m^2 K\n",
+ "\n",
+ "\n",
+ " hc = 362.632549817 W/m^2\n",
+ "\n",
+ " hr = 15.665080604 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 1566.5080604 W/m^2\n",
+ "\n",
+ " Total heat flux = 37438.136027 W/m^2\n",
+ "\n",
+ "\n",
+ " hc = 242.507001959 W/m^2\n",
+ "\n",
+ " hr = 3.13301612081 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 28652.514946 W/m^2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEXCAYAAADr+ZCUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdcU2f7P/ArTAdKGBIgQVYCKFBAZYi1RREQ67YyrIKr\ndTxatX0o2vFVv62Ktj7VVq2/p5UCWkDrRCuIi2qVIQoWB0uCkDDUkLBncv/+OD39IkIZAodxvV+v\n80pycsaVtObDfc597sMihABCCCHU25SYLgAhhNDghAGEEEKIERhACCGEGIEBhBBCiBEYQAghhBiB\nAYQQQogRGEAIdbNffvnlPS8vr0v0ayUlJUVeXp4ZAMCaNWt++Oqrrz5nrjqE+g4WXgeE0KtMTEzy\nnz17pqesrCxXVVVtdHV1vX348OHVPB5P1NltKSkpKXJzc/lmZmZ5PVErQv0VtoAQagWLxSIXLlyY\nWVlZOaK4uNiAw+GUrl+//num6+ppTU1NKkzXgAYPDCCE2qGurl6/YMGCU48ePRpLzysvL9cMCAiI\n0NPTe2ZiYpK/Y8eOzwghLACAsLCwpZMnT77Z2raWLl0a9sUXX3wJAJCQkODG4/FE//nPfz7icDil\nhoaGRWFhYUvpZSUSic6sWbPOa2pqljs5OaV8/vnnX7W1XQCAP/74401XV9fbWlpa0tGjRxdEREQE\nAAC4ubklHDlyZAW9XMv6lJSUFIcOHVprYWGRbWFhkb127dpDQUFBXzff9pw5c859++23mwAAioqK\nDBcsWHBKT0/vmZmZWd7333+/vpNfKUIAgAGEUJvoQKmpqRl2/Phx34kTJybS761fv/77ysrKEUKh\n0PT3339/OyIiIuDnn39e1t42WSwWYbFYfx/3Li0t5VRUVIwsKioyPHLkyIp//etfB8vLyzUBAP71\nr38dHDFiRGVpaSknPDw8MCIiIqD5us09ffrUeMaMGRc3bNiw/8WLF7rp6en2dnZ291vbZ2vOnTs3\nJyUlxenx48dj/P39o44fP+5LvyeVSrUuX77s4e/vH6VQKJRmzZp13sHBIa2oqMjw6tWr7vv27dsY\nHx/v2d5nR6glDCCEWkEIYc2dO/eslpaWlM1my65ever+73//+xsAALlcrnz8+HHfXbt2bRk+fHi1\nsbHx048//njv0aNHl3R02/RzVVXVxv/5n//5X2VlZbm3t3eshoZGVVZWlqVcLlc+ffr0/O3bt28d\nMmRI3ZgxYx4HBgaGN1+3ucjIyEUeHh6XfX19jysrK8u1tbXL6ADqiC1btuxis9kydXX1+jfffPMP\nFotFbt68ORkA4OTJk++6urre1tfXL7lz547jixcvdD///POvVFRUmkxNTYUrV678KTo62q+j+0KI\nhsd7EWoFi8Ui586dmzN16tRrhBDW2bNn57799tu/P378eAwhhNXY2KhqbGz8lF5+9OjRBWKxmNvZ\n/ejo6EiUlJQU9Othw4bVVFVVaTx//nxUU1OTipGRUSH93j91gBCJRLzX6eTQfD8sFov4+flFR0VF\n+U+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q8nJyf9otdp7+7ne5XKF\nk6W21tbW39fX1w+3tbX99mWjROjrwgoIBaScnJwxh8NBkXk8ctrZ2flhfHw843MGCgqCUMTzvMiy\nrDQxMZGu1+tbvmSMCMkBKyCEEEKywAoIIYSQLDABIYQQkgUmIIQQQrLABIQQQkgWmIAQQgjJAhMQ\nQgghWbwDrHA2pVW5S0IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4843ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 , Page no:337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #m\n",
+ "l = 0.15 ; #m\n",
+ "T = 500+273 ; #K\n",
+ "Tc = -196+273 ; #K\n",
+ "e = 0.4;\n",
+ "#Properties\n",
+ "k = 0.0349 ; #W/m K\n",
+ "rho = 0.80 ; #kg/m^3\n",
+ "Cpavg = 1.048 ; #kJ/kg J\n",
+ "rholiq = 800 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "s = 5.670*10**-8;\n",
+ "#Film boiling will occur, hence eqn 8.7.9 is applicable\n",
+ "Tm = (T+Tc) /2; #Film boiling will occur\n",
+ "u = 23*10**-6 ; #kg/m s\n",
+ "latent = 201*10**3 ; #J/kg\n",
+ "hfg = (latent + Cpavg *(Tm -Tc) *1000); #Jk/g\n",
+ "hc = 0.62*((( k**3) *rho *799.2*9.81* hfg )/(D*u*(T-Tc)) )**(1/4) ; #W/m^2 K\n",
+ "#Taking the emissivity of liquid surface to be unity and using equation 3.9.1, the exchange of radiant heat flux\n",
+ "flux = s*(T**4- Tc**4) /(1/ e +1/1 -1) ; #W/m^2\n",
+ "hr = flux /(T-Tc);\n",
+ "#Since h_r < h_c, total heat transfer coefficient is determined from eqn 8.7.11\n",
+ "h = hc +3/4* hr ; #W/m^2 K\n",
+ "fluxi = h*(T-Tc);\n",
+ "Rate = fluxi *3.14*D*l; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Initial heat flux =\",round(fluxi,4),\"W/m^2\";\n",
+ "print\"Initial heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial heat flux = 69646.6128 W/m^2\n",
+ "Initial heat transfer rate = 656.0711 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_2.ipynb new file mode 100755 index 00000000..d8b484bd --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_2.ipynb @@ -0,0 +1,495 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f7a2826bb5ef350cbea2514ac8a8b908a8de4a74e86c0b05c1c2aaabf919bcf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Condensation and boiling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 , Page no:318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 80 ; #C\n",
+ "Tw = 70 ; #C\n",
+ "L = 1 ; #m\n",
+ "g = 9.8 ; #m/s^2\n",
+ "#From table A.1\n",
+ "rho = 978.8 ; #kg/m^3\n",
+ "k = 0.672 ; #W/m K\n",
+ "hfg = 2309 ; #At 80 C,kJ/kg\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts + Tw)/2 ; #Assuming condensate film is laminar and Re < 30\n",
+ "u = 381 *10**-6 ; #kg/m s\n",
+ "v = u/rho ;\n",
+ "#Substituting in eqn 8.3.9, we get\n",
+ "h = 0.943*(( hfg *1000*( rho**2)*g*(k**3)) /(( Ts -Tw)*u*L) )**(1/4) ; #W/m^2 K\n",
+ "rate = h*L*(Ts -Tw)/( hfg *1000) ; #kg/m s\n",
+ "Re = 4* rate /u;\n",
+ "#Substituting h = Re*(lambda*1000)*u/(4*L*(Ts-Tw)), in eqn 8.3.12\n",
+ "Re_1 = (((4* L*(Ts -Tw)*k/( hfg *1000* u)*(g/(v**2) )**(1/3) )+5.2)/1.08)**(1/1.22) ; #Substituting h = Re*(hfg*1000)*u/(4*L*(Ts-Tw))\n",
+ "#From eqn 8.3.12\n",
+ "h_1 = ((Re /(1.08*( Re**1.22) -5.2) )*k *(( g/v**2)**(1/3) )); #W/m^2 K\n",
+ "m = h_1*L *10/( hfg *1000) ; #rate of condensation,kg/m s\n",
+ "\n",
+ "#result\n",
+ "print\"Assuming condensate film is laminar and Re < 30\";\n",
+ "print\"h =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"ReL =\",round(Re,4);\n",
+ "print\"Initial assumption was wrong, Now considering the effect of ripples, we get\";\n",
+ "print\"Re =\",round(Re_1,4);\n",
+ "print\"Heat Transfer Cofficient =\",round(h_1,4),\"W/m^2 K\";\n",
+ "print\"Rate of condensation =\",round(m,6),\"kg/m s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming condensate film is laminar and Re < 30\n",
+ "h = 6078.7864 W/m^2 K\n",
+ "ReL = 276.3936\n",
+ "Initial assumption was wrong, Now considering the effect of ripples, we get\n",
+ "Re = 320.4829\n",
+ "Heat Transfer Cofficient = 7287.8478 W/m^2 K\n",
+ "Rate of condensation = 0.031563 kg/m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 , Page no:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 262 ; #K\n",
+ "D = 0.022 ; #m\n",
+ "Tw = 258 ; #K\n",
+ "#Properties at Tm\n",
+ "rho = 1324 ; #kg/m^3\n",
+ "k = 0.1008 ; #W/m K\n",
+ "g = 9.81 ; #m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts+Tw) /2;\n",
+ "v = 1.90*10**-7 ; #m^2/s\n",
+ "hfg = 215.1*10**3 ; #J/kg\n",
+ "u = v*rho ; #Viscosity\n",
+ "#From eqn 8.4.1\n",
+ "h = 0.725*( hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*D))**(1/4) ;\n",
+ "rate = h*3.14*D*(Ts -Tw) / hfg ; #kg/s m\n",
+ "Re = 4* rate /u ;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"Condensation rate per unit length =\",round(rate,6),\"kg/s m\";\n",
+ "print\"Film Reynolds number =\",round(Re,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient = 2622.2475 W/m^2 K\n",
+ "Condensation rate per unit length = 0.003369 kg/s m\n",
+ "Film Reynolds number = 53.5629\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 25/60 ; #kg/sec\n",
+ "ID = 0.025 ; #m\n",
+ "OD = 0.029 ; #m\n",
+ "Tci = 30 ; #C\n",
+ "Tce = 70 ; #C\n",
+ "g = 9.8 ; #m/s^2\n",
+ "Ts = 100 ; #C\n",
+ "#Assuming 5.3.2 is valid, properties at 50 C\n",
+ "#Properties at Tm\n",
+ "rho = 988.1 ; #kg/m^3\n",
+ "k = 0.648 ; #W/m K\n",
+ "Pr = 3.54 ;\n",
+ "#From eqn 4.6.4a\n",
+ "f = 0.005635;\n",
+ "#From eqn 5.3.2\n",
+ "Nu = 198.39 ;\n",
+ "Tw = 90 ; #Assuming average wall temperature = 90 C\n",
+ "#Properties at Tm\n",
+ "#Properties at Tm\n",
+ "rho = 961.9 ; #kg/m^3\n",
+ "k = 0.682 ; #W/m K\n",
+ "l = 0; #initial guess, assumed value for fsolve function\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.556*10**-6; #m^2/s\n",
+ "Re = 4*m/(3.14*ID*rho *v);\n",
+ "h = Nu*k/ID ;\n",
+ "u = 298.6*10**-6 ; #kg/m s\n",
+ "hfg = 2257*10**3 ; #J/kg\n",
+ "#Equating the heat flow from the condensing steam to the tube wall, to the heat flow from the tube wall to the flowing water.\n",
+ "#Solving the simplified equation\n",
+ "h = 0.725*(hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*OD))**(1/4) ;\n",
+ "#By solving trial and error method, the temperature value we get\n",
+ "T=86.964984;# in oC\n",
+ "#Therefore\n",
+ "hc = 21338.77/(100 - T)**(1/4) ; #W/m^2 K\n",
+ "#Now, equating the heat flowing from the condensing steam to the tube wall to the heat gained by the water, we have\n",
+ "#Solving by trial and error method, we get\n",
+ "L=5.216152; #in meter\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature obtained from trial and error =\",round(T,4),\"oC\";\n",
+ "print\"hc =\",round(hc,4),\"W/m^2 K\";\n",
+ "print\"Length of the tube =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature obtained from trial and error = 86.965 oC\n",
+ "hc = 11230.3034 W/m^2 K\n",
+ "Length of the tube = 5.2162 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "#Properties at (Tw+Ts)/2 = 100.5 degree celsius\n",
+ "deltaT1 = 1; #in degree celsius\n",
+ "p1 = 7.55*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v1 = 0.294*10**-6; #[m^2/sec] viscosity at 100.5 degree celsius\n",
+ "k1 = 0.683; #[W/m-k]thermal conductivity\n",
+ "Pr1 = 1.74; #Prandtl number\n",
+ "g = 9.81; #acceleration due to gravity\n",
+ "L = 0.14*10**-2; #diameter in meters\n",
+ "#Properties at (Tw+Ts)/2 =102.5\n",
+ "deltaT2 = 5; #in degree celsius\n",
+ "p2 = 7.66*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v2 = 0.289*10**-6; #[m^2/sec] viscosity at 102.5 degree celsius \n",
+ "k2 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr2 = 1.71; #Prandtl number \n",
+ "#Properties at (Tw+Ts)/2 =105\n",
+ "deltaT3 = 10; #in degree celsius\n",
+ "p3 = 7.80*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v3 = 0.284*10**-6; #[m^2/sec] viscosity at 105 degree celsius \n",
+ "k3 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr3 = 1.68; #Prandtl number\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ra1 = ((p1*g*deltaT1*L**3)/(v1**2))*Pr1;\n",
+ "q1=(k1/L)*(deltaT1)*(0.36+(0.518*Ra1**(1/4))/(1+(0.559/Pr1)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra2 = ((p2*g*deltaT2*L**3)/(v2**2))*Pr2;\n",
+ "q2=(k2/L)*(deltaT2)*(0.36+(0.518*Ra2**(1/4))/(1+(0.559/Pr2)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra3 = ((p3*g*deltaT3*L**3)/(v3**2))*Pr3;\n",
+ "q3=(k3/L)*(deltaT3)*(0.36+(0.518*Ra3**(1/4))/(1+(0.559/Pr3)**(9/16))**(4/9))\n",
+ "\n",
+ "#At 100 degree celsius\n",
+ "Cpl = 4.220; #[kJ/kg]\n",
+ "lamda = 2257; #[kJ/kg]\n",
+ "ul = 282.4*10**-6; #viscosity is in kg/m-sec\n",
+ "sigma = 589*10**-4; #Surface tension is in N/m\n",
+ "pl = 958.4; #density in kg/m^3\n",
+ "pv =0.598; #density of vapour in kg/m^3\n",
+ "deltap = pl-pv;\n",
+ "Prl = 1.75; #Prandtl no. of liquid\n",
+ "Ksf = 0.013;\n",
+ "deltaT11=5;\n",
+ "deltaT12=10;\n",
+ "deltaT13=20;\n",
+ "q11=141.32*deltaT11**3\n",
+ "q12=141.32*deltaT12**3\n",
+ "q13=141.32*deltaT13**3\n",
+ "\n",
+ "\n",
+ "L1 = (L/2)*(g*(pl-pv)/sigma)**(1/2);\n",
+ "f_L = 0.89+2.27*math.exp(-3.44*L1**(0.5));\n",
+ "q2 = f_L*((3.14/24)*lamda*10**(3)*pv**(0.5)*(sigma*g*(pl-pv))**(0.25));\n",
+ "\n",
+ "Tn=pow(q2/141.32,1/3)\n",
+ "q3 = 0.09*lamda*10**3*pv*(sigma*g*(pl-pv)/(pl+pv)**(2))**(0.25);\n",
+ "Ts1 = 140; #surface temperature in degree celsius\n",
+ "Ts2 = 200; #surface temperature in degree celsius\n",
+ "Ts3 = 600; #surface temperature in degree celsius\n",
+ "Twm1 = (140+100)/2; #Mean film temperature\n",
+ "#properties of steam at 120 degree celsius and 1.013 bar\n",
+ "kv = 0.02558; #thermal conductivity in W/mK\n",
+ "pv1 = 0.5654; #vapor density in kg/m**3\n",
+ "uv=13.185*10**(-6); #viscosity of vapour in kg/m sec\n",
+ "lamda1 = (2716.1-419.1)*10**(3);#Latent heat of fusion in J/kg\n",
+ "hc = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(140-100)))**(0.25);\n",
+ "qrad = 5.67*10**(-8)*(413**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr = qrad/(413-373);\n",
+ "h = hc + 0.75*hr;\n",
+ "\n",
+ "hc_200 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(200-100)))**(0.25);\n",
+ "qrad1 = 5.67*10**(-8)*(473**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_200 = qrad1/(200-100);\n",
+ "h_200 = hc_200 +0.75*hr_200;\n",
+ "hc_600 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(600-100)))**(0.25);\n",
+ "qrad2 = 5.67*10**(-8)*(873**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_600 = qrad1/(600-100)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"\\n q/A = \",round(q1,2),\" W/m^2 at (Tw-Ts)=1\";\n",
+ "print \"\\n q/A = \",round(q2,2),\" W/m^2 at (Tw-Ts)=5\";\n",
+ "print \"\\n q/A = \",round(q3,2),\" W/m^2 at (Tw-Ts)=10\";\n",
+ "print \"\\n q/A at deltaT = 5 degree celsius = \",q11,\" W/m^2\";\n",
+ "print \"\\nq/A at deltaT = 10 degree celsius = \",q12,\" W/m^2\";\n",
+ "print \"\\n q/A at deltaT =20 degree celsius = \",q13,\" W/m^2\";\n",
+ "print \"\\n Peak heat flux L = \",round(L1,2); \n",
+ "print \"\\n f(l) = \",round(f_L,2);\n",
+ "print \"\\n q/A = \",q2,\" W/m^2\";\n",
+ "print \"Tw-Ts = \",Tn,\" degree celsius\"\n",
+ "print \"\\n\\n Minimum heat flux\";\n",
+ "print \"\\n q/A \",q3, \"W/m^2\"\n",
+ "print \"\\n\\n Stable film boiling\"\n",
+ "print \"\\n hc = \",hc,\" W/m^2\"\n",
+ "print \"\\n q/A due to radiation = \",qrad,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr,\" W/m^2 K \";\n",
+ "print \"\\n Since hr<hc \";\n",
+ "print \"\\n The total heat transfer coefficient \";\n",
+ "print \" h = \",h,\" W/m^2 K\";\n",
+ "print \"\\n Total heat flux \",h*(140-100),\" W/m^2 K\";\n",
+ "print \"\\n\\n hc = \",hc_200,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_200,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad1,\" W/m^2\";\n",
+ "print \"\\n Total heat flux = \",h_200*100,\" W/m^2\";\n",
+ "print \"\\n\\n hc = \",hc_600,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_600,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad2,\" W/m^2\";\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "q = [q11, q12, q13];\n",
+ "plt.plot ([1, 5, 10],q);\n",
+ "deltaT=linspace(1,10,10);\n",
+ "q1=141.32*deltaT**3;\n",
+ "plt.plot (deltaT,q1)\n",
+ "plt.title (\"Boiling curve\");\n",
+ "plt.xlabel(\" (Tw - Ts)degree celsius \");\n",
+ "plt.ylabel(\" Heat flux,(q/A)W/m^2 \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " q/A = 1116.99 W/m^2 at (Tw-Ts)=1\n",
+ "\n",
+ " q/A = 1393519.91 W/m^2 at (Tw-Ts)=5\n",
+ "\n",
+ " q/A = 19025.3 W/m^2 at (Tw-Ts)=10\n",
+ "\n",
+ " q/A at deltaT = 5 degree celsius = 17665.0 W/m^2\n",
+ "\n",
+ "q/A at deltaT = 10 degree celsius = 141320.0 W/m^2\n",
+ "\n",
+ " q/A at deltaT =20 degree celsius = 1130560.0 W/m^2\n",
+ "\n",
+ " Peak heat flux L = 0.28\n",
+ "\n",
+ " f(l) = 1.26\n",
+ "\n",
+ " q/A = 1393519.90741 W/m^2\n",
+ "Tw-Ts = 21.4438708455 degree celsius\n",
+ "\n",
+ "\n",
+ " Minimum heat flux\n",
+ "\n",
+ " q/A 19025.295556 W/m^2\n",
+ "\n",
+ "\n",
+ " Stable film boiling\n",
+ "\n",
+ " hc = 455.986290831 W/m^2\n",
+ "\n",
+ " q/A due to radiation = 496.874268274 W/m^2\n",
+ "\n",
+ " hr = 12.4218567068 W/m^2 K \n",
+ "\n",
+ " Since hr<hc \n",
+ "\n",
+ " The total heat transfer coefficient \n",
+ " h = 465.302683361 W/m^2 K\n",
+ "\n",
+ " Total heat flux 18612.1073344 W/m^2 K\n",
+ "\n",
+ "\n",
+ " hc = 362.632549817 W/m^2\n",
+ "\n",
+ " hr = 15.665080604 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 1566.5080604 W/m^2\n",
+ "\n",
+ " Total heat flux = 37438.136027 W/m^2\n",
+ "\n",
+ "\n",
+ " hc = 242.507001959 W/m^2\n",
+ "\n",
+ " hr = 3.13301612081 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 28652.514946 W/m^2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEXCAYAAADr+ZCUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdcU2f7P/ArTAdKGBIgQVYCKFBAZYi1RREQ67YyrIKr\ndTxatX0o2vFVv62Ktj7VVq2/p5UCWkDrRCu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ydXX1+jfffPMP\nFotFbt68ORkA4OTJk++6urre1tfXL7lz547jixcvdD///POvVFRUmkxNTYUrV678KTo62q+j+0KI\nhsd7EWoFi8Ui586dmzN16tRrhBDW2bNn57799tu/P378eAwhhNXY2KhqbGz8lF5+9OjRBWKxmNvZ\n/ejo6EiUlJQU9Othw4bVVFVVaTx//nxUU1OTipGRUSH93j91gBCJRLzX6eTQfD8sFov4+flFR0VF\n+U+ePPlmZGTkooCAgAgAqqVVVFRkqKWlJaWXl8vlym+99daNru4bDV7YAkKoHSwWi8ybN++MsrKy\n/I8//nhTV1f3haqqamN+fr4JvUxBQcHojvaQa+9wGADAqFGjnquoqDQVFhYa0fOaP2/JyMio8MmT\nJ+atvTd8+PDq6urq4fTrkpIS/fZq8vf3jzp58uS7T58+NU5JSXFasGDBKQAqaE1NTYVSqVSLnioq\nKkZeuHBhZnufCaGWMIAQagN9uIsQwjp37twcqVSqNWbMmMfKyspyHx+fE5999tmOqqoqjadPnxp/\n++23mxYvXnysI9ts6zBac8rKyvL58+ef3rZt27ba2tqhmZmZVkePHl3SVni99957v1y5cmXar7/+\nurCpqUlFIpHo3L9/3w4AwN7ePv306dPza2trh+bm5vKbd0hoi729fbquru6LlStX/jR9+vS4kSNH\nVgAAODk5pYwYMaJyz549n9TW1g6Vy+XKDx48sElNTZ3Q3jYRagkDCKE2zJo16/yIESMqNTU1y7/4\n4osvIyIiAsaMGfMYAOD7779fP3z48GozM7O8yZMn33zvvfd+WbZs2c8Ar570b/m8rfdaOnDgwLry\n8nJNfX39ksDAwHB/f/8oNTW1htaWNTIyKrx48eKMvXv3fqyjoyNxcHBI+/PPP98AANi0adO3ampq\nDRwOp3TZsmU/L168+FhHali0aFHktWvXpi5atCiSnqekpKS4cOHCzPT0dHszM7O8UaNGPf/ggw/+\nW1FRMbIj3ylCzeGFqAj1E8HBwbufPXum15Hedgj1Bz3WAlq+fHkoh8MptbW1zaDnBQUFfT1mzJjH\ndnZ29+fPn3+a7m4KALBr164tAoEg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ZWVt7keV7c3t4+SOL03UFn\nMBiMu7u7oRzHLTAMs9jU1NQMAFBRUXGLpml7YmLiPMuykk6nM5NkRNA0bW9sbLySnZ39l1qtttbU\n1FwHADCZTNWzs7MnEhISnqlUKhtJxN7Prqur+4PjuAWWZaX09PQJjuMWvI+XlJTcdTqdSoZhFjs6\nOi6REQKSJLFk04bRaDRg9fN9wWakKCCNjY3lWCyWUrPZrJM7FgCAhoaGq8nJyf9otdp7+7ne5XKF\nk6W21tbW39fX1w+3tbX99mWjROjrwgoIBaScnJwxh8NBkXk8ctrZ2flhfHw843MGCgqCUMTzvMiy\nrDQxMZGu1+tbvmSMCMkBKyCEEEKywAoIIYSQLDABIYQQkgUmIIQQQrLABIQQQkgWmIAQQgjJAhMQ\nQgghWbwDrHA2pVW5S0IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4843ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 , Page no:337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #m\n",
+ "l = 0.15 ; #m\n",
+ "T = 500+273 ; #K\n",
+ "Tc = -196+273 ; #K\n",
+ "e = 0.4;\n",
+ "#Properties\n",
+ "k = 0.0349 ; #W/m K\n",
+ "rho = 0.80 ; #kg/m^3\n",
+ "Cpavg = 1.048 ; #kJ/kg J\n",
+ "rholiq = 800 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "s = 5.670*10**-8;\n",
+ "#Film boiling will occur, hence eqn 8.7.9 is applicable\n",
+ "Tm = (T+Tc) /2; #Film boiling will occur\n",
+ "u = 23*10**-6 ; #kg/m s\n",
+ "latent = 201*10**3 ; #J/kg\n",
+ "hfg = (latent + Cpavg *(Tm -Tc) *1000); #Jk/g\n",
+ "hc = 0.62*((( k**3) *rho *799.2*9.81* hfg )/(D*u*(T-Tc)) )**(1/4) ; #W/m^2 K\n",
+ "#Taking the emissivity of liquid surface to be unity and using equation 3.9.1, the exchange of radiant heat flux\n",
+ "flux = s*(T**4- Tc**4) /(1/ e +1/1 -1) ; #W/m^2\n",
+ "hr = flux /(T-Tc);\n",
+ "#Since h_r < h_c, total heat transfer coefficient is determined from eqn 8.7.11\n",
+ "h = hc +3/4* hr ; #W/m^2 K\n",
+ "fluxi = h*(T-Tc);\n",
+ "Rate = fluxi *3.14*D*l; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Initial heat flux =\",round(fluxi,4),\"W/m^2\";\n",
+ "print\"Initial heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial heat flux = 69646.6128 W/m^2\n",
+ "Initial heat transfer rate = 656.0711 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_3.ipynb new file mode 100755 index 00000000..d8b484bd --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_3.ipynb @@ -0,0 +1,495 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f7a2826bb5ef350cbea2514ac8a8b908a8de4a74e86c0b05c1c2aaabf919bcf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Condensation and boiling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 , Page no:318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 80 ; #C\n",
+ "Tw = 70 ; #C\n",
+ "L = 1 ; #m\n",
+ "g = 9.8 ; #m/s^2\n",
+ "#From table A.1\n",
+ "rho = 978.8 ; #kg/m^3\n",
+ "k = 0.672 ; #W/m K\n",
+ "hfg = 2309 ; #At 80 C,kJ/kg\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts + Tw)/2 ; #Assuming condensate film is laminar and Re < 30\n",
+ "u = 381 *10**-6 ; #kg/m s\n",
+ "v = u/rho ;\n",
+ "#Substituting in eqn 8.3.9, we get\n",
+ "h = 0.943*(( hfg *1000*( rho**2)*g*(k**3)) /(( Ts -Tw)*u*L) )**(1/4) ; #W/m^2 K\n",
+ "rate = h*L*(Ts -Tw)/( hfg *1000) ; #kg/m s\n",
+ "Re = 4* rate /u;\n",
+ "#Substituting h = Re*(lambda*1000)*u/(4*L*(Ts-Tw)), in eqn 8.3.12\n",
+ "Re_1 = (((4* L*(Ts -Tw)*k/( hfg *1000* u)*(g/(v**2) )**(1/3) )+5.2)/1.08)**(1/1.22) ; #Substituting h = Re*(hfg*1000)*u/(4*L*(Ts-Tw))\n",
+ "#From eqn 8.3.12\n",
+ "h_1 = ((Re /(1.08*( Re**1.22) -5.2) )*k *(( g/v**2)**(1/3) )); #W/m^2 K\n",
+ "m = h_1*L *10/( hfg *1000) ; #rate of condensation,kg/m s\n",
+ "\n",
+ "#result\n",
+ "print\"Assuming condensate film is laminar and Re < 30\";\n",
+ "print\"h =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"ReL =\",round(Re,4);\n",
+ "print\"Initial assumption was wrong, Now considering the effect of ripples, we get\";\n",
+ "print\"Re =\",round(Re_1,4);\n",
+ "print\"Heat Transfer Cofficient =\",round(h_1,4),\"W/m^2 K\";\n",
+ "print\"Rate of condensation =\",round(m,6),\"kg/m s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming condensate film is laminar and Re < 30\n",
+ "h = 6078.7864 W/m^2 K\n",
+ "ReL = 276.3936\n",
+ "Initial assumption was wrong, Now considering the effect of ripples, we get\n",
+ "Re = 320.4829\n",
+ "Heat Transfer Cofficient = 7287.8478 W/m^2 K\n",
+ "Rate of condensation = 0.031563 kg/m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 , Page no:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 262 ; #K\n",
+ "D = 0.022 ; #m\n",
+ "Tw = 258 ; #K\n",
+ "#Properties at Tm\n",
+ "rho = 1324 ; #kg/m^3\n",
+ "k = 0.1008 ; #W/m K\n",
+ "g = 9.81 ; #m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts+Tw) /2;\n",
+ "v = 1.90*10**-7 ; #m^2/s\n",
+ "hfg = 215.1*10**3 ; #J/kg\n",
+ "u = v*rho ; #Viscosity\n",
+ "#From eqn 8.4.1\n",
+ "h = 0.725*( hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*D))**(1/4) ;\n",
+ "rate = h*3.14*D*(Ts -Tw) / hfg ; #kg/s m\n",
+ "Re = 4* rate /u ;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"Condensation rate per unit length =\",round(rate,6),\"kg/s m\";\n",
+ "print\"Film Reynolds number =\",round(Re,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient = 2622.2475 W/m^2 K\n",
+ "Condensation rate per unit length = 0.003369 kg/s m\n",
+ "Film Reynolds number = 53.5629\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 25/60 ; #kg/sec\n",
+ "ID = 0.025 ; #m\n",
+ "OD = 0.029 ; #m\n",
+ "Tci = 30 ; #C\n",
+ "Tce = 70 ; #C\n",
+ "g = 9.8 ; #m/s^2\n",
+ "Ts = 100 ; #C\n",
+ "#Assuming 5.3.2 is valid, properties at 50 C\n",
+ "#Properties at Tm\n",
+ "rho = 988.1 ; #kg/m^3\n",
+ "k = 0.648 ; #W/m K\n",
+ "Pr = 3.54 ;\n",
+ "#From eqn 4.6.4a\n",
+ "f = 0.005635;\n",
+ "#From eqn 5.3.2\n",
+ "Nu = 198.39 ;\n",
+ "Tw = 90 ; #Assuming average wall temperature = 90 C\n",
+ "#Properties at Tm\n",
+ "#Properties at Tm\n",
+ "rho = 961.9 ; #kg/m^3\n",
+ "k = 0.682 ; #W/m K\n",
+ "l = 0; #initial guess, assumed value for fsolve function\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.556*10**-6; #m^2/s\n",
+ "Re = 4*m/(3.14*ID*rho *v);\n",
+ "h = Nu*k/ID ;\n",
+ "u = 298.6*10**-6 ; #kg/m s\n",
+ "hfg = 2257*10**3 ; #J/kg\n",
+ "#Equating the heat flow from the condensing steam to the tube wall, to the heat flow from the tube wall to the flowing water.\n",
+ "#Solving the simplified equation\n",
+ "h = 0.725*(hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*OD))**(1/4) ;\n",
+ "#By solving trial and error method, the temperature value we get\n",
+ "T=86.964984;# in oC\n",
+ "#Therefore\n",
+ "hc = 21338.77/(100 - T)**(1/4) ; #W/m^2 K\n",
+ "#Now, equating the heat flowing from the condensing steam to the tube wall to the heat gained by the water, we have\n",
+ "#Solving by trial and error method, we get\n",
+ "L=5.216152; #in meter\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature obtained from trial and error =\",round(T,4),\"oC\";\n",
+ "print\"hc =\",round(hc,4),\"W/m^2 K\";\n",
+ "print\"Length of the tube =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature obtained from trial and error = 86.965 oC\n",
+ "hc = 11230.3034 W/m^2 K\n",
+ "Length of the tube = 5.2162 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "#Properties at (Tw+Ts)/2 = 100.5 degree celsius\n",
+ "deltaT1 = 1; #in degree celsius\n",
+ "p1 = 7.55*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v1 = 0.294*10**-6; #[m^2/sec] viscosity at 100.5 degree celsius\n",
+ "k1 = 0.683; #[W/m-k]thermal conductivity\n",
+ "Pr1 = 1.74; #Prandtl number\n",
+ "g = 9.81; #acceleration due to gravity\n",
+ "L = 0.14*10**-2; #diameter in meters\n",
+ "#Properties at (Tw+Ts)/2 =102.5\n",
+ "deltaT2 = 5; #in degree celsius\n",
+ "p2 = 7.66*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v2 = 0.289*10**-6; #[m^2/sec] viscosity at 102.5 degree celsius \n",
+ "k2 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr2 = 1.71; #Prandtl number \n",
+ "#Properties at (Tw+Ts)/2 =105\n",
+ "deltaT3 = 10; #in degree celsius\n",
+ "p3 = 7.80*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v3 = 0.284*10**-6; #[m^2/sec] viscosity at 105 degree celsius \n",
+ "k3 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr3 = 1.68; #Prandtl number\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ra1 = ((p1*g*deltaT1*L**3)/(v1**2))*Pr1;\n",
+ "q1=(k1/L)*(deltaT1)*(0.36+(0.518*Ra1**(1/4))/(1+(0.559/Pr1)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra2 = ((p2*g*deltaT2*L**3)/(v2**2))*Pr2;\n",
+ "q2=(k2/L)*(deltaT2)*(0.36+(0.518*Ra2**(1/4))/(1+(0.559/Pr2)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra3 = ((p3*g*deltaT3*L**3)/(v3**2))*Pr3;\n",
+ "q3=(k3/L)*(deltaT3)*(0.36+(0.518*Ra3**(1/4))/(1+(0.559/Pr3)**(9/16))**(4/9))\n",
+ "\n",
+ "#At 100 degree celsius\n",
+ "Cpl = 4.220; #[kJ/kg]\n",
+ "lamda = 2257; #[kJ/kg]\n",
+ "ul = 282.4*10**-6; #viscosity is in kg/m-sec\n",
+ "sigma = 589*10**-4; #Surface tension is in N/m\n",
+ "pl = 958.4; #density in kg/m^3\n",
+ "pv =0.598; #density of vapour in kg/m^3\n",
+ "deltap = pl-pv;\n",
+ "Prl = 1.75; #Prandtl no. of liquid\n",
+ "Ksf = 0.013;\n",
+ "deltaT11=5;\n",
+ "deltaT12=10;\n",
+ "deltaT13=20;\n",
+ "q11=141.32*deltaT11**3\n",
+ "q12=141.32*deltaT12**3\n",
+ "q13=141.32*deltaT13**3\n",
+ "\n",
+ "\n",
+ "L1 = (L/2)*(g*(pl-pv)/sigma)**(1/2);\n",
+ "f_L = 0.89+2.27*math.exp(-3.44*L1**(0.5));\n",
+ "q2 = f_L*((3.14/24)*lamda*10**(3)*pv**(0.5)*(sigma*g*(pl-pv))**(0.25));\n",
+ "\n",
+ "Tn=pow(q2/141.32,1/3)\n",
+ "q3 = 0.09*lamda*10**3*pv*(sigma*g*(pl-pv)/(pl+pv)**(2))**(0.25);\n",
+ "Ts1 = 140; #surface temperature in degree celsius\n",
+ "Ts2 = 200; #surface temperature in degree celsius\n",
+ "Ts3 = 600; #surface temperature in degree celsius\n",
+ "Twm1 = (140+100)/2; #Mean film temperature\n",
+ "#properties of steam at 120 degree celsius and 1.013 bar\n",
+ "kv = 0.02558; #thermal conductivity in W/mK\n",
+ "pv1 = 0.5654; #vapor density in kg/m**3\n",
+ "uv=13.185*10**(-6); #viscosity of vapour in kg/m sec\n",
+ "lamda1 = (2716.1-419.1)*10**(3);#Latent heat of fusion in J/kg\n",
+ "hc = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(140-100)))**(0.25);\n",
+ "qrad = 5.67*10**(-8)*(413**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr = qrad/(413-373);\n",
+ "h = hc + 0.75*hr;\n",
+ "\n",
+ "hc_200 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(200-100)))**(0.25);\n",
+ "qrad1 = 5.67*10**(-8)*(473**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_200 = qrad1/(200-100);\n",
+ "h_200 = hc_200 +0.75*hr_200;\n",
+ "hc_600 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(600-100)))**(0.25);\n",
+ "qrad2 = 5.67*10**(-8)*(873**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_600 = qrad1/(600-100)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"\\n q/A = \",round(q1,2),\" W/m^2 at (Tw-Ts)=1\";\n",
+ "print \"\\n q/A = \",round(q2,2),\" W/m^2 at (Tw-Ts)=5\";\n",
+ "print \"\\n q/A = \",round(q3,2),\" W/m^2 at (Tw-Ts)=10\";\n",
+ "print \"\\n q/A at deltaT = 5 degree celsius = \",q11,\" W/m^2\";\n",
+ "print \"\\nq/A at deltaT = 10 degree celsius = \",q12,\" W/m^2\";\n",
+ "print \"\\n q/A at deltaT =20 degree celsius = \",q13,\" W/m^2\";\n",
+ "print \"\\n Peak heat flux L = \",round(L1,2); \n",
+ "print \"\\n f(l) = \",round(f_L,2);\n",
+ "print \"\\n q/A = \",q2,\" W/m^2\";\n",
+ "print \"Tw-Ts = \",Tn,\" degree celsius\"\n",
+ "print \"\\n\\n Minimum heat flux\";\n",
+ "print \"\\n q/A \",q3, \"W/m^2\"\n",
+ "print \"\\n\\n Stable film boiling\"\n",
+ "print \"\\n hc = \",hc,\" W/m^2\"\n",
+ "print \"\\n q/A due to radiation = \",qrad,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr,\" W/m^2 K \";\n",
+ "print \"\\n Since hr<hc \";\n",
+ "print \"\\n The total heat transfer coefficient \";\n",
+ "print \" h = \",h,\" W/m^2 K\";\n",
+ "print \"\\n Total heat flux \",h*(140-100),\" W/m^2 K\";\n",
+ "print \"\\n\\n hc = \",hc_200,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_200,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad1,\" W/m^2\";\n",
+ "print \"\\n Total heat flux = \",h_200*100,\" W/m^2\";\n",
+ "print \"\\n\\n hc = \",hc_600,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_600,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad2,\" W/m^2\";\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "q = [q11, q12, q13];\n",
+ "plt.plot ([1, 5, 10],q);\n",
+ "deltaT=linspace(1,10,10);\n",
+ "q1=141.32*deltaT**3;\n",
+ "plt.plot (deltaT,q1)\n",
+ "plt.title (\"Boiling curve\");\n",
+ "plt.xlabel(\" (Tw - Ts)degree celsius \");\n",
+ "plt.ylabel(\" Heat flux,(q/A)W/m^2 \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " q/A = 1116.99 W/m^2 at (Tw-Ts)=1\n",
+ "\n",
+ " q/A = 1393519.91 W/m^2 at (Tw-Ts)=5\n",
+ "\n",
+ " q/A = 19025.3 W/m^2 at (Tw-Ts)=10\n",
+ "\n",
+ " q/A at deltaT = 5 degree celsius = 17665.0 W/m^2\n",
+ "\n",
+ "q/A at deltaT = 10 degree celsius = 141320.0 W/m^2\n",
+ "\n",
+ " q/A at deltaT =20 degree celsius = 1130560.0 W/m^2\n",
+ "\n",
+ " Peak heat flux L = 0.28\n",
+ "\n",
+ " f(l) = 1.26\n",
+ "\n",
+ " q/A = 1393519.90741 W/m^2\n",
+ "Tw-Ts = 21.4438708455 degree celsius\n",
+ "\n",
+ "\n",
+ " Minimum heat flux\n",
+ "\n",
+ " q/A 19025.295556 W/m^2\n",
+ "\n",
+ "\n",
+ " Stable film boiling\n",
+ "\n",
+ " hc = 455.986290831 W/m^2\n",
+ "\n",
+ " q/A due to radiation = 496.874268274 W/m^2\n",
+ "\n",
+ " hr = 12.4218567068 W/m^2 K \n",
+ "\n",
+ " Since hr<hc \n",
+ "\n",
+ " The total heat transfer coefficient \n",
+ " h = 465.302683361 W/m^2 K\n",
+ "\n",
+ " Total heat flux 18612.1073344 W/m^2 K\n",
+ "\n",
+ "\n",
+ " hc = 362.632549817 W/m^2\n",
+ "\n",
+ " hr = 15.665080604 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 1566.5080604 W/m^2\n",
+ "\n",
+ " Total heat flux = 37438.136027 W/m^2\n",
+ "\n",
+ "\n",
+ " hc = 242.507001959 W/m^2\n",
+ "\n",
+ " hr = 3.13301612081 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 28652.514946 W/m^2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEXCAYAAADr+ZCUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdcU2f7P/ArTAdKGBIgQVYCKFBAZYi1RREQ67YyrIKr\ndTxatX0o2vFVv62Ktj7VVq2/p5UCWkDrRCuIi2qVIQoWB0uCkDDUkLBncv/+OD39IkIZAodxvV+v\n80pycsaVtObDfc597sMihABCCCHU25SYLgAhhNDghAGEEEKIERhACCGEGIEBhBBCiBEYQAghhBiB\nAYQQQogRGEAIdbNffvnlPS8vr0v0ayUlJUVeXp4ZAMCaNWt++Oqrrz5nrjqE+g4WXgeE0KtMTEzy\nnz17pqesrCxXVVVtdHV1vX348OHVPB5P1NltKSkpKXJzc/lmZmZ5PVErQv0VtoAQagWLxSIXLlyY\nWVlZOaK4uNiAw+GUrl+//num6+ppTU1NKkzXgAYPDCCE2qGurl6/YMGCU48ePRpLzysvL9cMCAiI\n0NPTe2ZiYpK/Y8eOzwghLACAsLCwpZMnT77Z2raWLl0a9sUXX3wJAJCQkODG4/FE//nPfz7icDil\nhoaGRWFhYUvpZSUSic6sWbPOa2pqljs5OaV8/vnnX7W1XQCAP/74401XV9fbWlpa0tGjRxdEREQE\nAAC4ubklHDlyZAW9XMv6lJSUFIcOHVprYWGRbWFhkb127dpDQUFBXzff9pw5c859++23mwAAioqK\nDBcsWHBKT0/vmZmZWd7333+/vpNfKUIAgAGEUJvoQKmpqRl2/Phx34kTJybS761fv/77ysrKEUKh\n0PT3339/OyIiIuDnn39e1t42WSwWYbFYfx/3Li0t5VRUVIwsKioyPHLkyIp//etfB8vLyzUBAP71\nr38dHDFiRGVpaSknPDw8MCIiIqD5us09ffrUeMaMGRc3bNiw/8WLF7rp6en2dnZ291vbZ2vOnTs3\nJyUlxenx48dj/P39o44fP+5LvyeVSrUuX77s4e/vH6VQKJRmzZp13sHBIa2oqMjw6tWr7vv27dsY\nHx/v2d5nR6glDCCEWkEIYc2dO/eslpaWlM1my65ever+73//+xsAALlcrnz8+HHfXbt2bRk+fHi1\nsbHx048//njv0aNHl3R02/RzVVXVxv/5n//5X2VlZbm3t3eshoZGVVZWlqVcLlc+ffr0/O3bt28d\nMmRI3ZgxYx4HBgaGN1+3ucjIyEUeHh6XfX19jysrK8u1tbXL6ADqiC1btuxis9kydXX1+jfffPMP\nFotFbt68ORkA4OTJk++6urre1tfXL7lz547jixcvdD///POvVFRUmkxNTYUrV678KTo62q+j+0KI\nhsd7EWoFi8Ui586dmzN16tRrhBDW2bNn57799tu/P378eAwhhNXY2KhqbGz8lF5+9OjRBWKxmNvZ\n/ejo6EiUlJQU9Othw4bVVFVVaTx//nxUU1OTipGRUSH93j91gBCJRLzX6eTQfD8sFov4+flFR0VF\n+U+ePPlmZGTkooCAgAgAqqVVVFRkqKWlJaWXl8vlym+99daNru4bDV7YAkKoHSwWi8ybN++MsrKy\n/I8//nhTV1f3haqqamN+fr4JvUxBQcHojvaQa+9wGADAqFGjnquoqDQVFhYa0fOaP2/JyMio8MmT\nJ+atvTd8+PDq6urq4fTrkpIS/fZq8vf3jzp58uS7T58+NU5JSXFasGDBKQAqaE1NTYVSqVSLnioq\nKkZeuHBhZnufCaGWMIAQagN9uIsQwjp37twcqVSqNWbMmMfKyspyHx+fE5999tmOqqoqjadPnxp/\n++23mxYvXnysI9ts6zBac8rKyvL58+ef3rZt27ba2tqhmZmZVkePHl3SVni99957v1y5cmXar7/+\nurCpqUlFIpHo3L9/3w4AwN7ePv306dPza2trh+bm5vKbd0hoi729fbquru6LlStX/jR9+vS4kSNH\nVgAAODk5pYwYMaJyz549n9TW1g6Vy+XKDx48sElNTZ3Q3jYRagkDCKE2zJo16/yIESMqNTU1y7/4\n4osvIyIiAsaMGfMYAOD7779fP3z48GozM7O8yZMn33zvvfd+WbZs2c8Ar570b/m8rfdaOnDgwLry\n8nJNfX39ksDAwHB/f/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1qtVjXAh4lweXn5WEpKykxz\nc3NTVFTUhu+MmtjY2Bek6/b8/Hzi6upqHICna7JCoXhdVlZ2p7a29s9vpTM3+jowAaGAlJGRMf6x\nMRHkrT0mJuZfAE8lBPB+wuN+p4OS+/b19Z1nGGaR53nRZrOpyId8URT51NTUSQAArVZ7j6IoB03T\n9vLy8ttpaWl/AwCEhobuDgwMnK2vr7+mVqutPM+Lk5OTqQAA3d3dv1ZWVt7keV7c3t4+SOL03UFn\nMBiMu7u7oRzHLTAMs9jU1NQMAFBRUXGLpml7YmLiPMuykk6nM5NkRNA0bW9sbLySnZ39l1qtttbU\n1FwHADCZTNWzs7MnEhISnqlUKhtJxN7Prqur+4PjuAWWZaX09PQJjuMWvI+XlJTcdTqdSoZhFjs6\nOi6REQKSJLFk04bRaDRg9fN9wWakKCCNjY3lWCyWUrPZrJM7FgCAhoaGq8nJyf9otdp7+7ne5XKF\nk6W21tbW39fX1w+3tbX99mWjROjrwgoIBaScnJwxh8NBkXk8ctrZ2flhfHw843MGCgqCUMTzvMiy\nrDQxMZGu1+tbvmSMCMkBKyCEEEKywAoIIYSQLDABIYQQkgUmIIQQQrLABIQQQkgWmIAQQgjJAhMQ\nQgghWbwDrHA2pVW5S0IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4843ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 , Page no:337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #m\n",
+ "l = 0.15 ; #m\n",
+ "T = 500+273 ; #K\n",
+ "Tc = -196+273 ; #K\n",
+ "e = 0.4;\n",
+ "#Properties\n",
+ "k = 0.0349 ; #W/m K\n",
+ "rho = 0.80 ; #kg/m^3\n",
+ "Cpavg = 1.048 ; #kJ/kg J\n",
+ "rholiq = 800 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "s = 5.670*10**-8;\n",
+ "#Film boiling will occur, hence eqn 8.7.9 is applicable\n",
+ "Tm = (T+Tc) /2; #Film boiling will occur\n",
+ "u = 23*10**-6 ; #kg/m s\n",
+ "latent = 201*10**3 ; #J/kg\n",
+ "hfg = (latent + Cpavg *(Tm -Tc) *1000); #Jk/g\n",
+ "hc = 0.62*((( k**3) *rho *799.2*9.81* hfg )/(D*u*(T-Tc)) )**(1/4) ; #W/m^2 K\n",
+ "#Taking the emissivity of liquid surface to be unity and using equation 3.9.1, the exchange of radiant heat flux\n",
+ "flux = s*(T**4- Tc**4) /(1/ e +1/1 -1) ; #W/m^2\n",
+ "hr = flux /(T-Tc);\n",
+ "#Since h_r < h_c, total heat transfer coefficient is determined from eqn 8.7.11\n",
+ "h = hc +3/4* hr ; #W/m^2 K\n",
+ "fluxi = h*(T-Tc);\n",
+ "Rate = fluxi *3.14*D*l; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Initial heat flux =\",round(fluxi,4),\"W/m^2\";\n",
+ "print\"Initial heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial heat flux = 69646.6128 W/m^2\n",
+ "Initial heat transfer rate = 656.0711 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_4.ipynb new file mode 100755 index 00000000..d8b484bd --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_4.ipynb @@ -0,0 +1,495 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f7a2826bb5ef350cbea2514ac8a8b908a8de4a74e86c0b05c1c2aaabf919bcf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Condensation and boiling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 , Page no:318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 80 ; #C\n",
+ "Tw = 70 ; #C\n",
+ "L = 1 ; #m\n",
+ "g = 9.8 ; #m/s^2\n",
+ "#From table A.1\n",
+ "rho = 978.8 ; #kg/m^3\n",
+ "k = 0.672 ; #W/m K\n",
+ "hfg = 2309 ; #At 80 C,kJ/kg\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts + Tw)/2 ; #Assuming condensate film is laminar and Re < 30\n",
+ "u = 381 *10**-6 ; #kg/m s\n",
+ "v = u/rho ;\n",
+ "#Substituting in eqn 8.3.9, we get\n",
+ "h = 0.943*(( hfg *1000*( rho**2)*g*(k**3)) /(( Ts -Tw)*u*L) )**(1/4) ; #W/m^2 K\n",
+ "rate = h*L*(Ts -Tw)/( hfg *1000) ; #kg/m s\n",
+ "Re = 4* rate /u;\n",
+ "#Substituting h = Re*(lambda*1000)*u/(4*L*(Ts-Tw)), in eqn 8.3.12\n",
+ "Re_1 = (((4* L*(Ts -Tw)*k/( hfg *1000* u)*(g/(v**2) )**(1/3) )+5.2)/1.08)**(1/1.22) ; #Substituting h = Re*(hfg*1000)*u/(4*L*(Ts-Tw))\n",
+ "#From eqn 8.3.12\n",
+ "h_1 = ((Re /(1.08*( Re**1.22) -5.2) )*k *(( g/v**2)**(1/3) )); #W/m^2 K\n",
+ "m = h_1*L *10/( hfg *1000) ; #rate of condensation,kg/m s\n",
+ "\n",
+ "#result\n",
+ "print\"Assuming condensate film is laminar and Re < 30\";\n",
+ "print\"h =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"ReL =\",round(Re,4);\n",
+ "print\"Initial assumption was wrong, Now considering the effect of ripples, we get\";\n",
+ "print\"Re =\",round(Re_1,4);\n",
+ "print\"Heat Transfer Cofficient =\",round(h_1,4),\"W/m^2 K\";\n",
+ "print\"Rate of condensation =\",round(m,6),\"kg/m s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming condensate film is laminar and Re < 30\n",
+ "h = 6078.7864 W/m^2 K\n",
+ "ReL = 276.3936\n",
+ "Initial assumption was wrong, Now considering the effect of ripples, we get\n",
+ "Re = 320.4829\n",
+ "Heat Transfer Cofficient = 7287.8478 W/m^2 K\n",
+ "Rate of condensation = 0.031563 kg/m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 , Page no:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 262 ; #K\n",
+ "D = 0.022 ; #m\n",
+ "Tw = 258 ; #K\n",
+ "#Properties at Tm\n",
+ "rho = 1324 ; #kg/m^3\n",
+ "k = 0.1008 ; #W/m K\n",
+ "g = 9.81 ; #m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts+Tw) /2;\n",
+ "v = 1.90*10**-7 ; #m^2/s\n",
+ "hfg = 215.1*10**3 ; #J/kg\n",
+ "u = v*rho ; #Viscosity\n",
+ "#From eqn 8.4.1\n",
+ "h = 0.725*( hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*D))**(1/4) ;\n",
+ "rate = h*3.14*D*(Ts -Tw) / hfg ; #kg/s m\n",
+ "Re = 4* rate /u ;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"Condensation rate per unit length =\",round(rate,6),\"kg/s m\";\n",
+ "print\"Film Reynolds number =\",round(Re,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient = 2622.2475 W/m^2 K\n",
+ "Condensation rate per unit length = 0.003369 kg/s m\n",
+ "Film Reynolds number = 53.5629\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 25/60 ; #kg/sec\n",
+ "ID = 0.025 ; #m\n",
+ "OD = 0.029 ; #m\n",
+ "Tci = 30 ; #C\n",
+ "Tce = 70 ; #C\n",
+ "g = 9.8 ; #m/s^2\n",
+ "Ts = 100 ; #C\n",
+ "#Assuming 5.3.2 is valid, properties at 50 C\n",
+ "#Properties at Tm\n",
+ "rho = 988.1 ; #kg/m^3\n",
+ "k = 0.648 ; #W/m K\n",
+ "Pr = 3.54 ;\n",
+ "#From eqn 4.6.4a\n",
+ "f = 0.005635;\n",
+ "#From eqn 5.3.2\n",
+ "Nu = 198.39 ;\n",
+ "Tw = 90 ; #Assuming average wall temperature = 90 C\n",
+ "#Properties at Tm\n",
+ "#Properties at Tm\n",
+ "rho = 961.9 ; #kg/m^3\n",
+ "k = 0.682 ; #W/m K\n",
+ "l = 0; #initial guess, assumed value for fsolve function\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.556*10**-6; #m^2/s\n",
+ "Re = 4*m/(3.14*ID*rho *v);\n",
+ "h = Nu*k/ID ;\n",
+ "u = 298.6*10**-6 ; #kg/m s\n",
+ "hfg = 2257*10**3 ; #J/kg\n",
+ "#Equating the heat flow from the condensing steam to the tube wall, to the heat flow from the tube wall to the flowing water.\n",
+ "#Solving the simplified equation\n",
+ "h = 0.725*(hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*OD))**(1/4) ;\n",
+ "#By solving trial and error method, the temperature value we get\n",
+ "T=86.964984;# in oC\n",
+ "#Therefore\n",
+ "hc = 21338.77/(100 - T)**(1/4) ; #W/m^2 K\n",
+ "#Now, equating the heat flowing from the condensing steam to the tube wall to the heat gained by the water, we have\n",
+ "#Solving by trial and error method, we get\n",
+ "L=5.216152; #in meter\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature obtained from trial and error =\",round(T,4),\"oC\";\n",
+ "print\"hc =\",round(hc,4),\"W/m^2 K\";\n",
+ "print\"Length of the tube =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature obtained from trial and error = 86.965 oC\n",
+ "hc = 11230.3034 W/m^2 K\n",
+ "Length of the tube = 5.2162 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "#Properties at (Tw+Ts)/2 = 100.5 degree celsius\n",
+ "deltaT1 = 1; #in degree celsius\n",
+ "p1 = 7.55*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v1 = 0.294*10**-6; #[m^2/sec] viscosity at 100.5 degree celsius\n",
+ "k1 = 0.683; #[W/m-k]thermal conductivity\n",
+ "Pr1 = 1.74; #Prandtl number\n",
+ "g = 9.81; #acceleration due to gravity\n",
+ "L = 0.14*10**-2; #diameter in meters\n",
+ "#Properties at (Tw+Ts)/2 =102.5\n",
+ "deltaT2 = 5; #in degree celsius\n",
+ "p2 = 7.66*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v2 = 0.289*10**-6; #[m^2/sec] viscosity at 102.5 degree celsius \n",
+ "k2 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr2 = 1.71; #Prandtl number \n",
+ "#Properties at (Tw+Ts)/2 =105\n",
+ "deltaT3 = 10; #in degree celsius\n",
+ "p3 = 7.80*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v3 = 0.284*10**-6; #[m^2/sec] viscosity at 105 degree celsius \n",
+ "k3 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr3 = 1.68; #Prandtl number\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ra1 = ((p1*g*deltaT1*L**3)/(v1**2))*Pr1;\n",
+ "q1=(k1/L)*(deltaT1)*(0.36+(0.518*Ra1**(1/4))/(1+(0.559/Pr1)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra2 = ((p2*g*deltaT2*L**3)/(v2**2))*Pr2;\n",
+ "q2=(k2/L)*(deltaT2)*(0.36+(0.518*Ra2**(1/4))/(1+(0.559/Pr2)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra3 = ((p3*g*deltaT3*L**3)/(v3**2))*Pr3;\n",
+ "q3=(k3/L)*(deltaT3)*(0.36+(0.518*Ra3**(1/4))/(1+(0.559/Pr3)**(9/16))**(4/9))\n",
+ "\n",
+ "#At 100 degree celsius\n",
+ "Cpl = 4.220; #[kJ/kg]\n",
+ "lamda = 2257; #[kJ/kg]\n",
+ "ul = 282.4*10**-6; #viscosity is in kg/m-sec\n",
+ "sigma = 589*10**-4; #Surface tension is in N/m\n",
+ "pl = 958.4; #density in kg/m^3\n",
+ "pv =0.598; #density of vapour in kg/m^3\n",
+ "deltap = pl-pv;\n",
+ "Prl = 1.75; #Prandtl no. of liquid\n",
+ "Ksf = 0.013;\n",
+ "deltaT11=5;\n",
+ "deltaT12=10;\n",
+ "deltaT13=20;\n",
+ "q11=141.32*deltaT11**3\n",
+ "q12=141.32*deltaT12**3\n",
+ "q13=141.32*deltaT13**3\n",
+ "\n",
+ "\n",
+ "L1 = (L/2)*(g*(pl-pv)/sigma)**(1/2);\n",
+ "f_L = 0.89+2.27*math.exp(-3.44*L1**(0.5));\n",
+ "q2 = f_L*((3.14/24)*lamda*10**(3)*pv**(0.5)*(sigma*g*(pl-pv))**(0.25));\n",
+ "\n",
+ "Tn=pow(q2/141.32,1/3)\n",
+ "q3 = 0.09*lamda*10**3*pv*(sigma*g*(pl-pv)/(pl+pv)**(2))**(0.25);\n",
+ "Ts1 = 140; #surface temperature in degree celsius\n",
+ "Ts2 = 200; #surface temperature in degree celsius\n",
+ "Ts3 = 600; #surface temperature in degree celsius\n",
+ "Twm1 = (140+100)/2; #Mean film temperature\n",
+ "#properties of steam at 120 degree celsius and 1.013 bar\n",
+ "kv = 0.02558; #thermal conductivity in W/mK\n",
+ "pv1 = 0.5654; #vapor density in kg/m**3\n",
+ "uv=13.185*10**(-6); #viscosity of vapour in kg/m sec\n",
+ "lamda1 = (2716.1-419.1)*10**(3);#Latent heat of fusion in J/kg\n",
+ "hc = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(140-100)))**(0.25);\n",
+ "qrad = 5.67*10**(-8)*(413**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr = qrad/(413-373);\n",
+ "h = hc + 0.75*hr;\n",
+ "\n",
+ "hc_200 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(200-100)))**(0.25);\n",
+ "qrad1 = 5.67*10**(-8)*(473**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_200 = qrad1/(200-100);\n",
+ "h_200 = hc_200 +0.75*hr_200;\n",
+ "hc_600 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(600-100)))**(0.25);\n",
+ "qrad2 = 5.67*10**(-8)*(873**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_600 = qrad1/(600-100)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"\\n q/A = \",round(q1,2),\" W/m^2 at (Tw-Ts)=1\";\n",
+ "print \"\\n q/A = \",round(q2,2),\" W/m^2 at (Tw-Ts)=5\";\n",
+ "print \"\\n q/A = \",round(q3,2),\" W/m^2 at (Tw-Ts)=10\";\n",
+ "print \"\\n q/A at deltaT = 5 degree celsius = \",q11,\" W/m^2\";\n",
+ "print \"\\nq/A at deltaT = 10 degree celsius = \",q12,\" W/m^2\";\n",
+ "print \"\\n q/A at deltaT =20 degree celsius = \",q13,\" W/m^2\";\n",
+ "print \"\\n Peak heat flux L = \",round(L1,2); \n",
+ "print \"\\n f(l) = \",round(f_L,2);\n",
+ "print \"\\n q/A = \",q2,\" W/m^2\";\n",
+ "print \"Tw-Ts = \",Tn,\" degree celsius\"\n",
+ "print \"\\n\\n Minimum heat flux\";\n",
+ "print \"\\n q/A \",q3, \"W/m^2\"\n",
+ "print \"\\n\\n Stable film boiling\"\n",
+ "print \"\\n hc = \",hc,\" W/m^2\"\n",
+ "print \"\\n q/A due to radiation = \",qrad,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr,\" W/m^2 K \";\n",
+ "print \"\\n Since hr<hc \";\n",
+ "print \"\\n The total heat transfer coefficient \";\n",
+ "print \" h = \",h,\" W/m^2 K\";\n",
+ "print \"\\n Total heat flux \",h*(140-100),\" W/m^2 K\";\n",
+ "print \"\\n\\n hc = \",hc_200,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_200,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad1,\" W/m^2\";\n",
+ "print \"\\n Total heat flux = \",h_200*100,\" W/m^2\";\n",
+ "print \"\\n\\n hc = \",hc_600,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_600,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad2,\" W/m^2\";\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "q = [q11, q12, q13];\n",
+ "plt.plot ([1, 5, 10],q);\n",
+ "deltaT=linspace(1,10,10);\n",
+ "q1=141.32*deltaT**3;\n",
+ "plt.plot (deltaT,q1)\n",
+ "plt.title (\"Boiling curve\");\n",
+ "plt.xlabel(\" (Tw - Ts)degree celsius \");\n",
+ "plt.ylabel(\" Heat flux,(q/A)W/m^2 \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " q/A = 1116.99 W/m^2 at (Tw-Ts)=1\n",
+ "\n",
+ " q/A = 1393519.91 W/m^2 at (Tw-Ts)=5\n",
+ "\n",
+ " q/A = 19025.3 W/m^2 at (Tw-Ts)=10\n",
+ "\n",
+ " q/A at deltaT = 5 degree celsius = 17665.0 W/m^2\n",
+ "\n",
+ "q/A at deltaT = 10 degree celsius = 141320.0 W/m^2\n",
+ "\n",
+ " q/A at deltaT =20 degree celsius = 1130560.0 W/m^2\n",
+ "\n",
+ " Peak heat flux L = 0.28\n",
+ "\n",
+ " f(l) = 1.26\n",
+ "\n",
+ " q/A = 1393519.90741 W/m^2\n",
+ "Tw-Ts = 21.4438708455 degree celsius\n",
+ "\n",
+ "\n",
+ " Minimum heat flux\n",
+ "\n",
+ " q/A 19025.295556 W/m^2\n",
+ "\n",
+ "\n",
+ " Stable film boiling\n",
+ "\n",
+ " hc = 455.986290831 W/m^2\n",
+ "\n",
+ " q/A due to radiation = 496.874268274 W/m^2\n",
+ "\n",
+ " hr = 12.4218567068 W/m^2 K \n",
+ "\n",
+ " Since hr<hc \n",
+ "\n",
+ " The total heat transfer coefficient \n",
+ " h = 465.302683361 W/m^2 K\n",
+ "\n",
+ " Total heat flux 18612.1073344 W/m^2 K\n",
+ "\n",
+ "\n",
+ " hc = 362.632549817 W/m^2\n",
+ "\n",
+ " hr = 15.665080604 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 1566.5080604 W/m^2\n",
+ "\n",
+ " Total heat flux = 37438.136027 W/m^2\n",
+ "\n",
+ "\n",
+ " hc = 242.507001959 W/m^2\n",
+ "\n",
+ " hr = 3.13301612081 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 28652.514946 W/m^2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEXCAYAAADr+ZCUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdcU2f7P/ArTAdKGBIgQVYCKFBAZYi1RREQ67YyrIKr\ndTxatX0o2vFVv62Ktj7VVq2/p5UCWkDrRCuIi2qVIQoWB0uCkDDUkLBncv/+OD39IkIZAodxvV+v\n80pycsaVtObDfc597sMihABCCCHU25SYLgAhhNDghAGEEEKIERhACCGEGIEBhBBCiBEYQAghhBiB\nAYQQQogRGEAIdbNffvnlPS8vr0v0ayUlJUVeXp4ZAMCaNWt++Oqrrz5nrjqE+g4WXgeE0KtMTEzy\nnz17pqesrCxXVVVtdHV1vX348OHVPB5P1NltKSkpKXJzc/lmZmZ5PVErQv0VtoAQagWLxSIXLlyY\nWVlZOaK4uNiAw+GUrl+//num6+ppTU1NKkzXgAYPDCCE2qGurl6/YMGCU48ePRpLzysvL9cMCAiI\n0NPTe2ZiYpK/Y8eOzwghLACAsLCwpZMnT77Z2raWLl0a9sUXX3wJAJCQkODG4/FE//nPfz7icDil\nhoaGRWFhYUvpZSUSic6sWbPOa2pqljs5OaV8/vnnX7W1XQCAP/74401XV9fbWlpa0tGjRxdEREQE\nAAC4ubklHDlyZAW9XMv6lJSUFIcOHVprYWGRbWFhkb127dpDQUFBXzff9pw5c859++23mwAAioqK\nDBcsWHBKT0/vmZmZWd7333+/vpNfKUIAgAGEUJvoQKmpqRl2/Phx34kTJybS761fv/77ysrKEUKh\n0PT3339/OyIiIuDnn39e1t42WSwWYbFYfx/3Li0t5VRUVIwsKioyPHLkyIp//etfB8vLyzUBAP71\nr38dHDFiRGVpaSknPDw8MCIiIqD5us09ffrUeMaMGRc3bNiw/8WLF7rp6en2dnZ291vbZ2vOnTs3\nJyUlxenx48dj/P39o44fP+5LvyeVSrUuX77s4e/vH6VQKJRmzZp13sHBIa2oqMjw6tWr7vv27dsY\nHx/v2d5nR6glDCCEWkEIYc2dO/eslpaWlM1my65ever+73//+xsAALlcrnz8+HHfXbt2bRk+fHi1\nsbHx048//njv0aNHl3R02/RzVVXVxv/5n//5X2VlZbm3t3eshoZGVVZWlqVcLlc+ffr0/O3bt28d\nMmRI3ZgxYx4HBgaGN1+3ucjIyEUeHh6XfX19jysrK8u1tbXL6ADqiC1btuxis9kydXX1+jfffPMP\nFotFbt68ORkA4OTJk++6urre1tfXL7lz547jixcvdD///POvVFRUmkxNTYUrV678KTo62q+j+0KI\nhsd7EWoFi8Ui586dmzN16tRrhBDW2bNn57799tu/P378eAwhhNXY2KhqbGz8lF5+9OjRBWKxmNvZ\n/ejo6EiUlJQU9Othw4bVVFVVaTx//nxUU1OTipGRUSH93j91gBCJRLzX6eTQfD8sFov4+flFR0VF\n+U+ePPlmZGTkooCAgAgAqqVVVFRkqKWlJaWXl8vlym+99daNru4bDV7YAkKoHSwWi8ybN++MsrKy\n/I8//nhTV1f3haqqamN+fr4JvUxBQcHojvaQa+9wGADAqFGjnquoqDQVFhYa0fOaP2/JyMio8MmT\nJ+atvTd8+PDq6urq4fTrkpIS/fZq8vf3jzp58uS7T58+NU5JSXFasGDBKQAqaE1NTYVSqVSLnioq\nKkZeuHBhZnufCaGWMIAQagN9uIsQwjp37twcqVSqNWbMmMfKyspyHx+fE5999tmOqqoqjadPnxp/\n++23mxYvXnysI9ts6zBac8rKyvL58+ef3rZt27ba2tqhmZmZVkePHl3SVni99957v1y5cmXar7/+\nurCpq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inIEBQW5lUqlc2ho6PTH3sCHh4dP\niaLIfyr5AACsrKwcjYuLW62qqrpRXFx8X5IkFsBTiQQHB79VKBSvs7KynlgsltK9vb0Da2trR0ZH\nR3MBAOLj459vbGxETU1NnQTwdEK32+10ZGTky4iIiFekk3Zvb+/P/p6v0WhGTCZTNflPNkZoNJqR\nzs7Oi2RJcGlp6bjvHKC8vLzH/f3955xOpxIAYGtr6xAAQGFh4QPve1qtVjXAh4lweXn5WEpKykxz\nc3NTVFTUhu+MmtjY2Bek6/b8/Hzi6upqHICna7JCoXhdVlZ2p7a29s9vpTM3+jowAaGAlJGRMf6x\nMRHkrT0mJuZfAE8lBPB+wuN+p4OS+/b19Z1nGGaR53nRZrOpyId8URT51NTUSQAArVZ7j6IoB03T\n9vLy8ttpaWl/AwCEhobuDgwMnK2vr7+mVqutPM+Lk5OTqQAA3d3dv1ZWVt7keV7c3t4+SOL03UFn\nMBiMu7u7oRzHLTAMs9jU1NQMAFBRUXGLpml7YmLiPMuykk6nM5NkRNA0bW9sbLySnZ39l1qtttbU\n1FwHADCZTNWzs7MnEhISnqlUKhtJxN7Prqur+4PjuAWWZaX09PQJjuMWvI+XlJTcdTqdSoZhFjs6\nOi6REQKSJLFk04bRaDRg9fN9wWakKCCNjY3lWCyWUrPZrJM7FgCAhoaGq8nJyf9otdp7+7ne5XKF\nk6W21tbW39fX1w+3tbX99mWjROjrwgoIBaScnJwxh8NBkXk8ctrZ2flhfHw843MGCgqCUMTzvMiy\nrDQxMZGu1+tbvmSMCMkBKyCEEEKywAoIIYSQLDABIYQQkgUmIIQQQrLABIQQQkgWmIAQQgjJAhMQ\nQgghWbwDrHA2pVW5S0IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4843ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 , Page no:337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #m\n",
+ "l = 0.15 ; #m\n",
+ "T = 500+273 ; #K\n",
+ "Tc = -196+273 ; #K\n",
+ "e = 0.4;\n",
+ "#Properties\n",
+ "k = 0.0349 ; #W/m K\n",
+ "rho = 0.80 ; #kg/m^3\n",
+ "Cpavg = 1.048 ; #kJ/kg J\n",
+ "rholiq = 800 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "s = 5.670*10**-8;\n",
+ "#Film boiling will occur, hence eqn 8.7.9 is applicable\n",
+ "Tm = (T+Tc) /2; #Film boiling will occur\n",
+ "u = 23*10**-6 ; #kg/m s\n",
+ "latent = 201*10**3 ; #J/kg\n",
+ "hfg = (latent + Cpavg *(Tm -Tc) *1000); #Jk/g\n",
+ "hc = 0.62*((( k**3) *rho *799.2*9.81* hfg )/(D*u*(T-Tc)) )**(1/4) ; #W/m^2 K\n",
+ "#Taking the emissivity of liquid surface to be unity and using equation 3.9.1, the exchange of radiant heat flux\n",
+ "flux = s*(T**4- Tc**4) /(1/ e +1/1 -1) ; #W/m^2\n",
+ "hr = flux /(T-Tc);\n",
+ "#Since h_r < h_c, total heat transfer coefficient is determined from eqn 8.7.11\n",
+ "h = hc +3/4* hr ; #W/m^2 K\n",
+ "fluxi = h*(T-Tc);\n",
+ "Rate = fluxi *3.14*D*l; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Initial heat flux =\",round(fluxi,4),\"W/m^2\";\n",
+ "print\"Initial heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial heat flux = 69646.6128 W/m^2\n",
+ "Initial heat transfer rate = 656.0711 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_5.ipynb new file mode 100755 index 00000000..d8b484bd --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_5.ipynb @@ -0,0 +1,495 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f7a2826bb5ef350cbea2514ac8a8b908a8de4a74e86c0b05c1c2aaabf919bcf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Condensation and boiling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 , Page no:318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 80 ; #C\n",
+ "Tw = 70 ; #C\n",
+ "L = 1 ; #m\n",
+ "g = 9.8 ; #m/s^2\n",
+ "#From table A.1\n",
+ "rho = 978.8 ; #kg/m^3\n",
+ "k = 0.672 ; #W/m K\n",
+ "hfg = 2309 ; #At 80 C,kJ/kg\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts + Tw)/2 ; #Assuming condensate film is laminar and Re < 30\n",
+ "u = 381 *10**-6 ; #kg/m s\n",
+ "v = u/rho ;\n",
+ "#Substituting in eqn 8.3.9, we get\n",
+ "h = 0.943*(( hfg *1000*( rho**2)*g*(k**3)) /(( Ts -Tw)*u*L) )**(1/4) ; #W/m^2 K\n",
+ "rate = h*L*(Ts -Tw)/( hfg *1000) ; #kg/m s\n",
+ "Re = 4* rate /u;\n",
+ "#Substituting h = Re*(lambda*1000)*u/(4*L*(Ts-Tw)), in eqn 8.3.12\n",
+ "Re_1 = (((4* L*(Ts -Tw)*k/( hfg *1000* u)*(g/(v**2) )**(1/3) )+5.2)/1.08)**(1/1.22) ; #Substituting h = Re*(hfg*1000)*u/(4*L*(Ts-Tw))\n",
+ "#From eqn 8.3.12\n",
+ "h_1 = ((Re /(1.08*( Re**1.22) -5.2) )*k *(( g/v**2)**(1/3) )); #W/m^2 K\n",
+ "m = h_1*L *10/( hfg *1000) ; #rate of condensation,kg/m s\n",
+ "\n",
+ "#result\n",
+ "print\"Assuming condensate film is laminar and Re < 30\";\n",
+ "print\"h =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"ReL =\",round(Re,4);\n",
+ "print\"Initial assumption was wrong, Now considering the effect of ripples, we get\";\n",
+ "print\"Re =\",round(Re_1,4);\n",
+ "print\"Heat Transfer Cofficient =\",round(h_1,4),\"W/m^2 K\";\n",
+ "print\"Rate of condensation =\",round(m,6),\"kg/m s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming condensate film is laminar and Re < 30\n",
+ "h = 6078.7864 W/m^2 K\n",
+ "ReL = 276.3936\n",
+ "Initial assumption was wrong, Now considering the effect of ripples, we get\n",
+ "Re = 320.4829\n",
+ "Heat Transfer Cofficient = 7287.8478 W/m^2 K\n",
+ "Rate of condensation = 0.031563 kg/m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 , Page no:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 262 ; #K\n",
+ "D = 0.022 ; #m\n",
+ "Tw = 258 ; #K\n",
+ "#Properties at Tm\n",
+ "rho = 1324 ; #kg/m^3\n",
+ "k = 0.1008 ; #W/m K\n",
+ "g = 9.81 ; #m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts+Tw) /2;\n",
+ "v = 1.90*10**-7 ; #m^2/s\n",
+ "hfg = 215.1*10**3 ; #J/kg\n",
+ "u = v*rho ; #Viscosity\n",
+ "#From eqn 8.4.1\n",
+ "h = 0.725*( hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*D))**(1/4) ;\n",
+ "rate = h*3.14*D*(Ts -Tw) / hfg ; #kg/s m\n",
+ "Re = 4* rate /u ;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"Condensation rate per unit length =\",round(rate,6),\"kg/s m\";\n",
+ "print\"Film Reynolds number =\",round(Re,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient = 2622.2475 W/m^2 K\n",
+ "Condensation rate per unit length = 0.003369 kg/s m\n",
+ "Film Reynolds number = 53.5629\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 25/60 ; #kg/sec\n",
+ "ID = 0.025 ; #m\n",
+ "OD = 0.029 ; #m\n",
+ "Tci = 30 ; #C\n",
+ "Tce = 70 ; #C\n",
+ "g = 9.8 ; #m/s^2\n",
+ "Ts = 100 ; #C\n",
+ "#Assuming 5.3.2 is valid, properties at 50 C\n",
+ "#Properties at Tm\n",
+ "rho = 988.1 ; #kg/m^3\n",
+ "k = 0.648 ; #W/m K\n",
+ "Pr = 3.54 ;\n",
+ "#From eqn 4.6.4a\n",
+ "f = 0.005635;\n",
+ "#From eqn 5.3.2\n",
+ "Nu = 198.39 ;\n",
+ "Tw = 90 ; #Assuming average wall temperature = 90 C\n",
+ "#Properties at Tm\n",
+ "#Properties at Tm\n",
+ "rho = 961.9 ; #kg/m^3\n",
+ "k = 0.682 ; #W/m K\n",
+ "l = 0; #initial guess, assumed value for fsolve function\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.556*10**-6; #m^2/s\n",
+ "Re = 4*m/(3.14*ID*rho *v);\n",
+ "h = Nu*k/ID ;\n",
+ "u = 298.6*10**-6 ; #kg/m s\n",
+ "hfg = 2257*10**3 ; #J/kg\n",
+ "#Equating the heat flow from the condensing steam to the tube wall, to the heat flow from the tube wall to the flowing water.\n",
+ "#Solving the simplified equation\n",
+ "h = 0.725*(hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*OD))**(1/4) ;\n",
+ "#By solving trial and error method, the temperature value we get\n",
+ "T=86.964984;# in oC\n",
+ "#Therefore\n",
+ "hc = 21338.77/(100 - T)**(1/4) ; #W/m^2 K\n",
+ "#Now, equating the heat flowing from the condensing steam to the tube wall to the heat gained by the water, we have\n",
+ "#Solving by trial and error method, we get\n",
+ "L=5.216152; #in meter\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature obtained from trial and error =\",round(T,4),\"oC\";\n",
+ "print\"hc =\",round(hc,4),\"W/m^2 K\";\n",
+ "print\"Length of the tube =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature obtained from trial and error = 86.965 oC\n",
+ "hc = 11230.3034 W/m^2 K\n",
+ "Length of the tube = 5.2162 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "#Properties at (Tw+Ts)/2 = 100.5 degree celsius\n",
+ "deltaT1 = 1; #in degree celsius\n",
+ "p1 = 7.55*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v1 = 0.294*10**-6; #[m^2/sec] viscosity at 100.5 degree celsius\n",
+ "k1 = 0.683; #[W/m-k]thermal conductivity\n",
+ "Pr1 = 1.74; #Prandtl number\n",
+ "g = 9.81; #acceleration due to gravity\n",
+ "L = 0.14*10**-2; #diameter in meters\n",
+ "#Properties at (Tw+Ts)/2 =102.5\n",
+ "deltaT2 = 5; #in degree celsius\n",
+ "p2 = 7.66*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v2 = 0.289*10**-6; #[m^2/sec] viscosity at 102.5 degree celsius \n",
+ "k2 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr2 = 1.71; #Prandtl number \n",
+ "#Properties at (Tw+Ts)/2 =105\n",
+ "deltaT3 = 10; #in degree celsius\n",
+ "p3 = 7.80*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v3 = 0.284*10**-6; #[m^2/sec] viscosity at 105 degree celsius \n",
+ "k3 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr3 = 1.68; #Prandtl number\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ra1 = ((p1*g*deltaT1*L**3)/(v1**2))*Pr1;\n",
+ "q1=(k1/L)*(deltaT1)*(0.36+(0.518*Ra1**(1/4))/(1+(0.559/Pr1)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra2 = ((p2*g*deltaT2*L**3)/(v2**2))*Pr2;\n",
+ "q2=(k2/L)*(deltaT2)*(0.36+(0.518*Ra2**(1/4))/(1+(0.559/Pr2)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra3 = ((p3*g*deltaT3*L**3)/(v3**2))*Pr3;\n",
+ "q3=(k3/L)*(deltaT3)*(0.36+(0.518*Ra3**(1/4))/(1+(0.559/Pr3)**(9/16))**(4/9))\n",
+ "\n",
+ "#At 100 degree celsius\n",
+ "Cpl = 4.220; #[kJ/kg]\n",
+ "lamda = 2257; #[kJ/kg]\n",
+ "ul = 282.4*10**-6; #viscosity is in kg/m-sec\n",
+ "sigma = 589*10**-4; #Surface tension is in N/m\n",
+ "pl = 958.4; #density in kg/m^3\n",
+ "pv =0.598; #density of vapour in kg/m^3\n",
+ "deltap = pl-pv;\n",
+ "Prl = 1.75; #Prandtl no. of liquid\n",
+ "Ksf = 0.013;\n",
+ "deltaT11=5;\n",
+ "deltaT12=10;\n",
+ "deltaT13=20;\n",
+ "q11=141.32*deltaT11**3\n",
+ "q12=141.32*deltaT12**3\n",
+ "q13=141.32*deltaT13**3\n",
+ "\n",
+ "\n",
+ "L1 = (L/2)*(g*(pl-pv)/sigma)**(1/2);\n",
+ "f_L = 0.89+2.27*math.exp(-3.44*L1**(0.5));\n",
+ "q2 = f_L*((3.14/24)*lamda*10**(3)*pv**(0.5)*(sigma*g*(pl-pv))**(0.25));\n",
+ "\n",
+ "Tn=pow(q2/141.32,1/3)\n",
+ "q3 = 0.09*lamda*10**3*pv*(sigma*g*(pl-pv)/(pl+pv)**(2))**(0.25);\n",
+ "Ts1 = 140; #surface temperature in degree celsius\n",
+ "Ts2 = 200; #surface temperature in degree celsius\n",
+ "Ts3 = 600; #surface temperature in degree celsius\n",
+ "Twm1 = (140+100)/2; #Mean film temperature\n",
+ "#properties of steam at 120 degree celsius and 1.013 bar\n",
+ "kv = 0.02558; #thermal conductivity in W/mK\n",
+ "pv1 = 0.5654; #vapor density in kg/m**3\n",
+ "uv=13.185*10**(-6); #viscosity of vapour in kg/m sec\n",
+ "lamda1 = (2716.1-419.1)*10**(3);#Latent heat of fusion in J/kg\n",
+ "hc = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(140-100)))**(0.25);\n",
+ "qrad = 5.67*10**(-8)*(413**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr = qrad/(413-373);\n",
+ "h = hc + 0.75*hr;\n",
+ "\n",
+ "hc_200 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(200-100)))**(0.25);\n",
+ "qrad1 = 5.67*10**(-8)*(473**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_200 = qrad1/(200-100);\n",
+ "h_200 = hc_200 +0.75*hr_200;\n",
+ "hc_600 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(600-100)))**(0.25);\n",
+ "qrad2 = 5.67*10**(-8)*(873**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_600 = qrad1/(600-100)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"\\n q/A = \",round(q1,2),\" W/m^2 at (Tw-Ts)=1\";\n",
+ "print \"\\n q/A = \",round(q2,2),\" W/m^2 at (Tw-Ts)=5\";\n",
+ "print \"\\n q/A = \",round(q3,2),\" W/m^2 at (Tw-Ts)=10\";\n",
+ "print \"\\n q/A at deltaT = 5 degree celsius = \",q11,\" W/m^2\";\n",
+ "print \"\\nq/A at deltaT = 10 degree celsius = \",q12,\" W/m^2\";\n",
+ "print \"\\n q/A at deltaT =20 degree celsius = \",q13,\" W/m^2\";\n",
+ "print \"\\n Peak heat flux L = \",round(L1,2); \n",
+ "print \"\\n f(l) = \",round(f_L,2);\n",
+ "print \"\\n q/A = \",q2,\" W/m^2\";\n",
+ "print \"Tw-Ts = \",Tn,\" degree celsius\"\n",
+ "print \"\\n\\n Minimum heat flux\";\n",
+ "print \"\\n q/A \",q3, \"W/m^2\"\n",
+ "print \"\\n\\n Stable film boiling\"\n",
+ "print \"\\n hc = \",hc,\" W/m^2\"\n",
+ "print \"\\n q/A due to radiation = \",qrad,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr,\" W/m^2 K \";\n",
+ "print \"\\n Since hr<hc \";\n",
+ "print \"\\n The total heat transfer coefficient \";\n",
+ "print \" h = \",h,\" W/m^2 K\";\n",
+ "print \"\\n Total heat flux \",h*(140-100),\" W/m^2 K\";\n",
+ "print \"\\n\\n hc = \",hc_200,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_200,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad1,\" W/m^2\";\n",
+ "print \"\\n Total heat flux = \",h_200*100,\" W/m^2\";\n",
+ "print \"\\n\\n hc = \",hc_600,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_600,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad2,\" W/m^2\";\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "q = [q11, q12, q13];\n",
+ "plt.plot ([1, 5, 10],q);\n",
+ "deltaT=linspace(1,10,10);\n",
+ "q1=141.32*deltaT**3;\n",
+ "plt.plot (deltaT,q1)\n",
+ "plt.title (\"Boiling curve\");\n",
+ "plt.xlabel(\" (Tw - Ts)degree celsius \");\n",
+ "plt.ylabel(\" Heat flux,(q/A)W/m^2 \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " q/A = 1116.99 W/m^2 at (Tw-Ts)=1\n",
+ "\n",
+ " q/A = 1393519.91 W/m^2 at (Tw-Ts)=5\n",
+ "\n",
+ " q/A = 19025.3 W/m^2 at (Tw-Ts)=10\n",
+ "\n",
+ " q/A at deltaT = 5 degree celsius = 17665.0 W/m^2\n",
+ "\n",
+ "q/A at deltaT = 10 degree celsius = 141320.0 W/m^2\n",
+ "\n",
+ " q/A at deltaT =20 degree celsius = 1130560.0 W/m^2\n",
+ "\n",
+ " Peak heat flux L = 0.28\n",
+ "\n",
+ " f(l) = 1.26\n",
+ "\n",
+ " q/A = 1393519.90741 W/m^2\n",
+ "Tw-Ts = 21.4438708455 degree celsius\n",
+ "\n",
+ "\n",
+ " Minimum heat flux\n",
+ "\n",
+ " q/A 19025.295556 W/m^2\n",
+ "\n",
+ "\n",
+ " Stable film boiling\n",
+ "\n",
+ " hc = 455.986290831 W/m^2\n",
+ "\n",
+ " q/A due to radiation = 496.874268274 W/m^2\n",
+ "\n",
+ " hr = 12.4218567068 W/m^2 K \n",
+ "\n",
+ " Since hr<hc \n",
+ "\n",
+ " The total heat transfer coefficient \n",
+ " h = 465.302683361 W/m^2 K\n",
+ "\n",
+ " Total heat flux 18612.1073344 W/m^2 K\n",
+ "\n",
+ "\n",
+ " hc = 362.632549817 W/m^2\n",
+ "\n",
+ " hr = 15.665080604 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 1566.5080604 W/m^2\n",
+ "\n",
+ " Total heat flux = 37438.136027 W/m^2\n",
+ "\n",
+ "\n",
+ " hc = 242.507001959 W/m^2\n",
+ "\n",
+ " hr = 3.13301612081 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 28652.514946 W/m^2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEXCAYAAADr+ZCUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdcU2f7P/ArTAdKGBIgQVYCKFBAZYi1RREQ67YyrIKr\ndTxatX0o2vFVv62Ktj7VVq2/p5UCWkDrRCuIi2qVIQoWB0uCkDDUkLBncv/+OD39IkIZAodxvV+v\n80pycsaVtObDfc597sMihABCCCHU25SYLgAhhNDghAGEEEKIERhACCGEGIEBhBBCiBEYQAghhBiB\nAYQQQogRGEAIdbNffvnlPS8vr0v0ayUlJUVeXp4ZAMCaNWt++Oqrrz5nrjqE+g4WXgeE0KtMTEzy\nnz17pqesrCxXVVVtdHV1vX348OHVPB5P1NltKSkpKXJzc/lmZmZ5PVErQv0VtoAQagWLxSIXLlyY\nWVlZOaK4uNiAw+GUrl+//num6+ppTU1NKkzXgAYPDCCE2qGurl6/YMGCU48ePRpLzysvL9cMCAiI\n0NPTe2ZiYpK/Y8eOzwghLACAsLCwpZMnT77Z2raWLl0a9sUXX3wJAJCQkODG4/FE//nPfz7icDil\nhoaGRWFhYUvpZSUSic6sWbPOa2pqljs5OaV8/vnnX7W1XQCAP/74401XV9fbWlpa0tGjRxdEREQE\nAAC4ubklHDlyZAW9XMv6lJSUFIcOHVprYWGRbWFhkb127dpDQUFBXzff9pw5c859++23mwAAioqK\nDBcsWHBKT0/vmZmZWd7333+/vpNfKUIAgAGEUJvoQKmpqRl2/Phx34kTJybS761fv/77ysrKEUKh\n0PT3339/OyIiIuDnn39e1t42WSwWYbFYfx/3Li0t5VRUVIwsKioyPHLkyIp//etfB8vLyzUBAP71\nr38dHDFiRGVpaSknPDw8MCIiIqD5us09ffrUeMaMGRc3bNiw/8WLF7rp6en2dnZ291vbZ2vOnTs3\nJyUlxenx48dj/P39o44fP+5LvyeVSrUuX77s4e/vH6VQKJRmzZp13sHBIa2oqMjw6tWr7vv27dsY\nHx/v2d5nR6glDCCEWkEIYc2dO/eslpaWlM1my65ever+73//+xsAALlcrnz8+HHfXbt2bRk+fHi1\nsbHx048//njv0aNHl3R02/RzVVXVxv/5n//5X2VlZbm3t3eshoZGVVZWlqVcLlc+ffr0/O3bt28d\nMmRI3ZgxYx4HBgaGN1+3ucjIyEUeHh6XfX19jysrK8u1tbXL6ADqiC1btuxis9kydXX1+jfffPMP\nFotFbt68ORkA4OTJk++6urre1tfXL7lz547jixcvdD///POvVFRUmkxNTYUrV678KTo62q+j+0KI\nhsd7EWoFi8Ui586dmzN16tRrhBDW2bNn57799tu/P378eAwhhNXY2KhqbGz8lF5+9OjRBWKxmNvZ\n/ejo6EiUlJQU9Othw4bVVFVVaTx//nxUU1OTipGRUSH93j91gBCJRLzX6eTQfD8sFov4+flFR0VF\n+U+ePPlmZGTkooCAgAgAqqVVVFRkqKWlJaWXl8vlym+99daNru4bDV7YAkKoHSwWi8ybN++MsrKy\n/I8//nhTV1f3haqqamN+fr4JvUxBQcHojvaQa+9wGADAqFGjnquoqDQVFhYa0fOaP2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DABIYQQkgUmIIQQQrLABIQQQkgWmIAQQgjJAhMQ\nQgghWbwDrHA2pVW5S0IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4843ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 , Page no:337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #m\n",
+ "l = 0.15 ; #m\n",
+ "T = 500+273 ; #K\n",
+ "Tc = -196+273 ; #K\n",
+ "e = 0.4;\n",
+ "#Properties\n",
+ "k = 0.0349 ; #W/m K\n",
+ "rho = 0.80 ; #kg/m^3\n",
+ "Cpavg = 1.048 ; #kJ/kg J\n",
+ "rholiq = 800 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "s = 5.670*10**-8;\n",
+ "#Film boiling will occur, hence eqn 8.7.9 is applicable\n",
+ "Tm = (T+Tc) /2; #Film boiling will occur\n",
+ "u = 23*10**-6 ; #kg/m s\n",
+ "latent = 201*10**3 ; #J/kg\n",
+ "hfg = (latent + Cpavg *(Tm -Tc) *1000); #Jk/g\n",
+ "hc = 0.62*((( k**3) *rho *799.2*9.81* hfg )/(D*u*(T-Tc)) )**(1/4) ; #W/m^2 K\n",
+ "#Taking the emissivity of liquid surface to be unity and using equation 3.9.1, the exchange of radiant heat flux\n",
+ "flux = s*(T**4- Tc**4) /(1/ e +1/1 -1) ; #W/m^2\n",
+ "hr = flux /(T-Tc);\n",
+ "#Since h_r < h_c, total heat transfer coefficient is determined from eqn 8.7.11\n",
+ "h = hc +3/4* hr ; #W/m^2 K\n",
+ "fluxi = h*(T-Tc);\n",
+ "Rate = fluxi *3.14*D*l; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Initial heat flux =\",round(fluxi,4),\"W/m^2\";\n",
+ "print\"Initial heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial heat flux = 69646.6128 W/m^2\n",
+ "Initial heat transfer rate = 656.0711 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_6.ipynb new file mode 100755 index 00000000..d8b484bd --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_6.ipynb @@ -0,0 +1,495 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f7a2826bb5ef350cbea2514ac8a8b908a8de4a74e86c0b05c1c2aaabf919bcf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Condensation and boiling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 , Page no:318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 80 ; #C\n",
+ "Tw = 70 ; #C\n",
+ "L = 1 ; #m\n",
+ "g = 9.8 ; #m/s^2\n",
+ "#From table A.1\n",
+ "rho = 978.8 ; #kg/m^3\n",
+ "k = 0.672 ; #W/m K\n",
+ "hfg = 2309 ; #At 80 C,kJ/kg\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts + Tw)/2 ; #Assuming condensate film is laminar and Re < 30\n",
+ "u = 381 *10**-6 ; #kg/m s\n",
+ "v = u/rho ;\n",
+ "#Substituting in eqn 8.3.9, we get\n",
+ "h = 0.943*(( hfg *1000*( rho**2)*g*(k**3)) /(( Ts -Tw)*u*L) )**(1/4) ; #W/m^2 K\n",
+ "rate = h*L*(Ts -Tw)/( hfg *1000) ; #kg/m s\n",
+ "Re = 4* rate /u;\n",
+ "#Substituting h = Re*(lambda*1000)*u/(4*L*(Ts-Tw)), in eqn 8.3.12\n",
+ "Re_1 = (((4* L*(Ts -Tw)*k/( hfg *1000* u)*(g/(v**2) )**(1/3) )+5.2)/1.08)**(1/1.22) ; #Substituting h = Re*(hfg*1000)*u/(4*L*(Ts-Tw))\n",
+ "#From eqn 8.3.12\n",
+ "h_1 = ((Re /(1.08*( Re**1.22) -5.2) )*k *(( g/v**2)**(1/3) )); #W/m^2 K\n",
+ "m = h_1*L *10/( hfg *1000) ; #rate of condensation,kg/m s\n",
+ "\n",
+ "#result\n",
+ "print\"Assuming condensate film is laminar and Re < 30\";\n",
+ "print\"h =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"ReL =\",round(Re,4);\n",
+ "print\"Initial assumption was wrong, Now considering the effect of ripples, we get\";\n",
+ "print\"Re =\",round(Re_1,4);\n",
+ "print\"Heat Transfer Cofficient =\",round(h_1,4),\"W/m^2 K\";\n",
+ "print\"Rate of condensation =\",round(m,6),\"kg/m s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming condensate film is laminar and Re < 30\n",
+ "h = 6078.7864 W/m^2 K\n",
+ "ReL = 276.3936\n",
+ "Initial assumption was wrong, Now considering the effect of ripples, we get\n",
+ "Re = 320.4829\n",
+ "Heat Transfer Cofficient = 7287.8478 W/m^2 K\n",
+ "Rate of condensation = 0.031563 kg/m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 , Page no:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 262 ; #K\n",
+ "D = 0.022 ; #m\n",
+ "Tw = 258 ; #K\n",
+ "#Properties at Tm\n",
+ "rho = 1324 ; #kg/m^3\n",
+ "k = 0.1008 ; #W/m K\n",
+ "g = 9.81 ; #m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts+Tw) /2;\n",
+ "v = 1.90*10**-7 ; #m^2/s\n",
+ "hfg = 215.1*10**3 ; #J/kg\n",
+ "u = v*rho ; #Viscosity\n",
+ "#From eqn 8.4.1\n",
+ "h = 0.725*( hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*D))**(1/4) ;\n",
+ "rate = h*3.14*D*(Ts -Tw) / hfg ; #kg/s m\n",
+ "Re = 4* rate /u ;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"Condensation rate per unit length =\",round(rate,6),\"kg/s m\";\n",
+ "print\"Film Reynolds number =\",round(Re,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient = 2622.2475 W/m^2 K\n",
+ "Condensation rate per unit length = 0.003369 kg/s m\n",
+ "Film Reynolds number = 53.5629\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 25/60 ; #kg/sec\n",
+ "ID = 0.025 ; #m\n",
+ "OD = 0.029 ; #m\n",
+ "Tci = 30 ; #C\n",
+ "Tce = 70 ; #C\n",
+ "g = 9.8 ; #m/s^2\n",
+ "Ts = 100 ; #C\n",
+ "#Assuming 5.3.2 is valid, properties at 50 C\n",
+ "#Properties at Tm\n",
+ "rho = 988.1 ; #kg/m^3\n",
+ "k = 0.648 ; #W/m K\n",
+ "Pr = 3.54 ;\n",
+ "#From eqn 4.6.4a\n",
+ "f = 0.005635;\n",
+ "#From eqn 5.3.2\n",
+ "Nu = 198.39 ;\n",
+ "Tw = 90 ; #Assuming average wall temperature = 90 C\n",
+ "#Properties at Tm\n",
+ "#Properties at Tm\n",
+ "rho = 961.9 ; #kg/m^3\n",
+ "k = 0.682 ; #W/m K\n",
+ "l = 0; #initial guess, assumed value for fsolve function\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.556*10**-6; #m^2/s\n",
+ "Re = 4*m/(3.14*ID*rho *v);\n",
+ "h = Nu*k/ID ;\n",
+ "u = 298.6*10**-6 ; #kg/m s\n",
+ "hfg = 2257*10**3 ; #J/kg\n",
+ "#Equating the heat flow from the condensing steam to the tube wall, to the heat flow from the tube wall to the flowing water.\n",
+ "#Solving the simplified equation\n",
+ "h = 0.725*(hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*OD))**(1/4) ;\n",
+ "#By solving trial and error method, the temperature value we get\n",
+ "T=86.964984;# in oC\n",
+ "#Therefore\n",
+ "hc = 21338.77/(100 - T)**(1/4) ; #W/m^2 K\n",
+ "#Now, equating the heat flowing from the condensing steam to the tube wall to the heat gained by the water, we have\n",
+ "#Solving by trial and error method, we get\n",
+ "L=5.216152; #in meter\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature obtained from trial and error =\",round(T,4),\"oC\";\n",
+ "print\"hc =\",round(hc,4),\"W/m^2 K\";\n",
+ "print\"Length of the tube =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature obtained from trial and error = 86.965 oC\n",
+ "hc = 11230.3034 W/m^2 K\n",
+ "Length of the tube = 5.2162 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "#Properties at (Tw+Ts)/2 = 100.5 degree celsius\n",
+ "deltaT1 = 1; #in degree celsius\n",
+ "p1 = 7.55*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v1 = 0.294*10**-6; #[m^2/sec] viscosity at 100.5 degree celsius\n",
+ "k1 = 0.683; #[W/m-k]thermal conductivity\n",
+ "Pr1 = 1.74; #Prandtl number\n",
+ "g = 9.81; #acceleration due to gravity\n",
+ "L = 0.14*10**-2; #diameter in meters\n",
+ "#Properties at (Tw+Ts)/2 =102.5\n",
+ "deltaT2 = 5; #in degree celsius\n",
+ "p2 = 7.66*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v2 = 0.289*10**-6; #[m^2/sec] viscosity at 102.5 degree celsius \n",
+ "k2 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr2 = 1.71; #Prandtl number \n",
+ "#Properties at (Tw+Ts)/2 =105\n",
+ "deltaT3 = 10; #in degree celsius\n",
+ "p3 = 7.80*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v3 = 0.284*10**-6; #[m^2/sec] viscosity at 105 degree celsius \n",
+ "k3 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr3 = 1.68; #Prandtl number\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ra1 = ((p1*g*deltaT1*L**3)/(v1**2))*Pr1;\n",
+ "q1=(k1/L)*(deltaT1)*(0.36+(0.518*Ra1**(1/4))/(1+(0.559/Pr1)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra2 = ((p2*g*deltaT2*L**3)/(v2**2))*Pr2;\n",
+ "q2=(k2/L)*(deltaT2)*(0.36+(0.518*Ra2**(1/4))/(1+(0.559/Pr2)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra3 = ((p3*g*deltaT3*L**3)/(v3**2))*Pr3;\n",
+ "q3=(k3/L)*(deltaT3)*(0.36+(0.518*Ra3**(1/4))/(1+(0.559/Pr3)**(9/16))**(4/9))\n",
+ "\n",
+ "#At 100 degree celsius\n",
+ "Cpl = 4.220; #[kJ/kg]\n",
+ "lamda = 2257; #[kJ/kg]\n",
+ "ul = 282.4*10**-6; #viscosity is in kg/m-sec\n",
+ "sigma = 589*10**-4; #Surface tension is in N/m\n",
+ "pl = 958.4; #density in kg/m^3\n",
+ "pv =0.598; #density of vapour in kg/m^3\n",
+ "deltap = pl-pv;\n",
+ "Prl = 1.75; #Prandtl no. of liquid\n",
+ "Ksf = 0.013;\n",
+ "deltaT11=5;\n",
+ "deltaT12=10;\n",
+ "deltaT13=20;\n",
+ "q11=141.32*deltaT11**3\n",
+ "q12=141.32*deltaT12**3\n",
+ "q13=141.32*deltaT13**3\n",
+ "\n",
+ "\n",
+ "L1 = (L/2)*(g*(pl-pv)/sigma)**(1/2);\n",
+ "f_L = 0.89+2.27*math.exp(-3.44*L1**(0.5));\n",
+ "q2 = f_L*((3.14/24)*lamda*10**(3)*pv**(0.5)*(sigma*g*(pl-pv))**(0.25));\n",
+ "\n",
+ "Tn=pow(q2/141.32,1/3)\n",
+ "q3 = 0.09*lamda*10**3*pv*(sigma*g*(pl-pv)/(pl+pv)**(2))**(0.25);\n",
+ "Ts1 = 140; #surface temperature in degree celsius\n",
+ "Ts2 = 200; #surface temperature in degree celsius\n",
+ "Ts3 = 600; #surface temperature in degree celsius\n",
+ "Twm1 = (140+100)/2; #Mean film temperature\n",
+ "#properties of steam at 120 degree celsius and 1.013 bar\n",
+ "kv = 0.02558; #thermal conductivity in W/mK\n",
+ "pv1 = 0.5654; #vapor density in kg/m**3\n",
+ "uv=13.185*10**(-6); #viscosity of vapour in kg/m sec\n",
+ "lamda1 = (2716.1-419.1)*10**(3);#Latent heat of fusion in J/kg\n",
+ "hc = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(140-100)))**(0.25);\n",
+ "qrad = 5.67*10**(-8)*(413**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr = qrad/(413-373);\n",
+ "h = hc + 0.75*hr;\n",
+ "\n",
+ "hc_200 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(200-100)))**(0.25);\n",
+ "qrad1 = 5.67*10**(-8)*(473**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_200 = qrad1/(200-100);\n",
+ "h_200 = hc_200 +0.75*hr_200;\n",
+ "hc_600 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(600-100)))**(0.25);\n",
+ "qrad2 = 5.67*10**(-8)*(873**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_600 = qrad1/(600-100)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"\\n q/A = \",round(q1,2),\" W/m^2 at (Tw-Ts)=1\";\n",
+ "print \"\\n q/A = \",round(q2,2),\" W/m^2 at (Tw-Ts)=5\";\n",
+ "print \"\\n q/A = \",round(q3,2),\" W/m^2 at (Tw-Ts)=10\";\n",
+ "print \"\\n q/A at deltaT = 5 degree celsius = \",q11,\" W/m^2\";\n",
+ "print \"\\nq/A at deltaT = 10 degree celsius = \",q12,\" W/m^2\";\n",
+ "print \"\\n q/A at deltaT =20 degree celsius = \",q13,\" W/m^2\";\n",
+ "print \"\\n Peak heat flux L = \",round(L1,2); \n",
+ "print \"\\n f(l) = \",round(f_L,2);\n",
+ "print \"\\n q/A = \",q2,\" W/m^2\";\n",
+ "print \"Tw-Ts = \",Tn,\" degree celsius\"\n",
+ "print \"\\n\\n Minimum heat flux\";\n",
+ "print \"\\n q/A \",q3, \"W/m^2\"\n",
+ "print \"\\n\\n Stable film boiling\"\n",
+ "print \"\\n hc = \",hc,\" W/m^2\"\n",
+ "print \"\\n q/A due to radiation = \",qrad,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr,\" W/m^2 K \";\n",
+ "print \"\\n Since hr<hc \";\n",
+ "print \"\\n The total heat transfer coefficient \";\n",
+ "print \" h = \",h,\" W/m^2 K\";\n",
+ "print \"\\n Total heat flux \",h*(140-100),\" W/m^2 K\";\n",
+ "print \"\\n\\n hc = \",hc_200,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_200,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad1,\" W/m^2\";\n",
+ "print \"\\n Total heat flux = \",h_200*100,\" W/m^2\";\n",
+ "print \"\\n\\n hc = \",hc_600,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_600,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad2,\" W/m^2\";\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "q = [q11, q12, q13];\n",
+ "plt.plot ([1, 5, 10],q);\n",
+ "deltaT=linspace(1,10,10);\n",
+ "q1=141.32*deltaT**3;\n",
+ "plt.plot (deltaT,q1)\n",
+ "plt.title (\"Boiling curve\");\n",
+ "plt.xlabel(\" (Tw - Ts)degree celsius \");\n",
+ "plt.ylabel(\" Heat flux,(q/A)W/m^2 \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " q/A = 1116.99 W/m^2 at (Tw-Ts)=1\n",
+ "\n",
+ " q/A = 1393519.91 W/m^2 at (Tw-Ts)=5\n",
+ "\n",
+ " q/A = 19025.3 W/m^2 at (Tw-Ts)=10\n",
+ "\n",
+ " q/A at deltaT = 5 degree celsius = 17665.0 W/m^2\n",
+ "\n",
+ "q/A at deltaT = 10 degree celsius = 141320.0 W/m^2\n",
+ "\n",
+ " q/A at deltaT =20 degree celsius = 1130560.0 W/m^2\n",
+ "\n",
+ " Peak heat flux L = 0.28\n",
+ "\n",
+ " f(l) = 1.26\n",
+ "\n",
+ " q/A = 1393519.90741 W/m^2\n",
+ "Tw-Ts = 21.4438708455 degree celsius\n",
+ "\n",
+ "\n",
+ " Minimum heat flux\n",
+ "\n",
+ " q/A 19025.295556 W/m^2\n",
+ "\n",
+ "\n",
+ " Stable film boiling\n",
+ "\n",
+ " hc = 455.986290831 W/m^2\n",
+ "\n",
+ " q/A due to radiation = 496.874268274 W/m^2\n",
+ "\n",
+ " hr = 12.4218567068 W/m^2 K \n",
+ "\n",
+ " Since hr<hc \n",
+ "\n",
+ " The total heat transfer coefficient \n",
+ " h = 465.302683361 W/m^2 K\n",
+ "\n",
+ " Total heat flux 18612.1073344 W/m^2 K\n",
+ "\n",
+ "\n",
+ " hc = 362.632549817 W/m^2\n",
+ "\n",
+ " hr = 15.665080604 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 1566.5080604 W/m^2\n",
+ "\n",
+ " Total heat flux = 37438.136027 W/m^2\n",
+ "\n",
+ "\n",
+ " hc = 242.507001959 W/m^2\n",
+ "\n",
+ " hr = 3.13301612081 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 28652.514946 W/m^2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEXCAYAAADr+ZCUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdcU2f7P/ArTAdKGBIgQVYCKFBAZYi1RREQ67YyrIKr\ndTxatX0o2vFVv62Ktj7VVq2/p5UCWkDrRCuIi2qVIQoWB0uCkDDUkLBncv/+OD39IkIZAodxvV+v\n80pycsaVtObDfc597sMihABCCCHU25SYLgAhhNDghAGEEEKIERhACCGEGIEBhBBCiBEYQAghhBiB\nAYQQQogRGEAIdbNffvnlPS8v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qur+4PjuAWWZaX09PQJjuMWvI+XlJTcdTqdSoZhFjs6\nOi6REQKSJLFk04bRaDRg9fN9wWakKCCNjY3lWCyWUrPZrJM7FgCAhoaGq8nJyf9otdp7+7ne5XKF\nk6W21tbW39fX1w+3tbX99mWjROjrwgoIBaScnJwxh8NBkXk8ctrZ2flhfHw843MGCgqCUMTzvMiy\nrDQxMZGu1+tbvmSMCMkBKyCEEEKywAoIIYSQLDABIYQQkgUmIIQQQrLABIQQQkgWmIAQQgjJAhMQ\nQgghWbwDrHA2pVW5S0IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4843ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 , Page no:337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #m\n",
+ "l = 0.15 ; #m\n",
+ "T = 500+273 ; #K\n",
+ "Tc = -196+273 ; #K\n",
+ "e = 0.4;\n",
+ "#Properties\n",
+ "k = 0.0349 ; #W/m K\n",
+ "rho = 0.80 ; #kg/m^3\n",
+ "Cpavg = 1.048 ; #kJ/kg J\n",
+ "rholiq = 800 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "s = 5.670*10**-8;\n",
+ "#Film boiling will occur, hence eqn 8.7.9 is applicable\n",
+ "Tm = (T+Tc) /2; #Film boiling will occur\n",
+ "u = 23*10**-6 ; #kg/m s\n",
+ "latent = 201*10**3 ; #J/kg\n",
+ "hfg = (latent + Cpavg *(Tm -Tc) *1000); #Jk/g\n",
+ "hc = 0.62*((( k**3) *rho *799.2*9.81* hfg )/(D*u*(T-Tc)) )**(1/4) ; #W/m^2 K\n",
+ "#Taking the emissivity of liquid surface to be unity and using equation 3.9.1, the exchange of radiant heat flux\n",
+ "flux = s*(T**4- Tc**4) /(1/ e +1/1 -1) ; #W/m^2\n",
+ "hr = flux /(T-Tc);\n",
+ "#Since h_r < h_c, total heat transfer coefficient is determined from eqn 8.7.11\n",
+ "h = hc +3/4* hr ; #W/m^2 K\n",
+ "fluxi = h*(T-Tc);\n",
+ "Rate = fluxi *3.14*D*l; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Initial heat flux =\",round(fluxi,4),\"W/m^2\";\n",
+ "print\"Initial heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial heat flux = 69646.6128 W/m^2\n",
+ "Initial heat transfer rate = 656.0711 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_7.ipynb new file mode 100755 index 00000000..d8b484bd --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_7.ipynb @@ -0,0 +1,495 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f7a2826bb5ef350cbea2514ac8a8b908a8de4a74e86c0b05c1c2aaabf919bcf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Condensation and boiling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 , Page no:318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 80 ; #C\n",
+ "Tw = 70 ; #C\n",
+ "L = 1 ; #m\n",
+ "g = 9.8 ; #m/s^2\n",
+ "#From table A.1\n",
+ "rho = 978.8 ; #kg/m^3\n",
+ "k = 0.672 ; #W/m K\n",
+ "hfg = 2309 ; #At 80 C,kJ/kg\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts + Tw)/2 ; #Assuming condensate film is laminar and Re < 30\n",
+ "u = 381 *10**-6 ; #kg/m s\n",
+ "v = u/rho ;\n",
+ "#Substituting in eqn 8.3.9, we get\n",
+ "h = 0.943*(( hfg *1000*( rho**2)*g*(k**3)) /(( Ts -Tw)*u*L) )**(1/4) ; #W/m^2 K\n",
+ "rate = h*L*(Ts -Tw)/( hfg *1000) ; #kg/m s\n",
+ "Re = 4* rate /u;\n",
+ "#Substituting h = Re*(lambda*1000)*u/(4*L*(Ts-Tw)), in eqn 8.3.12\n",
+ "Re_1 = (((4* L*(Ts -Tw)*k/( hfg *1000* u)*(g/(v**2) )**(1/3) )+5.2)/1.08)**(1/1.22) ; #Substituting h = Re*(hfg*1000)*u/(4*L*(Ts-Tw))\n",
+ "#From eqn 8.3.12\n",
+ "h_1 = ((Re /(1.08*( Re**1.22) -5.2) )*k *(( g/v**2)**(1/3) )); #W/m^2 K\n",
+ "m = h_1*L *10/( hfg *1000) ; #rate of condensation,kg/m s\n",
+ "\n",
+ "#result\n",
+ "print\"Assuming condensate film is laminar and Re < 30\";\n",
+ "print\"h =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"ReL =\",round(Re,4);\n",
+ "print\"Initial assumption was wrong, Now considering the effect of ripples, we get\";\n",
+ "print\"Re =\",round(Re_1,4);\n",
+ "print\"Heat Transfer Cofficient =\",round(h_1,4),\"W/m^2 K\";\n",
+ "print\"Rate of condensation =\",round(m,6),\"kg/m s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming condensate film is laminar and Re < 30\n",
+ "h = 6078.7864 W/m^2 K\n",
+ "ReL = 276.3936\n",
+ "Initial assumption was wrong, Now considering the effect of ripples, we get\n",
+ "Re = 320.4829\n",
+ "Heat Transfer Cofficient = 7287.8478 W/m^2 K\n",
+ "Rate of condensation = 0.031563 kg/m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 , Page no:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 262 ; #K\n",
+ "D = 0.022 ; #m\n",
+ "Tw = 258 ; #K\n",
+ "#Properties at Tm\n",
+ "rho = 1324 ; #kg/m^3\n",
+ "k = 0.1008 ; #W/m K\n",
+ "g = 9.81 ; #m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts+Tw) /2;\n",
+ "v = 1.90*10**-7 ; #m^2/s\n",
+ "hfg = 215.1*10**3 ; #J/kg\n",
+ "u = v*rho ; #Viscosity\n",
+ "#From eqn 8.4.1\n",
+ "h = 0.725*( hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*D))**(1/4) ;\n",
+ "rate = h*3.14*D*(Ts -Tw) / hfg ; #kg/s m\n",
+ "Re = 4* rate /u ;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"Condensation rate per unit length =\",round(rate,6),\"kg/s m\";\n",
+ "print\"Film Reynolds number =\",round(Re,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient = 2622.2475 W/m^2 K\n",
+ "Condensation rate per unit length = 0.003369 kg/s m\n",
+ "Film Reynolds number = 53.5629\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 25/60 ; #kg/sec\n",
+ "ID = 0.025 ; #m\n",
+ "OD = 0.029 ; #m\n",
+ "Tci = 30 ; #C\n",
+ "Tce = 70 ; #C\n",
+ "g = 9.8 ; #m/s^2\n",
+ "Ts = 100 ; #C\n",
+ "#Assuming 5.3.2 is valid, properties at 50 C\n",
+ "#Properties at Tm\n",
+ "rho = 988.1 ; #kg/m^3\n",
+ "k = 0.648 ; #W/m K\n",
+ "Pr = 3.54 ;\n",
+ "#From eqn 4.6.4a\n",
+ "f = 0.005635;\n",
+ "#From eqn 5.3.2\n",
+ "Nu = 198.39 ;\n",
+ "Tw = 90 ; #Assuming average wall temperature = 90 C\n",
+ "#Properties at Tm\n",
+ "#Properties at Tm\n",
+ "rho = 961.9 ; #kg/m^3\n",
+ "k = 0.682 ; #W/m K\n",
+ "l = 0; #initial guess, assumed value for fsolve function\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.556*10**-6; #m^2/s\n",
+ "Re = 4*m/(3.14*ID*rho *v);\n",
+ "h = Nu*k/ID ;\n",
+ "u = 298.6*10**-6 ; #kg/m s\n",
+ "hfg = 2257*10**3 ; #J/kg\n",
+ "#Equating the heat flow from the condensing steam to the tube wall, to the heat flow from the tube wall to the flowing water.\n",
+ "#Solving the simplified equation\n",
+ "h = 0.725*(hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*OD))**(1/4) ;\n",
+ "#By solving trial and error method, the temperature value we get\n",
+ "T=86.964984;# in oC\n",
+ "#Therefore\n",
+ "hc = 21338.77/(100 - T)**(1/4) ; #W/m^2 K\n",
+ "#Now, equating the heat flowing from the condensing steam to the tube wall to the heat gained by the water, we have\n",
+ "#Solving by trial and error method, we get\n",
+ "L=5.216152; #in meter\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature obtained from trial and error =\",round(T,4),\"oC\";\n",
+ "print\"hc =\",round(hc,4),\"W/m^2 K\";\n",
+ "print\"Length of the tube =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature obtained from trial and error = 86.965 oC\n",
+ "hc = 11230.3034 W/m^2 K\n",
+ "Length of the tube = 5.2162 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "#Properties at (Tw+Ts)/2 = 100.5 degree celsius\n",
+ "deltaT1 = 1; #in degree celsius\n",
+ "p1 = 7.55*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v1 = 0.294*10**-6; #[m^2/sec] viscosity at 100.5 degree celsius\n",
+ "k1 = 0.683; #[W/m-k]thermal conductivity\n",
+ "Pr1 = 1.74; #Prandtl number\n",
+ "g = 9.81; #acceleration due to gravity\n",
+ "L = 0.14*10**-2; #diameter in meters\n",
+ "#Properties at (Tw+Ts)/2 =102.5\n",
+ "deltaT2 = 5; #in degree celsius\n",
+ "p2 = 7.66*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v2 = 0.289*10**-6; #[m^2/sec] viscosity at 102.5 degree celsius \n",
+ "k2 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr2 = 1.71; #Prandtl number \n",
+ "#Properties at (Tw+Ts)/2 =105\n",
+ "deltaT3 = 10; #in degree celsius\n",
+ "p3 = 7.80*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v3 = 0.284*10**-6; #[m^2/sec] viscosity at 105 degree celsius \n",
+ "k3 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr3 = 1.68; #Prandtl number\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ra1 = ((p1*g*deltaT1*L**3)/(v1**2))*Pr1;\n",
+ "q1=(k1/L)*(deltaT1)*(0.36+(0.518*Ra1**(1/4))/(1+(0.559/Pr1)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra2 = ((p2*g*deltaT2*L**3)/(v2**2))*Pr2;\n",
+ "q2=(k2/L)*(deltaT2)*(0.36+(0.518*Ra2**(1/4))/(1+(0.559/Pr2)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra3 = ((p3*g*deltaT3*L**3)/(v3**2))*Pr3;\n",
+ "q3=(k3/L)*(deltaT3)*(0.36+(0.518*Ra3**(1/4))/(1+(0.559/Pr3)**(9/16))**(4/9))\n",
+ "\n",
+ "#At 100 degree celsius\n",
+ "Cpl = 4.220; #[kJ/kg]\n",
+ "lamda = 2257; #[kJ/kg]\n",
+ "ul = 282.4*10**-6; #viscosity is in kg/m-sec\n",
+ "sigma = 589*10**-4; #Surface tension is in N/m\n",
+ "pl = 958.4; #density in kg/m^3\n",
+ "pv =0.598; #density of vapour in kg/m^3\n",
+ "deltap = pl-pv;\n",
+ "Prl = 1.75; #Prandtl no. of liquid\n",
+ "Ksf = 0.013;\n",
+ "deltaT11=5;\n",
+ "deltaT12=10;\n",
+ "deltaT13=20;\n",
+ "q11=141.32*deltaT11**3\n",
+ "q12=141.32*deltaT12**3\n",
+ "q13=141.32*deltaT13**3\n",
+ "\n",
+ "\n",
+ "L1 = (L/2)*(g*(pl-pv)/sigma)**(1/2);\n",
+ "f_L = 0.89+2.27*math.exp(-3.44*L1**(0.5));\n",
+ "q2 = f_L*((3.14/24)*lamda*10**(3)*pv**(0.5)*(sigma*g*(pl-pv))**(0.25));\n",
+ "\n",
+ "Tn=pow(q2/141.32,1/3)\n",
+ "q3 = 0.09*lamda*10**3*pv*(sigma*g*(pl-pv)/(pl+pv)**(2))**(0.25);\n",
+ "Ts1 = 140; #surface temperature in degree celsius\n",
+ "Ts2 = 200; #surface temperature in degree celsius\n",
+ "Ts3 = 600; #surface temperature in degree celsius\n",
+ "Twm1 = (140+100)/2; #Mean film temperature\n",
+ "#properties of steam at 120 degree celsius and 1.013 bar\n",
+ "kv = 0.02558; #thermal conductivity in W/mK\n",
+ "pv1 = 0.5654; #vapor density in kg/m**3\n",
+ "uv=13.185*10**(-6); #viscosity of vapour in kg/m sec\n",
+ "lamda1 = (2716.1-419.1)*10**(3);#Latent heat of fusion in J/kg\n",
+ "hc = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(140-100)))**(0.25);\n",
+ "qrad = 5.67*10**(-8)*(413**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr = qrad/(413-373);\n",
+ "h = hc + 0.75*hr;\n",
+ "\n",
+ "hc_200 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(200-100)))**(0.25);\n",
+ "qrad1 = 5.67*10**(-8)*(473**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_200 = qrad1/(200-100);\n",
+ "h_200 = hc_200 +0.75*hr_200;\n",
+ "hc_600 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(600-100)))**(0.25);\n",
+ "qrad2 = 5.67*10**(-8)*(873**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_600 = qrad1/(600-100)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"\\n q/A = \",round(q1,2),\" W/m^2 at (Tw-Ts)=1\";\n",
+ "print \"\\n q/A = \",round(q2,2),\" W/m^2 at (Tw-Ts)=5\";\n",
+ "print \"\\n q/A = \",round(q3,2),\" W/m^2 at (Tw-Ts)=10\";\n",
+ "print \"\\n q/A at deltaT = 5 degree celsius = \",q11,\" W/m^2\";\n",
+ "print \"\\nq/A at deltaT = 10 degree celsius = \",q12,\" W/m^2\";\n",
+ "print \"\\n q/A at deltaT =20 degree celsius = \",q13,\" W/m^2\";\n",
+ "print \"\\n Peak heat flux L = \",round(L1,2); \n",
+ "print \"\\n f(l) = \",round(f_L,2);\n",
+ "print \"\\n q/A = \",q2,\" W/m^2\";\n",
+ "print \"Tw-Ts = \",Tn,\" degree celsius\"\n",
+ "print \"\\n\\n Minimum heat flux\";\n",
+ "print \"\\n q/A \",q3, \"W/m^2\"\n",
+ "print \"\\n\\n Stable film boiling\"\n",
+ "print \"\\n hc = \",hc,\" W/m^2\"\n",
+ "print \"\\n q/A due to radiation = \",qrad,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr,\" W/m^2 K \";\n",
+ "print \"\\n Since hr<hc \";\n",
+ "print \"\\n The total heat transfer coefficient \";\n",
+ "print \" h = \",h,\" W/m^2 K\";\n",
+ "print \"\\n Total heat flux \",h*(140-100),\" W/m^2 K\";\n",
+ "print \"\\n\\n hc = \",hc_200,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_200,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad1,\" W/m^2\";\n",
+ "print \"\\n Total heat flux = \",h_200*100,\" W/m^2\";\n",
+ "print \"\\n\\n hc = \",hc_600,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_600,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad2,\" W/m^2\";\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "q = [q11, q12, q13];\n",
+ "plt.plot ([1, 5, 10],q);\n",
+ "deltaT=linspace(1,10,10);\n",
+ "q1=141.32*deltaT**3;\n",
+ "plt.plot (deltaT,q1)\n",
+ "plt.title (\"Boiling curve\");\n",
+ "plt.xlabel(\" (Tw - Ts)degree celsius \");\n",
+ "plt.ylabel(\" Heat flux,(q/A)W/m^2 \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " q/A = 1116.99 W/m^2 at (Tw-Ts)=1\n",
+ "\n",
+ " q/A = 1393519.91 W/m^2 at (Tw-Ts)=5\n",
+ "\n",
+ " q/A = 19025.3 W/m^2 at (Tw-Ts)=10\n",
+ "\n",
+ " q/A at deltaT = 5 degree celsius = 17665.0 W/m^2\n",
+ "\n",
+ "q/A at deltaT = 10 degree celsius = 141320.0 W/m^2\n",
+ "\n",
+ " q/A at deltaT =20 degree celsius = 1130560.0 W/m^2\n",
+ "\n",
+ " Peak heat flux L = 0.28\n",
+ "\n",
+ " f(l) = 1.26\n",
+ "\n",
+ " q/A = 1393519.90741 W/m^2\n",
+ "Tw-Ts = 21.4438708455 degree celsius\n",
+ "\n",
+ "\n",
+ " Minimum heat flux\n",
+ "\n",
+ " q/A 19025.295556 W/m^2\n",
+ "\n",
+ "\n",
+ " Stable film boiling\n",
+ "\n",
+ " hc = 455.986290831 W/m^2\n",
+ "\n",
+ " q/A due to radiation = 496.874268274 W/m^2\n",
+ "\n",
+ " hr = 12.4218567068 W/m^2 K \n",
+ "\n",
+ " Since hr<hc \n",
+ "\n",
+ " The total heat transfer coefficient \n",
+ " h = 465.302683361 W/m^2 K\n",
+ "\n",
+ " Total heat flux 18612.1073344 W/m^2 K\n",
+ "\n",
+ "\n",
+ " hc = 362.632549817 W/m^2\n",
+ "\n",
+ " hr = 15.665080604 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 1566.5080604 W/m^2\n",
+ "\n",
+ " Total heat flux = 37438.136027 W/m^2\n",
+ "\n",
+ "\n",
+ " hc = 242.507001959 W/m^2\n",
+ "\n",
+ " hr = 3.13301612081 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 28652.514946 W/m^2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEXCAYAAADr+ZCUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0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Zbm3t3eshoZGVVZWlqVcLlc+ffr0/O3bt28d\nMmRI3ZgxYx4HBgaGN1+3ucjIyEUeHh6XfX19jysrK8u1tbXL6ADqiC1btuxis9kydXX1+jfffPMP\nFotFbt68ORkA4OTJk++6urre1tfXL7lz547jixcvdD///POvVFRUmkxNTYUrV678KTo62q+j+0KI\nhsd7EWoFi8Ui586dmzN16tRrhBDW2bNn57799tu/P378eAwhhNXY2KhqbGz8lF5+9OjRBWKxmNvZ\n/ejo6EiUlJQU9Othw4bVVFVVaTx//nxUU1OTipGRUSH93j91gBCJRLzX6eTQfD8sFov4+flFR0VF\n+U+ePPlmZGTkooCAgAgAqqVVVFRkqKWlJaWXl8vlym+99daNru4bDV7YAkKoHSwWi8ybN++MsrKy\n/I8//nhTV1f3haqqamN+fr4JvUxBQcHojvaQa+9wGADAqFGjnquoqDQVFhYa0fOaP2/JyMio8MmT\nJ+atvTd8+PDq6urq4fTrkpIS/fZq8vf3jzp58uS7T58+NU5JSXFasGDBKQAqaE1NTYVSqVSLnioq\nKkZeuHBhZnufCaGWMIAQagN9uIsQwjp37twcqVSqNWbMmMfKyspyHx+fE5999tmOqqoqjadPnxp/\n++23mxYvXnysI9ts6zBac8rKyvL58+ef3rZt27ba2tqhmZmZVkePHl3SVni99957v1y5cmXar7/+\nurCpqUlFIpHo3L9/3w4AwN7ePv306dPza2trh+bm5vKbd0hoi729fbquru6LlStX/jR9+vS4kSNH\nVgAAODk5pYwYMaJyz549n9TW1g6Vy+XKDx48sElNTZ3Q3jYRagkDCKE2zJo16/yIESMqNTU1y7/4\n4osvIyIiAsaMGfMYAOD7779fP3z48GozM7O8yZMn33zvvfd+WbZs2c8Ar570b/m8rfdaOnDgwLry\n8nJNfX39ksDAwHB/f/8oNTW1htaWNTIyKrx48eKMvXv3fqyjoyNxcHBI+/PPP98AANi0adO3ampq\nDRwOp3TZsmU/L168+FhHali0aFHktWvXpi5atCiSnqekpKS4cOHCzPT0dHszM7O8UaNGPf/ggw/+\nW1FR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b19Z1nGGaR53nRZrOpyId8URT51NTUSQAArVZ7j6IoB03T\n9vLy8ttpaWl/AwCEhobuDgwMnK2vr7+mVqutPM+Lk5OTqQAA3d3dv1ZWVt7keV7c3t4+SOL03UFn\nMBiMu7u7oRzHLTAMs9jU1NQMAFBRUXGLpml7YmLiPMuykk6nM5NkRNA0bW9sbLySnZ39l1qtttbU\n1FwHADCZTNWzs7MnEhISnqlUKhtJxN7Prqur+4PjuAWWZaX09PQJjuMWvI+XlJTcdTqdSoZhFjs6\nOi6REQKSJLFk04bRaDRg9fN9wWakKCCNjY3lWCyWUrPZrJM7FgCAhoaGq8nJyf9otdp7+7ne5XKF\nk6W21tbW39fX1w+3tbX99mWjROjrwgoIBaScnJwxh8NBkXk8ctrZ2flhfHw843MGCgqCUMTzvMiy\nrDQxMZGu1+tbvmSMCMkBKyCEEEKywAoIIYSQLDABIYQQkgUmIIQQQrLABIQQQkgWmIAQQgjJAhMQ\nQgghWbwDrHA2pVW5S0IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4843ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 , Page no:337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #m\n",
+ "l = 0.15 ; #m\n",
+ "T = 500+273 ; #K\n",
+ "Tc = -196+273 ; #K\n",
+ "e = 0.4;\n",
+ "#Properties\n",
+ "k = 0.0349 ; #W/m K\n",
+ "rho = 0.80 ; #kg/m^3\n",
+ "Cpavg = 1.048 ; #kJ/kg J\n",
+ "rholiq = 800 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "s = 5.670*10**-8;\n",
+ "#Film boiling will occur, hence eqn 8.7.9 is applicable\n",
+ "Tm = (T+Tc) /2; #Film boiling will occur\n",
+ "u = 23*10**-6 ; #kg/m s\n",
+ "latent = 201*10**3 ; #J/kg\n",
+ "hfg = (latent + Cpavg *(Tm -Tc) *1000); #Jk/g\n",
+ "hc = 0.62*((( k**3) *rho *799.2*9.81* hfg )/(D*u*(T-Tc)) )**(1/4) ; #W/m^2 K\n",
+ "#Taking the emissivity of liquid surface to be unity and using equation 3.9.1, the exchange of radiant heat flux\n",
+ "flux = s*(T**4- Tc**4) /(1/ e +1/1 -1) ; #W/m^2\n",
+ "hr = flux /(T-Tc);\n",
+ "#Since h_r < h_c, total heat transfer coefficient is determined from eqn 8.7.11\n",
+ "h = hc +3/4* hr ; #W/m^2 K\n",
+ "fluxi = h*(T-Tc);\n",
+ "Rate = fluxi *3.14*D*l; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Initial heat flux =\",round(fluxi,4),\"W/m^2\";\n",
+ "print\"Initial heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial heat flux = 69646.6128 W/m^2\n",
+ "Initial heat transfer rate = 656.0711 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_8.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_8.ipynb new file mode 100755 index 00000000..d8b484bd --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_8_Condensation_and_boiling_8.ipynb @@ -0,0 +1,495 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f7a2826bb5ef350cbea2514ac8a8b908a8de4a74e86c0b05c1c2aaabf919bcf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Condensation and boiling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 , Page no:318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 80 ; #C\n",
+ "Tw = 70 ; #C\n",
+ "L = 1 ; #m\n",
+ "g = 9.8 ; #m/s^2\n",
+ "#From table A.1\n",
+ "rho = 978.8 ; #kg/m^3\n",
+ "k = 0.672 ; #W/m K\n",
+ "hfg = 2309 ; #At 80 C,kJ/kg\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts + Tw)/2 ; #Assuming condensate film is laminar and Re < 30\n",
+ "u = 381 *10**-6 ; #kg/m s\n",
+ "v = u/rho ;\n",
+ "#Substituting in eqn 8.3.9, we get\n",
+ "h = 0.943*(( hfg *1000*( rho**2)*g*(k**3)) /(( Ts -Tw)*u*L) )**(1/4) ; #W/m^2 K\n",
+ "rate = h*L*(Ts -Tw)/( hfg *1000) ; #kg/m s\n",
+ "Re = 4* rate /u;\n",
+ "#Substituting h = Re*(lambda*1000)*u/(4*L*(Ts-Tw)), in eqn 8.3.12\n",
+ "Re_1 = (((4* L*(Ts -Tw)*k/( hfg *1000* u)*(g/(v**2) )**(1/3) )+5.2)/1.08)**(1/1.22) ; #Substituting h = Re*(hfg*1000)*u/(4*L*(Ts-Tw))\n",
+ "#From eqn 8.3.12\n",
+ "h_1 = ((Re /(1.08*( Re**1.22) -5.2) )*k *(( g/v**2)**(1/3) )); #W/m^2 K\n",
+ "m = h_1*L *10/( hfg *1000) ; #rate of condensation,kg/m s\n",
+ "\n",
+ "#result\n",
+ "print\"Assuming condensate film is laminar and Re < 30\";\n",
+ "print\"h =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"ReL =\",round(Re,4);\n",
+ "print\"Initial assumption was wrong, Now considering the effect of ripples, we get\";\n",
+ "print\"Re =\",round(Re_1,4);\n",
+ "print\"Heat Transfer Cofficient =\",round(h_1,4),\"W/m^2 K\";\n",
+ "print\"Rate of condensation =\",round(m,6),\"kg/m s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming condensate film is laminar and Re < 30\n",
+ "h = 6078.7864 W/m^2 K\n",
+ "ReL = 276.3936\n",
+ "Initial assumption was wrong, Now considering the effect of ripples, we get\n",
+ "Re = 320.4829\n",
+ "Heat Transfer Cofficient = 7287.8478 W/m^2 K\n",
+ "Rate of condensation = 0.031563 kg/m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 , Page no:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ts = 262 ; #K\n",
+ "D = 0.022 ; #m\n",
+ "Tw = 258 ; #K\n",
+ "#Properties at Tm\n",
+ "rho = 1324 ; #kg/m^3\n",
+ "k = 0.1008 ; #W/m K\n",
+ "g = 9.81 ; #m/s^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Ts+Tw) /2;\n",
+ "v = 1.90*10**-7 ; #m^2/s\n",
+ "hfg = 215.1*10**3 ; #J/kg\n",
+ "u = v*rho ; #Viscosity\n",
+ "#From eqn 8.4.1\n",
+ "h = 0.725*( hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*D))**(1/4) ;\n",
+ "rate = h*3.14*D*(Ts -Tw) / hfg ; #kg/s m\n",
+ "Re = 4* rate /u ;\n",
+ "\n",
+ "#result\n",
+ "print\"Heat transfer coefficient =\",round(h,4),\"W/m^2 K\";\n",
+ "print\"Condensation rate per unit length =\",round(rate,6),\"kg/s m\";\n",
+ "print\"Film Reynolds number =\",round(Re,4);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient = 2622.2475 W/m^2 K\n",
+ "Condensation rate per unit length = 0.003369 kg/s m\n",
+ "Film Reynolds number = 53.5629\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m = 25/60 ; #kg/sec\n",
+ "ID = 0.025 ; #m\n",
+ "OD = 0.029 ; #m\n",
+ "Tci = 30 ; #C\n",
+ "Tce = 70 ; #C\n",
+ "g = 9.8 ; #m/s^2\n",
+ "Ts = 100 ; #C\n",
+ "#Assuming 5.3.2 is valid, properties at 50 C\n",
+ "#Properties at Tm\n",
+ "rho = 988.1 ; #kg/m^3\n",
+ "k = 0.648 ; #W/m K\n",
+ "Pr = 3.54 ;\n",
+ "#From eqn 4.6.4a\n",
+ "f = 0.005635;\n",
+ "#From eqn 5.3.2\n",
+ "Nu = 198.39 ;\n",
+ "Tw = 90 ; #Assuming average wall temperature = 90 C\n",
+ "#Properties at Tm\n",
+ "#Properties at Tm\n",
+ "rho = 961.9 ; #kg/m^3\n",
+ "k = 0.682 ; #W/m K\n",
+ "l = 0; #initial guess, assumed value for fsolve function\n",
+ "\n",
+ "#calculations\n",
+ "v = 0.556*10**-6; #m^2/s\n",
+ "Re = 4*m/(3.14*ID*rho *v);\n",
+ "h = Nu*k/ID ;\n",
+ "u = 298.6*10**-6 ; #kg/m s\n",
+ "hfg = 2257*10**3 ; #J/kg\n",
+ "#Equating the heat flow from the condensing steam to the tube wall, to the heat flow from the tube wall to the flowing water.\n",
+ "#Solving the simplified equation\n",
+ "h = 0.725*(hfg *( rho**2) *g*(k**3) /(( Ts -Tw)*u*OD))**(1/4) ;\n",
+ "#By solving trial and error method, the temperature value we get\n",
+ "T=86.964984;# in oC\n",
+ "#Therefore\n",
+ "hc = 21338.77/(100 - T)**(1/4) ; #W/m^2 K\n",
+ "#Now, equating the heat flowing from the condensing steam to the tube wall to the heat gained by the water, we have\n",
+ "#Solving by trial and error method, we get\n",
+ "L=5.216152; #in meter\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature obtained from trial and error =\",round(T,4),\"oC\";\n",
+ "print\"hc =\",round(hc,4),\"W/m^2 K\";\n",
+ "print\"Length of the tube =\",round(L,4),\"m\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature obtained from trial and error = 86.965 oC\n",
+ "hc = 11230.3034 W/m^2 K\n",
+ "Length of the tube = 5.2162 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 , Page no:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "#Properties at (Tw+Ts)/2 = 100.5 degree celsius\n",
+ "deltaT1 = 1; #in degree celsius\n",
+ "p1 = 7.55*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v1 = 0.294*10**-6; #[m^2/sec] viscosity at 100.5 degree celsius\n",
+ "k1 = 0.683; #[W/m-k]thermal conductivity\n",
+ "Pr1 = 1.74; #Prandtl number\n",
+ "g = 9.81; #acceleration due to gravity\n",
+ "L = 0.14*10**-2; #diameter in meters\n",
+ "#Properties at (Tw+Ts)/2 =102.5\n",
+ "deltaT2 = 5; #in degree celsius\n",
+ "p2 = 7.66*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v2 = 0.289*10**-6; #[m^2/sec] viscosity at 102.5 degree celsius \n",
+ "k2 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr2 = 1.71; #Prandtl number \n",
+ "#Properties at (Tw+Ts)/2 =105\n",
+ "deltaT3 = 10; #in degree celsius\n",
+ "p3 = 7.80*10**-4; #[K^(-1) p1 is coefficient of cubical expansion\n",
+ "v3 = 0.284*10**-6; #[m^2/sec] viscosity at 105 degree celsius \n",
+ "k3 = 0.684; #[W/m-k]thermal conductivity\n",
+ "Pr3 = 1.68; #Prandtl number\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ra1 = ((p1*g*deltaT1*L**3)/(v1**2))*Pr1;\n",
+ "q1=(k1/L)*(deltaT1)*(0.36+(0.518*Ra1**(1/4))/(1+(0.559/Pr1)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra2 = ((p2*g*deltaT2*L**3)/(v2**2))*Pr2;\n",
+ "q2=(k2/L)*(deltaT2)*(0.36+(0.518*Ra2**(1/4))/(1+(0.559/Pr2)**(9/16))**(4/9))\n",
+ "\n",
+ "Ra3 = ((p3*g*deltaT3*L**3)/(v3**2))*Pr3;\n",
+ "q3=(k3/L)*(deltaT3)*(0.36+(0.518*Ra3**(1/4))/(1+(0.559/Pr3)**(9/16))**(4/9))\n",
+ "\n",
+ "#At 100 degree celsius\n",
+ "Cpl = 4.220; #[kJ/kg]\n",
+ "lamda = 2257; #[kJ/kg]\n",
+ "ul = 282.4*10**-6; #viscosity is in kg/m-sec\n",
+ "sigma = 589*10**-4; #Surface tension is in N/m\n",
+ "pl = 958.4; #density in kg/m^3\n",
+ "pv =0.598; #density of vapour in kg/m^3\n",
+ "deltap = pl-pv;\n",
+ "Prl = 1.75; #Prandtl no. of liquid\n",
+ "Ksf = 0.013;\n",
+ "deltaT11=5;\n",
+ "deltaT12=10;\n",
+ "deltaT13=20;\n",
+ "q11=141.32*deltaT11**3\n",
+ "q12=141.32*deltaT12**3\n",
+ "q13=141.32*deltaT13**3\n",
+ "\n",
+ "\n",
+ "L1 = (L/2)*(g*(pl-pv)/sigma)**(1/2);\n",
+ "f_L = 0.89+2.27*math.exp(-3.44*L1**(0.5));\n",
+ "q2 = f_L*((3.14/24)*lamda*10**(3)*pv**(0.5)*(sigma*g*(pl-pv))**(0.25));\n",
+ "\n",
+ "Tn=pow(q2/141.32,1/3)\n",
+ "q3 = 0.09*lamda*10**3*pv*(sigma*g*(pl-pv)/(pl+pv)**(2))**(0.25);\n",
+ "Ts1 = 140; #surface temperature in degree celsius\n",
+ "Ts2 = 200; #surface temperature in degree celsius\n",
+ "Ts3 = 600; #surface temperature in degree celsius\n",
+ "Twm1 = (140+100)/2; #Mean film temperature\n",
+ "#properties of steam at 120 degree celsius and 1.013 bar\n",
+ "kv = 0.02558; #thermal conductivity in W/mK\n",
+ "pv1 = 0.5654; #vapor density in kg/m**3\n",
+ "uv=13.185*10**(-6); #viscosity of vapour in kg/m sec\n",
+ "lamda1 = (2716.1-419.1)*10**(3);#Latent heat of fusion in J/kg\n",
+ "hc = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(140-100)))**(0.25);\n",
+ "qrad = 5.67*10**(-8)*(413**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr = qrad/(413-373);\n",
+ "h = hc + 0.75*hr;\n",
+ "\n",
+ "hc_200 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(200-100)))**(0.25);\n",
+ "qrad1 = 5.67*10**(-8)*(473**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_200 = qrad1/(200-100);\n",
+ "h_200 = hc_200 +0.75*hr_200;\n",
+ "hc_600 = 0.62*((kv**3)*pv*(pl-pv)*g*lamda1/(L*uv*(600-100)))**(0.25);\n",
+ "qrad2 = 5.67*10**(-8)*(873**4 - 373**4)/((1/0.9)+1-1);\n",
+ "hr_600 = qrad1/(600-100)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"\\n q/A = \",round(q1,2),\" W/m^2 at (Tw-Ts)=1\";\n",
+ "print \"\\n q/A = \",round(q2,2),\" W/m^2 at (Tw-Ts)=5\";\n",
+ "print \"\\n q/A = \",round(q3,2),\" W/m^2 at (Tw-Ts)=10\";\n",
+ "print \"\\n q/A at deltaT = 5 degree celsius = \",q11,\" W/m^2\";\n",
+ "print \"\\nq/A at deltaT = 10 degree celsius = \",q12,\" W/m^2\";\n",
+ "print \"\\n q/A at deltaT =20 degree celsius = \",q13,\" W/m^2\";\n",
+ "print \"\\n Peak heat flux L = \",round(L1,2); \n",
+ "print \"\\n f(l) = \",round(f_L,2);\n",
+ "print \"\\n q/A = \",q2,\" W/m^2\";\n",
+ "print \"Tw-Ts = \",Tn,\" degree celsius\"\n",
+ "print \"\\n\\n Minimum heat flux\";\n",
+ "print \"\\n q/A \",q3, \"W/m^2\"\n",
+ "print \"\\n\\n Stable film boiling\"\n",
+ "print \"\\n hc = \",hc,\" W/m^2\"\n",
+ "print \"\\n q/A due to radiation = \",qrad,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr,\" W/m^2 K \";\n",
+ "print \"\\n Since hr<hc \";\n",
+ "print \"\\n The total heat transfer coefficient \";\n",
+ "print \" h = \",h,\" W/m^2 K\";\n",
+ "print \"\\n Total heat flux \",h*(140-100),\" W/m^2 K\";\n",
+ "print \"\\n\\n hc = \",hc_200,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_200,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad1,\" W/m^2\";\n",
+ "print \"\\n Total heat flux = \",h_200*100,\" W/m^2\";\n",
+ "print \"\\n\\n hc = \",hc_600,\" W/m^2\";\n",
+ "print \"\\n hr = \",hr_600,\" W/m^2 K\";\n",
+ "print \"\\n q/A due to radiation = \",qrad2,\" W/m^2\";\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from pylab import linspace\n",
+ "%matplotlib inline\n",
+ "q = [q11, q12, q13];\n",
+ "plt.plot ([1, 5, 10],q);\n",
+ "deltaT=linspace(1,10,10);\n",
+ "q1=141.32*deltaT**3;\n",
+ "plt.plot (deltaT,q1)\n",
+ "plt.title (\"Boiling curve\");\n",
+ "plt.xlabel(\" (Tw - Ts)degree celsius \");\n",
+ "plt.ylabel(\" Heat flux,(q/A)W/m^2 \");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " q/A = 1116.99 W/m^2 at (Tw-Ts)=1\n",
+ "\n",
+ " q/A = 1393519.91 W/m^2 at (Tw-Ts)=5\n",
+ "\n",
+ " q/A = 19025.3 W/m^2 at (Tw-Ts)=10\n",
+ "\n",
+ " q/A at deltaT = 5 degree celsius = 17665.0 W/m^2\n",
+ "\n",
+ "q/A at deltaT = 10 degree celsius = 141320.0 W/m^2\n",
+ "\n",
+ " q/A at deltaT =20 degree celsius = 1130560.0 W/m^2\n",
+ "\n",
+ " Peak heat flux L = 0.28\n",
+ "\n",
+ " f(l) = 1.26\n",
+ "\n",
+ " q/A = 1393519.90741 W/m^2\n",
+ "Tw-Ts = 21.4438708455 degree celsius\n",
+ "\n",
+ "\n",
+ " Minimum heat flux\n",
+ "\n",
+ " q/A 19025.295556 W/m^2\n",
+ "\n",
+ "\n",
+ " Stable film boiling\n",
+ "\n",
+ " hc = 455.986290831 W/m^2\n",
+ "\n",
+ " q/A due to radiation = 496.874268274 W/m^2\n",
+ "\n",
+ " hr = 12.4218567068 W/m^2 K \n",
+ "\n",
+ " Since hr<hc \n",
+ "\n",
+ " The total heat transfer coefficient \n",
+ " h = 465.302683361 W/m^2 K\n",
+ "\n",
+ " Total heat flux 18612.1073344 W/m^2 K\n",
+ "\n",
+ "\n",
+ " hc = 362.632549817 W/m^2\n",
+ "\n",
+ " hr = 15.665080604 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 1566.5080604 W/m^2\n",
+ "\n",
+ " Total heat flux = 37438.136027 W/m^2\n",
+ "\n",
+ "\n",
+ " hc = 242.507001959 W/m^2\n",
+ "\n",
+ " hr = 3.13301612081 W/m^2 K\n",
+ "\n",
+ " q/A due to radiation = 28652.514946 W/m^2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEXCAYAAADr+ZCUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdcU2f7P/ArTAdKGBIgQVYCKFBAZYi1RREQ67YyrIKr\ndTxatX0o2vFVv62Ktj7VVq2/p5UCWkDrRCuIi2qVIQoWB0uCkDDUkLBncv/+OD39IkIZAodxvV+v\n80pycsaVtObDfc597sMihABCCCHU25SYLgAhhNDghAGEEEKIERhACCGEGIEBhBBCiBEYQAghhBiB\nAYQQQogRGEAIdbNffvnlPS8vr0v0ayUlJUVeXp4ZAMCaNWt++Oqrrz5nrjqE+g4WXgeE0KtMTEzy\nnz17pqesrCxXVVVtdHV1vX348OHVPB5P1NltKSkpKXJzc/lmZmZ5PVErQv0VtoAQagWLxSIXLlyY\nWVlZOaK4uNiAw+GUrl+//num6+ppTU1NKkzXgAYPDCCE2qGurl6/YMGCU48ePRpLzysvL9cMCAiI\n0NPTe2ZiYpK/Y8eOzwghLACAsLCwpZMnT77Z2raWLl0a9sUXX3wJAJCQkODG4/FE//nPfz7icDil\nhoaGRWFhYUvpZSUSic6sWbPOa2pqljs5OaV8/vnnX7W1XQCAP/74401XV9fbWlpa0tGjRxdEREQE\nAAC4ubklHDlyZAW9XMv6lJSUFIcOHVprYWGRbWFhkb127dpDQUFBXzff9pw5c859++23mwAAioqK\nDBcsWHBKT0/vmZmZWd7333+/vpNfKUIAgAGEUJvoQKmpqRl2/Phx34kTJybS761fv/77ysrKEUKh\n0PT3339/OyIiIuDnn39e1t42WSwWYbFYfx/3Li0t5VRUVIwsKioyPHLkyIp//etfB8vLyzUBAP71\nr38dHDFiRGVpaSknPDw8MCIiIqD5us09ffrUeMaMGRc3bNiw/8WLF7rp6en2dnZ291vbZ2vOnTs3\nJyUlxenx48dj/P39o44fP+5LvyeVSrUuX77s4e/vH6VQKJRmzZp13sHBIa2oqMjw6tWr7vv27dsY\nHx/v2d5nR6glDCCEWkEIYc2dO/eslpaWlM1my65ever+73//+xsAALlcrnz8+HHfXbt2bRk+fHi1\nsbHx048//njv0aNHl3R02/RzVVXVxv/5n//5X2VlZbm3t3eshoZGVVZWlqVcLlc+ffr0/O3bt28d\nMmRI3ZgxYx4HBgaGN1+3ucjIyEUeHh6XfX19jysrK8u1tbXL6ADqiC1btuxis9kydXX1+jfffPMP\nFotFbt68ORkA4OTJk++6urre1tfXL7lz547jixcvdD///POvVFRUmkxNTYUrV678KTo62q+j+0KI\nhsd7EWoFi8Ui586dmzN16tRrhBDW2bNn57799tu/P378eAwhhNXY2KhqbGz8lF5+9OjRBWKxmNvZ\n/ejo6EiUlJQU9Othw4bVVFVVaTx//nxUU1OTipGRUSH93j91gBCJRLzX6eTQfD8sFov4+flFR0VF\n+U+ePPlmZGTkooCAgAgAqqVVVFRkqKWlJaWXl8vlym+99daNru4bDV7YAkKoHSwWi8ybN++MsrKy\n/I8//nhTV1f3haqqamN+fr4JvUxBQcHojvaQa+9wGADAqFGjnquoqDQVFhYa0fOaP2/JyMio8MmT\nJ+atvTd8+PDq6urq4fTrkpIS/fZq8vf3jzp58uS7T58+NU5JSXFasGDBKQAqaE1NTYVSqVSLnioq\nKkZeuHBhZnufCaGWMIAQagN9uIsQwjp37twcqVSqNWbMmMfKyspyHx+fE5999tmOqqoqjadPnxp/\n++23mxYvXnysI9ts6zBac8rKyvL58+ef3rZt27ba2tqhmZmZVkePHl3SVni99957v1y5cmXar7/+\nurCpqUlFIpHo3L9/3w4AwN7ePv306dPza2trh+bm5vKbd0hoi729fbquru6LlStX/jR9+vS4kSNH\nVgAAODk5pYwYMaJyz549n9TW1g6Vy+XKDx48sElNTZ3Q3jYRagkDCKE2zJo16/yIESMqN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ZGTky4iIiFekk3Zvb+/P/p6v0WhGTCZTNflPNkZoNJqR\nzs7Oi2RJcGlp6bjvHKC8vLzH/f3955xOpxIAYGtr6xAAQGFh4QPve1qtVjXAh4lweXn5WEpKykxz\nc3NTVFTUhu+MmtjY2Bek6/b8/Hzi6upqHICna7JCoXhdVlZ2p7a29s9vpTM3+jowAaGAlJGRMf6x\nMRHkrT0mJuZfAE8lBPB+wuN+p4OS+/b19Z1nGGaR53nRZrOpyId8URT51NTUSQAArVZ7j6IoB03T\n9vLy8ttpaWl/AwCEhobuDgwMnK2vr7+mVqutPM+Lk5OTqQAA3d3dv1ZWVt7keV7c3t4+SOL03UFn\nMBiMu7u7oRzHLTAMs9jU1NQMAFBRUXGLpml7YmLiPMuykk6nM5NkRNA0bW9sbLySnZ39l1qtttbU\n1FwHADCZTNWzs7MnEhISnqlUKhtJxN7Prqur+4PjuAWWZaX09PQJjuMWvI+XlJTcdTqdSoZhFjs6\nOi6REQKSJLFk04bRaDRg9fN9wWakKCCNjY3lWCyWUrPZrJM7FgCAhoaGq8nJyf9otdp7+7ne5XKF\nk6W21tbW39fX1w+3tbX99mWjROjrwgoIBaScnJwxh8NBkXk8ctrZ2flhfHw843MGCgqCUMTzvMiy\nrDQxMZGu1+tbvmSMCMkBKyCEEEKywAoIIYSQLDABIYQQkgUmIIQQQrLABIQQQkgWmIAQQgjJAhMQ\nQgghWbwDrHA2pVW5S0IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4843ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 , Page no:337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.02 ; #m\n",
+ "l = 0.15 ; #m\n",
+ "T = 500+273 ; #K\n",
+ "Tc = -196+273 ; #K\n",
+ "e = 0.4;\n",
+ "#Properties\n",
+ "k = 0.0349 ; #W/m K\n",
+ "rho = 0.80 ; #kg/m^3\n",
+ "Cpavg = 1.048 ; #kJ/kg J\n",
+ "rholiq = 800 ; #kg/m^3\n",
+ "\n",
+ "#calculations\n",
+ "s = 5.670*10**-8;\n",
+ "#Film boiling will occur, hence eqn 8.7.9 is applicable\n",
+ "Tm = (T+Tc) /2; #Film boiling will occur\n",
+ "u = 23*10**-6 ; #kg/m s\n",
+ "latent = 201*10**3 ; #J/kg\n",
+ "hfg = (latent + Cpavg *(Tm -Tc) *1000); #Jk/g\n",
+ "hc = 0.62*((( k**3) *rho *799.2*9.81* hfg )/(D*u*(T-Tc)) )**(1/4) ; #W/m^2 K\n",
+ "#Taking the emissivity of liquid surface to be unity and using equation 3.9.1, the exchange of radiant heat flux\n",
+ "flux = s*(T**4- Tc**4) /(1/ e +1/1 -1) ; #W/m^2\n",
+ "hr = flux /(T-Tc);\n",
+ "#Since h_r < h_c, total heat transfer coefficient is determined from eqn 8.7.11\n",
+ "h = hc +3/4* hr ; #W/m^2 K\n",
+ "fluxi = h*(T-Tc);\n",
+ "Rate = fluxi *3.14*D*l; #W\n",
+ "\n",
+ "#result\n",
+ "print\"Initial heat flux =\",round(fluxi,4),\"W/m^2\";\n",
+ "print\"Initial heat transfer rate =\",round(Rate,4),\"W\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial heat flux = 69646.6128 W/m^2\n",
+ "Initial heat transfer rate = 656.0711 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_1.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_1.ipynb new file mode 100755 index 00000000..a65d7225 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_1.ipynb @@ -0,0 +1,626 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:68af0c4a8337e2d1285b325265301de0a726e4a41ce7ffd072403aa9458bcfde"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page no:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "wa = 0.76 ;\n",
+ "wb = 0.24 ;\n",
+ "ma = 28 ; #kg/kg mole\n",
+ "mb = 32 ; #kg/kg mole\n",
+ "\n",
+ "#calculations\n",
+ "xa = ( wa /ma)/( wa /ma+ wb /mb);\n",
+ "xb = ( wb /mb)/( wa /ma+ wb /mb);\n",
+ "\n",
+ "#result\n",
+ "print\"The molar fractions are given by\";\n",
+ "print\"xa =\",round(xa,5);\n",
+ "print\"xb =\",round(xb,5);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar fractions are given by\n",
+ "xa = 0.78351\n",
+ "xb = 0.21649\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page no:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#calculations\n",
+ "#From Table 9.1 at 1 atm and 25 C\n",
+ "Dab = 0.62*10**-5 ; #m^2/s\n",
+ "#Therefore at 2 atm and 50 C\n",
+ "Dab2 = Dab*(1/2)*(323/298)**1.5 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Dab at 2 atm & 50 C =\",'%.4E'%Dab2,\"m^2/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dab at 2 atm & 50 C = 3.4982E-06 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (a), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^ 2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D400 = 1.6*10**-11 ; #at 400K [m^2/ s ]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#Subtituting the values in eqn 9.3.3 , At 400 K\n",
+ "m400 = A* D400 *( rho1 - rho2 )/t; #kg / s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of diffusion of Hydrogen at 400 K =\",m400,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of diffusion of Hydrogen at 400 K = 7.2e-11 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (b), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D1200 = 3.5*10**-8 ; #at 1200k [m^2/s]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#At 1200 K\n",
+ "#From eqn 9.3.3\n",
+ "m1200 = A* D1200 *( rho1 - rho2 )/t ; #At 1200 K\n",
+ "\n",
+ "#result\n",
+ "print\"b) Rate of diffusion of Hydrogen at 1200 K =\",m1200,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b) Rate of diffusion of Hydrogen at 1200 K = 1.575e-07 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (a), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Assuming Equimolal counter diffusion\n",
+ "#From Table 9.1\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -( Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "RNH3 = Na *17 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Na = -Nb =\",'%.4E'%Na,\"(kg mole)/m^2 s\";\n",
+ "print\"Rate at which ammonia is lost through the tube =\",'%.3E'%RNH3,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Na = -Nb = 2.2489E-11 (kg mole)/m^2 s\n",
+ "Rate at which ammonia is lost through the tube = 3.823E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (b), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Since the tank is large and the pressure and temperature at the two ends of the same tube are same, \n",
+ "#we are assuming Equimolal counter diffusion\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -(Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "#Since equimolal counter diffusion is taking place\n",
+ "Nb = - Na ; \n",
+ "#therefore rate at which air enters the tank\n",
+ "Rair = abs (Nb)*29 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which air enters the tank =\",'%.4E'%Rair,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which air enters the tank = 6.5219E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 , Page no:359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "h = 0.20 ; #m\n",
+ "hw = 0.03 ; #m\n",
+ "R = 8314 ; #J/kg mole K\n",
+ "Psat = 0.02339 ; #bar\n",
+ "xa2 = 0 ; #mole fraction at open top\n",
+ "\n",
+ "#calculations\n",
+ "#Evaporation of water, one dimensional\n",
+ "Tw = 20+273 ; #K\n",
+ "P = 1.014*10**5; #Pa\n",
+ "xa1 = Psat /1.014 ; #mole fraction at liq-vap interface\n",
+ "c = P/(R* Tw );\n",
+ "#From Table 9.2\n",
+ "Dab = 2.422*10**-5 ; #m^2/s\n",
+ "#Substituting above values in eqn 9.4.18\n",
+ "flux = 0.041626* Dab /0.17* math.log ((1 -0) /(1 - xa1 )); #kg mole/m^2 s\n",
+ "rate = flux *18*(3.14/4) *(D**2) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation of water =\",'%.4E'%rate,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation of water = 3.1290E-09 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 , Page no:364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 1; #length, m\n",
+ "w = 0.25; #width, m\n",
+ "T = 293 ; #Temperature, K\n",
+ "rhoinfinity = 0; #kg/m^3\n",
+ "R = 8314; #J/ kg K\n",
+ "paw = 2339; #Saturation pressure of water at 20 degree C. [N/m^2]\n",
+ "rhoainf = 0 ; #since air in the free stream is dry\n",
+ "\n",
+ "#calculations\n",
+ "#From Table A.2\n",
+ "v = 15.06*10**-6; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.4224*10**-5; #m^2/s\n",
+ "Re = 2.5/ v;\n",
+ "Sc = v/ Dab ;\n",
+ "#Since Re > 3*10^5, we may assume laminar boundary layer\n",
+ "Sh = 0.664* Sc**(1/3) *Re**(1/2) ; #Sherwood number\n",
+ "h = Sh*Dab;\n",
+ "rhoaw = paw /(R /18* T); #kg/m^3\n",
+ "mh = h *(2* l*w)*( rhoaw - rhoinfinity );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation from plate =\",'%.4E'%mh,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation from plate = 4.8335E-05 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (a) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#a) Colburn anology and Gnielinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm\n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm \n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting this value into Gnielinski\n",
+ "Nu = ((f /2) *(Re -1000) *Pr )/(1+12.7*(( f/2)**(1/2) )*(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "hm = h/r; #m/s\n",
+ "\n",
+ "#result\n",
+ "print\"hm using Colburn anology and Gnielinski equation =\",round(hm,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hm using Colburn anology and Gnielinski equation = 0.009495\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (b) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#(b) mess transfer correlation equivalent to the Gleilinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting in eqn 9.6.7\n",
+ "ShD = ((f /2) *(Re -1000) *Sc )/(1+12.7*(( f/2)) *(( Sc**(2/3) ) -1));\n",
+ "hm1 = ShD * Dab /D;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) hm =\",round(hm1,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) hm = 0.007258\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (c) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#c) To show that mass flux of water is very small compared to the mass flux of air flowing in the pipe\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm \n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#From steam table\n",
+ "rhoaw = 1/38.77 ; #kg/m^3\n",
+ "#let X = (m_a/A)_max\n",
+ "X = f* rhoaw ; #kg/m^2 s\n",
+ "#let Y = mass flux of air in pipe = (m/A)\n",
+ "Y = rho*V ; #kg/m^2 s\n",
+ "ratio = X/Y ;\n",
+ "percent = ratio *100;\n",
+ "\n",
+ "#result\n",
+ "print\"(c) (ma/A)max/(ma/A) =\",round(percent,6),\"percent Thus,\\nmass flux of water is very small compared to the mass flux of air flowing in the pipe.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c) (ma/A)max/(ma/A) = 0.010927 percent Thus,\n",
+ "mass flux of water is very small compared to the mass flux of air flowing in the pipe.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 , Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 0.5 ; #m/s\n",
+ "Th = 30 ; #C\n",
+ "Tc = 26 ; #C\n",
+ "#From table A.2\n",
+ "rho = 1.173 ; #kg/m^3\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02654 ; #W/m K\n",
+ "Psat = 3363; #From steam table\n",
+ "PP30 = 4246 ; #From steam table partial pressure of water vapour at 30 C, N/m^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Th+ Tc )/2;\n",
+ "#From Table 9.2 at 301 K\n",
+ "alpha = k/( rho *Cp); #m^2/s\n",
+ "Dab = 2.5584*10**-5 ; #m^2/s\n",
+ "hfg = 2439.2*10**3 ; #J/kg\n",
+ "#Substituting in equation 9.7.5\n",
+ "#let difference = rho_aw-rho_a infinity\n",
+ "difference = rho *Cp *(( alpha /Dab)**(2/3) )*( Th - Tc )/hfg ;\n",
+ "#From steam table\n",
+ "rhoaw = Psat /(8314/18*299) ;\n",
+ "rhoinf = rhoaw - difference ;\n",
+ "x = rhoinf / rho ; #mole fraction of water vapour in air stream\n",
+ "PP = rhoinf *8314/18*303; #Partial pressure of water vapour in air stream\n",
+ "relH = PP/ PP30 ;\n",
+ "percent = relH *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Relative humidity =\",round(relH,4),\"i.e.\",round(percent,4),\"percent\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative humidity = 0.7441 i.e. 74.4122 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_2.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_2.ipynb new file mode 100755 index 00000000..a65d7225 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_2.ipynb @@ -0,0 +1,626 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:68af0c4a8337e2d1285b325265301de0a726e4a41ce7ffd072403aa9458bcfde"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page no:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "wa = 0.76 ;\n",
+ "wb = 0.24 ;\n",
+ "ma = 28 ; #kg/kg mole\n",
+ "mb = 32 ; #kg/kg mole\n",
+ "\n",
+ "#calculations\n",
+ "xa = ( wa /ma)/( wa /ma+ wb /mb);\n",
+ "xb = ( wb /mb)/( wa /ma+ wb /mb);\n",
+ "\n",
+ "#result\n",
+ "print\"The molar fractions are given by\";\n",
+ "print\"xa =\",round(xa,5);\n",
+ "print\"xb =\",round(xb,5);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar fractions are given by\n",
+ "xa = 0.78351\n",
+ "xb = 0.21649\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page no:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#calculations\n",
+ "#From Table 9.1 at 1 atm and 25 C\n",
+ "Dab = 0.62*10**-5 ; #m^2/s\n",
+ "#Therefore at 2 atm and 50 C\n",
+ "Dab2 = Dab*(1/2)*(323/298)**1.5 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Dab at 2 atm & 50 C =\",'%.4E'%Dab2,\"m^2/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dab at 2 atm & 50 C = 3.4982E-06 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (a), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^ 2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D400 = 1.6*10**-11 ; #at 400K [m^2/ s ]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#Subtituting the values in eqn 9.3.3 , At 400 K\n",
+ "m400 = A* D400 *( rho1 - rho2 )/t; #kg / s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of diffusion of Hydrogen at 400 K =\",m400,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of diffusion of Hydrogen at 400 K = 7.2e-11 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (b), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D1200 = 3.5*10**-8 ; #at 1200k [m^2/s]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#At 1200 K\n",
+ "#From eqn 9.3.3\n",
+ "m1200 = A* D1200 *( rho1 - rho2 )/t ; #At 1200 K\n",
+ "\n",
+ "#result\n",
+ "print\"b) Rate of diffusion of Hydrogen at 1200 K =\",m1200,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b) Rate of diffusion of Hydrogen at 1200 K = 1.575e-07 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (a), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Assuming Equimolal counter diffusion\n",
+ "#From Table 9.1\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -( Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "RNH3 = Na *17 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Na = -Nb =\",'%.4E'%Na,\"(kg mole)/m^2 s\";\n",
+ "print\"Rate at which ammonia is lost through the tube =\",'%.3E'%RNH3,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Na = -Nb = 2.2489E-11 (kg mole)/m^2 s\n",
+ "Rate at which ammonia is lost through the tube = 3.823E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (b), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Since the tank is large and the pressure and temperature at the two ends of the same tube are same, \n",
+ "#we are assuming Equimolal counter diffusion\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -(Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "#Since equimolal counter diffusion is taking place\n",
+ "Nb = - Na ; \n",
+ "#therefore rate at which air enters the tank\n",
+ "Rair = abs (Nb)*29 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which air enters the tank =\",'%.4E'%Rair,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which air enters the tank = 6.5219E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 , Page no:359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "h = 0.20 ; #m\n",
+ "hw = 0.03 ; #m\n",
+ "R = 8314 ; #J/kg mole K\n",
+ "Psat = 0.02339 ; #bar\n",
+ "xa2 = 0 ; #mole fraction at open top\n",
+ "\n",
+ "#calculations\n",
+ "#Evaporation of water, one dimensional\n",
+ "Tw = 20+273 ; #K\n",
+ "P = 1.014*10**5; #Pa\n",
+ "xa1 = Psat /1.014 ; #mole fraction at liq-vap interface\n",
+ "c = P/(R* Tw );\n",
+ "#From Table 9.2\n",
+ "Dab = 2.422*10**-5 ; #m^2/s\n",
+ "#Substituting above values in eqn 9.4.18\n",
+ "flux = 0.041626* Dab /0.17* math.log ((1 -0) /(1 - xa1 )); #kg mole/m^2 s\n",
+ "rate = flux *18*(3.14/4) *(D**2) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation of water =\",'%.4E'%rate,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation of water = 3.1290E-09 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 , Page no:364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 1; #length, m\n",
+ "w = 0.25; #width, m\n",
+ "T = 293 ; #Temperature, K\n",
+ "rhoinfinity = 0; #kg/m^3\n",
+ "R = 8314; #J/ kg K\n",
+ "paw = 2339; #Saturation pressure of water at 20 degree C. [N/m^2]\n",
+ "rhoainf = 0 ; #since air in the free stream is dry\n",
+ "\n",
+ "#calculations\n",
+ "#From Table A.2\n",
+ "v = 15.06*10**-6; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.4224*10**-5; #m^2/s\n",
+ "Re = 2.5/ v;\n",
+ "Sc = v/ Dab ;\n",
+ "#Since Re > 3*10^5, we may assume laminar boundary layer\n",
+ "Sh = 0.664* Sc**(1/3) *Re**(1/2) ; #Sherwood number\n",
+ "h = Sh*Dab;\n",
+ "rhoaw = paw /(R /18* T); #kg/m^3\n",
+ "mh = h *(2* l*w)*( rhoaw - rhoinfinity );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation from plate =\",'%.4E'%mh,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation from plate = 4.8335E-05 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (a) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#a) Colburn anology and Gnielinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm\n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm \n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting this value into Gnielinski\n",
+ "Nu = ((f /2) *(Re -1000) *Pr )/(1+12.7*(( f/2)**(1/2) )*(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "hm = h/r; #m/s\n",
+ "\n",
+ "#result\n",
+ "print\"hm using Colburn anology and Gnielinski equation =\",round(hm,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hm using Colburn anology and Gnielinski equation = 0.009495\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (b) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#(b) mess transfer correlation equivalent to the Gleilinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting in eqn 9.6.7\n",
+ "ShD = ((f /2) *(Re -1000) *Sc )/(1+12.7*(( f/2)) *(( Sc**(2/3) ) -1));\n",
+ "hm1 = ShD * Dab /D;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) hm =\",round(hm1,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) hm = 0.007258\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (c) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#c) To show that mass flux of water is very small compared to the mass flux of air flowing in the pipe\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm \n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#From steam table\n",
+ "rhoaw = 1/38.77 ; #kg/m^3\n",
+ "#let X = (m_a/A)_max\n",
+ "X = f* rhoaw ; #kg/m^2 s\n",
+ "#let Y = mass flux of air in pipe = (m/A)\n",
+ "Y = rho*V ; #kg/m^2 s\n",
+ "ratio = X/Y ;\n",
+ "percent = ratio *100;\n",
+ "\n",
+ "#result\n",
+ "print\"(c) (ma/A)max/(ma/A) =\",round(percent,6),\"percent Thus,\\nmass flux of water is very small compared to the mass flux of air flowing in the pipe.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c) (ma/A)max/(ma/A) = 0.010927 percent Thus,\n",
+ "mass flux of water is very small compared to the mass flux of air flowing in the pipe.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 , Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 0.5 ; #m/s\n",
+ "Th = 30 ; #C\n",
+ "Tc = 26 ; #C\n",
+ "#From table A.2\n",
+ "rho = 1.173 ; #kg/m^3\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02654 ; #W/m K\n",
+ "Psat = 3363; #From steam table\n",
+ "PP30 = 4246 ; #From steam table partial pressure of water vapour at 30 C, N/m^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Th+ Tc )/2;\n",
+ "#From Table 9.2 at 301 K\n",
+ "alpha = k/( rho *Cp); #m^2/s\n",
+ "Dab = 2.5584*10**-5 ; #m^2/s\n",
+ "hfg = 2439.2*10**3 ; #J/kg\n",
+ "#Substituting in equation 9.7.5\n",
+ "#let difference = rho_aw-rho_a infinity\n",
+ "difference = rho *Cp *(( alpha /Dab)**(2/3) )*( Th - Tc )/hfg ;\n",
+ "#From steam table\n",
+ "rhoaw = Psat /(8314/18*299) ;\n",
+ "rhoinf = rhoaw - difference ;\n",
+ "x = rhoinf / rho ; #mole fraction of water vapour in air stream\n",
+ "PP = rhoinf *8314/18*303; #Partial pressure of water vapour in air stream\n",
+ "relH = PP/ PP30 ;\n",
+ "percent = relH *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Relative humidity =\",round(relH,4),\"i.e.\",round(percent,4),\"percent\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative humidity = 0.7441 i.e. 74.4122 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_3.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_3.ipynb new file mode 100755 index 00000000..a65d7225 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_3.ipynb @@ -0,0 +1,626 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:68af0c4a8337e2d1285b325265301de0a726e4a41ce7ffd072403aa9458bcfde"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page no:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "wa = 0.76 ;\n",
+ "wb = 0.24 ;\n",
+ "ma = 28 ; #kg/kg mole\n",
+ "mb = 32 ; #kg/kg mole\n",
+ "\n",
+ "#calculations\n",
+ "xa = ( wa /ma)/( wa /ma+ wb /mb);\n",
+ "xb = ( wb /mb)/( wa /ma+ wb /mb);\n",
+ "\n",
+ "#result\n",
+ "print\"The molar fractions are given by\";\n",
+ "print\"xa =\",round(xa,5);\n",
+ "print\"xb =\",round(xb,5);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar fractions are given by\n",
+ "xa = 0.78351\n",
+ "xb = 0.21649\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page no:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#calculations\n",
+ "#From Table 9.1 at 1 atm and 25 C\n",
+ "Dab = 0.62*10**-5 ; #m^2/s\n",
+ "#Therefore at 2 atm and 50 C\n",
+ "Dab2 = Dab*(1/2)*(323/298)**1.5 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Dab at 2 atm & 50 C =\",'%.4E'%Dab2,\"m^2/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dab at 2 atm & 50 C = 3.4982E-06 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (a), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^ 2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D400 = 1.6*10**-11 ; #at 400K [m^2/ s ]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#Subtituting the values in eqn 9.3.3 , At 400 K\n",
+ "m400 = A* D400 *( rho1 - rho2 )/t; #kg / s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of diffusion of Hydrogen at 400 K =\",m400,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of diffusion of Hydrogen at 400 K = 7.2e-11 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (b), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D1200 = 3.5*10**-8 ; #at 1200k [m^2/s]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#At 1200 K\n",
+ "#From eqn 9.3.3\n",
+ "m1200 = A* D1200 *( rho1 - rho2 )/t ; #At 1200 K\n",
+ "\n",
+ "#result\n",
+ "print\"b) Rate of diffusion of Hydrogen at 1200 K =\",m1200,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b) Rate of diffusion of Hydrogen at 1200 K = 1.575e-07 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (a), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Assuming Equimolal counter diffusion\n",
+ "#From Table 9.1\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -( Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "RNH3 = Na *17 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Na = -Nb =\",'%.4E'%Na,\"(kg mole)/m^2 s\";\n",
+ "print\"Rate at which ammonia is lost through the tube =\",'%.3E'%RNH3,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Na = -Nb = 2.2489E-11 (kg mole)/m^2 s\n",
+ "Rate at which ammonia is lost through the tube = 3.823E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (b), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Since the tank is large and the pressure and temperature at the two ends of the same tube are same, \n",
+ "#we are assuming Equimolal counter diffusion\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -(Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "#Since equimolal counter diffusion is taking place\n",
+ "Nb = - Na ; \n",
+ "#therefore rate at which air enters the tank\n",
+ "Rair = abs (Nb)*29 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which air enters the tank =\",'%.4E'%Rair,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which air enters the tank = 6.5219E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 , Page no:359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "h = 0.20 ; #m\n",
+ "hw = 0.03 ; #m\n",
+ "R = 8314 ; #J/kg mole K\n",
+ "Psat = 0.02339 ; #bar\n",
+ "xa2 = 0 ; #mole fraction at open top\n",
+ "\n",
+ "#calculations\n",
+ "#Evaporation of water, one dimensional\n",
+ "Tw = 20+273 ; #K\n",
+ "P = 1.014*10**5; #Pa\n",
+ "xa1 = Psat /1.014 ; #mole fraction at liq-vap interface\n",
+ "c = P/(R* Tw );\n",
+ "#From Table 9.2\n",
+ "Dab = 2.422*10**-5 ; #m^2/s\n",
+ "#Substituting above values in eqn 9.4.18\n",
+ "flux = 0.041626* Dab /0.17* math.log ((1 -0) /(1 - xa1 )); #kg mole/m^2 s\n",
+ "rate = flux *18*(3.14/4) *(D**2) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation of water =\",'%.4E'%rate,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation of water = 3.1290E-09 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 , Page no:364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 1; #length, m\n",
+ "w = 0.25; #width, m\n",
+ "T = 293 ; #Temperature, K\n",
+ "rhoinfinity = 0; #kg/m^3\n",
+ "R = 8314; #J/ kg K\n",
+ "paw = 2339; #Saturation pressure of water at 20 degree C. [N/m^2]\n",
+ "rhoainf = 0 ; #since air in the free stream is dry\n",
+ "\n",
+ "#calculations\n",
+ "#From Table A.2\n",
+ "v = 15.06*10**-6; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.4224*10**-5; #m^2/s\n",
+ "Re = 2.5/ v;\n",
+ "Sc = v/ Dab ;\n",
+ "#Since Re > 3*10^5, we may assume laminar boundary layer\n",
+ "Sh = 0.664* Sc**(1/3) *Re**(1/2) ; #Sherwood number\n",
+ "h = Sh*Dab;\n",
+ "rhoaw = paw /(R /18* T); #kg/m^3\n",
+ "mh = h *(2* l*w)*( rhoaw - rhoinfinity );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation from plate =\",'%.4E'%mh,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation from plate = 4.8335E-05 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (a) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#a) Colburn anology and Gnielinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm\n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm \n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting this value into Gnielinski\n",
+ "Nu = ((f /2) *(Re -1000) *Pr )/(1+12.7*(( f/2)**(1/2) )*(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "hm = h/r; #m/s\n",
+ "\n",
+ "#result\n",
+ "print\"hm using Colburn anology and Gnielinski equation =\",round(hm,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hm using Colburn anology and Gnielinski equation = 0.009495\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (b) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#(b) mess transfer correlation equivalent to the Gleilinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting in eqn 9.6.7\n",
+ "ShD = ((f /2) *(Re -1000) *Sc )/(1+12.7*(( f/2)) *(( Sc**(2/3) ) -1));\n",
+ "hm1 = ShD * Dab /D;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) hm =\",round(hm1,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) hm = 0.007258\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (c) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#c) To show that mass flux of water is very small compared to the mass flux of air flowing in the pipe\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm \n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#From steam table\n",
+ "rhoaw = 1/38.77 ; #kg/m^3\n",
+ "#let X = (m_a/A)_max\n",
+ "X = f* rhoaw ; #kg/m^2 s\n",
+ "#let Y = mass flux of air in pipe = (m/A)\n",
+ "Y = rho*V ; #kg/m^2 s\n",
+ "ratio = X/Y ;\n",
+ "percent = ratio *100;\n",
+ "\n",
+ "#result\n",
+ "print\"(c) (ma/A)max/(ma/A) =\",round(percent,6),\"percent Thus,\\nmass flux of water is very small compared to the mass flux of air flowing in the pipe.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c) (ma/A)max/(ma/A) = 0.010927 percent Thus,\n",
+ "mass flux of water is very small compared to the mass flux of air flowing in the pipe.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 , Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 0.5 ; #m/s\n",
+ "Th = 30 ; #C\n",
+ "Tc = 26 ; #C\n",
+ "#From table A.2\n",
+ "rho = 1.173 ; #kg/m^3\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02654 ; #W/m K\n",
+ "Psat = 3363; #From steam table\n",
+ "PP30 = 4246 ; #From steam table partial pressure of water vapour at 30 C, N/m^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Th+ Tc )/2;\n",
+ "#From Table 9.2 at 301 K\n",
+ "alpha = k/( rho *Cp); #m^2/s\n",
+ "Dab = 2.5584*10**-5 ; #m^2/s\n",
+ "hfg = 2439.2*10**3 ; #J/kg\n",
+ "#Substituting in equation 9.7.5\n",
+ "#let difference = rho_aw-rho_a infinity\n",
+ "difference = rho *Cp *(( alpha /Dab)**(2/3) )*( Th - Tc )/hfg ;\n",
+ "#From steam table\n",
+ "rhoaw = Psat /(8314/18*299) ;\n",
+ "rhoinf = rhoaw - difference ;\n",
+ "x = rhoinf / rho ; #mole fraction of water vapour in air stream\n",
+ "PP = rhoinf *8314/18*303; #Partial pressure of water vapour in air stream\n",
+ "relH = PP/ PP30 ;\n",
+ "percent = relH *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Relative humidity =\",round(relH,4),\"i.e.\",round(percent,4),\"percent\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative humidity = 0.7441 i.e. 74.4122 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_4.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_4.ipynb new file mode 100755 index 00000000..a65d7225 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_4.ipynb @@ -0,0 +1,626 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:68af0c4a8337e2d1285b325265301de0a726e4a41ce7ffd072403aa9458bcfde"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page no:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "wa = 0.76 ;\n",
+ "wb = 0.24 ;\n",
+ "ma = 28 ; #kg/kg mole\n",
+ "mb = 32 ; #kg/kg mole\n",
+ "\n",
+ "#calculations\n",
+ "xa = ( wa /ma)/( wa /ma+ wb /mb);\n",
+ "xb = ( wb /mb)/( wa /ma+ wb /mb);\n",
+ "\n",
+ "#result\n",
+ "print\"The molar fractions are given by\";\n",
+ "print\"xa =\",round(xa,5);\n",
+ "print\"xb =\",round(xb,5);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar fractions are given by\n",
+ "xa = 0.78351\n",
+ "xb = 0.21649\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page no:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#calculations\n",
+ "#From Table 9.1 at 1 atm and 25 C\n",
+ "Dab = 0.62*10**-5 ; #m^2/s\n",
+ "#Therefore at 2 atm and 50 C\n",
+ "Dab2 = Dab*(1/2)*(323/298)**1.5 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Dab at 2 atm & 50 C =\",'%.4E'%Dab2,\"m^2/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dab at 2 atm & 50 C = 3.4982E-06 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (a), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^ 2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D400 = 1.6*10**-11 ; #at 400K [m^2/ s ]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#Subtituting the values in eqn 9.3.3 , At 400 K\n",
+ "m400 = A* D400 *( rho1 - rho2 )/t; #kg / s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of diffusion of Hydrogen at 400 K =\",m400,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of diffusion of Hydrogen at 400 K = 7.2e-11 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (b), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D1200 = 3.5*10**-8 ; #at 1200k [m^2/s]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#At 1200 K\n",
+ "#From eqn 9.3.3\n",
+ "m1200 = A* D1200 *( rho1 - rho2 )/t ; #At 1200 K\n",
+ "\n",
+ "#result\n",
+ "print\"b) Rate of diffusion of Hydrogen at 1200 K =\",m1200,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b) Rate of diffusion of Hydrogen at 1200 K = 1.575e-07 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (a), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Assuming Equimolal counter diffusion\n",
+ "#From Table 9.1\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -( Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "RNH3 = Na *17 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Na = -Nb =\",'%.4E'%Na,\"(kg mole)/m^2 s\";\n",
+ "print\"Rate at which ammonia is lost through the tube =\",'%.3E'%RNH3,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Na = -Nb = 2.2489E-11 (kg mole)/m^2 s\n",
+ "Rate at which ammonia is lost through the tube = 3.823E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (b), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Since the tank is large and the pressure and temperature at the two ends of the same tube are same, \n",
+ "#we are assuming Equimolal counter diffusion\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -(Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "#Since equimolal counter diffusion is taking place\n",
+ "Nb = - Na ; \n",
+ "#therefore rate at which air enters the tank\n",
+ "Rair = abs (Nb)*29 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which air enters the tank =\",'%.4E'%Rair,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which air enters the tank = 6.5219E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 , Page no:359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "h = 0.20 ; #m\n",
+ "hw = 0.03 ; #m\n",
+ "R = 8314 ; #J/kg mole K\n",
+ "Psat = 0.02339 ; #bar\n",
+ "xa2 = 0 ; #mole fraction at open top\n",
+ "\n",
+ "#calculations\n",
+ "#Evaporation of water, one dimensional\n",
+ "Tw = 20+273 ; #K\n",
+ "P = 1.014*10**5; #Pa\n",
+ "xa1 = Psat /1.014 ; #mole fraction at liq-vap interface\n",
+ "c = P/(R* Tw );\n",
+ "#From Table 9.2\n",
+ "Dab = 2.422*10**-5 ; #m^2/s\n",
+ "#Substituting above values in eqn 9.4.18\n",
+ "flux = 0.041626* Dab /0.17* math.log ((1 -0) /(1 - xa1 )); #kg mole/m^2 s\n",
+ "rate = flux *18*(3.14/4) *(D**2) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation of water =\",'%.4E'%rate,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation of water = 3.1290E-09 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 , Page no:364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 1; #length, m\n",
+ "w = 0.25; #width, m\n",
+ "T = 293 ; #Temperature, K\n",
+ "rhoinfinity = 0; #kg/m^3\n",
+ "R = 8314; #J/ kg K\n",
+ "paw = 2339; #Saturation pressure of water at 20 degree C. [N/m^2]\n",
+ "rhoainf = 0 ; #since air in the free stream is dry\n",
+ "\n",
+ "#calculations\n",
+ "#From Table A.2\n",
+ "v = 15.06*10**-6; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.4224*10**-5; #m^2/s\n",
+ "Re = 2.5/ v;\n",
+ "Sc = v/ Dab ;\n",
+ "#Since Re > 3*10^5, we may assume laminar boundary layer\n",
+ "Sh = 0.664* Sc**(1/3) *Re**(1/2) ; #Sherwood number\n",
+ "h = Sh*Dab;\n",
+ "rhoaw = paw /(R /18* T); #kg/m^3\n",
+ "mh = h *(2* l*w)*( rhoaw - rhoinfinity );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation from plate =\",'%.4E'%mh,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation from plate = 4.8335E-05 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (a) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#a) Colburn anology and Gnielinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm\n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm \n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting this value into Gnielinski\n",
+ "Nu = ((f /2) *(Re -1000) *Pr )/(1+12.7*(( f/2)**(1/2) )*(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "hm = h/r; #m/s\n",
+ "\n",
+ "#result\n",
+ "print\"hm using Colburn anology and Gnielinski equation =\",round(hm,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hm using Colburn anology and Gnielinski equation = 0.009495\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (b) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#(b) mess transfer correlation equivalent to the Gleilinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting in eqn 9.6.7\n",
+ "ShD = ((f /2) *(Re -1000) *Sc )/(1+12.7*(( f/2)) *(( Sc**(2/3) ) -1));\n",
+ "hm1 = ShD * Dab /D;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) hm =\",round(hm1,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) hm = 0.007258\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (c) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#c) To show that mass flux of water is very small compared to the mass flux of air flowing in the pipe\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm \n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#From steam table\n",
+ "rhoaw = 1/38.77 ; #kg/m^3\n",
+ "#let X = (m_a/A)_max\n",
+ "X = f* rhoaw ; #kg/m^2 s\n",
+ "#let Y = mass flux of air in pipe = (m/A)\n",
+ "Y = rho*V ; #kg/m^2 s\n",
+ "ratio = X/Y ;\n",
+ "percent = ratio *100;\n",
+ "\n",
+ "#result\n",
+ "print\"(c) (ma/A)max/(ma/A) =\",round(percent,6),\"percent Thus,\\nmass flux of water is very small compared to the mass flux of air flowing in the pipe.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c) (ma/A)max/(ma/A) = 0.010927 percent Thus,\n",
+ "mass flux of water is very small compared to the mass flux of air flowing in the pipe.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 , Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 0.5 ; #m/s\n",
+ "Th = 30 ; #C\n",
+ "Tc = 26 ; #C\n",
+ "#From table A.2\n",
+ "rho = 1.173 ; #kg/m^3\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02654 ; #W/m K\n",
+ "Psat = 3363; #From steam table\n",
+ "PP30 = 4246 ; #From steam table partial pressure of water vapour at 30 C, N/m^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Th+ Tc )/2;\n",
+ "#From Table 9.2 at 301 K\n",
+ "alpha = k/( rho *Cp); #m^2/s\n",
+ "Dab = 2.5584*10**-5 ; #m^2/s\n",
+ "hfg = 2439.2*10**3 ; #J/kg\n",
+ "#Substituting in equation 9.7.5\n",
+ "#let difference = rho_aw-rho_a infinity\n",
+ "difference = rho *Cp *(( alpha /Dab)**(2/3) )*( Th - Tc )/hfg ;\n",
+ "#From steam table\n",
+ "rhoaw = Psat /(8314/18*299) ;\n",
+ "rhoinf = rhoaw - difference ;\n",
+ "x = rhoinf / rho ; #mole fraction of water vapour in air stream\n",
+ "PP = rhoinf *8314/18*303; #Partial pressure of water vapour in air stream\n",
+ "relH = PP/ PP30 ;\n",
+ "percent = relH *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Relative humidity =\",round(relH,4),\"i.e.\",round(percent,4),\"percent\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative humidity = 0.7441 i.e. 74.4122 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_5.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_5.ipynb new file mode 100755 index 00000000..a65d7225 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_5.ipynb @@ -0,0 +1,626 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:68af0c4a8337e2d1285b325265301de0a726e4a41ce7ffd072403aa9458bcfde"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page no:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "wa = 0.76 ;\n",
+ "wb = 0.24 ;\n",
+ "ma = 28 ; #kg/kg mole\n",
+ "mb = 32 ; #kg/kg mole\n",
+ "\n",
+ "#calculations\n",
+ "xa = ( wa /ma)/( wa /ma+ wb /mb);\n",
+ "xb = ( wb /mb)/( wa /ma+ wb /mb);\n",
+ "\n",
+ "#result\n",
+ "print\"The molar fractions are given by\";\n",
+ "print\"xa =\",round(xa,5);\n",
+ "print\"xb =\",round(xb,5);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar fractions are given by\n",
+ "xa = 0.78351\n",
+ "xb = 0.21649\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page no:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#calculations\n",
+ "#From Table 9.1 at 1 atm and 25 C\n",
+ "Dab = 0.62*10**-5 ; #m^2/s\n",
+ "#Therefore at 2 atm and 50 C\n",
+ "Dab2 = Dab*(1/2)*(323/298)**1.5 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Dab at 2 atm & 50 C =\",'%.4E'%Dab2,\"m^2/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dab at 2 atm & 50 C = 3.4982E-06 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (a), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^ 2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D400 = 1.6*10**-11 ; #at 400K [m^2/ s ]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#Subtituting the values in eqn 9.3.3 , At 400 K\n",
+ "m400 = A* D400 *( rho1 - rho2 )/t; #kg / s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of diffusion of Hydrogen at 400 K =\",m400,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of diffusion of Hydrogen at 400 K = 7.2e-11 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (b), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D1200 = 3.5*10**-8 ; #at 1200k [m^2/s]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#At 1200 K\n",
+ "#From eqn 9.3.3\n",
+ "m1200 = A* D1200 *( rho1 - rho2 )/t ; #At 1200 K\n",
+ "\n",
+ "#result\n",
+ "print\"b) Rate of diffusion of Hydrogen at 1200 K =\",m1200,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b) Rate of diffusion of Hydrogen at 1200 K = 1.575e-07 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (a), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Assuming Equimolal counter diffusion\n",
+ "#From Table 9.1\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -( Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "RNH3 = Na *17 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Na = -Nb =\",'%.4E'%Na,\"(kg mole)/m^2 s\";\n",
+ "print\"Rate at which ammonia is lost through the tube =\",'%.3E'%RNH3,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Na = -Nb = 2.2489E-11 (kg mole)/m^2 s\n",
+ "Rate at which ammonia is lost through the tube = 3.823E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (b), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Since the tank is large and the pressure and temperature at the two ends of the same tube are same, \n",
+ "#we are assuming Equimolal counter diffusion\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -(Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "#Since equimolal counter diffusion is taking place\n",
+ "Nb = - Na ; \n",
+ "#therefore rate at which air enters the tank\n",
+ "Rair = abs (Nb)*29 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which air enters the tank =\",'%.4E'%Rair,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which air enters the tank = 6.5219E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 , Page no:359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "h = 0.20 ; #m\n",
+ "hw = 0.03 ; #m\n",
+ "R = 8314 ; #J/kg mole K\n",
+ "Psat = 0.02339 ; #bar\n",
+ "xa2 = 0 ; #mole fraction at open top\n",
+ "\n",
+ "#calculations\n",
+ "#Evaporation of water, one dimensional\n",
+ "Tw = 20+273 ; #K\n",
+ "P = 1.014*10**5; #Pa\n",
+ "xa1 = Psat /1.014 ; #mole fraction at liq-vap interface\n",
+ "c = P/(R* Tw );\n",
+ "#From Table 9.2\n",
+ "Dab = 2.422*10**-5 ; #m^2/s\n",
+ "#Substituting above values in eqn 9.4.18\n",
+ "flux = 0.041626* Dab /0.17* math.log ((1 -0) /(1 - xa1 )); #kg mole/m^2 s\n",
+ "rate = flux *18*(3.14/4) *(D**2) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation of water =\",'%.4E'%rate,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation of water = 3.1290E-09 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 , Page no:364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 1; #length, m\n",
+ "w = 0.25; #width, m\n",
+ "T = 293 ; #Temperature, K\n",
+ "rhoinfinity = 0; #kg/m^3\n",
+ "R = 8314; #J/ kg K\n",
+ "paw = 2339; #Saturation pressure of water at 20 degree C. [N/m^2]\n",
+ "rhoainf = 0 ; #since air in the free stream is dry\n",
+ "\n",
+ "#calculations\n",
+ "#From Table A.2\n",
+ "v = 15.06*10**-6; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.4224*10**-5; #m^2/s\n",
+ "Re = 2.5/ v;\n",
+ "Sc = v/ Dab ;\n",
+ "#Since Re > 3*10^5, we may assume laminar boundary layer\n",
+ "Sh = 0.664* Sc**(1/3) *Re**(1/2) ; #Sherwood number\n",
+ "h = Sh*Dab;\n",
+ "rhoaw = paw /(R /18* T); #kg/m^3\n",
+ "mh = h *(2* l*w)*( rhoaw - rhoinfinity );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation from plate =\",'%.4E'%mh,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation from plate = 4.8335E-05 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (a) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#a) Colburn anology and Gnielinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm\n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm \n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting this value into Gnielinski\n",
+ "Nu = ((f /2) *(Re -1000) *Pr )/(1+12.7*(( f/2)**(1/2) )*(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "hm = h/r; #m/s\n",
+ "\n",
+ "#result\n",
+ "print\"hm using Colburn anology and Gnielinski equation =\",round(hm,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hm using Colburn anology and Gnielinski equation = 0.009495\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (b) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#(b) mess transfer correlation equivalent to the Gleilinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting in eqn 9.6.7\n",
+ "ShD = ((f /2) *(Re -1000) *Sc )/(1+12.7*(( f/2)) *(( Sc**(2/3) ) -1));\n",
+ "hm1 = ShD * Dab /D;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) hm =\",round(hm1,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) hm = 0.007258\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (c) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#c) To show that mass flux of water is very small compared to the mass flux of air flowing in the pipe\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm \n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#From steam table\n",
+ "rhoaw = 1/38.77 ; #kg/m^3\n",
+ "#let X = (m_a/A)_max\n",
+ "X = f* rhoaw ; #kg/m^2 s\n",
+ "#let Y = mass flux of air in pipe = (m/A)\n",
+ "Y = rho*V ; #kg/m^2 s\n",
+ "ratio = X/Y ;\n",
+ "percent = ratio *100;\n",
+ "\n",
+ "#result\n",
+ "print\"(c) (ma/A)max/(ma/A) =\",round(percent,6),\"percent Thus,\\nmass flux of water is very small compared to the mass flux of air flowing in the pipe.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c) (ma/A)max/(ma/A) = 0.010927 percent Thus,\n",
+ "mass flux of water is very small compared to the mass flux of air flowing in the pipe.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 , Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 0.5 ; #m/s\n",
+ "Th = 30 ; #C\n",
+ "Tc = 26 ; #C\n",
+ "#From table A.2\n",
+ "rho = 1.173 ; #kg/m^3\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02654 ; #W/m K\n",
+ "Psat = 3363; #From steam table\n",
+ "PP30 = 4246 ; #From steam table partial pressure of water vapour at 30 C, N/m^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Th+ Tc )/2;\n",
+ "#From Table 9.2 at 301 K\n",
+ "alpha = k/( rho *Cp); #m^2/s\n",
+ "Dab = 2.5584*10**-5 ; #m^2/s\n",
+ "hfg = 2439.2*10**3 ; #J/kg\n",
+ "#Substituting in equation 9.7.5\n",
+ "#let difference = rho_aw-rho_a infinity\n",
+ "difference = rho *Cp *(( alpha /Dab)**(2/3) )*( Th - Tc )/hfg ;\n",
+ "#From steam table\n",
+ "rhoaw = Psat /(8314/18*299) ;\n",
+ "rhoinf = rhoaw - difference ;\n",
+ "x = rhoinf / rho ; #mole fraction of water vapour in air stream\n",
+ "PP = rhoinf *8314/18*303; #Partial pressure of water vapour in air stream\n",
+ "relH = PP/ PP30 ;\n",
+ "percent = relH *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Relative humidity =\",round(relH,4),\"i.e.\",round(percent,4),\"percent\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative humidity = 0.7441 i.e. 74.4122 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_6.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_6.ipynb new file mode 100755 index 00000000..a65d7225 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_6.ipynb @@ -0,0 +1,626 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:68af0c4a8337e2d1285b325265301de0a726e4a41ce7ffd072403aa9458bcfde"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page no:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "wa = 0.76 ;\n",
+ "wb = 0.24 ;\n",
+ "ma = 28 ; #kg/kg mole\n",
+ "mb = 32 ; #kg/kg mole\n",
+ "\n",
+ "#calculations\n",
+ "xa = ( wa /ma)/( wa /ma+ wb /mb);\n",
+ "xb = ( wb /mb)/( wa /ma+ wb /mb);\n",
+ "\n",
+ "#result\n",
+ "print\"The molar fractions are given by\";\n",
+ "print\"xa =\",round(xa,5);\n",
+ "print\"xb =\",round(xb,5);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar fractions are given by\n",
+ "xa = 0.78351\n",
+ "xb = 0.21649\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page no:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#calculations\n",
+ "#From Table 9.1 at 1 atm and 25 C\n",
+ "Dab = 0.62*10**-5 ; #m^2/s\n",
+ "#Therefore at 2 atm and 50 C\n",
+ "Dab2 = Dab*(1/2)*(323/298)**1.5 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Dab at 2 atm & 50 C =\",'%.4E'%Dab2,\"m^2/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dab at 2 atm & 50 C = 3.4982E-06 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (a), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^ 2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D400 = 1.6*10**-11 ; #at 400K [m^2/ s ]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#Subtituting the values in eqn 9.3.3 , At 400 K\n",
+ "m400 = A* D400 *( rho1 - rho2 )/t; #kg / s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of diffusion of Hydrogen at 400 K =\",m400,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of diffusion of Hydrogen at 400 K = 7.2e-11 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (b), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D1200 = 3.5*10**-8 ; #at 1200k [m^2/s]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#At 1200 K\n",
+ "#From eqn 9.3.3\n",
+ "m1200 = A* D1200 *( rho1 - rho2 )/t ; #At 1200 K\n",
+ "\n",
+ "#result\n",
+ "print\"b) Rate of diffusion of Hydrogen at 1200 K =\",m1200,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b) Rate of diffusion of Hydrogen at 1200 K = 1.575e-07 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (a), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Assuming Equimolal counter diffusion\n",
+ "#From Table 9.1\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -( Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "RNH3 = Na *17 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Na = -Nb =\",'%.4E'%Na,\"(kg mole)/m^2 s\";\n",
+ "print\"Rate at which ammonia is lost through the tube =\",'%.3E'%RNH3,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Na = -Nb = 2.2489E-11 (kg mole)/m^2 s\n",
+ "Rate at which ammonia is lost through the tube = 3.823E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (b), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Since the tank is large and the pressure and temperature at the two ends of the same tube are same, \n",
+ "#we are assuming Equimolal counter diffusion\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -(Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "#Since equimolal counter diffusion is taking place\n",
+ "Nb = - Na ; \n",
+ "#therefore rate at which air enters the tank\n",
+ "Rair = abs (Nb)*29 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which air enters the tank =\",'%.4E'%Rair,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which air enters the tank = 6.5219E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 , Page no:359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "h = 0.20 ; #m\n",
+ "hw = 0.03 ; #m\n",
+ "R = 8314 ; #J/kg mole K\n",
+ "Psat = 0.02339 ; #bar\n",
+ "xa2 = 0 ; #mole fraction at open top\n",
+ "\n",
+ "#calculations\n",
+ "#Evaporation of water, one dimensional\n",
+ "Tw = 20+273 ; #K\n",
+ "P = 1.014*10**5; #Pa\n",
+ "xa1 = Psat /1.014 ; #mole fraction at liq-vap interface\n",
+ "c = P/(R* Tw );\n",
+ "#From Table 9.2\n",
+ "Dab = 2.422*10**-5 ; #m^2/s\n",
+ "#Substituting above values in eqn 9.4.18\n",
+ "flux = 0.041626* Dab /0.17* math.log ((1 -0) /(1 - xa1 )); #kg mole/m^2 s\n",
+ "rate = flux *18*(3.14/4) *(D**2) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation of water =\",'%.4E'%rate,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation of water = 3.1290E-09 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 , Page no:364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 1; #length, m\n",
+ "w = 0.25; #width, m\n",
+ "T = 293 ; #Temperature, K\n",
+ "rhoinfinity = 0; #kg/m^3\n",
+ "R = 8314; #J/ kg K\n",
+ "paw = 2339; #Saturation pressure of water at 20 degree C. [N/m^2]\n",
+ "rhoainf = 0 ; #since air in the free stream is dry\n",
+ "\n",
+ "#calculations\n",
+ "#From Table A.2\n",
+ "v = 15.06*10**-6; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.4224*10**-5; #m^2/s\n",
+ "Re = 2.5/ v;\n",
+ "Sc = v/ Dab ;\n",
+ "#Since Re > 3*10^5, we may assume laminar boundary layer\n",
+ "Sh = 0.664* Sc**(1/3) *Re**(1/2) ; #Sherwood number\n",
+ "h = Sh*Dab;\n",
+ "rhoaw = paw /(R /18* T); #kg/m^3\n",
+ "mh = h *(2* l*w)*( rhoaw - rhoinfinity );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation from plate =\",'%.4E'%mh,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation from plate = 4.8335E-05 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (a) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#a) Colburn anology and Gnielinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm\n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm \n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting this value into Gnielinski\n",
+ "Nu = ((f /2) *(Re -1000) *Pr )/(1+12.7*(( f/2)**(1/2) )*(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "hm = h/r; #m/s\n",
+ "\n",
+ "#result\n",
+ "print\"hm using Colburn anology and Gnielinski equation =\",round(hm,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hm using Colburn anology and Gnielinski equation = 0.009495\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (b) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#(b) mess transfer correlation equivalent to the Gleilinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting in eqn 9.6.7\n",
+ "ShD = ((f /2) *(Re -1000) *Sc )/(1+12.7*(( f/2)) *(( Sc**(2/3) ) -1));\n",
+ "hm1 = ShD * Dab /D;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) hm =\",round(hm1,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) hm = 0.007258\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (c) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#c) To show that mass flux of water is very small compared to the mass flux of air flowing in the pipe\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm \n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#From steam table\n",
+ "rhoaw = 1/38.77 ; #kg/m^3\n",
+ "#let X = (m_a/A)_max\n",
+ "X = f* rhoaw ; #kg/m^2 s\n",
+ "#let Y = mass flux of air in pipe = (m/A)\n",
+ "Y = rho*V ; #kg/m^2 s\n",
+ "ratio = X/Y ;\n",
+ "percent = ratio *100;\n",
+ "\n",
+ "#result\n",
+ "print\"(c) (ma/A)max/(ma/A) =\",round(percent,6),\"percent Thus,\\nmass flux of water is very small compared to the mass flux of air flowing in the pipe.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c) (ma/A)max/(ma/A) = 0.010927 percent Thus,\n",
+ "mass flux of water is very small compared to the mass flux of air flowing in the pipe.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 , Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 0.5 ; #m/s\n",
+ "Th = 30 ; #C\n",
+ "Tc = 26 ; #C\n",
+ "#From table A.2\n",
+ "rho = 1.173 ; #kg/m^3\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02654 ; #W/m K\n",
+ "Psat = 3363; #From steam table\n",
+ "PP30 = 4246 ; #From steam table partial pressure of water vapour at 30 C, N/m^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Th+ Tc )/2;\n",
+ "#From Table 9.2 at 301 K\n",
+ "alpha = k/( rho *Cp); #m^2/s\n",
+ "Dab = 2.5584*10**-5 ; #m^2/s\n",
+ "hfg = 2439.2*10**3 ; #J/kg\n",
+ "#Substituting in equation 9.7.5\n",
+ "#let difference = rho_aw-rho_a infinity\n",
+ "difference = rho *Cp *(( alpha /Dab)**(2/3) )*( Th - Tc )/hfg ;\n",
+ "#From steam table\n",
+ "rhoaw = Psat /(8314/18*299) ;\n",
+ "rhoinf = rhoaw - difference ;\n",
+ "x = rhoinf / rho ; #mole fraction of water vapour in air stream\n",
+ "PP = rhoinf *8314/18*303; #Partial pressure of water vapour in air stream\n",
+ "relH = PP/ PP30 ;\n",
+ "percent = relH *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Relative humidity =\",round(relH,4),\"i.e.\",round(percent,4),\"percent\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative humidity = 0.7441 i.e. 74.4122 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_7.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_7.ipynb new file mode 100755 index 00000000..a65d7225 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_7.ipynb @@ -0,0 +1,626 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:68af0c4a8337e2d1285b325265301de0a726e4a41ce7ffd072403aa9458bcfde"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page no:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "wa = 0.76 ;\n",
+ "wb = 0.24 ;\n",
+ "ma = 28 ; #kg/kg mole\n",
+ "mb = 32 ; #kg/kg mole\n",
+ "\n",
+ "#calculations\n",
+ "xa = ( wa /ma)/( wa /ma+ wb /mb);\n",
+ "xb = ( wb /mb)/( wa /ma+ wb /mb);\n",
+ "\n",
+ "#result\n",
+ "print\"The molar fractions are given by\";\n",
+ "print\"xa =\",round(xa,5);\n",
+ "print\"xb =\",round(xb,5);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar fractions are given by\n",
+ "xa = 0.78351\n",
+ "xb = 0.21649\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page no:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#calculations\n",
+ "#From Table 9.1 at 1 atm and 25 C\n",
+ "Dab = 0.62*10**-5 ; #m^2/s\n",
+ "#Therefore at 2 atm and 50 C\n",
+ "Dab2 = Dab*(1/2)*(323/298)**1.5 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Dab at 2 atm & 50 C =\",'%.4E'%Dab2,\"m^2/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dab at 2 atm & 50 C = 3.4982E-06 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (a), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^ 2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D400 = 1.6*10**-11 ; #at 400K [m^2/ s ]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#Subtituting the values in eqn 9.3.3 , At 400 K\n",
+ "m400 = A* D400 *( rho1 - rho2 )/t; #kg / s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of diffusion of Hydrogen at 400 K =\",m400,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of diffusion of Hydrogen at 400 K = 7.2e-11 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (b), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D1200 = 3.5*10**-8 ; #at 1200k [m^2/s]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#At 1200 K\n",
+ "#From eqn 9.3.3\n",
+ "m1200 = A* D1200 *( rho1 - rho2 )/t ; #At 1200 K\n",
+ "\n",
+ "#result\n",
+ "print\"b) Rate of diffusion of Hydrogen at 1200 K =\",m1200,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b) Rate of diffusion of Hydrogen at 1200 K = 1.575e-07 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (a), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Assuming Equimolal counter diffusion\n",
+ "#From Table 9.1\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -( Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "RNH3 = Na *17 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Na = -Nb =\",'%.4E'%Na,\"(kg mole)/m^2 s\";\n",
+ "print\"Rate at which ammonia is lost through the tube =\",'%.3E'%RNH3,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Na = -Nb = 2.2489E-11 (kg mole)/m^2 s\n",
+ "Rate at which ammonia is lost through the tube = 3.823E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (b), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Since the tank is large and the pressure and temperature at the two ends of the same tube are same, \n",
+ "#we are assuming Equimolal counter diffusion\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -(Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "#Since equimolal counter diffusion is taking place\n",
+ "Nb = - Na ; \n",
+ "#therefore rate at which air enters the tank\n",
+ "Rair = abs (Nb)*29 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which air enters the tank =\",'%.4E'%Rair,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which air enters the tank = 6.5219E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 , Page no:359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "h = 0.20 ; #m\n",
+ "hw = 0.03 ; #m\n",
+ "R = 8314 ; #J/kg mole K\n",
+ "Psat = 0.02339 ; #bar\n",
+ "xa2 = 0 ; #mole fraction at open top\n",
+ "\n",
+ "#calculations\n",
+ "#Evaporation of water, one dimensional\n",
+ "Tw = 20+273 ; #K\n",
+ "P = 1.014*10**5; #Pa\n",
+ "xa1 = Psat /1.014 ; #mole fraction at liq-vap interface\n",
+ "c = P/(R* Tw );\n",
+ "#From Table 9.2\n",
+ "Dab = 2.422*10**-5 ; #m^2/s\n",
+ "#Substituting above values in eqn 9.4.18\n",
+ "flux = 0.041626* Dab /0.17* math.log ((1 -0) /(1 - xa1 )); #kg mole/m^2 s\n",
+ "rate = flux *18*(3.14/4) *(D**2) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation of water =\",'%.4E'%rate,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation of water = 3.1290E-09 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 , Page no:364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 1; #length, m\n",
+ "w = 0.25; #width, m\n",
+ "T = 293 ; #Temperature, K\n",
+ "rhoinfinity = 0; #kg/m^3\n",
+ "R = 8314; #J/ kg K\n",
+ "paw = 2339; #Saturation pressure of water at 20 degree C. [N/m^2]\n",
+ "rhoainf = 0 ; #since air in the free stream is dry\n",
+ "\n",
+ "#calculations\n",
+ "#From Table A.2\n",
+ "v = 15.06*10**-6; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.4224*10**-5; #m^2/s\n",
+ "Re = 2.5/ v;\n",
+ "Sc = v/ Dab ;\n",
+ "#Since Re > 3*10^5, we may assume laminar boundary layer\n",
+ "Sh = 0.664* Sc**(1/3) *Re**(1/2) ; #Sherwood number\n",
+ "h = Sh*Dab;\n",
+ "rhoaw = paw /(R /18* T); #kg/m^3\n",
+ "mh = h *(2* l*w)*( rhoaw - rhoinfinity );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation from plate =\",'%.4E'%mh,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation from plate = 4.8335E-05 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (a) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#a) Colburn anology and Gnielinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm\n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm \n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting this value into Gnielinski\n",
+ "Nu = ((f /2) *(Re -1000) *Pr )/(1+12.7*(( f/2)**(1/2) )*(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "hm = h/r; #m/s\n",
+ "\n",
+ "#result\n",
+ "print\"hm using Colburn anology and Gnielinski equation =\",round(hm,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hm using Colburn anology and Gnielinski equation = 0.009495\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (b) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#(b) mess transfer correlation equivalent to the Gleilinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting in eqn 9.6.7\n",
+ "ShD = ((f /2) *(Re -1000) *Sc )/(1+12.7*(( f/2)) *(( Sc**(2/3) ) -1));\n",
+ "hm1 = ShD * Dab /D;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) hm =\",round(hm1,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) hm = 0.007258\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (c) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#c) To show that mass flux of water is very small compared to the mass flux of air flowing in the pipe\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm \n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#From steam table\n",
+ "rhoaw = 1/38.77 ; #kg/m^3\n",
+ "#let X = (m_a/A)_max\n",
+ "X = f* rhoaw ; #kg/m^2 s\n",
+ "#let Y = mass flux of air in pipe = (m/A)\n",
+ "Y = rho*V ; #kg/m^2 s\n",
+ "ratio = X/Y ;\n",
+ "percent = ratio *100;\n",
+ "\n",
+ "#result\n",
+ "print\"(c) (ma/A)max/(ma/A) =\",round(percent,6),\"percent Thus,\\nmass flux of water is very small compared to the mass flux of air flowing in the pipe.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c) (ma/A)max/(ma/A) = 0.010927 percent Thus,\n",
+ "mass flux of water is very small compared to the mass flux of air flowing in the pipe.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 , Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 0.5 ; #m/s\n",
+ "Th = 30 ; #C\n",
+ "Tc = 26 ; #C\n",
+ "#From table A.2\n",
+ "rho = 1.173 ; #kg/m^3\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02654 ; #W/m K\n",
+ "Psat = 3363; #From steam table\n",
+ "PP30 = 4246 ; #From steam table partial pressure of water vapour at 30 C, N/m^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Th+ Tc )/2;\n",
+ "#From Table 9.2 at 301 K\n",
+ "alpha = k/( rho *Cp); #m^2/s\n",
+ "Dab = 2.5584*10**-5 ; #m^2/s\n",
+ "hfg = 2439.2*10**3 ; #J/kg\n",
+ "#Substituting in equation 9.7.5\n",
+ "#let difference = rho_aw-rho_a infinity\n",
+ "difference = rho *Cp *(( alpha /Dab)**(2/3) )*( Th - Tc )/hfg ;\n",
+ "#From steam table\n",
+ "rhoaw = Psat /(8314/18*299) ;\n",
+ "rhoinf = rhoaw - difference ;\n",
+ "x = rhoinf / rho ; #mole fraction of water vapour in air stream\n",
+ "PP = rhoinf *8314/18*303; #Partial pressure of water vapour in air stream\n",
+ "relH = PP/ PP30 ;\n",
+ "percent = relH *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Relative humidity =\",round(relH,4),\"i.e.\",round(percent,4),\"percent\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative humidity = 0.7441 i.e. 74.4122 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_8.ipynb b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_8.ipynb new file mode 100755 index 00000000..a65d7225 --- /dev/null +++ b/Textbook_Of_Heat_Transfer_by_S._P._Sukhatme/Chapter_9_Mass_Transfer_8.ipynb @@ -0,0 +1,626 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:68af0c4a8337e2d1285b325265301de0a726e4a41ce7ffd072403aa9458bcfde"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page no:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "wa = 0.76 ;\n",
+ "wb = 0.24 ;\n",
+ "ma = 28 ; #kg/kg mole\n",
+ "mb = 32 ; #kg/kg mole\n",
+ "\n",
+ "#calculations\n",
+ "xa = ( wa /ma)/( wa /ma+ wb /mb);\n",
+ "xb = ( wb /mb)/( wa /ma+ wb /mb);\n",
+ "\n",
+ "#result\n",
+ "print\"The molar fractions are given by\";\n",
+ "print\"xa =\",round(xa,5);\n",
+ "print\"xb =\",round(xb,5);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar fractions are given by\n",
+ "xa = 0.78351\n",
+ "xb = 0.21649\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page no:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#calculations\n",
+ "#From Table 9.1 at 1 atm and 25 C\n",
+ "Dab = 0.62*10**-5 ; #m^2/s\n",
+ "#Therefore at 2 atm and 50 C\n",
+ "Dab2 = Dab*(1/2)*(323/298)**1.5 ;\n",
+ "\n",
+ "#result\n",
+ "print\"Dab at 2 atm & 50 C =\",'%.4E'%Dab2,\"m^2/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dab at 2 atm & 50 C = 3.4982E-06 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (a), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^ 2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D400 = 1.6*10**-11 ; #at 400K [m^2/ s ]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#Subtituting the values in eqn 9.3.3 , At 400 K\n",
+ "m400 = A* D400 *( rho1 - rho2 )/t; #kg / s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of diffusion of Hydrogen at 400 K =\",m400,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of diffusion of Hydrogen at 400 K = 7.2e-11 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 (b), Page no:352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t = 0.04 ; #m\n",
+ "A = 2 ; #m^2\n",
+ "rho1 = 0.10 ;\n",
+ "rho2 = 0.01 ;\n",
+ "\n",
+ "#calculations\n",
+ "D1200 = 3.5*10**-8 ; #at 1200k [m^2/s]\n",
+ "#Mass Diffusion in solid solution, assuming Ficks law is valid & steady state and one dimensional diffusion\n",
+ "#At 1200 K\n",
+ "#From eqn 9.3.3\n",
+ "m1200 = A* D1200 *( rho1 - rho2 )/t ; #At 1200 K\n",
+ "\n",
+ "#result\n",
+ "print\"b) Rate of diffusion of Hydrogen at 1200 K =\",m1200,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b) Rate of diffusion of Hydrogen at 1200 K = 1.575e-07 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (a), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Assuming Equimolal counter diffusion\n",
+ "#From Table 9.1\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -( Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "RNH3 = Na *17 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Na = -Nb =\",'%.4E'%Na,\"(kg mole)/m^2 s\";\n",
+ "print\"Rate at which ammonia is lost through the tube =\",'%.3E'%RNH3,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Na = -Nb = 2.2489E-11 (kg mole)/m^2 s\n",
+ "Rate at which ammonia is lost through the tube = 3.823E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 (b), Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 1 ; #m\n",
+ "D = 0.005 ; #m\n",
+ "Pa1 = 1 ; #atm\n",
+ "Pa2 = 0 ;\n",
+ "R = 8314 ;\n",
+ "T = 298 ; #K\n",
+ "\n",
+ "#calculations\n",
+ "#Since the tank is large and the pressure and temperature at the two ends of the same tube are same, \n",
+ "#we are assuming Equimolal counter diffusion\n",
+ "Dab = 2.80*10**-5 ; #m^2/s\n",
+ "#Substituing in eqn 9.4.12\n",
+ "Na = -(Dab /(R*T)*( Pa2 - Pa1 ) *(1.014*10**5) /L )*(3.14*(D/2)**2) ;\n",
+ "#Since equimolal counter diffusion is taking place\n",
+ "Nb = - Na ; \n",
+ "#therefore rate at which air enters the tank\n",
+ "Rair = abs (Nb)*29 ; #kg/s\n",
+ "\n",
+ "#result\n",
+ "print\"Rate at which air enters the tank =\",'%.4E'%Rair,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate at which air enters the tank = 6.5219E-10 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 , Page no:359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "h = 0.20 ; #m\n",
+ "hw = 0.03 ; #m\n",
+ "R = 8314 ; #J/kg mole K\n",
+ "Psat = 0.02339 ; #bar\n",
+ "xa2 = 0 ; #mole fraction at open top\n",
+ "\n",
+ "#calculations\n",
+ "#Evaporation of water, one dimensional\n",
+ "Tw = 20+273 ; #K\n",
+ "P = 1.014*10**5; #Pa\n",
+ "xa1 = Psat /1.014 ; #mole fraction at liq-vap interface\n",
+ "c = P/(R* Tw );\n",
+ "#From Table 9.2\n",
+ "Dab = 2.422*10**-5 ; #m^2/s\n",
+ "#Substituting above values in eqn 9.4.18\n",
+ "flux = 0.041626* Dab /0.17* math.log ((1 -0) /(1 - xa1 )); #kg mole/m^2 s\n",
+ "rate = flux *18*(3.14/4) *(D**2) ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation of water =\",'%.4E'%rate,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation of water = 3.1290E-09 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 , Page no:364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 1; #length, m\n",
+ "w = 0.25; #width, m\n",
+ "T = 293 ; #Temperature, K\n",
+ "rhoinfinity = 0; #kg/m^3\n",
+ "R = 8314; #J/ kg K\n",
+ "paw = 2339; #Saturation pressure of water at 20 degree C. [N/m^2]\n",
+ "rhoainf = 0 ; #since air in the free stream is dry\n",
+ "\n",
+ "#calculations\n",
+ "#From Table A.2\n",
+ "v = 15.06*10**-6; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.4224*10**-5; #m^2/s\n",
+ "Re = 2.5/ v;\n",
+ "Sc = v/ Dab ;\n",
+ "#Since Re > 3*10^5, we may assume laminar boundary layer\n",
+ "Sh = 0.664* Sc**(1/3) *Re**(1/2) ; #Sherwood number\n",
+ "h = Sh*Dab;\n",
+ "rhoaw = paw /(R /18* T); #kg/m^3\n",
+ "mh = h *(2* l*w)*( rhoaw - rhoinfinity );\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of evaporation from plate =\",'%.4E'%mh,\"kg/s\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation from plate = 4.8335E-05 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (a) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#a) Colburn anology and Gnielinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "# From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm\n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm \n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting this value into Gnielinski\n",
+ "Nu = ((f /2) *(Re -1000) *Pr )/(1+12.7*(( f/2)**(1/2) )*(( Pr**(2/3) ) -1));\n",
+ "h = Nu*k/D;\n",
+ "hm = h/r; #m/s\n",
+ "\n",
+ "#result\n",
+ "print\"hm using Colburn anology and Gnielinski equation =\",round(hm,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hm using Colburn anology and Gnielinski equation = 0.009495\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (b) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#(b) mess transfer correlation equivalent to the Gleilinski equation\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#Substituting in eqn 9.6.7\n",
+ "ShD = ((f /2) *(Re -1000) *Sc )/(1+12.7*(( f/2)) *(( Sc**(2/3) ) -1));\n",
+ "hm1 = ShD * Dab /D;\n",
+ "\n",
+ "#result\n",
+ "print\"(b) hm =\",round(hm1,6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) hm = 0.007258\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 (c) , Page no:366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 0.04 ; #m\n",
+ "V = 1.9 ; #m/s\n",
+ "rho = 1.177 ; #kg/m^3\n",
+ "Pr = 0.7015 ;\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02646 ; #W/m K\n",
+ "\n",
+ "#calculations\n",
+ "#c) To show that mass flux of water is very small compared to the mass flux of air flowing in the pipe\n",
+ "#Properties of air at 27 degree C\n",
+ "v = 15.718*10**-6 ; #m^2/s\n",
+ "#From Table 9.2\n",
+ "Dab = 2.54 * 10**-5 ; #m^2/s\n",
+ "Sc = v/ Dab ;\n",
+ "Re = V*D/v;\n",
+ "#The flow is turbulent and eqn 9.6.5 may be applied\n",
+ "#let r = h/hm \n",
+ "r = rho*Cp *(( Sc/Pr)**(2/3) ); #let r = h/hm\n",
+ "#From Blasius equation 4.6.4a\n",
+ "f = 0.079* Re**( -0.25) ;\n",
+ "#From steam table\n",
+ "rhoaw = 1/38.77 ; #kg/m^3\n",
+ "#let X = (m_a/A)_max\n",
+ "X = f* rhoaw ; #kg/m^2 s\n",
+ "#let Y = mass flux of air in pipe = (m/A)\n",
+ "Y = rho*V ; #kg/m^2 s\n",
+ "ratio = X/Y ;\n",
+ "percent = ratio *100;\n",
+ "\n",
+ "#result\n",
+ "print\"(c) (ma/A)max/(ma/A) =\",round(percent,6),\"percent Thus,\\nmass flux of water is very small compared to the mass flux of air flowing in the pipe.\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c) (ma/A)max/(ma/A) = 0.010927 percent Thus,\n",
+ "mass flux of water is very small compared to the mass flux of air flowing in the pipe.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 , Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 0.5 ; #m/s\n",
+ "Th = 30 ; #C\n",
+ "Tc = 26 ; #C\n",
+ "#From table A.2\n",
+ "rho = 1.173 ; #kg/m^3\n",
+ "Cp = 1005 ; #J/kg K\n",
+ "k = 0.02654 ; #W/m K\n",
+ "Psat = 3363; #From steam table\n",
+ "PP30 = 4246 ; #From steam table partial pressure of water vapour at 30 C, N/m^2\n",
+ "\n",
+ "#calculations\n",
+ "Tm = (Th+ Tc )/2;\n",
+ "#From Table 9.2 at 301 K\n",
+ "alpha = k/( rho *Cp); #m^2/s\n",
+ "Dab = 2.5584*10**-5 ; #m^2/s\n",
+ "hfg = 2439.2*10**3 ; #J/kg\n",
+ "#Substituting in equation 9.7.5\n",
+ "#let difference = rho_aw-rho_a infinity\n",
+ "difference = rho *Cp *(( alpha /Dab)**(2/3) )*( Th - Tc )/hfg ;\n",
+ "#From steam table\n",
+ "rhoaw = Psat /(8314/18*299) ;\n",
+ "rhoinf = rhoaw - difference ;\n",
+ "x = rhoinf / rho ; #mole fraction of water vapour in air stream\n",
+ "PP = rhoinf *8314/18*303; #Partial pressure of water vapour in air stream\n",
+ "relH = PP/ PP30 ;\n",
+ "percent = relH *100;\n",
+ "\n",
+ "#result\n",
+ "print\"Relative humidity =\",round(relH,4),\"i.e.\",round(percent,4),\"percent\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative humidity = 0.7441 i.e. 74.4122 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Thermal_Engineering/screenshots/chap1.png b/Thermal_Engineering/screenshots/chap1.png Binary files differnew file mode 100755 index 00000000..77731f94 --- /dev/null +++ b/Thermal_Engineering/screenshots/chap1.png diff --git a/Thermal_Engineering/screenshots/chap10.png b/Thermal_Engineering/screenshots/chap10.png Binary files differnew file mode 100755 index 00000000..13aad64f --- /dev/null +++ b/Thermal_Engineering/screenshots/chap10.png diff --git a/Thermal_Engineering/screenshots/chap9.png b/Thermal_Engineering/screenshots/chap9.png Binary files differnew file mode 100755 index 00000000..30ec2b28 --- /dev/null +++ b/Thermal_Engineering/screenshots/chap9.png diff --git a/Thermal_Engineering_by_K_K_Ramalingam/Chapter1.ipynb b/Thermal_Engineering_by_K_K_Ramalingam/Chapter1.ipynb new file mode 100755 index 00000000..b1f558ad --- /dev/null +++ b/Thermal_Engineering_by_K_K_Ramalingam/Chapter1.ipynb @@ -0,0 +1,1978 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 - Gas Power Cycles"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 1.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The pressures at 1 is (bar) = 1.0\n",
+ "(b)The pressures at 2 is (bar) = 12.0\n",
+ "(c)The pressures at 3 is (bar) = 22.38\n",
+ "(d)The pressures at 4 is (bar) = 1.86\n",
+ "(e)Temperature at 1 is (K) = 300.0\n",
+ "(f)Temperature at 2 is (K) = 610.2\n",
+ "(g)Temperature at 3 is (K) = 1138.0\n",
+ "(h)Temperature at 4 is (K) = 559.0\n",
+ "(i)Volume at 1 is (m^3) = 0.5\n",
+ "(j)Volume at 1 is (m^3) = 0.08475\n",
+ "(h)Volume at 1 is (m^3) = 0.08475\n",
+ "(k)Volume at 1 is (m^3) = 0.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.29\n",
+ "#calculate the pressure and temperature in all cases\n",
+ "import math\n",
+ "#Input data\n",
+ "V1=0.5;#Initial Volume before the commencement of compression in m**3\n",
+ "P1=1.;#Initial pressure before the commencement of compression in bar\n",
+ "T1=300.;#Initial temperature in K\n",
+ "P2=12.;#Final pressure at the end of compression stroke in bar\n",
+ "Q=220.;#Heat added during the constant volume process in kJ\n",
+ "r=1.4;#Isentropic constant for air\n",
+ "R=0.287;#Characteristic Gas constant in kJ/kg K\n",
+ "Cv=0.718;#Specific heat of mixture in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "r1=(P2/P1)**(1/r);#Compression ratio\n",
+ "T2=T1*(r1)**(r-1);#Final temperature after the end of compression stroke in K\n",
+ "V2=(P1*T2*V1)/(P2*T1);#Final volume after the end of compression stroke in m**3\n",
+ "m=(P1*10**5*V1)/(R*T1*1000);#Mass of air flowing in kg\n",
+ "T3=(Q/(m*Cv))+T2;#Temperature after constant volume heat addition in K\n",
+ "P3=(P2*T3)/T2;#Pressure after constant volume heat addition in K\n",
+ "V3=V2;#Volume at 3\n",
+ "P4=P3*(1/r1)**(r);#Pressure after isentropic expansion in bar\n",
+ "V4=V1;#Volume after isentropic expansion in m**3\n",
+ "T4=T3*(1/r1)**(r-1);#Temperature at the end of isentropic expansion in K\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The pressures at 1 is (bar) = ',round(P1,2)\n",
+ "print '(b)The pressures at 2 is (bar) = ',round(P2,2)\n",
+ "print '(c)The pressures at 3 is (bar) = ',round(P3,2)\n",
+ "print '(d)The pressures at 4 is (bar) = ',round(P4,2)\n",
+ "print '(e)Temperature at 1 is (K) = ',round(T1,2)\n",
+ "print '(f)Temperature at 2 is (K) = ',round(T2,1)\n",
+ "print '(g)Temperature at 3 is (K) = ',round(T3,0)\n",
+ "print '(h)Temperature at 4 is (K) = ',round(T4,0)\n",
+ "print '(i)Volume at 1 is (m^3) = ',round(V1,2)\n",
+ "print '(j)Volume at 1 is (m^3) = ',round(V2,5)\n",
+ "print '(h)Volume at 1 is (m^3) = ',round(V3,5)\n",
+ "print '(k)Volume at 1 is (m^3) = ',round(V4,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 1.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The increase in efficiency due to change in compression ratio from 6 to 7 is (percent) = 2.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.31\n",
+ "#calculate the increase in efficiency\n",
+ "#Input data\n",
+ "r1=6.;#Initial compression ratio\n",
+ "r2=7.;#Final compression ratio\n",
+ "r=1.4;#Isentropic coefficient of air\n",
+ "\n",
+ "#Calculations\n",
+ "nr1=(1-(1/r1)**(r-1))*100;#Otto cycle efficiency when compression ratio is 6 in percentage\n",
+ "nr2=(1-(1/r2)**(r-1))*100;#Otto cycle efficiency when compression ratio is 7 in percentage\n",
+ "n=nr2-nr1;#Increase in efficiency in percentage\n",
+ "\n",
+ "#Output\n",
+ "print 'The increase in efficiency due to change in compression ratio from 6 to 7 is (percent) = ',round(n,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 1.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The compression ratio is 5.007 \n",
+ "(b)Efficiency of the Otto cycle is (percent) = 47.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.31\n",
+ "#calculate the compression ratio and Efficiency of Otto cycle\n",
+ "#Input data\n",
+ "T1=315.;#Temperature at the beginning of isentropic compression in K\n",
+ "T2=600.;#Temperature at the end of isentropic compression in K\n",
+ "r=1.4;#Isentropic constant of air\n",
+ "\n",
+ "#Calculations\n",
+ "r1=(T2/T1)**(1/(r-1));#Compression ratio\n",
+ "n=(1-(1/r1**(r-1)))*100;#Efficiency of Otto cycle in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The compression ratio is ',round(r1,3),'\\n(b)Efficiency of the Otto cycle is (percent) = ',n\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 1.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The air standard efficiency of air is (percent) = 47.43\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.32\n",
+ "#calculate the standard efficiency of air\n",
+ "#Input data\n",
+ "D=0.1;#Diameter of the cylinder in m\n",
+ "L=0.15;#Stroke length in m\n",
+ "Vc=0.295*10**-3;#Clearance volume in m**3\n",
+ "r=1.4;#Isentropic constant of air\n",
+ "\n",
+ "#Calculations\n",
+ "Vs=(3.14/4)*(D**2*L);#Swept volume in m**3\n",
+ "r1=(Vc+Vs)/Vc;#Compression ratio\n",
+ "n=(1-(1/r1)**(r-1))*100.;#Otto cycle efficiency in percentage\n",
+ "\n",
+ "#Output\n",
+ "print 'The air standard efficiency of air is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 1.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Compression ratio is 7.56\n",
+ "(b)The air standard efficiency is (percent) = 55.5\n",
+ "(c)Mean effective pressure is (bar) = 4.86\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.33\n",
+ "#calculate the compression ratio, standard air efficiency and Mean effective pressure\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of air in bar\n",
+ "T1=300.;#Initial temperature in K\n",
+ "P2=17.;#Pressure at the end of isentropic compression in bar\n",
+ "P3=40.;#Pressure at the end of constant volume heat addition in bar\n",
+ "Cv=0.717;#Specific heat of mixture in kJ/kg K\n",
+ "M=28.97;#Molecular weight in kg\n",
+ "Ru=8.314;#Universial gas constant in kJ/kg mole K\n",
+ "m=1.;#Mass from which heat is extracted in kg\n",
+ "W=363.;#Work done in kN m\n",
+ "\n",
+ "#Calculations\n",
+ "Rc=Ru/M;#Characteristic gas constant in kJ/kg K\n",
+ "Cp=Rc+Cv;#Specific heat at constant pressure in kJ/kg K\n",
+ "r=Cp/Cv;#Isentropic gas constant\n",
+ "r1=(P2/P1)**(1/r);#Compression ratio\n",
+ "na=(1-(1/r1)**(r-1))*100;#Air standard efficiency in percentage\n",
+ "T2=T1*(P2/P1)**((r-1)/r);#Temperature at the end of isentropic compression process in K\n",
+ "T3=(P3/P2)*T2;#Temperature at the end of constant volume heat addition in K\n",
+ "Q=m*Cv*(T3-T2);#Heat supplied in kJ/kg\n",
+ "V1=(m*Rc*T1*1000)/(P1*10**5);#Initial volume before compression in m**3\n",
+ "V2=V1/r1;#Volume at the end of compression stroke in m**3\n",
+ "Vs=V1-V2;#Stroke volume in m**3\n",
+ "MEP=(W/Vs)/100;#Mean effective pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Compression ratio is',round(r1,2)\n",
+ "print '(b)The air standard efficiency is (percent) = ',round(na,1)\n",
+ "print '(c)Mean effective pressure is (bar) = ',round(MEP,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 1.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Clearance volume as percentage of stroke volume is (percent) = 23.93\n",
+ "(b)Compression ratio is = 5.18\n",
+ "(c)Air standard efficiency is (percent) = 48.2\n",
+ "(d)Work done per cycle is (kJ) = 101.23\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.34\n",
+ "#calculate the clearance volume, compression ratio, standard efficiency, work done\n",
+ "#Input data\n",
+ "V1=0.6;#Initial volume of an engine working on otto cycle in m**3\n",
+ "P1=1.;#Initial pressure in bar\n",
+ "T1=308.;#Initial temperature in K\n",
+ "P2=10.;#Pressure at the end of compression stroke in bar\n",
+ "Q=210.;#Heat added during constant heat process in kJ\n",
+ "r=1.4;#Isentropic constant of air\n",
+ "\n",
+ "#Calculations\n",
+ "r1=(P2/P1)**(1/r);#Compression ratio\n",
+ "V2=V1/r1;#Clearance volume in m**3\n",
+ "C=(V2/(V1-V2))*100;#Percentage clearance in percent\n",
+ "na=(1-(1/r1)**(r-1))*100;#Air standard efficiency in percent\n",
+ "W=Q*(na/100);#Work done per cycle in kJ\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Clearance volume as percentage of stroke volume is (percent) = ',round(C,2)\n",
+ "print '(b)Compression ratio is = ',round(r1,2)\n",
+ "print '(c)Air standard efficiency is (percent) = ',round(na,1)\n",
+ "print '(d)Work done per cycle is (kJ) = ',round(W,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 1.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ideal power developed by the engine is (kW) = 1030.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.36\n",
+ "#calculate the Ideal power\n",
+ "#Input data\n",
+ "r=5.5;#Compression ratio of an engine working on the otto cycle\n",
+ "Q=250.;#Heat supplied during constant volume in kJ\n",
+ "N=500.;#Engine operating speed in rpm\n",
+ "r1=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "n=(1-(1/r)**(r1-1))*100;#Otto cycle efficiency in percent\n",
+ "W=Q*(n/100);#Work done per cycle in kJ\n",
+ "P=W*(N/60);#Work done per second i.e., Power developed in kJ/s or kW\n",
+ "\n",
+ "#Output data\n",
+ "print 'Ideal power developed by the engine is (kW) = ',round(P,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 1.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mean effective pressure is (bar) = 2.377\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.36\n",
+ "#calculate the Mean effective pressure\n",
+ "#Input data\n",
+ "V1=0.53;#Volume of cylinder of an engine working on Otto cycle in m**3\n",
+ "V2=0.1;#Clearance volume in m**3\n",
+ "Q=210.;#Heat supplied during constant volume in kJ\n",
+ "r=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "r1=V1/V2;#Compression ratio\n",
+ "n=(1-(1/r1)**(r-1))*100;#Otto cycle efficiency in percentage\n",
+ "W=Q*(n/100);#Work done per cycle in kJ\n",
+ "P=W/((V1-V2)*100);#Mean effective pressure in bar\n",
+ "\n",
+ "#Output data\n",
+ "print 'Mean effective pressure is (bar) = ',round(P,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 1.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Maximum power developed by the engine is (kW) = 2.194\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.38\n",
+ "#calculate the Maximum power\n",
+ "#Input data\n",
+ "T3=1500.;#Upper temperature limit of a otto cycle in K\n",
+ "T1=300.;#Lower temperature limit in K\n",
+ "a=0.4;#Rate of flow of air through the cycle in kg/min\n",
+ "Cv=0.718;#\n",
+ "\n",
+ "#Calculations\n",
+ "T2=(T1*T3)**(1./2);#Temperature at point 2 in K\n",
+ "T4=T2;#Temperature at point 4 in K\n",
+ "W=Cv*((T3-T2)-(T4-T1));#Work done per cycle in kJ/kg\n",
+ "P=W*(a/60);#Maximum power developed by the engine in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'Maximum power developed by the engine is (kW) = ',round(P,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 1.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Thermal efficiency when cut off ratio is 1.25 is (percent) = 65.4\n",
+ "(b)Thermal efficiency when cut off ratio is 1.50 is (percent) = 64.0\n",
+ "(c)Thermal efficiency when cut off ratio is 2.00 is (percent) = 61.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.39\n",
+ "#calculate the Thermal efficiency in all cases\n",
+ "#Input data\n",
+ "r=1.4;#Air standard ratio\n",
+ "p1=1.25;#Cut off ratio 1\n",
+ "p2=1.50;#Cut off ratio 2\n",
+ "p3=2.00;#Cut off ratio 3\n",
+ "rc=16;#Compression ratio\n",
+ "\n",
+ "#Calculations\n",
+ "n1=(1-((1/rc**(r-1)*(p1**r-1)/(r*(p1-1)))))*100;#Thermal efficiency of the diesel cycle for cut off ratio 1.25\n",
+ "n2=(1-((1/rc**(r-1)*(p2**r-1)/(r*(p2-1)))))*100;#Thermal efficiency of the diesel cycle for cut off ratio 1.50\n",
+ "n3=(1-((1/rc**(r-1)*(p3**r-1)/(r*(p3-1)))))*100;#Thermal efficiency of the diesel cycle for cut off ratio 2.00\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Thermal efficiency when cut off ratio is 1.25 is (percent) = ',round(n1,1)\n",
+ "print '(b)Thermal efficiency when cut off ratio is 1.50 is (percent) = ',round(n2,1)\n",
+ "print '(c)Thermal efficiency when cut off ratio is 2.00 is (percent) = ',round(n3,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 - pg 1.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Air standard efficiency of the diesel cycle is (percent) = 61.94\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.40\n",
+ "#calculate the Air standard efficiency\n",
+ "r=15.;#Compression ratio of a diesel engine\n",
+ "Q=5.;#Heat supplied upto 5 percent of the stroke\n",
+ "r1=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "p=1+(Q/100)*(r-1);#Cut off ratio\n",
+ "n=(1-((1/r**(r1-1)*(p**r1-1)/(r1*(p-1)))))*100;#Efficiency of diesel cycle in percent\n",
+ "\n",
+ "#Output\n",
+ "print 'Air standard efficiency of the diesel cycle is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 - pg 1.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Air standard efficiency is (percent) = 66.2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.40\n",
+ "#calculate the air standard efficiency\n",
+ "#Input data\n",
+ "r=17.;#Compression ratio of a diesel engine\n",
+ "e=13.5;#Expansion ratio\n",
+ "r1=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "p=r/e;#Cut off ratio\n",
+ "n=(1-((1/r**(r1-1)*(p**r1-1)/(r1*(p-1)))))*100;#Air standard efficiency in percent\n",
+ "\n",
+ "#Output\n",
+ "print 'Air standard efficiency is (percent) = ',round(n,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 - pg 1.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Compression ratio = 14.45\n",
+ "(b)Cut off ratio = 2.49\n",
+ "(c)Ideal efficiency of the diesel cycle is (percent) = 54.78\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.41\n",
+ "#calculate the compression ratio, cut off ratio and Ideal efficiency\n",
+ "#Input data\n",
+ "T1=300.;#Temperature at the beggining of compression stroke in K\n",
+ "T2=873.;#Temperature at the end of compression stroke in K\n",
+ "T3=2173.;#Temperature at the beggining of expansion stroke in K\n",
+ "T4=1123.;#Temperature at the end of expansion stroke in K\n",
+ "r1=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "r=(T2/T1)**(1/(r1-1));#Compression ratio\n",
+ "rho=T3/T2;#Cut off ratio\n",
+ "n=(1-((1/r1)*((T4-T1)/(T3-T2))))*100;#Efficiency of diesel cycle in percent\n",
+ "\n",
+ "#Output data\n",
+ "print '(a)Compression ratio = ',round(r,2)\n",
+ "print '(b)Cut off ratio = ',round(rho,2)\n",
+ "print '(c)Ideal efficiency of the diesel cycle is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 - pg 1.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Pressure at point 1 in the cycle is (bar) = 1.0\n",
+ "(b)Pressure at point 2 & 3 is (bar) = 57.3\n",
+ "(c)Pressure at point 4 is (bar) = 4.87\n",
+ "(d)Temperature at point 1 is (K) = 300.0\n",
+ "(e)Temperature at point 2 is (K0 = 955.0\n",
+ "(f)Temperature at point 3 is (K) = 2955.0\n",
+ "(g)Temperature at point 4 is (K) = 1460.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.42\n",
+ "#calculate the pressure at all points\n",
+ "#Input data\n",
+ "r=18.;#Compression ratio of diesel cycle\n",
+ "Q=2000.;#Heat added in kJ/kg\n",
+ "T1=300.;#Lowest temperature in the cycle in K\n",
+ "p1=1.;#Lowest pressure in the cycle in bar\n",
+ "Cp=1.;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "Cv=0.714;#Specific heat of air at constant volume in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "r1=Cp/Cv;#Isentropic ratio\n",
+ "v1=((1-Cv)*T1)/(p1*10**5);#Initial volume at point 1 in the graph in m**3/kg\n",
+ "v2=v1/r;#Volume at point 2 in m**3/kg\n",
+ "p2=p1*(v1/v2)**(r1);#Pressure at point 2 in bar\n",
+ "T2=T1*(v1/v2)**(r1-1);#Temperature at point 2 in K\n",
+ "T3=(Q/Cp)+T2;#Temperature at point 3 in K\n",
+ "v3=v2*(T3/T2);#Volume at point 3 in K\n",
+ "v4=v1;#Since Constant volume heat rejection in m**3/kg\n",
+ "T4=T3/(v4/v3)**(r1-1);#Temperature at point 4 in K for isentropic expansion\n",
+ "p4=p1*(T4/T1);#Pressure at point 4 in bar\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Pressure at point 1 in the cycle is (bar) = ',p1\n",
+ "print '(b)Pressure at point 2 & 3 is (bar) = ',round(p2,1)\n",
+ "print '(c)Pressure at point 4 is (bar) = ',round(p4,2)\n",
+ "print '(d)Temperature at point 1 is (K) = ',T1\n",
+ "print '(e)Temperature at point 2 is (K0 = ',round(T2,0)\n",
+ "print '(f)Temperature at point 3 is (K) = ',round(T3,0)\n",
+ "print '(g)Temperature at point 4 is (K) = ',round(T4,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16 - pg 1.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Thermal efficiency is (percent) = 61.38\n",
+ "(b)Power developed is (kW) = 405.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.43\n",
+ "#calculate the Thermal efficiency and Power developed\n",
+ "#Input data\n",
+ "r=16.;#Compression ratio for the air standard diesel cycle\n",
+ "Q1=2200.;#Heat added in kJ/kg\n",
+ "T4=1500.;#Temperature at the end of isentropic expansion in K\n",
+ "T1=310.;#Lowest temperature in the cycle in K\n",
+ "m=0.3;#Air flow rate in kg/sec\n",
+ "Cv=0.714;#Specific heat at constant volume in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "Q2=Cv*(T4-T1);#Heat rejected in kJ/kg\n",
+ "n=((Q1-Q2)/Q1)*100;#Efficiency in percent\n",
+ "P=m*(Q1-Q2);#Power developed in kW\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Thermal efficiency is (percent) =',round(n,2)\n",
+ "print '(b)Power developed is (kW) = ',round(P,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 17 - pg 1.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Air standard efficiency of the cycle is (percent) = 55.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.44\n",
+ "#calculate the air standard efficiency of the cycle\n",
+ "#Input data\n",
+ "T1=303;#Temperature at the beginning of compression in K\n",
+ "T2=823;#Temperature at the end of compression in K\n",
+ "T3=3123;#Temperature at the end of heat addition in K\n",
+ "T4=1723;#Temperature at the end of isentropic expansion in K\n",
+ "r=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "n=(1-((T4-T1)/(r*(T3-T2))))*100;#Efficiency of the cycle in percent\n",
+ "\n",
+ "#Output\n",
+ "print 'Air standard efficiency of the cycle is (percent) = ',round(n,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18 - pg 1.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mean effective pressure of the cycle is (bar) = 5.44\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.45\n",
+ "#calculate the Mean effective pressure\n",
+ "#Input data\n",
+ "r=15.;#Compression Ratio of a diesel engine\n",
+ "P1=1.;#Operating Pressure of a diesel engine in bar\n",
+ "r1=1.4;#Isentropic constant\n",
+ "V1=15.;#Volume at the start of compression stroke in m**3\n",
+ "V3=1.8;#Volume at the end of constant Pressure heat addition in m**3\n",
+ "V2=1.;#Volume at the end of isentropic compression stroke in m**3\n",
+ "\n",
+ "#Calculations\n",
+ "Vs=V1-V2;#Swept volume in m**3\n",
+ "V4=V1;#Volume at the end of Isentropic expansion stroke in m**3\n",
+ "P2=P1*(r)**r1;#Pressure at the end of Isentropic compression of air\n",
+ "P3=P2;#Pressure at the end of constant pressure heat addition in bar\n",
+ "P4=P3*(V3/V4)**r1;#Pressure at the end of Isentropic expansion stroke in bar\n",
+ "Pm=(V2/Vs)*(P2*((V3/V2)-1)+(P3*(V3/V2)-P4*(V4/V2))/(r1-1)-(P2-P1*(V1/V2))/(r1-1));#Mean effective pressure in bar\n",
+ " \n",
+ "#Output\n",
+ "print 'Mean effective pressure of the cycle is (bar) = ',round(Pm,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19 - pg 1.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Compression ratio of the engine = 23.454\n",
+ "(b)Air standard efficiency is (percent) = 63.48\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.46\n",
+ "#calculate the compression ratio and air standard efficiency\n",
+ "#Input data\n",
+ "P1=1.5;#Pressure at the 7/8th stroke of compression in bar\n",
+ "P2=16;#Pressure at the 1/8th stroke of compression in bar\n",
+ "n=1.4;#Polytropic index\n",
+ "c=8.;#Cutoff occurs at 8% of the stroke in percentage\n",
+ "\n",
+ "#Calculations\n",
+ "R1=(P2/P1)**(1./n);#Ratio of volumes\n",
+ "R2=(R1-1.)/((7./8)-(R1/8.));#Ratio of stroke volume to the clearance volume\n",
+ "r=1.+R2;#Compression ratio\n",
+ "rho=1+((c/100.)*r);#Cut off ratio\n",
+ "na=(1-((1./r**(n-1))*(((rho**n)-1.)/(n*(rho-1)))))*100;#Air standard efficiency in percentage\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Compression ratio of the engine = ',round(r,3)\n",
+ "print '(b)Air standard efficiency is (percent) = ',round(na,2)\n",
+ "print 'The answers are a bit different due to rounding off error in textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 20 - pg 1.47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The loss in efficiency is (percent) = 2.15\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.47\n",
+ "#calculate the loss in efficiency\n",
+ "#Input data\n",
+ "r=16.;#Compression ratio of diesel engine\n",
+ "r1=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "rho1=1+(r-1)*(6./100);#Cutoff ratio at 6% of stroke\n",
+ "rho2=1+(r-1)*(9./100);#Cutoff ratio at 9% of stroke\n",
+ "n1=(1-(1/r**(r1-1))*(1/r1)*(rho1**r1-1)/(rho1-1))*100;#Efficiency of the cycle at 6% of the stroke in percent\n",
+ "n2=(1-(1/r**(r1-1))*(1/r1)*(rho2**r1-1)/(rho2-1))*100;#Efficiency of the cycle at 9% of the stroke in percent\n",
+ "L=n1-n2;#The loss in efficiency in percent\n",
+ "\n",
+ "#Output \n",
+ "print 'The loss in efficiency is (percent) = ',round(L,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 21 - pg 1.48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Compression ratio = 13.65\n",
+ "(b)Temperature at the end of compression is (K) = 862.0\n",
+ "(c)Temperature at the end of comstant pressure heat addition is (K) = 1410.0\n",
+ "(d)Air standard efficiency is (percent) = 60.84\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.48\n",
+ "#calculate the compression ratio, temperature in all cases\n",
+ "#Input data\n",
+ "P1=1.03;#Pressure at the beginning of compression stroke in bar\n",
+ "T1=303.;#Initial temperature in K\n",
+ "P2=40.;#Maximum pressure in the cycle in bar\n",
+ "Q=550.;#The heat supplied during the cycle in kJ/kg\n",
+ "r=1.4;#Isentropic compression ratio\n",
+ "Cp=1.004;#Specific heat at constant pressure in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "r1=(P2/P1)**(1/r);#Compression ratio\n",
+ "T2=(P2/P1)**((r-1)/r)*T1;#Temperature at the end of compression stroke in K\n",
+ "T3=(Q/Cp)+T2;#Temperature at the end of heat addition in K\n",
+ "rho=T3/T2;#Cut off ratio\n",
+ "n=(1-(1/r1**(r-1))*(1/r)*(rho**r-1)/(rho-1))*100;#Air standard efficiency in percentage\n",
+ "\n",
+ "#Output\\n\n",
+ "print '(a)Compression ratio =',round(r1,2)\n",
+ "print '(b)Temperature at the end of compression is (K) =',round(T2,0)\n",
+ "print '(c)Temperature at the end of comstant pressure heat addition is (K) = ',round(T3,0)\n",
+ "print '(d)Air standard efficiency is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 22 - pg 1.50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The air standard efficiency of an oil engine working on the combustion cycle is (percent) = 56.44\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.50\n",
+ "#calculate the air standard efficiency \n",
+ "#Input data\n",
+ "r=12.;#Compression ratio of an oil engine, working on the combustion cycle\n",
+ "r1=1.4;#Isentropic ratio\n",
+ "P1=1.;#Pressure at the beginning of compression\n",
+ "P3=35.;#Pressure at the end of constant volume heat addition in bar\n",
+ "\n",
+ "#Calculations\n",
+ "rho=1+(1/10.)*(r-1);#Cut off ratio at 1/10th of the stroke\n",
+ "P2=P1*(r)**r1;#Pressure at the end of isentropic compression in bar\n",
+ "a=P3/P2;#Pressure ratio\n",
+ "n=(1-(1/r**(r1-1))*(a*rho**r1-1)/((a-1)+(r1*a*(rho-1))))*100;#Air standard efficiency in percent\n",
+ "\n",
+ "#Output\n",
+ "print 'The air standard efficiency of an oil engine working on the combustion cycle is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 23 - pg 1.51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Temperature at the end of constant volume heat addition is (C) = 938.85\n",
+ "(b)Cut off ratio = 1.38\n",
+ "The answer for cut off ratio is wrong in textbook. It doesnt convert C to kelvins\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.51\n",
+ "#calculate the temperature and cut off ratio\n",
+ "#Input data\n",
+ "P1=1.;#Pressure at the beginning of compression stroke of an oil engine working on a air standard dual cycle in bar\n",
+ "T1=303.;#Temperature at the beginning of compression stroke in K\n",
+ "P3=40.;#The maximum pressure reached in bar\n",
+ "T4=1673.;#Maximum temperature reached in K\n",
+ "Cp=1.004;#Specific heat at constant pressure in kJ/kg K\n",
+ "Cv=0.717;#Specific heat at constant volume in kJ/kg K\n",
+ "r1=10.;#Compression ratio\n",
+ "\n",
+ "#Calculations\n",
+ "P4=P3;#Pressure at the start of constant pressure heat addition in bar\n",
+ "r=Cp/Cv;#Isentropic ratio\n",
+ "T2=T1*r1**(r-1);#Temperature at the end of compression stroke in K\n",
+ "P2=P1*r1**r;#Pressure at the end of compression stroke in bar\n",
+ "T3=T2*(P3/P2);#Temperature at the end of constant volume heat addition in K\n",
+ "rho=T4/T3;#Cut off ratio\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Temperature at the end of constant volume heat addition is (C) = ',T3-273.15\n",
+ "print '(b)Cut off ratio = ',round(rho,2)\n",
+ "print 'The answer for cut off ratio is wrong in textbook. It doesnt convert C to kelvins'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 24 - pg 1.52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The work done per kg of air is (kJ) = 412.9\n",
+ "(b)Cycle efficiency is (percent) = 58.07\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.52\n",
+ "#calculate the work done and cycle efficiency\n",
+ "#Input data\n",
+ "P1=1.;#pressure at the beginning of compression stroke in bar\n",
+ "T1=298.;#Temperature at the beginning of compression stroke in K\n",
+ "P3=38.;#Pressure at the end of constant volume heat addition in bar\n",
+ "T4=1573.;#Temperature at the end of constant volume heat addition in K\n",
+ "r=9.5;#Compression ratio\n",
+ "Cp=1.004;#Specific heat of air at constant pressure\n",
+ "Cv=0.717;#Specific heat of air at constant volume\n",
+ "\n",
+ "#Calculations\n",
+ "r1=Cp/Cv;#Isentropic ratio\n",
+ "T2=T1*r**(r1-1);#Temperature at the end of compression stroke in K\n",
+ "P2=P1*r**r1;#Pressure at the end of compression stroke in bar\n",
+ "T3=T2*(P3/P2);#Temperature at the end of constant volume heat addition in K\n",
+ "rho=T4/T3;#Cut off ratio\n",
+ "T5=T4*(rho/r)**(r1-1);#Temperature at the end of expansion stroke in K\n",
+ "Qs=Cv*(T3-T2)+Cp*(T4-T3);#Heat supplied per kg in kJ\n",
+ "Qr=Cv*(T5-T1);#Heat rejected per kg in kJ\n",
+ "W=Qs-Qr;#Work done per kg of air in kJ\n",
+ "n=(W/Qs)*100;#Efficiency of the air standard dual cycle in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The work done per kg of air is (kJ) = ',round(W,1)\n",
+ "print '(b)Cycle efficiency is (percent) = ',round(n,2)\n",
+ "print 'The answers are a bit different due to rounding off error in textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 25 - pg 1.53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Pressure at the end of compression stroke is (bar) = 26.9\n",
+ "(b)Temperature at the end of compression stroke is (K) = 943.2\n",
+ "(c)Temperature at the end of constant volume heat addition is (K) = 2278.1\n",
+ "(d)Temperature at the end of constant pressure heat addition is (K) = 2968.22\n",
+ "(e)Temperature at the end of expansion stroke is (K) = 1287.47\n",
+ "(e)Pressure at the end of expansion stroke is (bar) = 3.5\n",
+ "(f)Efficiency of the cycle is (percent) = 60.04\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.53\n",
+ "#calculate the pressure, Temperature in all cases and Efficiency\n",
+ "#Input data\n",
+ "r=10.5;#Compression ratio\n",
+ "P3=65.;#Maximum pressure in bar\n",
+ "qs=1650.;#Heat supplied in kJ/kg\n",
+ "P1=1.;#Pressure at the beginning of compression stroke in bar\n",
+ "T1=368.;#Temperature at the beginning of compression stroke in K\n",
+ "Cp=1.004;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "Cv=0.717;#Specific heat of air at constant volume in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "P4=P3;#Pressure at the end of constant volume heat addition in bar\n",
+ "r1=Cp/Cv;#Compression ratio\n",
+ "P2=P1*r**r1;#Pressure at the end of compression stroke in bar\n",
+ "T2=T1*r**(r1-1);#Temperature at the end of compression stroke in K\n",
+ "T3=T2*(P3/P2);#Temperature at the end of constant volume heat addition in K\n",
+ "qv=Cv*(T3-T2);#Heat supplied at constant volume in kJ/kg\n",
+ "qp=qs-qv;#Heat supplied at constant pressure in kJ/kg\n",
+ "T4=(qp/Cp)+T3;#Temperature at the end of constant volume heat addition in K\n",
+ "rho=T4/T3;#Cut off ratio\n",
+ "T5=T4*(rho/r)**(r1-1);#Temperature at the end of expansion stroke in K\n",
+ "P5=P4*(rho/r)**r1;#Pressure at the end of expansion stroke in K\n",
+ "q=Cv*(T5-T1);#Heat rejected in kJ/kg\n",
+ "n=((qs-q)/qs)*100;#Efficiency of the cycle in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Pressure at the end of compression stroke is (bar) = ',round(P2,1)\n",
+ "print '(b)Temperature at the end of compression stroke is (K) = ',round(T2,1)\n",
+ "print '(c)Temperature at the end of constant volume heat addition is (K) = ',round(T3,2)\n",
+ "print '(d)Temperature at the end of constant pressure heat addition is (K) = ',round(T4,2)\n",
+ "print '(e)Temperature at the end of expansion stroke is (K) = ',round(T5,2)\n",
+ "print '(e)Pressure at the end of expansion stroke is (bar) = ',round(P5,2)\n",
+ "print '(f)Efficiency of the cycle is (percent) = ',round(n,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 26 - pg 1.55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The air standard efficiency is (percent) = 44.88\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.55\n",
+ "#calculate the standard efficiency\n",
+ "#Input data\n",
+ "r=8.5;#Compression ratio\n",
+ "e=5.5;#Expansion ratio\n",
+ "P1=1;#Pressure at the beginning of compression stroke in bar\n",
+ "T1=313.;#Temperature at the beginning of compression stroke in K\n",
+ "n=1.3;#polytropic constant\n",
+ "Cp=1.004;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "Cv=0.717;#Specific heat of air at constant volume in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "rho=r/e;#Cut off ratio\n",
+ "T2=T1*r**(n-1);#Temperature at the end of compression stroke in K\n",
+ "T3=(2*Cv*T2)/(2*Cv-Cp*rho+1);#Temperature at the end of constant volume heat addition in K\n",
+ "T4=rho*T3;#Temperature at the end of constant pressure heat addition in K\n",
+ "a=T3/T2;#Pressure ratio i.e.,P3/P2\n",
+ "n1=(1-(1/r**(n-1))*(a*rho**n-1)/((a-1)+(n*a*(rho-1))))*100;#Air standard efficiency in percent\n",
+ "\n",
+ "#Output\n",
+ "print 'The air standard efficiency is (percent) = ',round(n1,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 27 - pg 1.56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The ideal thermal efficiency is (percent) = 59.18\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.56\n",
+ "#calculate the ideal thermal efficiency\n",
+ "#Input data\n",
+ "P1=1;#Initial pressure in a compression engine working on a dual combustion engine in bar\n",
+ "T1=300.;#Initial Temperature in K\n",
+ "P2=25.;#Pressure at the end of compression stroke in bar\n",
+ "Q=400.;#Heat supplied per kg of air during constant volume heating in kJ/kg\n",
+ "P5=2.6;#Pressure at the end of isentropic expansion in bar\n",
+ "Cp=1.005;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "Cv=0.715;#Specific heat of air at constant volume in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "r=Cp/Cv;#Isentropic index\n",
+ "r1=(P2/P1)**(1/r);#Compression ratio\n",
+ "T2=T1*(r1)**(r-1);#Temperature at the end of compression stroke in K\n",
+ "T3=(Q/Cv)+T2;#Temperature at the end of constant volume heat addition in K\n",
+ "a=T3/T2;#Pressure ratio\n",
+ "P3=a*P2;#Pressure ratio at the end of constant volume heat addition in bar\n",
+ "P4=P3;#Pressure at the end of constant pressure heat addition in bar\n",
+ "x=(P5/P4)**(1/r);#Ratio of volume at the end of constant pressure heat addition to the volume at the end of isentropic expansion\n",
+ "rho=x*(r1);#Cut off ratio\n",
+ "n=(1-(1/r1**(r-1))*(a*rho**r-1)/((a-1)+(r*a*(rho-1))))*100;#Air standard efficiency in percent of a dual combustion engine\n",
+ "\n",
+ "#Output\n",
+ "print 'The ideal thermal efficiency is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 28 - pg 1.58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Temperature at the end of compression stroke is (K) = 914.0\n",
+ "(b)Temperature at the end of constant volume heat addition is (K) = 1828.0\n",
+ "(c)Temperature at the end of constant pressure heat addition is (K) = 3655.0\n",
+ "(d)Temperature at the end of isentropic expansion process is (K) = 1678.0\n",
+ "(e)Efficiency of the cycle is (percent) = 60.82\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.58\n",
+ "#calculate the temperature in all cases\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of an enfine working on a dual combustion cycle in bar\n",
+ "T1=318.;#Initial temperature before compression in K\n",
+ "r1=14.;#Compression ratio\n",
+ "r=1.4;#Isentropic index\n",
+ "a=2.;#Pressure ratio in the compression process\n",
+ "rho=2.;#Cut off ratio \n",
+ "\n",
+ "#Calculations\n",
+ "T2=T1*r1**(r-1);#Temperature at the end of compression stroke in K\n",
+ "T3=T2*a;#Temperature at the end of constant volume heat addition in K\n",
+ "T4=rho*T3;#Temperature at the end of constant pressure heat addition in K\n",
+ "T5=T4*(rho/r1)**(r-1);#Temperature at the end of isentropic compression in K\n",
+ "n=(1-((T5-T1)/(r*(T4-T3)+(T3-T2))))*100;#Efficiency of an engine working on a dual combustion cycle in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Temperature at the end of compression stroke is (K) = ',round(T2,0)\n",
+ "print '(b)Temperature at the end of constant volume heat addition is (K) = ',round(T3,0)\n",
+ "print '(c)Temperature at the end of constant pressure heat addition is (K) = ',round(T4,0)\n",
+ "print '(d)Temperature at the end of isentropic expansion process is (K) = ',round(T5,0)\n",
+ "print '(e)Efficiency of the cycle is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 29 - pg 1.59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(1)Pressure ratio = 1.465\n",
+ "(2)Cut off ratio = 1.7\n",
+ "(3)Heat supplied per cycle is (kJ) = 15.0\n",
+ "(4)Heat rejected per cycle is (kJ) = 5.54\n",
+ "(5)Work done per cycle is (kJ) = 9.45\n",
+ "(6)Thermal efficiency of the cycle is (percent) = 63.0\n",
+ "(7)Mass of air contained in the cylinder is (kg) = 0.01204\n",
+ "(8)Mean effective pressure is (bar) = 9.45\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.59\n",
+ "#calculate the pressure ratio, cut off ratio, heat supplied, heat rejected, Work done, Thermal efficiency, Mass of air, Mean effective pressure\n",
+ "#Input data\n",
+ "r=15.;#Compression ratio\n",
+ "Vs=0.01;#Stroke volume in m**3\n",
+ "P1=1.;#Initial pressure in bar\n",
+ "T1=310.;#Initial temperature in K\n",
+ "P3=65.;#Pressure in constant pressure heat addition stroke in bar\n",
+ "Cp=1.;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "Cv=0.714;#Specific heat of air at constant volume in kJ/kg K\n",
+ "R=287.;#Molar gas constant\n",
+ "\n",
+ "#Calculations\n",
+ "r1=Cp/Cv;#Isentropic index\n",
+ "P2=P1*(r)**r1;#Pressure at the end of compression stroke in bar\n",
+ "a=P3/P2;#Pressure ratio\n",
+ "rho=1+((5./100)*(r-1))\n",
+ "V2=Vs/(r-1);#Volume at the end of compression stroke in m**3\n",
+ "V1=Vs+V2;#Initial volume in m**3\n",
+ "m=P1*10**5*V1/(R*T1);#Mass of air contained in the cylinder in kg\n",
+ "T2=T1*r**(r1-1);#Temperature at the end of compression stroke in K\n",
+ "a=P3/P2;#Pressure ratio\n",
+ "T3=T2*a;#Temperature at the end of constant volume heat addition in K\n",
+ "T4=T3*rho;#Temperature at the end of constant pressure heat addition in K\n",
+ "T5=T4/(r/rho)**(r1-1);#Temperature at the end of isentropic expansion in K\n",
+ "Qs=(Cv*(T3-T2)+Cp*(T4-T3))*m;#Heat supplied in kJ\n",
+ "Qr=m*Cv*(T5-T1);#Heat rejected in kJ\n",
+ "W=Qs-Qr;#Work done per cycle in kJ\n",
+ "n=(W/Qs)*100;#Efficiency of the cycle in percent\n",
+ "Mep=(W/Vs)/100;#Mean effective pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print '(1)Pressure ratio = ',round(a,3)\n",
+ "print '(2)Cut off ratio = ',rho \n",
+ "print '(3)Heat supplied per cycle is (kJ) = ',round(Qs,0)\n",
+ "print '(4)Heat rejected per cycle is (kJ) = ',round(Qr,2)\n",
+ "print '(5)Work done per cycle is (kJ) = ',round(W,2)\n",
+ "print '(6)Thermal efficiency of the cycle is (percent) = ',round(n,0)\n",
+ "print '(7)Mass of air contained in the cylinder is (kg) = ',round(m,5)\n",
+ "print '(8)Mean effective pressure is (bar) = ',round(Mep,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 30 - pg 1.62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Thermal efficiency of the turbine unit is (percent) = 38.56\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.62\n",
+ "#calculate the Thermal efficiency\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of air received by gas turbine plant in bar\n",
+ "T1=310.;#Initial tamperature in K\n",
+ "P2=5.5;#Pressure at the end of compression in bar\n",
+ "r=1.4;#isentropic index\n",
+ "\n",
+ "#Calculations\n",
+ "rp=P2/P1;#pressure ratio\n",
+ "n=(1-(1/rp)**((r-1)/r))*100;#Thermal efficiency of the turbine in percent\n",
+ "\n",
+ "#Output data\n",
+ "print 'Thermal efficiency of the turbine unit is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 31 - pg 1.62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Power developed by the turbine assembly per kg of air supplied per second is (kW) = 242.51\n",
+ "The answer is a bit different from textbook due to rounding off error \n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.62\n",
+ "#calculate the Power developed\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of a simple closed cycle gas turbine plant in bar\n",
+ "T1=298.;#Initial temperature in K\n",
+ "P2=5.1;#Pressure of gas after compression in bar\n",
+ "T3=1123.;#Temperature at the end of compression in K\n",
+ "P4=1.;#Pressure of hot air after expansion in the turbine in bar\n",
+ "r=1.4;#Isentropic constant\n",
+ "Cp=1.005;#Specific heat of air in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "P3=P2;#Pressure at the end of constant pressure stroke\n",
+ "T2=T1*(P2/P1)**((r-1)/r);#Temperature at the end of process 1-2 in K\n",
+ "T4=T3*(P4/P3)**((r-1)/r);#Temperature at the end of process 3-4 in K\n",
+ "Wt=Cp*(T3-T4);#Work done by the turbine in kJ/kg\n",
+ "Wc=Cp*(T2-T1);#Work required by the compressor in kJ/kg\n",
+ "W=Wt-Wc;#Net work done by the turbine in kJ/kg\n",
+ "P=1*W;#Power developed by the turbine assembly per kg per second in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'Power developed by the turbine assembly per kg of air supplied per second is (kW) = ',round(P,2)\n",
+ "print 'The answer is a bit different from textbook due to rounding off error '\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 32 - pg 1.63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The maximum temperature of the cycle is (K) = 1148.97\n",
+ "(b)Cycle efficiency is (percent) = 41.42\n",
+ "The answers are a bit different from textbook due to rounding off error \n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.63\n",
+ "#calculate the maximum temperature and cycle efficiency\n",
+ "#Input data\n",
+ "P1=1.;#The pressure of air entering the compressor of a gas turbine plant operating on Brayton cycle in bar\n",
+ "T1=293.;#Initial temperature in K\n",
+ "r=6.5;#Pressure ratio of the cycle\n",
+ "r1=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "T2=T1*(r)**((r1-1)/r1);#Temperature at the end of compression in K\n",
+ "T4=2.3*(T2-T1)/0.708;#Temperature at point 4 in K\n",
+ "T3=T4*(r)**((r1-1)/r1);#Maximum temperature in K\n",
+ "n=(1-((T4-T1)/(T3-T2)))*100;#Turbine plant efficiency in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The maximum temperature of the cycle is (K) = ',round(T3,2)\n",
+ "print '(b)Cycle efficiency is (percent) = ',round(n,2)\n",
+ "print 'The answers are a bit different from textbook due to rounding off error '\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 33 - pg 1.64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The net power output of the installation is (kW) = 152.54\n",
+ "(b)Air fuel ratio is 108.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.64\n",
+ "#calculate the net power an dair fuel ratio\n",
+ "#Input data\n",
+ "P1=1.;#Pressure in an oil gas turbine installation in bar\n",
+ "T1=298.;#Initial Temperature in K\n",
+ "P2=4.;#Pressure after compression in bar\n",
+ "CV=42100.;#Calorific value of oil in kJ/kg\n",
+ "T3=813.;#The temperature reached after compression in K\n",
+ "m=1.2;#Air flow rate in kg/s\n",
+ "Cp=1.05;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "r=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "r1=P2/P1;#Pressure ratio\n",
+ "T2=(r1)**((r-1)/r)*T1;#Temperature at the end of compression stroke in K\n",
+ "T4=T3/(r1)**((r-1)/r);#Temperature at the end of isentropic expansion in K\n",
+ "Wt=m*Cp*(T3-T4);#Work done by the turbine in kJ/s or kW\n",
+ "Wc=m*Cp*(T2-T1);#Work to be supplied to the compressor in kJ/s or kW\n",
+ "Wn=Wt-Wc;#Net work done by the turbine unit in kW\n",
+ "qs=m*Cp*(T3-T2);#Heat supplied by the oil in kJ/s\n",
+ "M=qs/CV;#Mass of fuel burnt per second in kg/s\n",
+ "a=m/M;#Air fuel ratio\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The net power output of the installation is (kW) = ',round(Wn,2)\n",
+ "print '(b)Air fuel ratio is ',round(a,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 34 - pg 1.66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The net power of the plant per kg of air/s is (kW) = 324.42\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.66\n",
+ "#calculate the net power\n",
+ "#Input data\n",
+ "T1=300.;#Minimum temperature of the plant containing a two stage compressor with perfect intercooling and a single stage turbine in K\n",
+ "T5=1100.;#Maximum temperature of the plant in K\n",
+ "P1=1.;#Initial Pressure in bar\n",
+ "P5=15.;#Final pressure in bar\n",
+ "Cp=1.05;#Specific heat of air in kJ/kg K\n",
+ "r=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "P6=P1;#Pressure at 6 in bar\n",
+ "P3=(P1*P5)**(1./2);#The intermediate pressure for cooling in bar\n",
+ "P2=P3;#Pressure at point 2 in bar\n",
+ "T2=T1*(P2/P1)**((r-1)/r);#Temperature at the end of process 1-2\n",
+ "T3=T1;#Intermediate temperature in K\n",
+ "T4=1.473*T3;#Temperature at point 4 in K\n",
+ "T6=T5/(P5/P6)**((r-1)/r);#Temperature at point 6 in k\n",
+ "Wt=Cp*(T5-T6);#Work done by the turbine per kg of air in kJ/s\n",
+ "Wc=Cp*(T4-T3)+Cp*(T2-T1);#Work done by the compressor per kg of air in kJ/s\n",
+ "Wn=Wt-Wc;#Net work done in kJ/s\n",
+ "Pn=Wn;#Net power developed in kW\n",
+ "\n",
+ "#Output \n",
+ "print 'The net power of the plant per kg of air/s is (kW) = ',round(Pn,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 35 - pg 1.67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum power that can be obtained from turbine installation is (kW) = 366.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.67\n",
+ "#calculate the maximum power\n",
+ "#Input data\n",
+ "P1=1.;#Initial Pressure of a gas turbine power plant in bar\n",
+ "P2=8.;#Final pressure in bar\n",
+ "T1=300.;#Initial temperature in K\n",
+ "T5=850.;#Temperature of air expanded in the turbine in K\n",
+ "m=1.8;#Mass of air circulated per second in kg\n",
+ "Cp=1.05;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "r=1.4;#Ratio of specific heat\n",
+ "\n",
+ "#Calculations\n",
+ "P4=(P1*P2)**(0.5);#Pressure for maximum power output in bar\n",
+ "P3=P2;#Pressure after the constant pressure process in bar\n",
+ "T3=T5;#For reheating condition Temperature in K\n",
+ "T2=T1*(P2/P1)**((r-1)/r);#Temperature at the end of constant entropy process in K\n",
+ "T4=T3/((P3/P4)**((r-1)/r));#Temperature after the process 3-4 in K\n",
+ "T6=T4;#Temperature at the end of process 5-6 in K\n",
+ "Wt=m*Cp*((T3-T4)+(T5-T6));#Work done by the turbine in kJ/s\n",
+ "Wc=m*Cp*(T2-T1);#Work absorbed by the compressor in kJ/s\n",
+ "P=Wt-Wc;#Power that can be obtained from gas turbine installation in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'The maximum power that can be obtained from turbine installation is (kW) = ',round(P,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 36 - pg 1.69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Mass of fluid to be circulated in the turbine is (kg/s) = 1.446\n",
+ "(b)The amount of heat supplied per second from the external source is (kJ/s) = 1212.2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.69\n",
+ "#calculate the mass of fluid and amount of heat supplied\n",
+ "#Input data\n",
+ "P1=1.5;#Pressure at the inlet of the low pressure compressor in bar\n",
+ "T1=300.;#Temperature at the inlet of the low pressure compressor in K\n",
+ "P5=9.;#Maximum pressure in bar\n",
+ "T5=1000.;#Maximum temperature in K\n",
+ "P=400.;#Net power developed by the turbine in kW\n",
+ "Cp=1.0;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "r=1.4;#Ratio of specific heat \n",
+ "\n",
+ "#Calculations\n",
+ "P8=P1;#For perfect intercooling and perfect reheating in bar\n",
+ "P4=P5;#For perfect intercooling and perfect reheating in bar\n",
+ "P2=(P1*P4)**0.5;#Pressure at the end of Isentropic compression in LP compressor in bar\n",
+ "P6=P2;#Pressure at the end of process 5-6 in bar\n",
+ "T2=T1*(P2/P1)**((r-1)/r);#Temperature at the end of isentropic compression in K\n",
+ "T3=T1;#For perfect intercooling in K\n",
+ "T4=T2;#For perfect intercooling in K\n",
+ "T6=T5/(P5/P6)**((r-1)/r);#Temperature at the end of process 5-6 in K\n",
+ "T7=T5;#Temperature in K\n",
+ "T8=T6;#Temperature in K\n",
+ "Wt=Cp*((T5-T6)+(T7-T8));#Work done by the turbine in kg/s\n",
+ "Wc=Cp*((T2-T1)+(T4-T3));#Work absorbed by the compressor in kJ/s\n",
+ "Wn=Wt-Wc;#Net work output in kJ/s\n",
+ "m=P/Wn;#Mass of fluid flow per second in kg/s\n",
+ "qs=m*Cp*((T5-T4)+(T7-T6));#Heat supplied from the external source in kJ/s\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Mass of fluid to be circulated in the turbine is (kg/s) = ',round(m,3)\n",
+ "print '(b)The amount of heat supplied per second from the external source is (kJ/s) = ',round(qs,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 37 - pg 1.70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Mass of air circulating in the installation is (kg/s) = 4.24\n",
+ "(b)Heat supplied by the heating chamber is (kJ/s) = 2414.2\n",
+ "The answers are a bit different from textbook due to rounding off error \n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.70\n",
+ "#calculate the mass of air and heat supplied\n",
+ "#Input data\n",
+ "T1=293.;#Temperature of a constant pressure open cycle gas turbine plant in K\n",
+ "T3=1043.;#The maximum temperature in K\n",
+ "a=6.5;#The pressure ratio\n",
+ "P=1000.;#Power developed by the installation in kW\n",
+ "Cp=1.05;#Specific heat at constant pressure in kJ/kg K\n",
+ "r=1.4;#Isentropic ratio\n",
+ "\n",
+ "#Calculations\n",
+ "T2=T1*a**((r-1)/r);#Temperature after the isentropic compression stroke in K\n",
+ "T4=T3/a**((r-1)/r);#Temperature after the isentropic expansion process in K\n",
+ "Wt=Cp*(T3-T4);#Work done by the turbine per kg of air per second in kJ\n",
+ "Wc=Cp*(T2-T1);#Work absorbed by the compressor per kg of air per second in kJ\n",
+ "Wn=Wt-Wc;#Net work output in kJ/s\n",
+ "m=P/Wn;#Mass of fluid circulated per second in kg/s\n",
+ "Q=m*Cp*(T3-T2);#Heat supplied by the heating chamber in kJ/s\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Mass of air circulating in the installation is (kg/s) = ',round(m,2)\n",
+ "print '(b)Heat supplied by the heating chamber is (kJ/s) = ',round(Q,1)\n",
+ "print 'The answers are a bit different from textbook due to rounding off error '"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 38 - pg 1.72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 41,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(1)Overall efficiency of the turbine is (percentage) = 21.0\n",
+ "(2)Mass of air circulated by the turbine is (kg) = 23.85\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.72\n",
+ "#calculate the Overall efficiency and Mass of air circulated\n",
+ "#Input data\n",
+ "a=6.;#Pressure ratio of a gas turbine plant\n",
+ "T1=293.;#Inlet temperature of air in K\n",
+ "T3=923.;#Maximum temperature of the cycle in K\n",
+ "P=2000.;#Power developed in the cycle in kW\n",
+ "nc=85.;#Efficiency of the compressor in percentage\n",
+ "nt=85.;#Efficiency of the turbine in percentage\n",
+ "Cp=1.;#Specific heat of gas at constant pressure in kJ/kg K\n",
+ "Cv=0.714;#Specific heat of gas at constant volume in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "r=Cp/Cv;#Ratio of specific heats\n",
+ "T2a=a**((r-1)/r)*T1;#Temperature at 2' in K\n",
+ "T2=((T2a-T1)/(nc/100))+T1;#Temperature at point 2 in K\n",
+ "T4a=T3/a**((r-1)/r);#Temperature at the point 4' in K\n",
+ "T4=T3-((T3-T4a)*(nt/100));#Temperature at the point 4 in K\n",
+ "Wt=Cp*(T3-T4);#Work done by the turbine per kg of air in kJ\n",
+ "Wc=Cp*(T2-T1);#Work done by the compressor per kg of air in kJ\n",
+ "Wn=Wt-Wc;#Net work output of the turbine per kg of air in kJ\n",
+ "qA=Cp*(T3-T2);#Heat supplied per kg of air in kJ\n",
+ "n=(Wn/qA)*100;#Overall efficiency of the turbine plant in percentage\n",
+ "m=P/Wn;#Mass of air circulated per second in kg\n",
+ "\n",
+ "#Output\n",
+ "print '(1)Overall efficiency of the turbine is (percentage) = ',round(n,0)\n",
+ "print '(2)Mass of air circulated by the turbine is (kg) = ',round(m,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 39 - pg 1.73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The isentropic efficiency of the turbine is (percent) = 88.93\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.73\n",
+ "#calculate the isentropic efficiency\n",
+ "#Input data\n",
+ "T1=293.;#Initial temperature of a gas turbine plant in K\n",
+ "P1=1.;#Initial pressure in bar\n",
+ "P2=4.5;#Pressure after the compression in bar\n",
+ "nc=80.;#Isentropic efficiency of a compressor in percentage\n",
+ "T3=923.;#Temperature of the gas whose properties may be assumed to resemble with those of air in the combustion chamber in K\n",
+ "deltaP=0.1;#Pressure drop in a combustion chamber in bar\n",
+ "nt=20.;#Thermal efficiency of the plant in percentage\n",
+ "r=1.4;#Isentropic index\n",
+ "P4=1.;#Pressure at point 4 in bar\n",
+ "\n",
+ "#Calculations\n",
+ "P3=P2-deltaP;#Pressure at point 3 in bar\n",
+ "T21=T1*(P2/P1)**((r-1)/r);#Temperature after the compression process in K\n",
+ "T2=(T21-T1)/(nc/100)+T1;#Temperature at the point 2 in K\n",
+ "T41=T3/(P3/P4)**((r-1)/r);#Temperature at the end of expansion process in K\n",
+ "Ac=T2-T1;#Work done by the compressor per kg of air per specific heat at constant pressure Ac=Wc/Cp\n",
+ "At=T3;#Work done by the turbine per kg of air per specific heat at constant pressure At=Wt/Cp\n",
+ "An=At-Ac;#Net work done per kg of air\n",
+ "Bs=T3-T2;#Heat supplied per kg of air per specific heat at constant pressure Bs=qs/Cp;qs=heat supplied\n",
+ "T4=An-((nt/100)*Bs);#Temperature at point 4 in K\n",
+ "nT=((T3-T4)/(T3-T41))*100;#Isentropic efficiency of the turbine in percentage\n",
+ "\n",
+ "#Output\n",
+ "print 'The isentropic efficiency of the turbine is (percent) = ',round(nT,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 40 - pg 1.75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Overall efficiency of the plant is (percent) = 14.31\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.75\n",
+ "#calculate the Overall efficiency\n",
+ "#Input data\n",
+ "P1=1.;#Pressure of air received by the gas turbine plant in bar\n",
+ "T1=300.;#Initial Temperature in K\n",
+ "P2=5.;#Pressure of air after compression in bar\n",
+ "T3=850.;#Temperature of air after the compression in K\n",
+ "nc=80.;#Efficiency of the compressor in percent\n",
+ "nt=85.;#Efficiency of the turbine in percent\n",
+ "r=1.4;#Isentropic index of gas\n",
+ "P41=1.;#Pressure at the point 41 in bar\n",
+ "Cp=1.05;#Specific heat of the gas at constant pressure in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "P3=P2;#Since 2-3 is constant pressure process in bar\n",
+ "T21=T1*(P2/P1)**((r-1)/r);#Temperature at the point 21 on the curve in K\n",
+ "T2=(T21-T1)/(nc/100)+T1;#Temperature at the point 2 in K\n",
+ "T41=T3/(P3/P41)**((r-1)/r);#Temperature at the point 41 in K\n",
+ "T4=T3-((nt/100)*(T3-T41));#Temperature of gas at the point 4 in K\n",
+ "Wt=Cp*(T3-T4);#work done by the turbine in kJ/kg of air\n",
+ "Wc=Cp*(T2-T1);#Work done by the compressor in kJ/kg of air\n",
+ "Wn=Wt-Wc;#Net work done by the plant in kJ\n",
+ "nt=(Wn/(Cp*(T3-T2)))*100;#Thermal efficiency of the plant in percentage \n",
+ "\n",
+ "#Output\n",
+ "print 'Overall efficiency of the plant is (percent) = ',round(nt,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 41 - pg 1.76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The overall efficiency of the plant is (percent) = 20.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 1.76\n",
+ "#calculate the overall efficiency\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of a gas turbine plant in bar\n",
+ "T1=310.;#Initial temperature in K\n",
+ "P2=4.;#Pressure of air after compressing in a rotary compressor in bar\n",
+ "P3=P2;#Constant pressure process\n",
+ "P41=P1;#Since 1-41 is a constant pressure process in bar\n",
+ "T3=900.;#Temperature of air at the point 3 in constant process in K\n",
+ "nc=80.;#Efficiency of the compressor in percentage\n",
+ "nt=85.;#Efficiency of the turbine in percentage\n",
+ "E=70.;#Effectiveness of the plant in percentage\n",
+ "r=1.4;#Isentropic index\n",
+ "Cp=1.;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "T21=T1*(P2/P1)**((r-1)/r);#Temperature at the point 21 in the temperature versus entropy graph in K\n",
+ "T2=T1+((T21-T1)/(nc/100));#Temperature of air after the compression process in K\n",
+ "T41=T3/((P3/P41)**((r-1)/r));#Temperature at the point 41 after the isentropic expansion process in K\n",
+ "T4=T3-((T3-T41)*(nt/100));#Temperature at the point 4 in K\n",
+ "Wt=Cp*(T3-T4);#Work done by the turbine in kJ\n",
+ "Wc=Cp*(T2-T1);#Work done by the compressor in kJ\n",
+ "Wn=Wt-Wc;#Net work done in kJ\n",
+ "qs=Cp*(T3-T2);#Heat supplied in kJ\n",
+ "qa=Cp*(T4-T2);#Heat available in the exhaust gases in kJ\n",
+ "H=qa*(E/100);#Actual heat recovered from the exhaust gases in the heat exchanger in kJ\n",
+ "Hs=qs-(H);#Heat supplied by the combustion chamber in kJ\n",
+ "nt=(Wn/Hs)*100;#Thermal efficiency of the gas turbine plant with heat exchanger in percent\n",
+ "\n",
+ "#Output \n",
+ "print 'The overall efficiency of the plant is (percent) = ',round(nt,1)\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/Thermal_Engineering_by_K_K_Ramalingam/Chapter10.ipynb b/Thermal_Engineering_by_K_K_Ramalingam/Chapter10.ipynb new file mode 100755 index 00000000..b7a9f72f --- /dev/null +++ b/Thermal_Engineering_by_K_K_Ramalingam/Chapter10.ipynb @@ -0,0 +1,419 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10 - Refrigeration and Air Conditioning"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 10.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Power rating of the compressor-motor unit if the cop of the plant is 2.1 is (kW) = 40.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 10.42\n",
+ "#calculate the Power rating of compressor-motor\n",
+ "#Input data\n",
+ "T1=273.;#The temperature of ice in K\n",
+ "T2=298.;#Temperature of water at room in K\n",
+ "COP=2.1;#Cop of the plant\n",
+ "ne=90.;#Overall electrochemical efficiency in percentage\n",
+ "w=15.;#Weight of ice produced per day in tonnes\n",
+ "cw=4.187;#Specific heat of water in kJ/kg degrees celcius\n",
+ "Li=335.;#Latent heat of ice in kJ/kg\n",
+ "mi=1.;#Mass of ice produced at 0 degrees celcius\n",
+ "\n",
+ "#Calculations\n",
+ "m=(w*1000.)/(24*60);#Mass of ice produced in kg/min\n",
+ "h=(mi*cw*(T2-T1))+Li;#Heat extracted from 1kg of water at 25 degrees celcius to produce 1kg of ice at 0 degrees celcius in kJ/kg\n",
+ "Q=m*h;#Total heat extracted in kJ\n",
+ "W=Q/COP;#Work done by the compressor in kJ/kg\n",
+ "P=W/(60.*(ne/100));#Power of compressor in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'Power rating of the compressor-motor unit if the cop of the plant is 2.1 is (kW) = ',round(P,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 10.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The refrigeration capacity of the plant is (TR) = 0.541\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 10.43\n",
+ "#calculate the refrigeration capacity\n",
+ "#Input data\n",
+ "m=400.;#Mass of fruits supplied to a cold storage in kg\n",
+ "T1=293.;#Temperature at which fruits are stored in K\n",
+ "T2=268.;#Temperature of cold storage in K\n",
+ "t=8.;#The time untill which fruits are cooled in hours\n",
+ "hfg=105.;#Latent heat of freezing in kJ/kg\n",
+ "Cf=1.25;#Specific heat of fruit\n",
+ "TR=210.;#One tonne refrigeration in kJ/min\n",
+ "\n",
+ "#Calculations\n",
+ "Q1=m*Cf*(T1-T2);#Sensible heat in kJ\n",
+ "Q2=m*hfg;#Latent heat of freezing in kJ\n",
+ "Q=Q1+Q2;#Heat removed from fruits in 8 hrs\n",
+ "Th=(Q1+Q2)/(t*60);#Total heat removed in one minute in kJ/kg\n",
+ "Rc=Th/TR;#Refrigerating capacity of the plant in TR\n",
+ "\n",
+ "#Output\n",
+ "print 'The refrigeration capacity of the plant is (TR) = ',round(Rc,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 10.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)COP of the machine when it is operated as a refrigerating machine is 5.0\n",
+ "(b)COP when it is operated as heat pump is 6.0\n",
+ "(c)COP or efficiency of the Heat engine is (percent) = 16.67\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 10.44\n",
+ "#calculate the COP of machine in all cases\n",
+ "#Input data\n",
+ "T1=300.;#The maximum temperature at which carnot cycle operates in K\n",
+ "T2=250.;#The minimum temperature at which carnot cycle operates in K\n",
+ "\n",
+ "#Calculations\n",
+ "COPr=T2/(T1-T2);#COP of the refrigerating machine\n",
+ "COPh=T1/(T1-T2)#COP of heat pump\n",
+ "n=((T1-T2)/T1)*100;#COP or efficiency of the heat engine in percentage\n",
+ "\n",
+ "#Output data\n",
+ "print '(a)COP of the machine when it is operated as a refrigerating machine is ',COPr\n",
+ "print '(b)COP when it is operated as heat pump is ',COPh\n",
+ "print '(c)COP or efficiency of the Heat engine is (percent) = ',round(n,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 10.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Capacity of the plant is (TR) = 48.31\n",
+ "(b)Time taken to achieve cooling is (hours) = 10.67\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 10.45\n",
+ "#calculate the capacity of the plant and time taken\n",
+ "#Input data\n",
+ "m=20000.;#The storage capacity of fish in a storage plant in kg\n",
+ "T1=298.;#Supplied temperature of fish in K\n",
+ "T2=263.;#Temperature of cold storage in which fish are stored in K\n",
+ "T3=268.;#Freezing point of fish in K\n",
+ "Caf=2.95;#Specific heat of fish above freezing point in kJ/kg K\n",
+ "Cbf=1.25;#Specific heat of below freezing point in kJ/kg K\n",
+ "W=75.;#Work required by the plant in kW\n",
+ "TR=210.;#One tonne refrigeration in kJ/min\n",
+ "hfg=230.;#Latent heat of fish in kJ/kg\n",
+ "\n",
+ "#Calculations\n",
+ "COPr=T2/(T1-T2);#COP of reversed carnot cycle\n",
+ "COPa=0.3*COPr;#Given that actual COP is 0.3 times of reversed COP\n",
+ "Hr=(COPa*W)*60;#Heat removed by the plant in kJ/min\n",
+ "C=Hr/TR;#Capacity of the plant in TR\n",
+ "Q1=m*Caf*(T1-T3);#Heat removed from the fish above freezing point in kJ\n",
+ "Q2=m*Cbf*(T3-T2);#Heat removed from fish below freezing point in kJ\n",
+ "Q3=m*hfg;#Total latent heat of the fish in kJ\n",
+ "Q=Q1+Q2+Q3;#Total heat removed by the plant in kJ\n",
+ "T=(Q/Hr)/60;#Time taken to achieve cooling in hrs \n",
+ "\n",
+ "#Output data\n",
+ "print '(a)Capacity of the plant is (TR) = ',round(C,2)\n",
+ "print '(b)Time taken to achieve cooling is (hours) = ',round(T,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 10.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Theoretical COP for a CO2 machine working at given temperatures = 4.39\n",
+ "The answer in textbook is wrong. Please check using a calculator\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 10.46\n",
+ "#calculate the Theoretical COP\n",
+ "#Input data\n",
+ "T2=298.;#Maximum temperature at which CO2 machine works in K\n",
+ "T1=268.;#Minimum temperature at which CO2 machine works in K\n",
+ "sf1=-0.042;#Liquid entropy at 268 K in kJ/kg K\n",
+ "hfg1=245.3;#Latent heat of gas at 268 K in kJ/kg\n",
+ "sf2=0.251;#Liquid entropy in kJ/kg K\n",
+ "hfg2=121.4;#Latent heat of gas at 298 K in kJ/kg\n",
+ "hf1=-7.54;#Liquid enthalpy at 268 K in kJ/kg\n",
+ "hf2=81.3;#Liquid enthalpy at 298 K in kJ/kg\n",
+ "hf3=81.3;#Enthalpy at point 3 in graph in kJ/kg\n",
+ "\n",
+ "#Calculations\n",
+ "s2=sf2+(hfg2/T2);#Entropy at point 2 from the graph in kJ/kg K\n",
+ "x1=(s2-sf1)/(hfg1/T1);#Dryness fraction at point 1\n",
+ "h1=hf1+(x1*hfg1);#Enthalpy at point 1 in kJ/kg\n",
+ "h2=hf2+hfg2;#Enthalpy at point 2 in kJ/kg\n",
+ "COP=(h1-hf3)/(h2-h1);#Coefficient of performance for a CO2 machine working at given temperatures\n",
+ "\n",
+ "#Output data\n",
+ "print 'Theoretical COP for a CO2 machine working at given temperatures = ',round(COP,2)\n",
+ "print 'The answer in textbook is wrong. Please check using a calculator'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 10.48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The capacity of refrigerator is (TR) = 24.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 10.48\n",
+ "#calculate the capacity of refrigerator\n",
+ "#Input data\n",
+ "T2=298.;#Maximum temperature at which ammonia refrigerating system works in K\n",
+ "T1=263.;#Minimum temperature at which ammonia refrigerating system works in K\n",
+ "mf=5.;#Fluid flow rate in kg/min\n",
+ "sf1=0.5443;#Liquid entropy at 298 K in kJ/kg K\n",
+ "sf2=1.1242;#Liquid entropy at 263 K in kJ/kg K\n",
+ "hfg1=1297.68;#Latent heat at 298 K in kJ/kg\n",
+ "hfg2=1166.94;#Latent heat at 263 K in kJ/kg\n",
+ "hf1=135.37;#Liquid enthalpy at point 1 in graph in kJ/kg\n",
+ "hf2=298.9;#Liquid enthalpy at point 2 in graph in kJ/kg\n",
+ "TR=210.;#One tonne refrigeration in TR\n",
+ "\n",
+ "#Calculations\n",
+ "s2=sf2+(hfg2/T2);#Entropy at point 2 in kJ/kg\n",
+ "x1=(s2-sf1)/(hfg1/T1);#Dryness fraction at point 1\n",
+ "h1=hf1+(x1*hfg1);#Enthalpy at point 1 in kJ/kg\n",
+ "h=h1-hf2;#Heat extracted of refrigerating effect produced per kg of refrigerant in kJ/kg\n",
+ "ht=mf*h;#Total heat extracted at a fluid flow rate of 5 kg/min in kJ/min\n",
+ "C=ht/TR;#Capacity of refrigerating in TR\n",
+ "\n",
+ "#Output\n",
+ "print 'The capacity of refrigerator is (TR) = ',round(C,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 10.49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The theoretical COP of a ammonia refrigerating machine working between given temperatures = 5.56\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 10.49\n",
+ "#calculate the theoretical COP\n",
+ "#Input data\n",
+ "T1=263.;#Minimum temperature at which ammonia refrigerating machine works in K\n",
+ "T2=303.;#Maximum temperature at which ammonia refrigerating machine works in K\n",
+ "x1=0.6;#Dryness fraction of ammonia during suction stroke\n",
+ "sf1=0.5443;#Liquid entropy at 263 K in kJ/kg K\n",
+ "hfg1=1297.68;#Latent heat at 263 K in kJ/kg\n",
+ "sf2=1.2037;#Liquid entropy at 303 K in kJ/kg K\n",
+ "hfg2=1145.8;#Latent heat at 303 K in kJ/kg\n",
+ "hf1=135.37;#Liquid enthalpy at 263 K in kJ/kg\n",
+ "hf2=323.08;#Liquid enthalpy at 303 K in kJ/kg\n",
+ "\n",
+ "#Calculations\n",
+ "s1=sf1+((x1*hfg1)/T1);#Entropy at point 1 in kJ/kg K\n",
+ "x2=(s1-sf2)/(hfg2/T2);#Entropy at point 2 in kJ/kg K\n",
+ "h1=hf1+(x1*hfg1);#Enthalpy at point 1 in kJ/kg\n",
+ "h2=hf2+(x2*hfg2);#Enthalpy at point 2 in kJ/kg\n",
+ "COP=(h1-hf2)/(h2-h1);#Theoretical COP of ammonia refrigerating machine\n",
+ "\n",
+ "#Output\n",
+ "print 'The theoretical COP of a ammonia refrigerating machine working between given temperatures = ',round(COP,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 10.51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The amount of ice produced is (kg/kW hr) = 11.44\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 10.51\n",
+ "#calculate the amount of ice\n",
+ "#Input data\n",
+ "T1=263.;#Minimum temperature at which Vapour compression refrigerator using methyl chloride operates in K\n",
+ "T2=318.;#Maximum temperature at which Vapour compression refrigerator using methyl chloride operates in K\n",
+ "sf1=0.183;#Entropy of the liquid in kJ/kg K\n",
+ "hfg1=460.7;#Enthalpy of the liquid in kJ/kg\n",
+ "sf2=0.485;#Entropy of the liquid in kJ/kg K\n",
+ "hfg2=483.6;#Enthalpy of the liquid in kJ/kg\n",
+ "x2=0.95;#Dryness fraction at point 2\n",
+ "hf3=133.0;#Enthalpy of the liquid in kJ/kg\n",
+ "W=3600.;#Work to be spent corresponding to 1kW/hour\n",
+ "Cw=4.187;#Specific heat of water in kJ/kg degrees celcius\n",
+ "mi=1;#Mass of ice produced at 0 degrees celcius\n",
+ "Li=335.;#Latent heat of ice in kJ/kg\n",
+ "hf1=45.4;#Enthalpy of liquid at 263 K in kJ/kg\n",
+ "hf2=133.;#Enthalpy of liquid at 318 K in kJ/kg\n",
+ "\n",
+ "#Calculations\n",
+ "s2=sf2+((x2*(hfg2-hf2))/T2);#Enthalpy at point 2 in kJ/kg\n",
+ "x1=(s2-sf1)/((hfg1-hf1)/T1);#Dryness fraction at point 1\n",
+ "h1=hf1+(x1*hfg1);#Enthalpy at point 1 in kJ/kg\n",
+ "h2=hf2+(x2*hfg2);#Enthalpy at point 2 in kJ/kg\n",
+ "COP=(h1-hf3)/(h2-h1);#Theoretical COP\n",
+ "COPa=0.6*COP;#Actual COP which is 60 percent of theoretical COP\n",
+ "H=W*COPa;#Heat extracted or refrigeration effect produced per kW hour in kJ\n",
+ "Hw=(mi*Cw*10)+Li;#Heat extracted from water at 10 degrees celcius for the formation of 1 kg of ice at 0 degrees celcius\n",
+ "I=H/Hw;#Amount of ice produced in kg/kW hr\n",
+ "\n",
+ "#Output\n",
+ "print 'The amount of ice produced is (kg/kW hr) = ',round(I,2)\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/Thermal_Engineering_by_K_K_Ramalingam/Chapter7.ipynb b/Thermal_Engineering_by_K_K_Ramalingam/Chapter7.ipynb new file mode 100755 index 00000000..3e77394f --- /dev/null +++ b/Thermal_Engineering_by_K_K_Ramalingam/Chapter7.ipynb @@ -0,0 +1,1461 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7 - Performance of IC Engines"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "## Example 1 - pg 7.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a) Brake torque is (Nm) = 971.2\n",
+ "(b)Power available at the brakes of the engine is (kW) = 152.48\n",
+ "The answers given in textbook are wrong. Please verify using a calculator\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.19\n",
+ "#calculate the brake torque and Power\n",
+ "#Input data\n",
+ "N=1500.;#Engine speed in rpm\n",
+ "p=110.;#Load on brakes in kg\n",
+ "L=900.;#Length of brake arm in mm\n",
+ "g=9.81;#Gravitational force in N/m**2\n",
+ "pi=3.14;#Mathematical constant\n",
+ "\n",
+ "#Calculations\n",
+ "T=((p*g)*(L/1000.));#Braking torque in Nm\n",
+ "P=((T/1000)*((2*3.14*N)/60));#Power available at the brakes of the engine in kW\n",
+ "\n",
+ "#Output\n",
+ "print '(a) Brake torque is (Nm) = ',round(T,1)\n",
+ "print '(b)Power available at the brakes of the engine is (kW) = ',round(P,2)\n",
+ "print 'The answers given in textbook are wrong. Please verify using a calculator'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 7.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The power available at the brakes is (kW) = 7.125\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.19\n",
+ "#calculate the power available\n",
+ "#Input data\n",
+ "N=700.;#Engine speed in rpm\n",
+ "D=0.6;#Diameter of brake drum in m\n",
+ "d=0.05;#Diameter of rope in m\n",
+ "W=35.;#Dead load on the brake drum in kg\n",
+ "S=4.5;#Spring balance reading in kg\n",
+ "g=9.81;#Gravitational constant in N/m**2\n",
+ "pi=3.14;#Mathematical constant\n",
+ "\n",
+ "#Calculations\n",
+ "P=(((W-S)*g*pi*(D+d))/1000)*(N/60);#Power in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'The power available at the brakes is (kW) = ',round(P,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 7.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Brake thermal efficiency of the engine is (percent) = 34.74\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.20\n",
+ "#calculate the brake thermal efficiency\n",
+ "#Input data\n",
+ "W=950.;#Load on hydraulic dynamometer in N\n",
+ "C=7500.;#Dynamometer constant\n",
+ "f=10.5;#Fuel used per hour in kg\n",
+ "h=50000.;#Calorific value of fuel in kJ/kg\n",
+ "N=400.;#Engine speed in rpm\n",
+ "\n",
+ "#Calculations\n",
+ "P=(W*N)/C;#Power available at the brakes in kW\n",
+ "H=P*60;#Heat equivalent of power at brakes in kJ/min\n",
+ "Hf=(f*h)/60;#Heat supplied by fuel per minute in kJ/min\n",
+ "n=(H/Hf)*100;#Brake thermal efficiency in percentage\n",
+ "\n",
+ "#Output\n",
+ "print ' Brake thermal efficiency of the engine is (percent) = ',round(n,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 7.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Specific fuel consumption is (kg/BHP hr) = 0.238\n",
+ "(b)Brake mean effective pressure is (kgf/cm^2) = 8.066\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.21\n",
+ "#calculate the specific fuel consumption and Brake mean effective pressure\n",
+ "#Input data\n",
+ "import math\n",
+ "n1=50.5;#Air standard efficiency in percentage\n",
+ "n2=50.;#Brake thermal efficiency in percentage\n",
+ "N=3000.;#Engine speed in rpm\n",
+ "H=10500.;#Heating value of fuel in kcal/kg\n",
+ "T=7.2;#Torque developed in kgf*m\n",
+ "B=6.3;#Bore diameter in cm\n",
+ "S=0.09;#stroke in m\n",
+ "\n",
+ "#Calculations\n",
+ "nbt=(n1/100)*(n2/100.);#Brake thermal efficiency in percentage\n",
+ "B1=(2*(22./7)*N*T)/4500.;#Brake horse power in kW\n",
+ "B2=B1/4;#Brake horse power per cylinder in kW\n",
+ "Bsf=(4500*60)/(H*427.*nbt);#Brake specific fuel consumption in kg/BHP hr\n",
+ "bmep=(B2*4500)/(S*(math.pi*B**2. /4.)*(N/2.));#Brake mean effective pressure in kgf/cm**2\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Specific fuel consumption is (kg/BHP hr) = ',round(Bsf,3)\n",
+ "print '(b)Brake mean effective pressure is (kgf/cm^2) = ',round(bmep,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 7.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mechanical efficiency of the engine is (percent) = 88.54\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.22\n",
+ "#calculate the Mechanical efficiency\n",
+ "#Input data\n",
+ "W=30.;#The net dynamometer load in kg\n",
+ "R=0.5;#Radius in m\n",
+ "N=2400.;#Speed in rpm\n",
+ "FHP=6.5;#Engine power in hp\n",
+ "\n",
+ "#Calculations\n",
+ "BHP=(2*3.14*R*N*W)/4500;#Brake horse power in kW\n",
+ "IHP=BHP+FHP;#Indicated horse power in kW\n",
+ "nm=(BHP/IHP)*100;#Mechanical efficiency in percentage\n",
+ "\n",
+ "#Output\n",
+ "print 'Mechanical efficiency of the engine is (percent) = ',round(nm,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 7.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The indicated horse power is (kW) = 24.35\n",
+ "(b)The brake horse power is (kW) = 19.48\n",
+ "(c)Friction horse power is (kW) = 4.87\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.22\n",
+ "#calculate the indicated, brake and Friction horse powers\n",
+ "#Input data\n",
+ "import math\n",
+ "d=25.;#Diameter of cylinder in cm\n",
+ "l=0.4;#Stroke of piston in m\n",
+ "N=200.;#Speed in rpm\n",
+ "m=10.;#Misfires per minute\n",
+ "M=6.2;#Mean effective pressure in kgf/cm**2\n",
+ "nm=0.8;#Mechanical efficiency in percent\n",
+ "\n",
+ "#Calculations\n",
+ "np=(N/2)-m;#Number of power strokes per minute\n",
+ "A=(math.pi*d**2)/4;#Area of the cylinder\n",
+ "I=(M*l*A*np)/4500.;#Indicated horse power in kW\n",
+ "B=I*nm;#Brake horse power in kW\n",
+ "F=I-B;#Friction horse power in kW\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The indicated horse power is (kW) = ',round(I,2)\n",
+ "print '(b)The brake horse power is (kW) = ',round(B,2)\n",
+ "print '(c)Friction horse power is (kW) = ',round(F,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 7.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The average piston speed is (m/s) = 117.53\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.23\n",
+ "#calculate the average piston speed\n",
+ "#Input data\n",
+ "import math\n",
+ "I=5.;#Indicated power developed by single cylinder of 2 stroke petrol engine\n",
+ "M=6.5;#Mean effective pressure in bar\n",
+ "d=0.1;#Diameter of piston in m\n",
+ "\n",
+ "#Calculations\n",
+ "A=(math.pi*d**2)/4;#Area of the cylinder\n",
+ "LN=(I*1000*60.)/(M*10**5*A);#Product of length of stroke and engine speed\n",
+ "S=2*LN;#Average piston speed in m/s\n",
+ "\n",
+ "#Output\n",
+ "print 'The average piston speed is (m/s) = ',round(S,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 7.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Diameter of the bore is (cm) = 35.43\n",
+ "(b)Stroke length of the piston is (cm) = 61.999\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.24\n",
+ "#calculate the diameter and stroke length\n",
+ "#Input data\n",
+ "P=60.;#Power developed by oil engine in kW\n",
+ "M=6.5;#Mean effective pressure in kgf/cm**2\n",
+ "N=85.;#Number of explosions per minute\n",
+ "r=1.75;#Ratio of stroke to bore diameter\n",
+ "nm=0.8;#Mechanical efficiency \n",
+ "\n",
+ "#Calculations\n",
+ "I=P/nm;#Indicated horse power\n",
+ "d=((I*100*4*4500.)/(M*r*3.14*N))**(1./3);#Bore diameter in cm\n",
+ "l=r*d;#Stroke length in cm\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Diameter of the bore is (cm) = ',round(d,2)\n",
+ "print '(b)Stroke length of the piston is (cm) = ',round(l,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 7.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The bore diameter of the cylinder is (cm) = 11.46\n",
+ "(b)Stroke length of the piston is (cm) = 14.89\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.24\n",
+ "#calculate the bore diameter and stroke length\n",
+ "#Input data \n",
+ "I=45.;#Power developed by two cylinder internal combustion engine operating on two stroke principle\n",
+ "N=1100.;#Speed in rpm\n",
+ "M=6.;#Mean effective pressure in kgf/cm**2\n",
+ "r=1.3;#Ratio of stroke to the bore\n",
+ "nc=2.;#Number of cylinders\n",
+ "\n",
+ "#Calculations\n",
+ "d=((I*4500*4)/(M*(r/100)*3.14*N*nc))**(1./3);#Diameter of the bore in cm\n",
+ "l=1.3*d;#Stroke length in cm\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The bore diameter of the cylinder is (cm) = ',round(d,2)\n",
+ "print '(b)Stroke length of the piston is (cm) = ',round(l,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 7.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The volumetric efficiency is (percent) = 78.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.25\n",
+ "#calculate the volumetric efficiency\n",
+ "#Input data\n",
+ "d=6.;#Diameter of the bore in cm\n",
+ "l=9.;#Length of the stroke in cm\n",
+ "m=0.00025;#Mass of charge admitted in each suction stroke\n",
+ "R=29.27;#Gas constant Kgfm/kg K\n",
+ "p=1.;#Normal pressure in kgf/cm**2\n",
+ "T=273.;#Temperature in K\n",
+ "\n",
+ "#Calculations\n",
+ "V=(m*R*T)*10**6/(p*10**4);#Volume of charge admitted in each cycle in m**3\n",
+ "Vs=(3.14*d**2*l)/4;#Swept volume of the cylinder\n",
+ "nv=(V/Vs)*100;#Volumetric efficiency in percentage\n",
+ "\n",
+ "#Output\n",
+ "print 'The volumetric efficiency is (percent) = ',round(nv,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 7.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The volumetric efficiency of the engine is (percent) = 79.21\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.26\n",
+ "#calculate the volumetric efficiency of the engine\n",
+ "#Input data\n",
+ "import math\n",
+ "d=0.12;#Diameter of the bore in m\n",
+ "l=0.13;#Length of stroke in m\n",
+ "N=2500.;#Speed of the engine in rpm\n",
+ "d1=0.06;#Diameter of the orifice in m\n",
+ "Cd=0.70;#Discharge coefficient of orifice\n",
+ "hw=33.;#Heat causing air flow through orifice in cm of water\n",
+ "p=760.;#Barometric reading in mm of Hg\n",
+ "T1=298.;#Ambient temperature in degree K\n",
+ "p1=1.013;#Pressure of air at the end of suction in bar\n",
+ "T2=22.;#Temperature of air at the end of suction in degree C\n",
+ "R=0.287;#Universal gas constant\n",
+ "n=6.;#Number of cylinders in the engine\n",
+ "n1=1250.;#Number of strokes per minute for a four stroke engine operating at 2500 rpm\n",
+ "\n",
+ "#Calculations\n",
+ "V=(math.pi*d**2*l)/4;#Swept volume of piston in m**3\n",
+ "Ao=(math.pi*d1**2)/4;#Area of the orifice in m**2\n",
+ "rho=p1*10**5/((R*T1)*1000);#Density of air at 1.013 bar and 22 degrees C\n",
+ "Va=840.*Cd*Ao*(hw/rho)**(1./2);#Volume of air passing through the orifice in m**3/min\n",
+ "V1=8.734/n;#Actual volume of air per cylinder in m**3/min\n",
+ "As=V1/n1;#Air supplied per cycle per cylinder in m**3\n",
+ "nv=(As/V)*100;#Volumetric efficiency of the engine in percentage\n",
+ "\n",
+ "#Output\n",
+ "print 'The volumetric efficiency of the engine is (percent) = ',round(nv,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 - pg 7.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The air standard efficiency is (percent) = 46.1\n",
+ "(b)Indicated power is (kW) = 9.093\n",
+ "(c)Indicated thermal efficiency is (percent) = 32.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.27\n",
+ "#calculate the air standard efficiency and Indicated power, thermal efficiency\n",
+ "#Input data\n",
+ "import math\n",
+ "d=0.15;#Diameter of the piston in m\n",
+ "l=0.19;#Length of the stroke in m\n",
+ "V=0.00091;#Clearance volume in m**3\n",
+ "N=250.;#Speed of the engine in rpm\n",
+ "M=6.5;#Indicated mean effective pressure in bar\n",
+ "c=6.3;#Gas consumption in m**3/hr\n",
+ "H=16000.;#Calorific value of the has in kJ/m**3\n",
+ "r1=1.4;#Polytropic index\n",
+ "\n",
+ "#Calculations\n",
+ "Vs=(math.pi*d**2*l)/4;#Swept volume in m**3\n",
+ "Vt=Vs+V;#Total cylinder volume in m**3\n",
+ "r=Vt/V;#Compression ratio\n",
+ "na=(1-(1/r**(r1-1)))*100;#Air standard efficiency in percent\n",
+ "A=(math.pi*d**2)/4;#Area of the bore in m\n",
+ "I=(M*10**5*l*A*N)/(1000*60);#Indicated power in kW\n",
+ "Hs=(c*H)/(60*60);#Heat supplied per second\n",
+ "nt=(I/Hs)*100;#Indicated thermal efficiency in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The air standard efficiency is (percent) = ',round(na,1)\n",
+ "print '(b)Indicated power is (kW) = ',round(I,3)\n",
+ "print '(c)Indicated thermal efficiency is (percent) = ',round(nt,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 - pg 7.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The diameter of the venturi of the venturi if the air speed is 90 m/s is (cm) = 3.55\n",
+ "(b)The diameter of the jet if the pressure drop at the jet is 0.8 times the pressure drop at the venturi is (mm) = 2.218\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.28\n",
+ "#calculate the diameter in all cases\n",
+ "#Input data\n",
+ "import math\n",
+ "ma=6.;#Air supplied per minute by a single jet carburetor in kg/min\n",
+ "mf=0.44;#Mass flow rate of petrol in kg/min\n",
+ "s=0.74;#Specific gravity of petrol in kg/m**3\n",
+ "p1=1.;#Initial pressure of air in bar\n",
+ "T1=300.;#Initial temperature of air in K\n",
+ "Ci=1.35;#Isentropic coefficient of air\n",
+ "V=90.;#Speed of air in the venturi in m/s\n",
+ "Vc=0.85;#Velocity coefficient of the venturi in m/s\n",
+ "Cf=0.66;#Coefficient of discharge for the jet\n",
+ "Cp=1005.;#Coefficient of pressure in J/kg K\n",
+ "n=1.35;#Isentropic coefficient of air\n",
+ "R=0.281;#Real gas constant in Nm/kg K\n",
+ "rhof=740.;#Density of fuel in mm of Hg\n",
+ "\n",
+ "#Calculations\n",
+ "p2=(1-((V/Vc)**(2)/(2*T1*Cp)))**((n)/(n-1));#Pressure at the venturi in bar\n",
+ "V1=((R*T1)/(p1*10**5))*1000;#Initial volume in m**3/kg\n",
+ "V2=V1*((p1/p2)**(0.741));#Final volume in m**3/kg\n",
+ "A2=((ma*V2)/(V*60.))*10**4;#Throat area of venturi in cm**2\n",
+ "d=((A2*4.)/math.pi)**(0.5);#Diameter of venturi in cm\n",
+ "deltaPa=1-p2;#Pressure drop causing air flow in bar\n",
+ "deltaPf=0.8*deltaPa;#Pressure drop causing fuel flow in bar\n",
+ "Af=(mf/60.)*(10**4)/((Cf)*(2*rhof*deltaPf*10**5)**(1./2));#Area through which fuel flows in cm**2\n",
+ "df=((Af*(4/math.pi))**(1./2))*10.;#Diameter of fuel jet in mm\n",
+ "\n",
+ "print '(a)The diameter of the venturi of the venturi if the air speed is 90 m/s is (cm) = ',round(d,2)\n",
+ "print '(b)The diameter of the jet if the pressure drop at the jet is 0.8 times the pressure drop at the venturi is (mm) = ',round(df,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 - pg 7.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The weight of fuel required per 1HP hr is (kg) = 0.1947\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.30\n",
+ "#calculate the weight of fuel\n",
+ "#Input data\n",
+ "r=14.;#The compression ratio of a diesel engine\n",
+ "Vc=1.;#Clearance volume in m**3\n",
+ "c=0.08;#Fuel supply cut off point\n",
+ "nr=0.55;#Relative efficiency\n",
+ "H=10000.;#Calorific value of fuel in kcal/kg\n",
+ "r1=1.4;#Ratio of specific heat of air\n",
+ "Vs=13.;#Stroke volume in m**3\n",
+ "\n",
+ "#Calculations\n",
+ "rho=Vc+(c*Vs);#Cut off ratio\n",
+ "na=1-(1*(rho**r1-1)/((r**(r1-1)*r1)*(rho-1)));#Air standard efficiency of diesel cycle in percent\n",
+ "In=(na*nr);#Indicated thermal efficiency in percent\n",
+ "H1=(4500*60)/(In*427.);#Heat in fuel supplied/1HP hr\n",
+ "W=H1/10**4;#Weight of fuel required/1HP hr\n",
+ "\n",
+ "#Output\n",
+ "print 'The weight of fuel required per 1HP hr is (kg) = ',round(W,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 - pg 7.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The quantity of fuel to be injected per cycle per cylinder is (cc) = 0.0654\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.31\n",
+ "#calculate the quantity of fuel\n",
+ "#Input data\n",
+ "P=120;#Power developed by a six cykinder four stroke diesel engine\n",
+ "N=2400;#Speed in rpm\n",
+ "f=0.2;#Brake specific fuel consumption in kg/kWh\n",
+ "s=0.85;#Specific gravity of fuel\n",
+ "\n",
+ "#Calculations\n",
+ "F=f*P;#Fuel consumed per hour in kg\n",
+ "F1=F/6;#Fuel consumed per cylinder in kg/h\n",
+ "n=(N*60.)/2;#Number of cycles per hour\n",
+ "F2=(F1/n)*10**3;#Fuel consumption per cycle in gm\n",
+ "V=F2/s;#Volume of fuel to be injected per cycle in cc\n",
+ "\n",
+ "#Output\n",
+ "print 'The quantity of fuel to be injected per cycle per cylinder is (cc) = ',round(V,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16 - pg 7.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The diameter of the orifice is (mm) = 0.6165\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.32\n",
+ "#calculate the diameter of the orifice\n",
+ "#Input data\n",
+ "P=20.;#Power developed by a four stroke diesel engine per cylinder in kW\n",
+ "N=2000.;#Operating speed of the diesel engine in rpm\n",
+ "s=0.25;#Specific fuel consumption in kh/kW\n",
+ "p1=180.;#Pressure of fuel injected in bar\n",
+ "d=25.;#Distance travelled by crank in degrees\n",
+ "p2=38.;#Pressure in the combustion chamber in bar\n",
+ "Cd=0.85;#Coefficient of velocity\n",
+ "A=30.;#API in degrees\n",
+ "\n",
+ "#Calculations\n",
+ "T=d/(360.*(N/60));#Duration of fuel injection in s\n",
+ "SG=(141.5/(131.5+A))*10**3;#Specific gravity of fuel\n",
+ "V=Cd*(2*(p1-p2)*10**5/SG)**(1./2);#Velocity of fuel injection in m/s\n",
+ "Vf=(s/60.)*P/((N/2)*SG);#Volume of fuel injected per cycle in m**3/cycle\n",
+ "Na=Vf/(V*T);#Nozzle orifice area in m**2\n",
+ "d=(((4*Na)/3.14)**(1./2))*10**3;#Diameter of the orifice of the fuel injector in mm\n",
+ "\n",
+ "#Output\n",
+ "print 'The diameter of the orifice is (mm) = ',round(d,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 17 - pg 7.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The total orifice area required per injector if the injection takes place over 16 degree crank angle is (m^2) = 4.8796e-07\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.33\n",
+ "#calculate the total orifice area\n",
+ "#Input data\n",
+ "P=200.;#Power developed by a six cylinder diesel engine in kW\n",
+ "N=2000.;#Operating speed of the engine in rpm\n",
+ "bs=0.2;#The brake specific fuel consumption in kg/kWh\n",
+ "p1=35.;#The pressure of air in the cylinder at the beginning of injection in bar\n",
+ "p2=55.;#Maximum cylinder pressure in bar\n",
+ "p3=180.;#Initial injection pressure in bar\n",
+ "p4=520.;#Maximum pressure at the injector in bar\n",
+ "Cd=0.75;#Coefficient of discharge\n",
+ "S=850.;#Specific gravity of fuel\n",
+ "p5=1.;#Atmospheric pressure in bar\n",
+ "a=16.;#The crank angle over which injection takes place in degrees\n",
+ "\n",
+ "#Calculations\n",
+ "Po=P/6.;#Power output per cylinder in kW\n",
+ "F=(Po*bs)/60.;#Fuel consumed per cylinder in kg/min\n",
+ "Fi=F/(N/2.);#Fuel injected per cycle in kg\n",
+ "T=a/(360.*(N/60));#Duration of injection in s\n",
+ "deltaP1=p3-p1;#Pressure difference at the beginning of injection in bar\n",
+ "deltaP2=p4-p2;#Pressure difference at the end of injection in bar\n",
+ "avP=(deltaP1+deltaP2)/2;#Average pressure difference in bar\n",
+ "V=Cd*(2.*(avP*10**5)/S)**(1./2);#Velocity of injection of fuel jet in m/s\n",
+ "Vo=Fi/S;#Volume of fuel injected per cycle in m**3/cycle\n",
+ "A=(Vo/(V*T));#Area of fuel orifices in m**2\n",
+ "\n",
+ "#Output\n",
+ "print 'The total orifice area required per injector if the injection takes place over 16 degree crank angle is (m^2) = ',round(A,11)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18 - pg 7.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The indicated mean effective pressure is (bar) = 8.25\n",
+ "(b)Indicated power is (kW) = 2.81\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.34\n",
+ "#calculate the indicated mean effective pressure and indicated power\n",
+ "#Input data\n",
+ "A=450.;#Area of indicator diagram in mm^2\n",
+ "l=60.;#Length of indicator diagram in mm\n",
+ "s=1.1;#Spring number in bar/mm\n",
+ "d=0.1;#Diameter of piston in m\n",
+ "L=0.13;#Length of stroke in m\n",
+ "N=400.;#Operating speed of the engine in rpm\n",
+ "\n",
+ "#Calculations\n",
+ "Av=A/l;#Average height of indicator diagram in mm\n",
+ "pm=Av*s;#Mean effective pressure in bar\n",
+ "np=N/2.;#Number of power strokes per minute for a four stroke diesel engine\n",
+ "Ar=(3.14*d**2)/4;#Area of the piston in m^2\n",
+ "I=(pm*10**5*L*Ar*np)/(1000*60);#Indicated power in kW\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The indicated mean effective pressure is (bar) = ',pm\n",
+ "print '(b)Indicated power is (kW) = ',round(I,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19 - pg 7.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The brake horse power is (kW) = 28.26\n",
+ "(b)Indicated horse power is (kW) = 35.063\n",
+ "(c)Thermal efficiency on IHP basis is (percent) = 37.33\n",
+ "(d)Thermal efficiency on BHP basis is (percent) = 30.08\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.35\n",
+ "#calculate the brake, Indicated horse power and Thermal efficiency\n",
+ "#Input data\n",
+ "d=25.;#Diameter of the bore in cm\n",
+ "l=0.4;#Stroke length in m\n",
+ "N=300.;#Operating speed of the engine in rpm\n",
+ "n=120.;#Number of explosions per minute\n",
+ "pm=6.7;#Mean effective pressure in kgf/cm**2\n",
+ "Tnet=90.;#Net brake load in kg\n",
+ "R=0.75;#Radius of brake drum in m\n",
+ "f=0.22;#Fuel supplied per minute in m**3\n",
+ "C=4500.;#Calorific value of fuel in kcal/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "BHP=(2*3.14*R*N*Tnet)/4500;#Brake horse power in kW\n",
+ "A=(3.14*d**2)/4;#Area of the cylinder in cm**2\n",
+ "IHP=(pm*l*A*n)/4500;#Indicated horse power in kW\n",
+ "H=f*C;#Heat supplied by fuel per minute in kcal\n",
+ "nt1=((IHP*C)/(990*427))*100;#Thermal efficiency on IHP basis in percent\n",
+ "nt2=((BHP*C)/(990*427))*100;#Thermal efficiency on BHP basis in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The brake horse power is (kW) = ',round(BHP,2)\n",
+ "print '(b)Indicated horse power is (kW) = ',round(IHP,3)\n",
+ "print '(c)Thermal efficiency on IHP basis is (percent) = ',round(nt1,2)\n",
+ "print '(d)Thermal efficiency on BHP basis is (percent) = ',round(nt2,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 20 - pg 7.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The brake horse power is (kW) = 3.62\n",
+ "(b)Indicated horse power is (kW) = 4.341\n",
+ "(c)Mechanical efficiency is (percent) = 83.4\n",
+ "(d)Indicated thermal efficiency is (percent) = 33.0\n",
+ "(e)Brake thermal efficiency is (percent) = 27.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.36\n",
+ "#calculate the brake, Indicated horse power and Thermal efficiency\n",
+ "#Input data\n",
+ "D=0.6;#Brake wheel diameter of a constant speed compression ignition engine operating on four stroke cycle in m\n",
+ "t=0.01;#Thickness of brake band in m\n",
+ "N=500.;#Operating speed of the engine in rpm\n",
+ "W=20.;#Load on brake band in kgf\n",
+ "S=3.;#Spring balance reading in kgf\n",
+ "l=6.25;#Length of indicator diagram in cm\n",
+ "A=4.35;#Area of indicator diagram in cm**2\n",
+ "Sn=11.;#Spring number in kgf/cm**2/cm\n",
+ "d=10.;#Diameter of the bore in cm\n",
+ "L=0.13;#Length of the stroke in m\n",
+ "F=0.23;#Specific fuel consumption in kg/BHP hr\n",
+ "CV=10000.;#Heating value of fuel in kcal/kg\n",
+ "\n",
+ "#Calculations\n",
+ "BHP=(3.14*(D+t)*N*(W-S))/4500;#Brake horse power in kW\n",
+ "MEP=(A*Sn)/l;#Mean effective pressure in kgf/cm**2\n",
+ "Ar=(3.14*d**2)/4;#Area of the cylinder in cm**2\n",
+ "np=N/2;#Number of explosions per minute\n",
+ "IHP=(MEP*L*Ar*np)/4500;#Indicated horse power in kW\n",
+ "nm=(BHP/IHP)*100;#Mechanical efficiency in percentage\n",
+ "Wf=F*BHP;#Fuel consumption per hr in kg/hr\n",
+ "nt=((IHP*4500*60)/(Wf*CV*427))*100;#Indicated thermal efficiency in percentage\n",
+ "nb=((BHP*4500*60)/(Wf*CV*427))*100;#Brake thermal efficiency in kW\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The brake horse power is (kW) = ',round(BHP,2)\n",
+ "print '(b)Indicated horse power is (kW) = ',round(IHP,3)\n",
+ "print '(c)Mechanical efficiency is (percent) = ',round(nm,1)\n",
+ "print '(d)Indicated thermal efficiency is (percent) = ',round(nt,0)\n",
+ "print '(e)Brake thermal efficiency is (percent) = ',round(nb,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 21 - pg 7.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The indicated thermal efficiency is (percent) = 30.9\n",
+ "Mechanical efficiency is (percent) = 82.0\n",
+ "Brake thermal efficiency is (percent) = 25.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.38\n",
+ "#calculate the indicated thermal efficiency\n",
+ "#Input data\n",
+ "N=1200.;#Operating speed of a four cylinder engine in rpm\n",
+ "BHP=25.3;#The brake horse power when all 4 cylinders are operating in kW\n",
+ "T=10.5;#The average torque when one cylinder was cut out in mkgf\n",
+ "CV=10000.;#Calorific value of the fuel used in kcal/kg\n",
+ "f=0.25;#The amount of petrol used in engine per BHP hour\n",
+ "J=427.;#\n",
+ "\n",
+ "#Calculations\n",
+ "BHP1=(2*3.14*N*T)/4500.;#BHP for 3 cylinders when 1 cylinder is cut out in kW\n",
+ "IHP=BHP-BHP1;#IHP of one cylinder in kW\n",
+ "IHPt=IHP*4.;#Total IHP of the engine with 4 cylinders\n",
+ "Wf=(f*BHP)/60.;#Fuel used per minute in kg\n",
+ "ni=((IHPt*4500.)/(Wf*CV*J))*100;#Indicated thermal efficiency in percent\n",
+ "nm=(BHP/IHPt)*100;#Mechanical efficiency in percent\n",
+ "nb=(IHPt*nm)/100;#Brake thermal efficiency in percent\n",
+ "\n",
+ "#Output\n",
+ "print 'The indicated thermal efficiency is (percent) = ',round(ni,1)\n",
+ "print 'Mechanical efficiency is (percent) = ',round(nm,1)\n",
+ "print 'Brake thermal efficiency is (percent) = ',round(nb,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 22 - pg 7.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)The IHP of the engine is (kW) = 38.6\n",
+ "(b)Mechanical efficiency is (percent) = 82.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.39\n",
+ "#calculate the IHP of the engine and Mechanical efficiency\n",
+ "#Input data\n",
+ "B=32.;#Brake horse power in kW with all cylinders working\n",
+ "B1=21.6;#BHP with number 1 cylinder cut out in kW\n",
+ "B2=22.3;#BHP with number 2 cylinder cut out in kW\n",
+ "B3=22.5;#BHP with number 3 cylinder cut out in kW\n",
+ "B4=23.;#BHP with number 4 cylinder cut out in kW\n",
+ "\n",
+ "#Calculations\n",
+ "I1=B-B1;#Indicated horse power of number 1 cylinder in kW\n",
+ "I2=B-B2;#IHP of number 2 cylinder in kW\n",
+ "I3=B-B3;#IHP of number 3 cylinder in kW\n",
+ "I4=B-B4;#IHP of number 4 cylinder in kW\n",
+ "I=I1+I2+I3+I4;#Total IHP of the engine in kW\n",
+ "nm=(B/I)*100;#Mechanical efficiency in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)The IHP of the engine is (kW) = ',I\n",
+ "print '(b)Mechanical efficiency is (percent) = ',round(nm,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 23 - pg 7.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Compression ratio = 6.6\n",
+ "(b)Indicated thermal efficiency is (percent) = 34.45\n",
+ "(c)Brake specific fuel consumption is (kg/kW sec) = 7.59e-05\n",
+ "(d)Bore diameter of the engine is (mm) = 98.99\n",
+ "(e)Stroke length of the engine is (mm) = 128.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.40\n",
+ "#calculate the Compression ratio, indicated thermal efficiency, brake specific fuel consumption and bore diameter\n",
+ "#Input data\n",
+ "r=15.;#The air fuel ratio by weight\n",
+ "CV=45000.;#Calorific value of fuel in kJ/kg\n",
+ "nm=85.;#Mechanical efficiency of 4 stroke 4 cylinder engine in percent\n",
+ "na=53.;#Air standard efficiency of the engine in percent\n",
+ "nr=65.;#Relative efficiency of the engine in percent\n",
+ "nv=80.;#Volumetric efficiency of the engine in percent\n",
+ "r1=1.3;#Stroke to bore ratio\n",
+ "p1=1.;#Suction pressure in bar\n",
+ "T=303.;#Suction temperature in K\n",
+ "S=3000.;#The operating speed of the engine in rpm\n",
+ "P=75.;#Power at brakes in kW\n",
+ "r2=1.4;#Ratio of specific heats for air\n",
+ "R1=0.287;#Characteristic gas constant for air fuel mixture in kJ/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "R=(1/(1-(na/100)))**(1/(r2-1));#Compression ratio of the engine\n",
+ "nti=((na/100)*(nr/100))*100;#The indicated thermal efficiency in percent\n",
+ "Pi=P/(nm/100);#Indicated power in kW\n",
+ "F=Pi/((nti*CV)/100);#Fuel per second injected in kg/sec\n",
+ "B=F/P;#Brake specific fuel consumption in kg/kWsec\n",
+ "A=1+r;#Mass of fuel mixture entering the engine foe every one kg of fuel in kg\n",
+ "m=A*F;#Mass of air fuel mixture per second in kg\n",
+ "V=(m*R1*T)/(p1*10**5/1000);#Volume of air fuel mixture supplied to the engine per sec\n",
+ "Vs=V/(nv/100);#Swept volume per second in m**3/sec\n",
+ "d=((Vs*2*60*4)/(S*3.14*r1*4))**(1./3)*1000;#Diameter of the bore in mm\n",
+ "L=r1*d;#Stroke length in mm\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Compression ratio = ',round(R,1)\n",
+ "print '(b)Indicated thermal efficiency is (percent) = ',nti\n",
+ "print '(c)Brake specific fuel consumption is (kg/kW sec) = ',round(B,7)\n",
+ "print '(d)Bore diameter of the engine is (mm) = ',round(d,2)\n",
+ "print '(e)Stroke length of the engine is (mm) = ',round(L,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 24 - pg 7.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Power available at brakes is (kW) = 24.23\n",
+ "(b)Indicated power developed is (kW) = 34.19\n",
+ "(c)Mechanical efficiency is (percent) = 70.85\n",
+ "(d)Brake Thermal efficiency is (percent) = 27.69\n",
+ "(e)Indicated thermal efficiency is (percent) = 39.08\n",
+ "Heat balance :\n",
+ "Heat supplied by fuel (kJ/hr) = 315000.0\n",
+ "Heat equivalent of power of brakes (percent) = 26.9\n",
+ "Heat equivalent of loss in friction (percent) = 11.4\n",
+ "Heat equivalent of removed through jacket (percent) = 26.6\n",
+ "Heat equivalent of carried away by gases (percent) = 26.91\n",
+ "Heat equivalent of unaccounted (percent) = 7.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.42\n",
+ "#calculate the power and efficiency in all cases\n",
+ "#Input data\n",
+ "d=0.3;#Diameter of the bore in m\n",
+ "L=0.45;#Stroke length in m\n",
+ "N=220.;#Operating speed of the engine in rpm\n",
+ "T=3600.;#Duration of trial in sec\n",
+ "F=7.;#Fuel consumption in kg per minute\n",
+ "CV=45000.;#Calorific value of fuel in kJ/kg\n",
+ "A=320.;#Area of indicator diagram in mm**2\n",
+ "l=60.;#Length of indicator diagram in mm\n",
+ "S=1.1;#Spring index in bar/mm\n",
+ "W=130.;#Net load on brakes in kg\n",
+ "D=1.65;#Diameter of brake drum in m\n",
+ "W1=500.;#Total weight of jacket cooling water in kg\n",
+ "t=40.;#Temperature rise of jacket cooling water in degrees celsius\n",
+ "t1=300.;#Temperature of exhaust gases in degrees celsius\n",
+ "ma=300.;#Air consumption in kg\n",
+ "sg=1.004;#Specific heat of exhaust gas in kJ/kgK\n",
+ "sw=4.185;#Specific heat of water in kJ/kgK\n",
+ "t2=25.;#Room temperature in degrees celsius\n",
+ "g=9.81;#gravity\n",
+ "\n",
+ "#Calculations\n",
+ "P=(W*g*3.14*D*N)/(1000*60);#Power available at brakes in kW\n",
+ "pm=(A*S)/l;#Mean effective pressure in bar\n",
+ "I=(pm*10**5*L*((3.14*d**2)/4)*N)/(1000.*2*60);#Indicated power developed in kW\n",
+ "nm=(P/I)*100;#Mechanical efficiency in percent\n",
+ "nt=(P/((F/T)*CV))*100;#Brake thermal efficiency in percent\n",
+ "ni=(I/((F/T)*CV))*100;#Indicated thermal efficiency in percent\n",
+ "Hs=F*CV;#Heat supplied on one hour basis\n",
+ "Hp=P*T;#Heat equivalent of brake power in kJ\n",
+ "Hf=(I-P)*3600;#Heat lost in friction in kJ\n",
+ "Hc=W1*t*sw;#Heat carried away by cooling water in kJ\n",
+ "He=(ma+F)*(t1-t2)*sg;#Heat carried away by exhaust gas in kJ\n",
+ "Hu=Hs-(Hp+Hf+Hc+He);#Heat unaccounted in kJ\n",
+ "nb=(He/Hs)*100;#Heat equivalent of power at brakes in percent\n",
+ "nf=(Hf/Hs)*100;#Heat lost in friction in percent\n",
+ "nw=(Hc/Hs)*100;#Heat removed by jacket water in percent\n",
+ "ne=(He/Hs)*100;#Heat carried away by exhaust gases in percent\n",
+ "nu=(Hu/Hs)*100;#Heat unaccounted in percent\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Power available at brakes is (kW) = ',round(P,2)\n",
+ "print '(b)Indicated power developed is (kW) = ',round(I,2)\n",
+ "print '(c)Mechanical efficiency is (percent) = ',nm\n",
+ "print '(d)Brake Thermal efficiency is (percent) = ',round(nt,2)\n",
+ "print '(e)Indicated thermal efficiency is (percent) = ',round(ni,2)\n",
+ "print 'Heat balance :'\n",
+ "print 'Heat supplied by fuel (kJ/hr) = ',Hs\n",
+ "print 'Heat equivalent of power of brakes (percent) = ',round(nb,1)\n",
+ "print 'Heat equivalent of loss in friction (percent) = ',round(nf,1)\n",
+ "print 'Heat equivalent of removed through jacket (percent) = ',round(nw,1)\n",
+ "print 'Heat equivalent of carried away by gases (percent) = ',round(ne,2)\n",
+ "print 'Heat equivalent of unaccounted (percent) = ',round(nu,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 25 - pg 7.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Indicated horse power is (kcal) = 42.62\n",
+ "(b)Brake horse power developed is (kcal) = 34.93\n",
+ "(c)Heat equivalent of friction is (kcal) = 81.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.46\n",
+ "#calculate the Indicated, brake horse power\n",
+ "#Input data\n",
+ "d=25.;#The bore diameter of a single cylinder 4 stroke engine in cm\n",
+ "l=0.38;#Stroke length in m\n",
+ "t=3600.;#Duration of test in sec\n",
+ "r=19710.;#Total number of revolutions\n",
+ "F=6.25;#Fuel oil used in kg\n",
+ "A=5.7;#Area of indicator diagram in cm**2\n",
+ "L=7.6;#Length of indicator diagram in cm\n",
+ "S=8.35;#Spring number in kgf/cm**3\n",
+ "P=63.5;#Net load on brake drum in kg\n",
+ "R=1.2;#Radius of brake drum in m\n",
+ "Ww=5.7;#Rate of coolant flow in kg/min\n",
+ "deltaT=44.;#Temperature rise of coolant in degrees celsius\n",
+ "T1=15.5;#Atmospheric temperature in degrees celsius\n",
+ "As=30.;#Air supplied per kg of fuel\n",
+ "CV=10600.;#Calorific value of fuel in kcal/kg\n",
+ "Te=390.;#Exhaust gas temperature in degrees celsius\n",
+ "sm=0.25;#Mean specific heat of exhaust gas\n",
+ "\n",
+ "#Calculations\n",
+ "Hs=(F*CV)/60.;#Heat supplied by fuel per minute in kcal\n",
+ "pm=(A*S)/L;#Mean effective pressure in kgf/cm**2\n",
+ "I=(pm*l*(3.14*d**2)*r)/(4*60.*2*4500);#Indicated horse power in kW\n",
+ "B=(P*R*2*3.14*r)/(4500*60);#Brake horse power in kW\n",
+ "Hei=(I*4500)/427.;#Heat equivalent of IHP/min in kcal\n",
+ "Heb=(B*4500)/427.;#Heat equivalent of BHP/min in kcal\n",
+ "Hf=Hei-Heb;#Heat in friction per minute in kcal\n",
+ "Hc=Ww*deltaT;#Heat carried away by coolant in kcal\n",
+ "We=(F+(As*F))/60.;#Weight of exhaust gases per minute\n",
+ "He=We*(Te-T1)*sm;#Heat carried away by exhaust gases in kcal\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Indicated horse power is (kcal) = ',round(I,2)\n",
+ "print '(b)Brake horse power developed is (kcal) = ',round(B,2)\n",
+ "print '(c)Heat equivalent of friction is (kcal) = ',round(Hf,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 26 - pg 7.48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage of heat carried away by exhaust gas is (percent) = 24.06\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.48\n",
+ "#calculate the percentage of heat carried away\n",
+ "#Input\n",
+ "F=10.;#Quantity of fuel supplied during the trial of a diesel engine in kg/hr\n",
+ "CV=42500.;#Calorific value of fuel in kJ/kg\n",
+ "r=20.;#Air fuel ratio\n",
+ "T=20.;#Ambient temperature in degrees celsius\n",
+ "mw=585.;#Water circulated through the gas calorimeter in litres/hr\n",
+ "T1=35.;#Temperature rise of water through the calorimeter in degrees celsius\n",
+ "T2=95.;#Temperature of gases at exit from the calorimeter in degrees celsius\n",
+ "se=1.05;#Specific heat of exhaust gases in kJ/kgK\n",
+ "sw=4.186;#Specific heat of water in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "M=(F/60.)*(r+1);#Mass of exhaust gases formed per minute\n",
+ "H=((mw/60.)*sw*T1)+(M*se*(T2-T));#Heat carried away by the exhaust gases per minute in kJ/min\n",
+ "Hs=(F/60.)*CV;#Heat supplied by fuel per minute in kJ/min\n",
+ "nh=(H/Hs)*100;#Percentage of heat carried away by the exhaust gas\n",
+ "\n",
+ "#Output\n",
+ "print 'Percentage of heat carried away by exhaust gas is (percent) = ',round(nh,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 27 - pg 7.49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage of heat carried away by exhaust gases is (percent) = 27.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.49\n",
+ "#calculate the Percentage of heat carried away\n",
+ "#Input data\n",
+ "F=11.;#Fuel used per hour observed during the trial of a single cylinder four stroke diesel engine in kg\n",
+ "mc=85.;#Carbon present in the fuel in percent\n",
+ "mh=14.;#Hydrogen present in the fuel in percent\n",
+ "mn=1.;#Non combustibles present in the fuel in percent\n",
+ "CV=50000.;#Calorific value of fuel in kJ/kg\n",
+ "Vc=8.5;#Percentage of carbon dioxide present in exhaust gas by Volumetric analysis\n",
+ "Vo=10.;#Oxygen present in exhaust gases in percent\n",
+ "Vn=81.5;#Nitrogen present in exhaust gases in percent\n",
+ "Te=400.;#Temperature of exhaust gases in degrees celsius\n",
+ "se=1.05;#Specific heat of exhaust gas in kJ/kg\n",
+ "Pp=0.030;#Partial pressure of steam in the exhaust in bar\n",
+ "Ta=20.;#Ambient temperature in degrees celsius\n",
+ "hs=2545.6;#Enthalpy of saturated steam in kJ/kg\n",
+ "Tsa=24.1;#Saturation temperature from graph in degrees celcius\n",
+ "Cp=2.1;#Specific heat in kJ/kg K\n",
+ "hst=3335.;#Enthalpy of super heated steam in kJ/kg\n",
+ "F1=9.\n",
+ "#Calculations\n",
+ "Ma=(Vn*mc)/(33.*Vc);#Mass of air supplied per kg of fuel in kg\n",
+ "Me=Ma+1;#Mass of exhaust gases formed per kg of fuel in kg\n",
+ "me=(Me*F)/60.;#Mass of exhaust gases formed per minute in kg\n",
+ "ms=F1*(mh/100.);#Mass of steam formed per kg of fuel in kg\n",
+ "ms1=(ms*F)/60.;#Mass of steam formed per minute in kg\n",
+ "mde=me-ms1;#Mass of dry exhaust gases formed per minute in kg\n",
+ "H=mde*se*(Te-Ta);#Heat carried away by the dry exhaust gases per minute in kJ/min\n",
+ "Es=hs+(Cp*(Te-Tsa));#Enthalpy of superheated steam in kJ/kg\n",
+ "He=ms1*hst;#Heat carried away by steam in the exhaust gases in kJ/min\n",
+ "Hl=H+He;#Total heat lost through dry exhaust gases and steam in kJ/min\n",
+ "Hf=(F/60.)*CV;#Heat supplied by fuel per minute in kJ/min\n",
+ "nh=(Hl/Hf)*100.;#Percentage of heat carried away by exhaust gases\n",
+ "\n",
+ "#Output\n",
+ "print 'Percentage of heat carried away by exhaust gases is (percent) = ',round(nh,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 28 - pg 7.51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The net increase in brake power is (kW) = 29.15\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 7.51\n",
+ "#calculate the net increase in brake power\n",
+ "#Input data\n",
+ "C=0.0033;#The capacity of a four stroke engine of compression ignition type\n",
+ "I=13.;#Average indicated power developed in kW/m**3\n",
+ "N=3500.;#Operating speed of the engine\n",
+ "nv=80.;#Volumetric efficiency in percentage\n",
+ "p1=1.013;#Initial pressure in bar\n",
+ "T1=298.;#Initial temperature in K\n",
+ "r=1.75;#Pressure ratio of the engine\n",
+ "ni=75.;#The isentropic efficiency in percentage\n",
+ "nm=80.;#mechanical efficiency in percentage\n",
+ "r1=1.4;#Polytropic index\n",
+ "\n",
+ "#Calculations\n",
+ "Vs=(N/2.)*C;#Swept volume in m**3/min\n",
+ "Vi=Vs*(nv/100);#Unsupercharged engine inducted volume in m**3/min\n",
+ "Pb=p1*r;#Blower delivery pressure in bar\n",
+ "T2s=((r)**((r1-1)/r1))*T1;#Final temperature in K\n",
+ "T2=((T2s-T1)/(ni/100.))+T1;#Blower delivery temperature in K\n",
+ "Ve=((Pb*Vs)*T1)/(T2*p1);#Equivalent volume at 1.013 bar and 298K in m**3/min\n",
+ "Vin=Ve-Vi;#Increase in inducted volume of air in m**3/min\n",
+ "Pin=Vin*I;#Increase in indicated power due to extra air inducted in kW\n",
+ "Pinp=((Pb-p1)*Vs*100.)/60.;#Increase in indicated power due to increase in induction pressure in kW\n",
+ "Pt=Pin+Pinp;#Total increase in indicated power in kW\n",
+ "nb=Pt*(nm/100.);#Total increase in brake power efficiency in kW\n",
+ "ma=(Pb*Vs*100.)/(60*0.287*T2);#Mass of air delivered by the blower in kg/s\n",
+ "Wb=ma*1.005*(T2-T1);#Work input to air by blower in kW\n",
+ "Pb1=Wb/(nv/100.);#Power required to drive the blower in kW\n",
+ "Pb2=nb-Pb1;#Net increase in brake power in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'The net increase in brake power is (kW) = ',round(Pb2,2)\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/Thermal_Engineering_by_K_K_Ramalingam/Chapter8.ipynb b/Thermal_Engineering_by_K_K_Ramalingam/Chapter8.ipynb new file mode 100755 index 00000000..6e460479 --- /dev/null +++ b/Thermal_Engineering_by_K_K_Ramalingam/Chapter8.ipynb @@ -0,0 +1,289 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8 - Steam Nozzles and Turbines"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 8.47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Final velocity of steam is (m/s) = 596.97\n",
+ "(b)Percentage reduction in velocity is (percent) = 7.87\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=((V2-550.)/V2)*100;#Percentage reduction in velocity\n",
+ "#Output\n",
+ "print '(a)Final velocity of steam is (m/s) = ',round(V2,2)\n",
+ "print '(b)Percentage reduction in velocity is (percent) = ',round(percentV,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 8.48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Velocity (m/s) = 886.98\n",
+ "The mass of steam discharged,when the exit diameter of the nozzle is 12mm is (kg/hour) = 236.47\n",
+ "The answers given in textbook are wrong. Please check using a calculator\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 'Velocity (m/s) = ',round(V2,2)\n",
+ "print 'The mass of steam discharged,when the exit diameter of the nozzle is 12mm is (kg/hour) = ',round(m,2)\n",
+ "print 'The answers given in textbook are wrong. Please check using a calculator'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 8.49"
+ ]
+ },
+ {
+ "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.674\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,3)\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 8.51"
+ ]
+ },
+ {
+ "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.2\n",
+ "(b)Cross sectional area of the nozzle at exit for maximum discharge is (mm^2) = 678.0\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,1)\n",
+ "print '(b)Cross sectional area of the nozzle at exit for maximum discharge is (mm^2) = ',round(Ae,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 8.52"
+ ]
+ },
+ {
+ "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) = 531.0\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,0)\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/Thermal_Engineering_by_K_K_Ramalingam/Chapter9.ipynb b/Thermal_Engineering_by_K_K_Ramalingam/Chapter9.ipynb new file mode 100755 index 00000000..d492b399 --- /dev/null +++ b/Thermal_Engineering_by_K_K_Ramalingam/Chapter9.ipynb @@ -0,0 +1,1013 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9 - Air Compressors"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 9.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Work required in a isothermal compression is (kJ/kg) = 155.813\n",
+ "(b)Work required in a polytropic compression is (kJ/kg) = 181.578\n",
+ "(c)Work required in a isentropic compression is (kJ/kg) = 203.47\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.18\n",
+ "#calculate the Work required in all cases\n",
+ "#Input data\n",
+ "import math\n",
+ "m=1.;#Mass of air that has to be compressed in kg\n",
+ "P1=1.;#Initial pressure of a single stage reciprocating air compressor in bar\n",
+ "P2=6.;#Final pressure in bar\n",
+ "T1=303.;#Initial temperature of air in K\n",
+ "n=1.2;#Polytropic index of air\n",
+ "R=287.;#Gas constant for air in J/kg K\n",
+ "r=1.4;#Isentropic index\n",
+ "\n",
+ "#Calculations\n",
+ "W1=(m*R*T1*math.log(P2/P1))/1000;#Work required for compression in kJ/kg in Isothermal compression process\n",
+ "W2=((n/(n-1))*m*R*T1*((P2/P1)**((n-1)/n)-1))/1000;#Work required for compression in a polytropic compression process in kJ/kg\n",
+ "W3=((r/(r-1))*m*R*T1*((P2/P1)**((r-1)/r)-1))/1000;#Work required for compression in a Isentropic compression process in kJ/kg\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Work required in a isothermal compression is (kJ/kg) = ',round(W1,3)\n",
+ "print '(b)Work required in a polytropic compression is (kJ/kg) = ',round(W2,3)\n",
+ "print '(c)Work required in a isentropic compression is (kJ/kg) = ',round(W3,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 9.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Length of the cylinder is (m) = 0.625\n",
+ "(b)Diameter of the cylinder is (mm) = 351.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.19\n",
+ "#calculate the Length and diameter of the cylinder\n",
+ "#Input data\n",
+ "Pi=60000.;#Indicated power of a double acting air compressor in W\n",
+ "P1=1.;#Initial pressure in bar\n",
+ "T1=293.;#Initial temperature in K\n",
+ "n=1.2;#Polytropic index of the process\n",
+ "P2=8.;#Final pressure in bar\n",
+ "N=120.;#Speed at which the cylinder operates in rpm\n",
+ "S=150.;#Average piston speed in m/min\n",
+ "\n",
+ "#Calculations\n",
+ "L=S/(2*N);#Length of the stroke in m\n",
+ "X=(3.14*L)/4;#X=V/D**2 i.e.,Volume of air before compression/square of the diameter in m\n",
+ "Y=((n/(n-1))*P1*10**5*X*(((P2/P1)**((n-1)/n))-1));#Y=W/D**2 Work done by the compressor per cycle in N/m\n",
+ "Nw=2*N;#Number of working strokes per minute since it is a double acting cylinder\n",
+ "D=(((Pi*60)/(Y*Nw))**(0.5))*1000;#Diameter of the cylinder in mm\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Length of the cylinder is (m) = ',L\n",
+ "print '(b)Diameter of the cylinder is (mm) = ',round(D,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 -pg 9.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The indicated power of the compressor is (kW) = 2.684\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.20\n",
+ "#calculate the Indicated power of compressor\n",
+ "#Input data\n",
+ "D=0.15;#Diameter of a cylinder of a single acting reciprocating air compressor in m\n",
+ "L=0.2;#Length of the stroke in m\n",
+ "P1=1.;#The pressure at which compressor sucks air in bar\n",
+ "P2=10.;#Final pressure in bar\n",
+ "T1=298.;#Initial Temperature in K\n",
+ "N=150.;#Operating speed of the compressor in rpm\n",
+ "n=1.3;#Polytropic index of the process\n",
+ "\n",
+ "#Calculations\n",
+ "V1=((3.14*D**2*L)/4);#Volume of air before compression in m**3\n",
+ "W=((n/(n-1))*P1*10**5*V1*((P2/P1)**((n-1)/n)-1));#Work done by the compressor for a polytropic compression of air in Nm\n",
+ "Pi=((W*N)/60)/1000;#Indicated power of the compressor in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'The indicated power of the compressor is (kW) = ',round(Pi,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 9.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mass of air delivered per minute is (kg/min) = 5.64\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.21\n",
+ "#calculate the mass of air delivered\n",
+ "#Input data\n",
+ "D=0.25;#Diameter of the cylinder of a single acting air compressor in m\n",
+ "L=0.4;#Length of the stroke in m\n",
+ "P1=1.;#Initial Pressure of the compressor in bar\n",
+ "T1=303.;#Initial temperature of the compressor in K\n",
+ "P2=6.;#Pressure during running in bar\n",
+ "N=250.;#Operating speed of the compressor in rpm\n",
+ "R=287.;#Gas constant in J/kg K \n",
+ "\n",
+ "#Calculations\n",
+ "V1=(3.14*D**2*L)/4;#Volume of air before compression in m**3\n",
+ "m=(P1*10**5*V1)/(R*T1);#Mass of air delivered by the compressor per stroke in kg/stroke\n",
+ "Nw=N;#Since single acting cylinder number of working stroke is equal to Operating speed of the compressor in rpm\n",
+ "ma=m*Nw;#Mass of air delivered per minute in kg/min\n",
+ "\n",
+ "#Output\n",
+ "print 'Mass of air delivered per minute is (kg/min) = ',round(ma,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 9.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Temperature of air delivered by the compressor is (K) = 546.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.22\n",
+ "#calculate the temperature of air\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of a single acting compressor in bar\n",
+ "P2=12.;#Final pressure in bar\n",
+ "N=500.;#Operating speed of the compressor in rpm\n",
+ "T1=308.;#Inlet air temperature in K\n",
+ "n=1.3;#Polytropic index\n",
+ "\n",
+ "#Calculations\n",
+ "T2=T1*(P2/P1)**((n-1)/n);#Temperature of air delivered by the compressor in K\n",
+ "\n",
+ "#Output\n",
+ "print 'Temperature of air delivered by the compressor is (K) = ',round(T2,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 9.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Temperature at the end of isentropic compression is (K) = 555.06\n",
+ "(b)Temperature at the end of polytropic compression is (K) = 486.49\n",
+ "(c)Temperature at the end of isotropic compression is (K) = 293.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.22\n",
+ "#calculate the temperature in all cases\n",
+ "#Input data\n",
+ "P1=1.;#Pressure at which air is sucked by a compressor in bar\n",
+ "T1=293.;#Initial temperature in K\n",
+ "P2=9.;#Delivery pressure after compression in bar\n",
+ "r=1.41;#Isentropic index\n",
+ "n=1.3;#Polytropic index\n",
+ "\n",
+ "#Calculations\n",
+ "T21=T1*((P2/P1)**((r-1)/r));#Temperature at the end of isentropic compression process in K\n",
+ "T22=T1*((P2/P1)**((n-1)/n));#Temperature at the end of isentropic compression process in K\n",
+ "T23=T1;#Temperature at the end of isotropic compression process in K (Temperature remains constant)\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Temperature at the end of isentropic compression is (K) = ',round(T21,2)\n",
+ "print '(b)Temperature at the end of polytropic compression is (K) = ',round(T22,2)\n",
+ "print '(c)Temperature at the end of isotropic compression is (K) = ',T23\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 9.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Work done by air during suction is (J) = 7000.0\n",
+ "(b)Work done on air during compression is (J) = -14754.0\n",
+ "(c)Work done on air during delivery is (J) = 12902.0\n",
+ "(d)Net work done on air during the cycle is (kJ) = 20.656\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.23\n",
+ "#calculate the work done in all cases\n",
+ "#Input data\n",
+ "V1=0.07;#Displacement of the piston of a single stage single cylinder air compressor in m**3\n",
+ "P1=1;#Initial pressure in bar\n",
+ "T1=308;#Initial temperature of air in K\n",
+ "P2=8.5;#Pressure after the compression process in bar\n",
+ "r=1.4;#Isentropic compression \n",
+ "\n",
+ "#Calculations\n",
+ "V2=V1*((P1/P2)**(1/1.4));#Final volume of the cylinder in m**3\n",
+ "W1=P1*10**5*V1;#Work done by air during suction in Nm (or) J\n",
+ "W2=(P1*10**5*V1*(1-(P2/P1)**((r-1)/r)))/(r-1);#Work done by air during compression in Nm or J\n",
+ "Wa1=P2*10**5*V2;#Work done on air during delivery in Nm or J\n",
+ "Wa2=((-W2)+Wa1-W1)/1000;#Net work done on air during the cycle in kJ\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Work done by air during suction is (J) = ',W1\n",
+ "print '(b)Work done on air during compression is (J) = ',round(W2,0)\n",
+ "print '(c)Work done on air during delivery is (J) = ',round(Wa1,0)\n",
+ "print '(d)Net work done on air during the cycle is (kJ) = ',round(Wa2,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 9.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Work done by air during suction is (Nm) = 5000.0\n",
+ "(b)Work done on air during Isothermal compression is (Nm) = -9730.0\n",
+ "(c)Heat transferred during this process is (J) = 9730.0\n",
+ "(d)Work done on air during delivery is (Nm) = 5000.0\n",
+ "(e)Net work done during the cycle is (Nm) = 9729.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.25\n",
+ "#calculate the work done in all cases\n",
+ "import math\n",
+ "#Input data\n",
+ "V1=0.05;#displacement of a piston of a single cylinder single stage reciprocating compressor in m**3\n",
+ "P1=1.;#pressure of air sucked in the compressor in bar\n",
+ "T1=300.;#Initial Temperature of air in K\n",
+ "P2=7.;#Pressure after the compression process in bar\n",
+ "\n",
+ "#Calculations\n",
+ "V2=(P1*V1)/P2;#Volume after the compression in m**3\n",
+ "W1=P1*10**5*V1;#Work done by air during suction in Nm\n",
+ "W2=P1*10**5*V1*math.log(V2/V1);#Work done on sir during isothermal compression in Nm\n",
+ "H=-W2;#Heat transferred to the cylinder walls in Nm or J\n",
+ "W3=P1*10**5*V1;#Work done on air during delivery in Nm\n",
+ "Wn=W1+(-W2)-W3;#Net work done during the cycke in N m\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Work done by air during suction is (Nm) = ',W1\n",
+ "print '(b)Work done on air during Isothermal compression is (Nm) = ',round(W2,0)\n",
+ "print '(c)Heat transferred during this process is (J) = ',round(H,0)\n",
+ "print '(d)Work done on air during delivery is (Nm) = ',W3\n",
+ "print '(e)Net work done during the cycle is (Nm) = ',math.floor(Wn)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 9.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Power required to compress and deliver 2kg of air per minute is (kW) = 7.296\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.26\n",
+ "#calculate the Power required\n",
+ "#Input data\n",
+ "m=2.;#Mass of air delivered per second in kg\n",
+ "P1=1.;#Initial pressure of a single stage compressor in bar\n",
+ "T1=293.;#Initial temperature in K\n",
+ "P2=7.;#Final pressure in bar\n",
+ "n=1.4;#Polytropic index\n",
+ "R=287.;#Gas constant in J/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "W=((n/(n-1))*m*R*T1*(((P2/P1)**((n-1)/n))-1))/(60*1000);#Work done by compressor in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'Power required to compress and deliver 2kg of air per minute is (kW) = ',round(W,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 9.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Work done by the compressor per cycle is (Nm) = 781.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.27\n",
+ "#calculate the Work done\n",
+ "#Input data\n",
+ "import math\n",
+ "D=0.15;#Diameter of the bore of a single stage single acting reciprocating air compressor in m\n",
+ "L=0.225;#Stroke length in m\n",
+ "P1=1;#Pressure of air received in bar\n",
+ "T1=308.;#Temperature of initial air in K\n",
+ "P2=6.5;#Delivery pressure in bar\n",
+ "n=1.3;#Polytropic index\n",
+ "\n",
+ "#Calculations\n",
+ "Vs=(math.pi*D**2*L)/4;#Stroke volume of the compressor in m**3\n",
+ "Vc=0.05*Vs;#Clearance volume in m**3\n",
+ "V1=Vs+Vc;#Initial volume of air in m**3\n",
+ "V4=Vc*(P2/P1)**(1/n);#The air in the clearance volume expands during suction stroke in m**3\n",
+ "V=V1-V4;#Effective swept volume in m**3\n",
+ "W=((n/(n-1))*P1*10**5*(V1-V4)*(((P2/P1)**((n-1)/n))-1));#Work done by the compressor per cycle in Nm\n",
+ "\n",
+ "#Output\n",
+ "print 'Work done by the compressor per cycle is (Nm) = ',round(W,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 9.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Free air delivered per cycle is (m^3) = 0.000356\n",
+ "(b)Free air delivered per minute is (m^3/min) = 0.1424\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.28\n",
+ "#calculate the free air delivered\n",
+ "#Input data\n",
+ "D=0.1;#Diameter of the bore of a single acting compressor in m\n",
+ "L=0.1;#Length of the stroke in m\n",
+ "N=400.;#Operating speed of the compressor in in rpm\n",
+ "Vc=0.00008;#Clearance volume in m**3\n",
+ "n=1.2;#Polytropic index\n",
+ "T1=303.;#Initial temperature in K\n",
+ "Tf=293.;#Final temperature in K\n",
+ "P1=0.95;#Initial pressure in bar\n",
+ "P2=8.;#Final pressure in bar\n",
+ "Pf=1.013;#Free air pressure in bar\n",
+ "\n",
+ "#Calculations\n",
+ "Vs=(3.14*D**2*L)/4.;#Stroke volume of the compressors in m**3\n",
+ "V1=Vc+Vs;#Initial volume of air is equal to cylinder volume in m**3\n",
+ "V4=Vc*(P2/P1)**(1/n);#Air in the clearance volume expands during suction stroke to V4\n",
+ "Ve=V1-V4;#Effective swept volume in m**3\n",
+ "Vf=(P1*(V1-V4)*Tf)/(T1*Pf);#Free air delivered per cycle can be obtained in m**3\n",
+ "A=Vf*N;#Free air delivered per minute in m**3/min\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Free air delivered per cycle is (m^3) = ',round(Vf,6)\n",
+ "print '(b)Free air delivered per minute is (m^3/min) = ',round(A,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 - pg 9.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Power of the compressor when it runs at 300 rpm is (kW) = 10.718\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.29\n",
+ "#calculate the Power of the compressor\n",
+ "#Input data\n",
+ "P1=1.;#Pressure of air drawn by a two stage single acting reciprocating air compressor in bar\n",
+ "T1=293.;#Initial temperature in K\n",
+ "P3=60.;#Final pressure after the compression in bar\n",
+ "P2=10.;#Pressure after compression in the LP cylinder in bar\n",
+ "T2=303.;#Temperature after cooling in K\n",
+ "D=0.16;#Diameter of a cylinder in m\n",
+ "L=0.2;#Stroke length of the cylinder in m\n",
+ "n=1.3;#Polytropic index\n",
+ "N=300.;#Operating speed of the compressor in rpm\n",
+ "R=287.;#Gas constant in J/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "V1=(3.14*D**2*L)/4;#Volume of the LP cylinder in m**3\n",
+ "V2=(P1*V1*T2)/(T1*P2);#Volume of the HP cylinder in m**3\n",
+ "W=(n/(n-1))*(P1*10**5*V1*(((P2/P1)**((n-1)/n))-1)+(P2*10**5*V2*(((P3/P2)**((n-1)/n))-1)));#Work done by the compressor per working cycle in N m\n",
+ "P=(W*N)/(60.*1000);#Power of the compressor in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'Power of the compressor when it runs at 300 rpm is (kW) = ',round(P,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 - pg 9.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage saving in the work of compression of air in two stages instead of single stage is (percent) = 12.6\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.30\n",
+ "#calculate the percentage saving\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure in bar\n",
+ "P3=9.;#Final pressure in bar\n",
+ "n=1.3;#Compression index\n",
+ "\n",
+ "#Calculations\n",
+ "W1=(n/(n-1))*(P1*10**5*(((P3/P1)**((n-1)/n))-1));#Work done in compression in a single stage per unit volume per kg of air in N m \n",
+ "P2=(P1*P3)**(0.5);#Intercooler pressure for perfect intercooling in bar\n",
+ "W2=2*(n/(n-1))*(P1*10**5*(((P2/P1)**((n-1)/n))-1));#Work done in compression in a two stage compressor per unit volume per kg of air in N m\n",
+ "Wc=W1-W2;#Saving in work of compression in N m\n",
+ "nw=((W1-W2)/W1)*100;#Percentage saving in work of compression in percentage\n",
+ "\n",
+ "#Output\n",
+ "print 'Percentage saving in the work of compression of air in two stages instead of single stage is (percent) = ',round(nw,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 - pg 9.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Minimum work required to compress 1kg of air for given conditions is (Nm) = 338979.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.31\n",
+ "#calculate the Minimum work required\n",
+ "#Input data\n",
+ "m=1.;#Mass of air to be compressed in kg\n",
+ "P1=1.;#Pressure of air before compression in bar\n",
+ "T1=303.;#Initial temperature in K\n",
+ "P3=25.;#Final pressure of air after compression in bar\n",
+ "n=1.3;#Polytropic index\n",
+ "R=287.;#Gas constant in J/kg K\n",
+ "\n",
+ "#Calculations\n",
+ "P2=(P1*P3)**(0.5);#Intermediate pressure in the case of perfect intercooling in bar\n",
+ "W=2*(n/(n-1))*(m*R*T1*(((P2/P1)**((n-1)/n))-1));#Work done in compression in a two stage compressor per unit volume per kg of air in N m\n",
+ "\n",
+ "#Output data\n",
+ "print 'Minimum work required to compress 1kg of air for given conditions is (Nm) = ',round(W,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 - pg 9.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The minimum power required to drive the compressor is (kW) = 12.524\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.32\n",
+ "#calculate the minimum power\n",
+ "#Input data\n",
+ "V1=3;#Volume of air sucked in by a two stage compressor in m**3\n",
+ "P1=1.04;#Initial pressure in bar\n",
+ "T1=298;#Initial temperature in K\n",
+ "P2=9;#Delivery pressure in bar\n",
+ "n=1.25;#Polytropic index\n",
+ "\n",
+ "#Calculations\n",
+ "P2=(P1*P2)**(0.5);#Intermediate pressure for perfect intercooling and for minimum work of compression in bar\n",
+ "W=2*(n/(n-1))*(P1*10**5*V1*(((P2/P1)**((n-1)/n))-1));#Work done in compression in a two stage compressor per unit volume per kg of air in Nm\n",
+ "P=W/(60*1000);#Power required to drive the compressor in kW\n",
+ "\n",
+ "#Output\n",
+ "print 'The minimum power required to drive the compressor is (kW) = ',round(P,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16 - pg 9.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mass of water to circulate in the intercooler for abstracting heat is (kg) = 2.098\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.32\n",
+ "#calculate the mass of water\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of a two stage air compressor in bar\n",
+ "P3=36.;#Final pressure in bar\n",
+ "T1=298.;#Initial temperature in K\n",
+ "n=1.35;#Polytropic index\n",
+ "T3=298.;#Temperature after intercooling in K\n",
+ "Tc=20.;#Permissible temperature rise of the cooling water in K\n",
+ "R=287.;#Gas constant in J/kg K\n",
+ "Cp=1.;#Specific heat of air in kJ/kg K\n",
+ "Cw=4.2;#Specific heat of water in kJ/kg K\n",
+ "ma=1.;#Mass of air in the compressor in kg\n",
+ "\n",
+ "#Calculations\n",
+ "P2=(P1*P3)**(0.5);#Intercooler pressure for complete intercooling and for minimum work of compression in bar\n",
+ "T2=T1*(P2/P1)**((n-1)/n);#Temperature after the compression process in K\n",
+ "mw=(ma*Cp*(T2-T3))/(Cw*(Tc));#Mass of water to circulate in the intercooler per kg of air in kg\n",
+ "\n",
+ "#Output\n",
+ "print 'Mass of water to circulate in the intercooler for abstracting heat is (kg) = ',round(mw,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 17 - pg 9.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The volume ratio of LP to HP cylinders = 2.83\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.33\n",
+ "#calculate the volume ratio\n",
+ "#Input data\n",
+ "V1=0.2;#Volume of air flow per second in a two stage single acting reciprocating compressor in m**3\n",
+ "P1=0.1;#Intake pressure of air in MPa\n",
+ "T1=293.;#Initial temperature in K\n",
+ "P3=0.8;#Final pressure after the air is compressed in MPa\n",
+ "N=600.;#Operating speed of the compressor in rpm\n",
+ "\n",
+ "#Calculations\n",
+ "P2=(P1*P3)**(0.5);#Intercooler pressure for perfect intercooling and for minimum work of compression in bar\n",
+ "Vl=(V1*60)/600;#Volume of the LP cylinder in m**3\n",
+ "Vh=(P1*Vl)/P2;#Volume of the high pressure cylinder in m**3\n",
+ "R=Vl/Vh;#Ratio of cylinder volumes\n",
+ "\n",
+ "#Output\n",
+ "print 'The volume ratio of LP to HP cylinders = ',round(R,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18 - pg 9.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The ratio of cylinder diameters for the efficiency of compression to be maximum = 2.236\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.34\n",
+ "#calculate the ratio required\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of air entering a two stage air compressor with complete intercooling in bar\n",
+ "P3=25.;#Delivery pressure of air toe the mains in bar\n",
+ "T1=303.;#Initial temperature in K\n",
+ "n=1.35;#Compression index\n",
+ "\n",
+ "#Calculations\n",
+ "P2=(P1*P3)**(0.5);#Inter cooler pressure for perfect intercooling in bar\n",
+ "R=(P2/P1)**(0.5);#Ratio of cylindrical diameters\n",
+ "\n",
+ "#Output\n",
+ "print 'The ratio of cylinder diameters for the efficiency of compression to be maximum = ',round(R,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19 - pg 9.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Number of stages = 4\n",
+ "(b)Intermediate pressures are, P2 = 3.31 bar, P3 = 10.95 bar, P4 = 36.26 bar\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.34\n",
+ "#calculate the number of stages and Intermediate pressures\n",
+ "#Input data\n",
+ "import math\n",
+ "P1=1.;#Initial pressure of a multistage compression in bar\n",
+ "Pn1=120.;#Final pressure in bar\n",
+ "r=4;#Permissible pressure ratios per stage\n",
+ "\n",
+ "#Calculations\n",
+ "n=math.log(Pn1/P1)/math.log(r)\n",
+ "n1=4;#As n=3.45 say 4 stages\n",
+ "P5=Pn1;#Since number of stages is 4\n",
+ "P4=P5/(Pn1/P1)**(1./n1);#Pressure after the stage 3 in bar\n",
+ "P3=P4/(Pn1/P1)**(1./n1);#Pressure after the stage 2 in bar\n",
+ "P2=P3/(Pn1/P1)**(1./n1);#Pressure after the stage 1 in bar\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Number of stages = ',n1\n",
+ "print '(b)Intermediate pressures are, P2 = ',round(P2,2),'bar, P3 = ',round(P3,2),'bar, P4 =',round(P4,2),'bar'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 20 - pg 9.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Power required to deliver 15 m^3/min air at suction condition is (kW) = 106.6\n",
+ "(b)Intermediate pressures are P2 = 3.42 bar P3 = 11.696 bar\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.35\n",
+ "#calculate the Power required and Intermediate pressures\n",
+ "#Input data\n",
+ "P1=1.;#Initial pressure of a 3 stage compressor in bar\n",
+ "P4=40.;#Final pressure in bar\n",
+ "T1=293.;#Initial temperature in K\n",
+ "n=1.3;#Polytropic index\n",
+ "V1=15.;#Air delivered per minute in m**3/min\n",
+ "\n",
+ "#Calculations\n",
+ "W=((3*n)/(n-1))*P1*10**5*V1*(((P4/P1)**((n-1)/(3*n)))-1);#Work done by the compressor in kJ/min\n",
+ "P=W/(60*1000.);#Power required to deliver 15 m**3/min air in kW\n",
+ "P2=P1*(P4/P1)**(1./3);#Intermediate pressure after stage 1 in bar\n",
+ "P3=P2*(P4/P1)**(1./3);#Intermediate pressure after stage 2 in bar\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Power required to deliver 15 m^3/min air at suction condition is (kW) = ',round(P,1)\n",
+ "print '(b)Intermediate pressures are P2 = ',round(P2,2),'bar P3 = ',round(P3,3),'bar'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 21 - pg 9.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Amount of heat rejected in each intercooler is (kJ) = 113.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.36\n",
+ "#calculate the Amount of heat rejected\n",
+ "#Input data\n",
+ "P1=1.;#Atmospheric pressure in bar\n",
+ "P4=60.;#Delivery pressure in bar\n",
+ "T1=303.;#Initial temperature in K\n",
+ "n=1.3;#Index of compression\n",
+ "Cp=1.005;#Specific heat of air at constant pressure in kJ/kg K\n",
+ "S=3.;#Number of stages\n",
+ "\n",
+ "#Calculations\n",
+ "P2=P1*(P4/P1)**(1./3);#Intermediate pressure in bar\n",
+ "T2=T1*(P2/P1)**((n-1)/n);#Temperature of air entering the intercoolers in K\n",
+ "H=Cp*(T2-T1);#Heat rejected in each intercooler in kJ\n",
+ "\n",
+ "#Output\n",
+ "print 'Amount of heat rejected in each intercooler is (kJ) = ',round(H,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 22 - pg 9.37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)L.P. and I.P.compressor delivery pressure is P2 = 4.021 bar P3 = 16.17 bar\n",
+ "(b)Ratio of cylinder volumes is V1:V2:V3 = 16.17 : 4.021 : 1\n",
+ "(c)Total indicated power is (kW) = 72.2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 9.37\n",
+ "#calculate the compressor delivery pressure and Ratio of cylinder volumes\n",
+ "#Input data\n",
+ "P1=1.;#Pressure at the end of suction stroke in LP cylinder of a 3 stage single acting reciprocating compressor in bar\n",
+ "T1=293.;#Temperature at the end of suction stroke in LP cylinder in K\n",
+ "V=9.;#Free air delivered by the compressor in m**3\n",
+ "P4=65.;#Pressure delivered by the compressor in bar\n",
+ "n=1.25;#Polytropic index\n",
+ "\n",
+ "#Calculations\n",
+ "P2=P1*(P4/P1)**(1./3);#Intermediate pressure after stage 1 in bar\n",
+ "P3=P2*(P4/P1)**(1./3);#Intermediate pressure after stage 2 in bar\n",
+ "V3=1;#The volume of cylinder for the third stage in m**3\n",
+ "V2=V3*(P3/P2);#Volume of the cylinder for second stage in m**3\n",
+ "V1=(P2/P1)*V2;#Volume of the cylinder for first stage in m**3\n",
+ "W=(((3*n)/(n-1))*P1*10**5*V*(((P4/P1)**((n-1)/(3*n)))-1))/1000;#Work done by the compressor in kJ/min\n",
+ "Pi=W/60;#Indicated power in kW\n",
+ "\n",
+ "#Output\n",
+ "print '(a)L.P. and I.P.compressor delivery pressure is P2 = ',round(P2,3),'bar P3 =',round(P3,2),'bar'\n",
+ "print '(b)Ratio of cylinder volumes is V1:V2:V3 = ',round(V1,2),':',round(V2,3),':',V3\n",
+ "print '(c)Total indicated power is (kW) = ',round(Pi,2)\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/Thermodynamics/README.txt b/Thermodynamics/README.txt index 9f3df981..05817825 100755 --- a/Thermodynamics/README.txt +++ b/Thermodynamics/README.txt @@ -1,10 +1,10 @@ -Contributed By: Manikandan D +Contributed By: gokul lalani Course: be -College/Institute/Organization: EBET Group of Institutions,Kangayam -Department/Designation: Mechanical Engineering +College/Institute/Organization: Freelancer +Department/Designation: Developer Book Title: Thermodynamics -Author: C P Arora -Publisher: Tata McGraw Hill, New Delhi -Year of publication: 2001 -Isbn: 0-07-462014-2 -Edition: 1
\ No newline at end of file +Author: J. P. Holman +Publisher: Prentice Hall, New Jersey +Year of publication: 1988 +Isbn: 0070296332 +Edition: 4
\ No newline at end of file diff --git a/Thermodynamics/screenshots/12conventioanlpower.png b/Thermodynamics/screenshots/12conventioanlpower.png Binary files differnew file mode 100755 index 00000000..0036a410 --- /dev/null +++ b/Thermodynamics/screenshots/12conventioanlpower.png diff --git a/Thermodynamics/screenshots/12conventioanlpower_1.png b/Thermodynamics/screenshots/12conventioanlpower_1.png Binary files differnew file mode 100755 index 00000000..0036a410 --- /dev/null +++ b/Thermodynamics/screenshots/12conventioanlpower_1.png diff --git a/Thermodynamics/screenshots/ch1Introduction.png b/Thermodynamics/screenshots/ch1Introduction.png Binary files differnew file mode 100755 index 00000000..cc9662ef --- /dev/null +++ b/Thermodynamics/screenshots/ch1Introduction.png diff --git a/Thermodynamics/screenshots/ch1Introduction_1.png b/Thermodynamics/screenshots/ch1Introduction_1.png Binary files differnew file mode 100755 index 00000000..cc9662ef --- /dev/null +++ b/Thermodynamics/screenshots/ch1Introduction_1.png diff --git a/Thermodynamics/screenshots/fractionalpopulation.png b/Thermodynamics/screenshots/fractionalpopulation.png Binary files differnew file mode 100755 index 00000000..a70013f6 --- /dev/null +++ b/Thermodynamics/screenshots/fractionalpopulation.png diff --git a/Thermodynamics/screenshots/fractionalpopulation_1.png b/Thermodynamics/screenshots/fractionalpopulation_1.png Binary files differnew file mode 100755 index 00000000..a70013f6 --- /dev/null +++ b/Thermodynamics/screenshots/fractionalpopulation_1.png diff --git a/Thermodynamics_by_J._P._Holman/ch1.ipynb b/Thermodynamics_by_J._P._Holman/ch1.ipynb new file mode 100755 index 00000000..ab6704bd --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch1.ipynb @@ -0,0 +1,157 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8c130f65381c568b421044f85ca49022c02733507c1f974f96d3542659c93a58" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Introduction" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "d = 8. \t\t\t#in\n", + "ir = 16. \t\t\t#in\n", + "MW = 28.97\n", + "T = 70.+460 \t\t\t#R\n", + "P = 30+14.7 \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "V = math.pi**2 *d**2 *(d+ir)/4\n", + "V = V*10./12**3\n", + "Rair = 1545/MW\n", + "m = P*144*V/(Rair*T)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass of air = %.2f lbm\"%(m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of air = 4.99 lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.2 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V = 4. \t\t\t#in**3\n", + "P = 30. \t\t\t#psia\n", + "T = 500.\t\t\t#R\n", + "MW = 32.\n", + "\t\t\t\n", + "# Calculations\n", + "print (\"Metric unit conversion,\")\n", + "V = V*2.54**3 *10**-3\n", + "P = 30*4.448/(2.54**2 *10**-4)\n", + "T = 5*(T-32)/9 +273\n", + "n = P*V/(8314.5*T)\n", + "eta = n*1000\n", + "N = eta*6.025*10**23\n", + "m = eta*MW\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of molecules of oxygen = %.3e molecules\"%(N)\n", + "print \" Mass of molecules = %.1f g\"%(m)\n", + "\n", + "#The answer in the textbook is a bit different due to rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Metric unit conversion,\n", + "No. of molecules of oxygen = 1.843e+24 molecules\n", + " Mass of molecules = 97.9 g\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.3 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P = 14.7 \t\t\t#psia\n", + "T = 70.+460 \t\t\t#R\n", + "M = 32.\n", + "\t\t\t\n", + "# Calculations\n", + "Ro = 1545/M\n", + "V2 = 3*Ro*T\n", + "V2 = V2*32.174\n", + "vrms = math.sqrt(V2)\n", + "\t\t\t\n", + "# Results\n", + "print \"rms velocity = %d ft/sec\"%(vrms)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "rms velocity = 1571 ft/sec\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch10.ipynb b/Thermodynamics_by_J._P._Holman/ch10.ipynb new file mode 100755 index 00000000..b175206d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch10.ipynb @@ -0,0 +1,358 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:9a6776975ca26711999c009e1ea80f5d9873f1eba4664269073ed9b23e69c74f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 :\n", + "Gaseous Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 pg : 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 2. \n", + "M = 28.\n", + "M2 = 32.\n", + "PN = 300. \t\t\t#psia\n", + "Pt = 400.\t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "nN = m/M\n", + "PO = Pt-PN\n", + "nO = nN*PO/PN\n", + "mO = M2*nO\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass of oxygen added = %.3f lbm\"%(mO)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of oxygen added = 0.762 lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2 pg : 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "n = 0.0714\n", + "R = 1545.\n", + "T = 560. \t\t\t#R\n", + "P = 400. \t\t\t#psia\n", + "VN = n*R*T/(P*144)\n", + "VO = (0.0238)*R*T/(P*144)\n", + "V = VN+VO\n", + "\t\t\t\n", + "# Results\n", + "print \"Total volume = %.3f ft**3\"%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total volume = 1.430 ft**3\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3 pg : 265" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "m1 = 5.\n", + "m2 = 2.\n", + "cp1 = 0.248\n", + "cp2 = 0.203\n", + "T11 = 300. \t\t\t#F\n", + "T12 = 100. \t\t\t#F\n", + "P = 10. \t\t\t#psia\n", + "Pi = 20. \t\t\t#psia\n", + "Pf = 15. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = (m1*cp1*T11 + m2*cp2*T12)/(m1*cp1+m2*cp2)\n", + "n1 = m1/28.\n", + "n2 = m2/44.\n", + "n = n1+n2\n", + "P1 = P*n1/n\n", + "P2 = P*n2/n\n", + "dS = m2*(cp2*math.log((T2+460)/(T12+460)) - 35.1/778 *math.log(P2/Pi)) +m2*(cp2*math.log((T2+460)/(T12+460)) - 55.2/778 *math.log(P1/Pf))\n", + "\t\t\t\n", + "# Results\n", + "print \"change in enthalpy = %.2f B/R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "change in enthalpy = 0.49 B/R\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4 pg : 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Pg = 2.8886 \t\t\t#psia\n", + "P = 25. \t\t\t#psia\n", + "phi = 0.5\n", + "\t\t\t\n", + "# Calculations\n", + "pv = phi*Pg\n", + "pa = P-pv\n", + "w = 0.622*pv/pa\n", + "x = (w)/(1+w)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass fraction of water vapor in the mixture = %.4f lbm vapor/ lvm mixture\"%(x)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass fraction of water vapor in the mixture = 0.0367 lbm vapor/ lvm mixture\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5 pg : 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "pgw = 0.5069 \t\t\t#psia\n", + "p = 14.696 \t\t\t#psia\n", + "Td = 100. \t \t\t#F\n", + "Tw = 80. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "pv = pgw- (p-pgw)*(Td-Tw)/(2800-Tw)\n", + "pg = 0.9492 \t\t\t#psia\n", + "phi = pv/pg\n", + "\t\t\t\n", + "# Results\n", + "print \"relative humidity of air stream = %.1f percent\"%(phi*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "relative humidity of air stream = 42.4 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6 pg : 279" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "w1 = 0.0176 \t\t\t#lbm\n", + "w2 = 0.0093 \t\t\t#lbm\n", + "T2d = 73. \t\t\t#F\n", + "T2 = 55. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "hv1 = 1061+0.445*100\n", + "hv2 = 1061+0.445*55\n", + "hf = 23.06\n", + "q1 = 20.\n", + "q2 = 4.88\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat removed in cooling section = %d Btu/lbm \"%(q1)\n", + "print \"Heat added in heating section = %.2f Btu/lbm \"%(q2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat removed in cooling section = 20 Btu/lbm \n", + "Heat added in heating section = 4.88 Btu/lbm \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.7 pg : 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Tdb = 115. \t\t\t#F\n", + "ph = 0.05\n", + "\n", + "Twb = 67. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print (\"From steam tables, Twb = 67 F\")\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From steam tables, Twb = 67 F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.8 pg : 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "w1 = 206.\n", + "w2 = 55.\n", + "ma1 = 2.\n", + "ma2 = 3.\n", + "\t\t\t\n", + "# Calculations\n", + "w3 = (ma1*w1 + ma2*w2)/(ma1+ma2)\n", + "Tdb3 = 82. \t\t\t#F\n", + "TWb3 = 74.55 \t\t\t#F\n", + "phi3 = 70. \t \t\t#percent\n", + "\t\t\t\n", + "# Results\n", + "print \"relative humidity = %d percent\"%(phi3)\n", + "print \" Dry bulb temperature = %d F\"%(Tdb3)\n", + "print \" Wet bulb temperature = %.2f F\"%(TWb3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "relative humidity = 70 percent\n", + " Dry bulb temperature = 82 F\n", + " Wet bulb temperature = 74.55 F\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch10_1.ipynb b/Thermodynamics_by_J._P._Holman/ch10_1.ipynb new file mode 100755 index 00000000..b175206d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch10_1.ipynb @@ -0,0 +1,358 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:9a6776975ca26711999c009e1ea80f5d9873f1eba4664269073ed9b23e69c74f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 :\n", + "Gaseous Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 pg : 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 2. \n", + "M = 28.\n", + "M2 = 32.\n", + "PN = 300. \t\t\t#psia\n", + "Pt = 400.\t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "nN = m/M\n", + "PO = Pt-PN\n", + "nO = nN*PO/PN\n", + "mO = M2*nO\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass of oxygen added = %.3f lbm\"%(mO)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of oxygen added = 0.762 lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2 pg : 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "n = 0.0714\n", + "R = 1545.\n", + "T = 560. \t\t\t#R\n", + "P = 400. \t\t\t#psia\n", + "VN = n*R*T/(P*144)\n", + "VO = (0.0238)*R*T/(P*144)\n", + "V = VN+VO\n", + "\t\t\t\n", + "# Results\n", + "print \"Total volume = %.3f ft**3\"%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total volume = 1.430 ft**3\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3 pg : 265" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "m1 = 5.\n", + "m2 = 2.\n", + "cp1 = 0.248\n", + "cp2 = 0.203\n", + "T11 = 300. \t\t\t#F\n", + "T12 = 100. \t\t\t#F\n", + "P = 10. \t\t\t#psia\n", + "Pi = 20. \t\t\t#psia\n", + "Pf = 15. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = (m1*cp1*T11 + m2*cp2*T12)/(m1*cp1+m2*cp2)\n", + "n1 = m1/28.\n", + "n2 = m2/44.\n", + "n = n1+n2\n", + "P1 = P*n1/n\n", + "P2 = P*n2/n\n", + "dS = m2*(cp2*math.log((T2+460)/(T12+460)) - 35.1/778 *math.log(P2/Pi)) +m2*(cp2*math.log((T2+460)/(T12+460)) - 55.2/778 *math.log(P1/Pf))\n", + "\t\t\t\n", + "# Results\n", + "print \"change in enthalpy = %.2f B/R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "change in enthalpy = 0.49 B/R\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4 pg : 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Pg = 2.8886 \t\t\t#psia\n", + "P = 25. \t\t\t#psia\n", + "phi = 0.5\n", + "\t\t\t\n", + "# Calculations\n", + "pv = phi*Pg\n", + "pa = P-pv\n", + "w = 0.622*pv/pa\n", + "x = (w)/(1+w)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass fraction of water vapor in the mixture = %.4f lbm vapor/ lvm mixture\"%(x)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass fraction of water vapor in the mixture = 0.0367 lbm vapor/ lvm mixture\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5 pg : 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "pgw = 0.5069 \t\t\t#psia\n", + "p = 14.696 \t\t\t#psia\n", + "Td = 100. \t \t\t#F\n", + "Tw = 80. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "pv = pgw- (p-pgw)*(Td-Tw)/(2800-Tw)\n", + "pg = 0.9492 \t\t\t#psia\n", + "phi = pv/pg\n", + "\t\t\t\n", + "# Results\n", + "print \"relative humidity of air stream = %.1f percent\"%(phi*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "relative humidity of air stream = 42.4 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6 pg : 279" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "w1 = 0.0176 \t\t\t#lbm\n", + "w2 = 0.0093 \t\t\t#lbm\n", + "T2d = 73. \t\t\t#F\n", + "T2 = 55. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "hv1 = 1061+0.445*100\n", + "hv2 = 1061+0.445*55\n", + "hf = 23.06\n", + "q1 = 20.\n", + "q2 = 4.88\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat removed in cooling section = %d Btu/lbm \"%(q1)\n", + "print \"Heat added in heating section = %.2f Btu/lbm \"%(q2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat removed in cooling section = 20 Btu/lbm \n", + "Heat added in heating section = 4.88 Btu/lbm \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.7 pg : 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Tdb = 115. \t\t\t#F\n", + "ph = 0.05\n", + "\n", + "Twb = 67. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print (\"From steam tables, Twb = 67 F\")\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From steam tables, Twb = 67 F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.8 pg : 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "w1 = 206.\n", + "w2 = 55.\n", + "ma1 = 2.\n", + "ma2 = 3.\n", + "\t\t\t\n", + "# Calculations\n", + "w3 = (ma1*w1 + ma2*w2)/(ma1+ma2)\n", + "Tdb3 = 82. \t\t\t#F\n", + "TWb3 = 74.55 \t\t\t#F\n", + "phi3 = 70. \t \t\t#percent\n", + "\t\t\t\n", + "# Results\n", + "print \"relative humidity = %d percent\"%(phi3)\n", + "print \" Dry bulb temperature = %d F\"%(Tdb3)\n", + "print \" Wet bulb temperature = %.2f F\"%(TWb3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "relative humidity = 70 percent\n", + " Dry bulb temperature = 82 F\n", + " Wet bulb temperature = 74.55 F\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch11.ipynb b/Thermodynamics_by_J._P._Holman/ch11.ipynb new file mode 100755 index 00000000..657d8d20 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch11.ipynb @@ -0,0 +1,390 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:bcb2b5536fdc9000213789c2755747f3e4bd3724ffe95c35320fbc2314325dca" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 :\n", + "Chemical Thermodynamics and\n", + "Equilibrium" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 pg : 287" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x = 1.5\n", + "P = 14.696 \t \t\t#psia\n", + "m = 28.96\n", + "\t\t\t\n", + "# Calculations\n", + "mf = 114. \t\t\t# lbm/mol fuel\n", + "ma = x*12.5*(1+3.76)*m\n", + "AF = ma/mf\n", + "n1 = 8.\n", + "n2 = 9.\n", + "n3 = (x-1)*12.5 \n", + "n4 = x*3.76*12.5\n", + "np = n1+n2+n3+n4\n", + "x1 = n1/np\n", + "x2 = n2/np\n", + "x3 = n3/np\n", + "x4 = n4/np\n", + "ph = x2*P\n", + "Td = 113.5 \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Air fuel ratio = %.1f lbm air/lbm fuel\"%(AF)\n", + "print \" Mole fraction of CO2 = %.2f percent\"%(x1*100)\n", + "print \" Mole fraction of H2O = %.2f percent\"%(x2*100)\n", + "print \" Mole fraction of O2 = %.2f percent\"%(x3*100)\n", + "print \" Mole fraction of N2 = %.2f percent\"%(x4*100)\n", + "print (\"From tables of saturation pressure\")\n", + "print \"Dew point = %.1f F\"%(Td)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air fuel ratio = 22.7 lbm air/lbm fuel\n", + " Mole fraction of CO2 = 8.53 percent\n", + " Mole fraction of H2O = 9.60 percent\n", + " Mole fraction of O2 = 6.67 percent\n", + " Mole fraction of N2 = 75.20 percent\n", + "From tables of saturation pressure\n", + "Dew point = 113.5 F\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2 pg : 290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x1 = 9.\n", + "x2 = 1.2\n", + "x3 = 1.5\n", + "x4 = 88.3\n", + "\t\t\t\n", + "# Calculations\n", + "a = x1+x2\n", + "b = 2*a\n", + "xO = (2*x1 + x2+ 2*x3 + b)/2\n", + "xN = x4/3.76\n", + "ratio = xO/a\n", + "percent = ratio/2 *100\n", + "\t\t\t\n", + "# Results\n", + "print \"Percent theoretical air = %.1f percent\"%(percent)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percent theoretical air = 104.4 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 pg : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 440. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = -169290\n", + "h2 = 7597.6\n", + "h3 = 4030.2\n", + "ht = h1+h2-h3\n", + "\t\t\t\n", + "# Results\n", + "print \"Molal enthalpy of CO2 = %d Btu/lbm mole\"%(ht)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Molal enthalpy of CO2 = -165722 Btu/lbm mole\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 pg : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 77. \t \t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "Hr = -36420. \t\t\t#B\n", + "hc = -169290. \t\t\t#B/lb mol\n", + "hh = -122970. \t\t\t#B/lb mol\n", + "Hp = 2*hc+3*hh\n", + "Q = Hp-Hr\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat transfer = %d B/mol fuel\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer = -671070 B/mol fuel\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5 pg : 294" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T2 = 440. \t\t\t#F\n", + "T1 = 77. \t\t\t#F\n", + "Mch4 = 16.\n", + "Mw = 18.\n", + "\t\t\t\n", + "# Calculations\n", + "h77 = 3725.1\n", + "ht = 6337.9\n", + "ht2 = 7597.6\n", + "h772 = 4030.2\n", + "hwt = 1260.3\n", + "h77w = 45.02\n", + "hr77 = -383040. \t\t\t#B/lbm mol\n", + "dHR = 1*Mch4*0.532*(T1-T2) + 2*(h77-ht)\n", + "dHp = 1*(ht2-h772) + 2*Mw*(hwt - h77w)\n", + "hrp = dHp+hr77+dHR\n", + "\t\t\t\n", + "# Results\n", + "print \"Enthalpy of combustion of gaseous methane = %d B/lbm mol fuel\"%(hrp)\n", + "\n", + "#The calculation in textbook is wrong Please check it using a calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy of combustion of gaseous methane = -344037 B/lbm mol fuel\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6 pg : 295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Hr = -107530. \t\t\t#B/mol fuel\n", + "print (\"By iteration of temperatures, T = 2700 R\")\n", + "T = 2700. \t\t\t#R\n", + "\t\t\t\n", + "# Results\n", + "print \"Adiabatic flame temperature = %d R\"%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "By iteration of temperatures, T = 2700 R\n", + "Adiabatic flame temperature = 2700 R\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.7 pg : 306" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import poly1d,roots\n", + "\n", + "# Variables\n", + "import math \n", + "Kp = 0.668\n", + "y = Kp**2\n", + "\t\t\t\n", + "# Calculations\n", + "x = poly1d(0)\n", + "vec = roots([y,2,-y,-2,0]) #x**3 + y*x**3 + 2*y*x**2 -y*x -2*y)\n", + "\n", + "eps = vec[0]\n", + "x1 = (1-eps)/(1+ eps/2)\n", + "x2 = eps/(1+eps/2)\n", + "x3 = eps/2/(1+ eps/2)\n", + "\t\t\t\n", + "# Results\n", + "print \"degree of reaction = %.3f \"%(eps)\n", + "print \" Equilibrium concentration of CO2 = %.3f \"%(x1)\n", + "print \" Equilibrium concentration of CO = %.3f \"%(x2)\n", + "print \" Equilibrium concentration of O2 = %.3f \"%(x3)\n", + "\n", + "#the answers are different due to approximation in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "degree of reaction = -4.482 \n", + " Equilibrium concentration of CO2 = -4.417 \n", + " Equilibrium concentration of CO = 3.612 \n", + " Equilibrium concentration of O2 = 1.806 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.8 pg : 307" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import roots\n", + "\n", + "# Variables\n", + "Kp = 15.63\n", + "y = Kp\n", + "\t\t\t\n", + "# Calculations\n", + "vec = roots([y+1,0,-y])#x**2 + y*x**2 - y)\n", + "eps = vec[0]\n", + "x1 = (1-eps)/(1+eps)\n", + "x2 = eps/(1+eps)\n", + "x3 = eps/(1+eps)\n", + "\t\t\t\n", + "# Results\n", + "print \" Equilibrium concentration of Cs = %.4f \"%(x1)\n", + "print \" Equilibrium concentration of Cs+ = %.4f \"%(x2)\n", + "print \" Equilibrium concentration of e- = %.4f \"%(x3)\n", + "\n", + "#the answers are a bit different due to approximation in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Equilibrium concentration of Cs = 0.0155 \n", + " Equilibrium concentration of Cs+ = 0.4922 \n", + " Equilibrium concentration of e- = 0.4922 \n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch11_1.ipynb b/Thermodynamics_by_J._P._Holman/ch11_1.ipynb new file mode 100755 index 00000000..657d8d20 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch11_1.ipynb @@ -0,0 +1,390 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:bcb2b5536fdc9000213789c2755747f3e4bd3724ffe95c35320fbc2314325dca" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 :\n", + "Chemical Thermodynamics and\n", + "Equilibrium" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 pg : 287" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x = 1.5\n", + "P = 14.696 \t \t\t#psia\n", + "m = 28.96\n", + "\t\t\t\n", + "# Calculations\n", + "mf = 114. \t\t\t# lbm/mol fuel\n", + "ma = x*12.5*(1+3.76)*m\n", + "AF = ma/mf\n", + "n1 = 8.\n", + "n2 = 9.\n", + "n3 = (x-1)*12.5 \n", + "n4 = x*3.76*12.5\n", + "np = n1+n2+n3+n4\n", + "x1 = n1/np\n", + "x2 = n2/np\n", + "x3 = n3/np\n", + "x4 = n4/np\n", + "ph = x2*P\n", + "Td = 113.5 \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Air fuel ratio = %.1f lbm air/lbm fuel\"%(AF)\n", + "print \" Mole fraction of CO2 = %.2f percent\"%(x1*100)\n", + "print \" Mole fraction of H2O = %.2f percent\"%(x2*100)\n", + "print \" Mole fraction of O2 = %.2f percent\"%(x3*100)\n", + "print \" Mole fraction of N2 = %.2f percent\"%(x4*100)\n", + "print (\"From tables of saturation pressure\")\n", + "print \"Dew point = %.1f F\"%(Td)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air fuel ratio = 22.7 lbm air/lbm fuel\n", + " Mole fraction of CO2 = 8.53 percent\n", + " Mole fraction of H2O = 9.60 percent\n", + " Mole fraction of O2 = 6.67 percent\n", + " Mole fraction of N2 = 75.20 percent\n", + "From tables of saturation pressure\n", + "Dew point = 113.5 F\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2 pg : 290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x1 = 9.\n", + "x2 = 1.2\n", + "x3 = 1.5\n", + "x4 = 88.3\n", + "\t\t\t\n", + "# Calculations\n", + "a = x1+x2\n", + "b = 2*a\n", + "xO = (2*x1 + x2+ 2*x3 + b)/2\n", + "xN = x4/3.76\n", + "ratio = xO/a\n", + "percent = ratio/2 *100\n", + "\t\t\t\n", + "# Results\n", + "print \"Percent theoretical air = %.1f percent\"%(percent)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percent theoretical air = 104.4 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 pg : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 440. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = -169290\n", + "h2 = 7597.6\n", + "h3 = 4030.2\n", + "ht = h1+h2-h3\n", + "\t\t\t\n", + "# Results\n", + "print \"Molal enthalpy of CO2 = %d Btu/lbm mole\"%(ht)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Molal enthalpy of CO2 = -165722 Btu/lbm mole\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 pg : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 77. \t \t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "Hr = -36420. \t\t\t#B\n", + "hc = -169290. \t\t\t#B/lb mol\n", + "hh = -122970. \t\t\t#B/lb mol\n", + "Hp = 2*hc+3*hh\n", + "Q = Hp-Hr\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat transfer = %d B/mol fuel\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer = -671070 B/mol fuel\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5 pg : 294" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T2 = 440. \t\t\t#F\n", + "T1 = 77. \t\t\t#F\n", + "Mch4 = 16.\n", + "Mw = 18.\n", + "\t\t\t\n", + "# Calculations\n", + "h77 = 3725.1\n", + "ht = 6337.9\n", + "ht2 = 7597.6\n", + "h772 = 4030.2\n", + "hwt = 1260.3\n", + "h77w = 45.02\n", + "hr77 = -383040. \t\t\t#B/lbm mol\n", + "dHR = 1*Mch4*0.532*(T1-T2) + 2*(h77-ht)\n", + "dHp = 1*(ht2-h772) + 2*Mw*(hwt - h77w)\n", + "hrp = dHp+hr77+dHR\n", + "\t\t\t\n", + "# Results\n", + "print \"Enthalpy of combustion of gaseous methane = %d B/lbm mol fuel\"%(hrp)\n", + "\n", + "#The calculation in textbook is wrong Please check it using a calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy of combustion of gaseous methane = -344037 B/lbm mol fuel\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6 pg : 295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Hr = -107530. \t\t\t#B/mol fuel\n", + "print (\"By iteration of temperatures, T = 2700 R\")\n", + "T = 2700. \t\t\t#R\n", + "\t\t\t\n", + "# Results\n", + "print \"Adiabatic flame temperature = %d R\"%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "By iteration of temperatures, T = 2700 R\n", + "Adiabatic flame temperature = 2700 R\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.7 pg : 306" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import poly1d,roots\n", + "\n", + "# Variables\n", + "import math \n", + "Kp = 0.668\n", + "y = Kp**2\n", + "\t\t\t\n", + "# Calculations\n", + "x = poly1d(0)\n", + "vec = roots([y,2,-y,-2,0]) #x**3 + y*x**3 + 2*y*x**2 -y*x -2*y)\n", + "\n", + "eps = vec[0]\n", + "x1 = (1-eps)/(1+ eps/2)\n", + "x2 = eps/(1+eps/2)\n", + "x3 = eps/2/(1+ eps/2)\n", + "\t\t\t\n", + "# Results\n", + "print \"degree of reaction = %.3f \"%(eps)\n", + "print \" Equilibrium concentration of CO2 = %.3f \"%(x1)\n", + "print \" Equilibrium concentration of CO = %.3f \"%(x2)\n", + "print \" Equilibrium concentration of O2 = %.3f \"%(x3)\n", + "\n", + "#the answers are different due to approximation in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "degree of reaction = -4.482 \n", + " Equilibrium concentration of CO2 = -4.417 \n", + " Equilibrium concentration of CO = 3.612 \n", + " Equilibrium concentration of O2 = 1.806 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.8 pg : 307" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import roots\n", + "\n", + "# Variables\n", + "Kp = 15.63\n", + "y = Kp\n", + "\t\t\t\n", + "# Calculations\n", + "vec = roots([y+1,0,-y])#x**2 + y*x**2 - y)\n", + "eps = vec[0]\n", + "x1 = (1-eps)/(1+eps)\n", + "x2 = eps/(1+eps)\n", + "x3 = eps/(1+eps)\n", + "\t\t\t\n", + "# Results\n", + "print \" Equilibrium concentration of Cs = %.4f \"%(x1)\n", + "print \" Equilibrium concentration of Cs+ = %.4f \"%(x2)\n", + "print \" Equilibrium concentration of e- = %.4f \"%(x3)\n", + "\n", + "#the answers are a bit different due to approximation in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Equilibrium concentration of Cs = 0.0155 \n", + " Equilibrium concentration of Cs+ = 0.4922 \n", + " Equilibrium concentration of e- = 0.4922 \n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch12.ipynb b/Thermodynamics_by_J._P._Holman/ch12.ipynb new file mode 100755 index 00000000..de315e52 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch12.ipynb @@ -0,0 +1,606 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:82090567853b966deac889dc0128f75e1e99033e5ed66e328546471b278bffea" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 :\n", + "conventional power and\n", + "refrigeration cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 pg : 321" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1357. \t\t\t#500 psia, 700 F\n", + "h2 = 935. \t\t\t#P2 = 2 psia\n", + "h3 = 93.99 \t\t\t#sat liq at 2 psia\n", + "vf = 0.01613\n", + "P4 = 500. \t\t\t#psia\n", + "P3 = 2. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dh4 = vf*(P4-P3)*144/778.\n", + "h4 = h3+dh4\n", + "eta = ((h1-h2)-(h4-h3))/(h1-h4)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent \"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 33.3 percent \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.2 pg : 323" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1357. \t\t\t#500 psia 700F\n", + "h2 = 1194. \t\t\t#P2 = 100 psia\n", + "h3 = 1379. \t\t\t#100 psia, 700 F\n", + "h4 = 1047. \t\t\t#p4 = 2 psia\n", + "h5 = 93.99 \t\t\t#sat liq at 2 psia\n", + "h6 = 95.02 \t\t\t#example 12.1\n", + "\t\t\t\n", + "# Calculations\n", + "W = h1-h2+h3-h4-(h6-h5)\n", + "Q = (h1-h6)+(h3-h2)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.2f percent\"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 34.14 percent\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.3 pg : 327" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = 1357. \t\t\t#500 psia, 700F\n", + "h2 = 1194. \t\t\t#100 psia\n", + "h3 = 935.\t\t\t#2 psia\n", + "h4 = 93.99 \t\t\t#sat liq at 2 psia\n", + "vf = 0.01613 \n", + "vf2 = 0.01774\n", + "P5 = 100. \t\t\t#psia\n", + "P4 = 2. \t\t\t#psia\n", + "dh4 = vf*(P5-P4)*144/778.\n", + "h5 = h4+dh4\n", + "h6 = 298.4\n", + "P7 = 500. \t\t\t#psia\n", + "P6 = 100. \t\t\t#psia\n", + "dh6 = vf2*(P7-P6)*144./778\n", + "h7 = dh6+h6\n", + "m = (h6-h5)/(h2-h5)\n", + "W = h1-h2 + (1-m)*(h2-h3) - (1-m)*(h5-h4) -(h7-h6)\n", + "Q = h1-h7\n", + "etath = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent\"%(etath*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 35.2 percent\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.4 pg : 330" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x = 0.8\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = 1357. \t\t\t#500 psia 700F\n", + "h2 = 1194. \t\t\t#P2 = 100 psia\n", + "h3 = 1379. \t\t\t#100 psia, 700 F\n", + "h4 = 1047. \t\t\t#p4 = 2 psia\n", + "h5 = 93.99 \t\t\t#sat liq at 2 psia\n", + "h6 = 95.02 \t\t\t#example 12.1\n", + "h2d = h1- x*(h1-h2) \n", + "h4d = h3- x*(h3-h4)\n", + "W = (h1-h2d) +(h3-h4d) - (h6-h5)\n", + "Q = (h1-h6) + (h3-h2d)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %d percent\"%(eta*100+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 28 percent\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.5 pg : 335" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P4 = 50. \t\t\t#psia\n", + "P1 = 14.7 \t\t\t#psia\n", + "P3 = 50. \t\t\t#psia\n", + "P2 = 14.7 \t\t\t#psia\n", + "g = 1.4\n", + "\t\t\t\n", + "# Calculations\n", + "V1r = (P4/P1)**(1/g)\n", + "V2r = (P3/P2)**(1/g)\n", + "#After solving,\n", + "V4 = 5.38 \t\t\t#ft**3/min\n", + "V1 = 12.9 \t \t\t#ft**3/min\n", + "V2 = 112.9 \t\t\t#ft**3/min\n", + "PD = V2-V4\n", + "etavol = (V2-V1)/(V2-V4)\n", + "W32 = g*P2*144*V2*((P3/P2)**((g-1)/g) -1 ) /(1-g)\n", + "W41 = g*P4*144*V4*((P1/P4)**((g-1)/g) -1 ) /(1-g)\n", + "Wt = W32+W41\n", + "\t\t\t\n", + "# Results\n", + "print \"Total work = %.2e ft-lbf /min\"%(Wt)\n", + "\t\t\t#The answer given in textbook is wrong . please verify it umath.sing a calculator\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total work = -3.10e+05 ft-lbf /min\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.6 pg : 337" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P1 = 14.7 \t\t\t#psia\n", + "P4 = 100. \t\t\t#psia\n", + "T1 = 530. \t\t\t#R\n", + "T3 = T1\n", + "g = 1.4\n", + "m = 10. \t\t\t#lbm\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "P2 = math.sqrt(P1*P4)\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T2\n", + "W = 2*cp*(T2-T1)\n", + "Wt = W*m\n", + "hp = Wt*60./2545\n", + "Q = m*cp*(T2-T3)\n", + "T4 = T1*(P4/P1)**((g-1)/g)\n", + "W2 = m*cp*(T4-T1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Work required in case 1 = %d Btu/min\"%(Wt+1)\n", + "print \" Work required in case 2 = %d Btu/min\"%(W2+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work required in case 1 = 802 Btu/min\n", + " Work required in case 2 = 928 Btu/min\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.7 pg : 342" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "g = 1.4\n", + "r1 = 10.\n", + "r2 = 12.\n", + "r3 = 15.\n", + "Tl = 530. \t\t\t#R\n", + "Th = 1960. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "eta1 = 1- (r1)**(1-g)\n", + "eta2 = 1- (r2)**(1-g)\n", + "eta3 = 1- (r3)**(1-g)\n", + "etac = 1-Tl/Th\n", + "\t\t\t\n", + "# Results\n", + "print \"Efficiency in case 1 = %.1f percent\"%(eta1*100)\n", + "print \" Efficiency in case 2 = %.1f percent\"%(eta2*100)\n", + "print \" Efficiency in case 3 = %.1f percent\"%(eta3*100)\n", + "print \" Carnot efficiency = %.f percent\"%(etac*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency in case 1 = 60.2 percent\n", + " Efficiency in case 2 = 63.0 percent\n", + " Efficiency in case 3 = 66.1 percent\n", + " Carnot efficiency = 73 percent\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.8 pg : 344" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 70.+460 \t\t\t#R\n", + "P1 = 14.7 \t\t\t#psia\n", + "g = 1.4\n", + "r = 15.\n", + "rc = 2.\n", + "cp = 0.24\n", + "cp2 = 0.1715\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(r)**(g-1)\n", + "T3 = rc*T2\n", + "T4 = T3*(rc/r)**(g-1)\n", + "Qh = cp*(T3-T2)\n", + "Ql = cp2*(T4-T1)\n", + "W = Qh-Ql\n", + "eta = W/Qh\n", + "\t\t\t\n", + "# Results\n", + "print \"Work output = %.f B/lbm\"%(W)\n", + "print \" Efficiency = %.1f percent\"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work output = 227 B/lbm\n", + " Efficiency = 60.4 percent\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.9 pg : 351" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 14.7 \t\t\t#psia\n", + "P4 = 14.7 \t\t\t#psia\n", + "T1 = 530. \t\t\t#R\n", + "T3 = 1960. \t\t\t#R\n", + "P2 = 60. \t\t\t#psia\n", + "P3 = P2\n", + "g = 1.4\n", + "eta1 = 0.85\n", + "eta2 = 0.9\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T3*(P4/P3)**((g-1)/g)\n", + "T2d = (T2-T1)/eta1 + T1\n", + "T4d = -eta2*(T3-T4) +T3\n", + "Wact = 0.24*(T3-T4d - (T2d-T1))\n", + "Qh = 0.24*(T3-T2d)\n", + "etath = Wact/Qh\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent\"%(etath*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 24.5 percent\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.10 pg : 352" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "e = 0.83\n", + "\t\t\t\n", + "# Calculations\n", + "T1 = 530. \t\t\t#R\n", + "T2d = 838. \t\t\t#R\n", + "T6d = T2d\n", + "T3 = 1960. \t\t\t#R\n", + "T4d = 1375. \t\t\t#R\n", + "T5d = T4d\n", + "T5 = e*(T5d-T2d) +T2d\n", + "W = 0.24*((T3-T4d)- (T2d-T1))\n", + "Q = 0.24*(T3-T5)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %d percent\"%(eta*100+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 41 percent\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.11 pg : 354" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T1 = 420. \t\t\t#R\n", + "T11 = 530. \t\t\t#R\n", + "T3 = 2460. \t\t\t#R\n", + "V1 = 300. \t\t\t#ft/sec\n", + "P1 = 5. \t\t\t#psia\n", + "P5 = P1\n", + "P2 = 50. \t\t\t#psia\n", + "P3 = 5. \t\t\t#psia\n", + "P4 = 50. \t\t\t#psia\n", + "g = 1.4\n", + "cp = 0.24\n", + "m = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T3-T2+T11\n", + "T5 = T3*(P3/P4)**((g-1)/g)\n", + "V5 = math.sqrt(2*32.2*cp*(T4-T5)*778)\n", + "T = m*(V1-V5)/32.2\n", + "Qh = cp*(T3-T2)\n", + "P = -T*V1\n", + "\t\t\t\n", + "# Results\n", + "print \"Thrust = %.1f lbf\"%(T)\n", + "print \" Heat input = %d B/lbm\"%(Qh)\n", + "print \" Power = %d ft-lbf /sec\"%(round(P,-3))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust = -93.1 lbf\n", + " Heat input = 395 B/lbm\n", + " Power = 28000 ft-lbf /sec\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.12 pg : 360" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "h1 = 80.419 \t\t\t#B/lbm\n", + "h3 = 36.013 \t\t\t#B/lbm\n", + "h4 = h3\n", + "P3 = 172.35 \t\t\t#psia\n", + "P2 = P3\n", + "m = 5. \t\t\t#tons\n", + "Q = 12000.\n", + "\t\t\t\n", + "# Calculations\n", + "h2 = 91.5 \t\t\t#B/lbm\n", + "COP = (h1-h4)/(h2-h1)\n", + "W = h2-h1\n", + "md = m*Q/(h1-h4)\n", + "Wt = md*(h2-h1)\n", + "Wt2 = Wt/2545.\n", + "\t\t\t\n", + "# Results\n", + "print \"Coefficient of performance = %.1f\"%(COP)\n", + "print \" Input work = %.1f hp\"%(Wt2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of performance = 4.0\n", + " Input work = 5.9 hp\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch12_1.ipynb b/Thermodynamics_by_J._P._Holman/ch12_1.ipynb new file mode 100755 index 00000000..de315e52 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch12_1.ipynb @@ -0,0 +1,606 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:82090567853b966deac889dc0128f75e1e99033e5ed66e328546471b278bffea" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 :\n", + "conventional power and\n", + "refrigeration cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 pg : 321" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1357. \t\t\t#500 psia, 700 F\n", + "h2 = 935. \t\t\t#P2 = 2 psia\n", + "h3 = 93.99 \t\t\t#sat liq at 2 psia\n", + "vf = 0.01613\n", + "P4 = 500. \t\t\t#psia\n", + "P3 = 2. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dh4 = vf*(P4-P3)*144/778.\n", + "h4 = h3+dh4\n", + "eta = ((h1-h2)-(h4-h3))/(h1-h4)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent \"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 33.3 percent \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.2 pg : 323" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1357. \t\t\t#500 psia 700F\n", + "h2 = 1194. \t\t\t#P2 = 100 psia\n", + "h3 = 1379. \t\t\t#100 psia, 700 F\n", + "h4 = 1047. \t\t\t#p4 = 2 psia\n", + "h5 = 93.99 \t\t\t#sat liq at 2 psia\n", + "h6 = 95.02 \t\t\t#example 12.1\n", + "\t\t\t\n", + "# Calculations\n", + "W = h1-h2+h3-h4-(h6-h5)\n", + "Q = (h1-h6)+(h3-h2)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.2f percent\"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 34.14 percent\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.3 pg : 327" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = 1357. \t\t\t#500 psia, 700F\n", + "h2 = 1194. \t\t\t#100 psia\n", + "h3 = 935.\t\t\t#2 psia\n", + "h4 = 93.99 \t\t\t#sat liq at 2 psia\n", + "vf = 0.01613 \n", + "vf2 = 0.01774\n", + "P5 = 100. \t\t\t#psia\n", + "P4 = 2. \t\t\t#psia\n", + "dh4 = vf*(P5-P4)*144/778.\n", + "h5 = h4+dh4\n", + "h6 = 298.4\n", + "P7 = 500. \t\t\t#psia\n", + "P6 = 100. \t\t\t#psia\n", + "dh6 = vf2*(P7-P6)*144./778\n", + "h7 = dh6+h6\n", + "m = (h6-h5)/(h2-h5)\n", + "W = h1-h2 + (1-m)*(h2-h3) - (1-m)*(h5-h4) -(h7-h6)\n", + "Q = h1-h7\n", + "etath = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent\"%(etath*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 35.2 percent\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.4 pg : 330" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x = 0.8\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = 1357. \t\t\t#500 psia 700F\n", + "h2 = 1194. \t\t\t#P2 = 100 psia\n", + "h3 = 1379. \t\t\t#100 psia, 700 F\n", + "h4 = 1047. \t\t\t#p4 = 2 psia\n", + "h5 = 93.99 \t\t\t#sat liq at 2 psia\n", + "h6 = 95.02 \t\t\t#example 12.1\n", + "h2d = h1- x*(h1-h2) \n", + "h4d = h3- x*(h3-h4)\n", + "W = (h1-h2d) +(h3-h4d) - (h6-h5)\n", + "Q = (h1-h6) + (h3-h2d)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %d percent\"%(eta*100+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 28 percent\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.5 pg : 335" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P4 = 50. \t\t\t#psia\n", + "P1 = 14.7 \t\t\t#psia\n", + "P3 = 50. \t\t\t#psia\n", + "P2 = 14.7 \t\t\t#psia\n", + "g = 1.4\n", + "\t\t\t\n", + "# Calculations\n", + "V1r = (P4/P1)**(1/g)\n", + "V2r = (P3/P2)**(1/g)\n", + "#After solving,\n", + "V4 = 5.38 \t\t\t#ft**3/min\n", + "V1 = 12.9 \t \t\t#ft**3/min\n", + "V2 = 112.9 \t\t\t#ft**3/min\n", + "PD = V2-V4\n", + "etavol = (V2-V1)/(V2-V4)\n", + "W32 = g*P2*144*V2*((P3/P2)**((g-1)/g) -1 ) /(1-g)\n", + "W41 = g*P4*144*V4*((P1/P4)**((g-1)/g) -1 ) /(1-g)\n", + "Wt = W32+W41\n", + "\t\t\t\n", + "# Results\n", + "print \"Total work = %.2e ft-lbf /min\"%(Wt)\n", + "\t\t\t#The answer given in textbook is wrong . please verify it umath.sing a calculator\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total work = -3.10e+05 ft-lbf /min\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.6 pg : 337" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P1 = 14.7 \t\t\t#psia\n", + "P4 = 100. \t\t\t#psia\n", + "T1 = 530. \t\t\t#R\n", + "T3 = T1\n", + "g = 1.4\n", + "m = 10. \t\t\t#lbm\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "P2 = math.sqrt(P1*P4)\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T2\n", + "W = 2*cp*(T2-T1)\n", + "Wt = W*m\n", + "hp = Wt*60./2545\n", + "Q = m*cp*(T2-T3)\n", + "T4 = T1*(P4/P1)**((g-1)/g)\n", + "W2 = m*cp*(T4-T1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Work required in case 1 = %d Btu/min\"%(Wt+1)\n", + "print \" Work required in case 2 = %d Btu/min\"%(W2+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work required in case 1 = 802 Btu/min\n", + " Work required in case 2 = 928 Btu/min\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.7 pg : 342" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "g = 1.4\n", + "r1 = 10.\n", + "r2 = 12.\n", + "r3 = 15.\n", + "Tl = 530. \t\t\t#R\n", + "Th = 1960. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "eta1 = 1- (r1)**(1-g)\n", + "eta2 = 1- (r2)**(1-g)\n", + "eta3 = 1- (r3)**(1-g)\n", + "etac = 1-Tl/Th\n", + "\t\t\t\n", + "# Results\n", + "print \"Efficiency in case 1 = %.1f percent\"%(eta1*100)\n", + "print \" Efficiency in case 2 = %.1f percent\"%(eta2*100)\n", + "print \" Efficiency in case 3 = %.1f percent\"%(eta3*100)\n", + "print \" Carnot efficiency = %.f percent\"%(etac*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency in case 1 = 60.2 percent\n", + " Efficiency in case 2 = 63.0 percent\n", + " Efficiency in case 3 = 66.1 percent\n", + " Carnot efficiency = 73 percent\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.8 pg : 344" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 70.+460 \t\t\t#R\n", + "P1 = 14.7 \t\t\t#psia\n", + "g = 1.4\n", + "r = 15.\n", + "rc = 2.\n", + "cp = 0.24\n", + "cp2 = 0.1715\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(r)**(g-1)\n", + "T3 = rc*T2\n", + "T4 = T3*(rc/r)**(g-1)\n", + "Qh = cp*(T3-T2)\n", + "Ql = cp2*(T4-T1)\n", + "W = Qh-Ql\n", + "eta = W/Qh\n", + "\t\t\t\n", + "# Results\n", + "print \"Work output = %.f B/lbm\"%(W)\n", + "print \" Efficiency = %.1f percent\"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work output = 227 B/lbm\n", + " Efficiency = 60.4 percent\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.9 pg : 351" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 14.7 \t\t\t#psia\n", + "P4 = 14.7 \t\t\t#psia\n", + "T1 = 530. \t\t\t#R\n", + "T3 = 1960. \t\t\t#R\n", + "P2 = 60. \t\t\t#psia\n", + "P3 = P2\n", + "g = 1.4\n", + "eta1 = 0.85\n", + "eta2 = 0.9\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T3*(P4/P3)**((g-1)/g)\n", + "T2d = (T2-T1)/eta1 + T1\n", + "T4d = -eta2*(T3-T4) +T3\n", + "Wact = 0.24*(T3-T4d - (T2d-T1))\n", + "Qh = 0.24*(T3-T2d)\n", + "etath = Wact/Qh\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent\"%(etath*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 24.5 percent\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.10 pg : 352" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "e = 0.83\n", + "\t\t\t\n", + "# Calculations\n", + "T1 = 530. \t\t\t#R\n", + "T2d = 838. \t\t\t#R\n", + "T6d = T2d\n", + "T3 = 1960. \t\t\t#R\n", + "T4d = 1375. \t\t\t#R\n", + "T5d = T4d\n", + "T5 = e*(T5d-T2d) +T2d\n", + "W = 0.24*((T3-T4d)- (T2d-T1))\n", + "Q = 0.24*(T3-T5)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %d percent\"%(eta*100+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 41 percent\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.11 pg : 354" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T1 = 420. \t\t\t#R\n", + "T11 = 530. \t\t\t#R\n", + "T3 = 2460. \t\t\t#R\n", + "V1 = 300. \t\t\t#ft/sec\n", + "P1 = 5. \t\t\t#psia\n", + "P5 = P1\n", + "P2 = 50. \t\t\t#psia\n", + "P3 = 5. \t\t\t#psia\n", + "P4 = 50. \t\t\t#psia\n", + "g = 1.4\n", + "cp = 0.24\n", + "m = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T3-T2+T11\n", + "T5 = T3*(P3/P4)**((g-1)/g)\n", + "V5 = math.sqrt(2*32.2*cp*(T4-T5)*778)\n", + "T = m*(V1-V5)/32.2\n", + "Qh = cp*(T3-T2)\n", + "P = -T*V1\n", + "\t\t\t\n", + "# Results\n", + "print \"Thrust = %.1f lbf\"%(T)\n", + "print \" Heat input = %d B/lbm\"%(Qh)\n", + "print \" Power = %d ft-lbf /sec\"%(round(P,-3))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust = -93.1 lbf\n", + " Heat input = 395 B/lbm\n", + " Power = 28000 ft-lbf /sec\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.12 pg : 360" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "h1 = 80.419 \t\t\t#B/lbm\n", + "h3 = 36.013 \t\t\t#B/lbm\n", + "h4 = h3\n", + "P3 = 172.35 \t\t\t#psia\n", + "P2 = P3\n", + "m = 5. \t\t\t#tons\n", + "Q = 12000.\n", + "\t\t\t\n", + "# Calculations\n", + "h2 = 91.5 \t\t\t#B/lbm\n", + "COP = (h1-h4)/(h2-h1)\n", + "W = h2-h1\n", + "md = m*Q/(h1-h4)\n", + "Wt = md*(h2-h1)\n", + "Wt2 = Wt/2545.\n", + "\t\t\t\n", + "# Results\n", + "print \"Coefficient of performance = %.1f\"%(COP)\n", + "print \" Input work = %.1f hp\"%(Wt2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of performance = 4.0\n", + " Input work = 5.9 hp\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch13.ipynb b/Thermodynamics_by_J._P._Holman/ch13.ipynb new file mode 100755 index 00000000..f2b649d3 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch13.ipynb @@ -0,0 +1,107 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:11cb16e5df43b71fcfcbd028a413a4b4822b665e44e65d30bde344b1e73319cb" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 :\n", + "Thermodynamics of irreversible\n", + "processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 pg : 377" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Eab1 = 0.\n", + "Eab2 = 5.87 \t\t\t#mV\n", + "T1 = 150. \t\t\t#F\n", + "T2 = 200. \t \t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "Eab = -1.12+ 0.035*T1\n", + "pi1 = 0.035*(T1+460)\n", + "pi2 = 0.035*(T2+460)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermocouple reading at %d F = %.2f mv\"%(T1,Eab)\n", + "print \" Peltier coefficient at %d F = %.1f mv\"%(T1,pi1)\n", + "print \" Peltier coefficient at %d F = %.1f mv\"%(T2,pi2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermocouple reading at 150 F = 4.13 mv\n", + " Peltier coefficient at 150 F = 21.4 mv\n", + " Peltier coefficient at 200 F = 23.1 mv\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2 pg : 380" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 0. \t\t\t#C\n", + "\t\t\t\n", + "# Calculations\n", + "de1 = -72. \t\t\t#mV/C\n", + "de2 = 500. \t\t\t#mv/C\n", + "alpha = de1-de2\n", + "pi = -(T+273)*alpha\n", + "\t\t\t\n", + "# Results\n", + "print \"Peltier coefficient at %d C = %d mv\"%(T,pi/1000)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Peltier coefficient at 0 C = 156 mv\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch13_1.ipynb b/Thermodynamics_by_J._P._Holman/ch13_1.ipynb new file mode 100755 index 00000000..f2b649d3 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch13_1.ipynb @@ -0,0 +1,107 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:11cb16e5df43b71fcfcbd028a413a4b4822b665e44e65d30bde344b1e73319cb" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 :\n", + "Thermodynamics of irreversible\n", + "processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 pg : 377" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Eab1 = 0.\n", + "Eab2 = 5.87 \t\t\t#mV\n", + "T1 = 150. \t\t\t#F\n", + "T2 = 200. \t \t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "Eab = -1.12+ 0.035*T1\n", + "pi1 = 0.035*(T1+460)\n", + "pi2 = 0.035*(T2+460)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermocouple reading at %d F = %.2f mv\"%(T1,Eab)\n", + "print \" Peltier coefficient at %d F = %.1f mv\"%(T1,pi1)\n", + "print \" Peltier coefficient at %d F = %.1f mv\"%(T2,pi2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermocouple reading at 150 F = 4.13 mv\n", + " Peltier coefficient at 150 F = 21.4 mv\n", + " Peltier coefficient at 200 F = 23.1 mv\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2 pg : 380" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 0. \t\t\t#C\n", + "\t\t\t\n", + "# Calculations\n", + "de1 = -72. \t\t\t#mV/C\n", + "de2 = 500. \t\t\t#mv/C\n", + "alpha = de1-de2\n", + "pi = -(T+273)*alpha\n", + "\t\t\t\n", + "# Results\n", + "print \"Peltier coefficient at %d C = %d mv\"%(T,pi/1000)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Peltier coefficient at 0 C = 156 mv\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch14.ipynb b/Thermodynamics_by_J._P._Holman/ch14.ipynb new file mode 100755 index 00000000..b28135ae --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch14.ipynb @@ -0,0 +1,189 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:af8a4c7e1aee0095ba7f54013d97317f8251c73de6783cf6d6c6f47de9fd5e14" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14 :\n", + "direct energy conversion" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1 pg : 385" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 25.+273 \t\t\t#K\n", + "F = 23060.\n", + "\t\t\t\n", + "# Calculations\n", + "H = -68317.\n", + "G = -56690.\n", + "Er = -G/(2*F)\n", + "eta = G/H\n", + "W = -G\n", + "Q = H-G\n", + "\t\t\t\n", + "# Results\n", + "print \"Voltage output of the cell = %.3f volts\"%(Er)\n", + "print \" Efficiency = %d percent\"%(eta*100 +1)\n", + "print \" Electrical Work output = %d cal/mol H2\"%(W)\n", + "print \" Heat transfer to the surroundings = %d cal/mol H2\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Voltage output of the cell = 1.229 volts\n", + " Efficiency = 83 percent\n", + " Electrical Work output = 56690 cal/mol H2\n", + " Heat transfer to the surroundings = -11627 cal/mol H2\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2 pg : 395" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "x1 = 0.75\n", + "x2 = 0.25\n", + "an = -190*10**-6 \t\t\t#volt/C\n", + "rn = 1.45*10**-3 \t\t\t#ohm cm\n", + "zn = 2*10**-3 \t\t\t#K**-1\n", + "ap = 190*10**-6 \t\t\t#volt/C\n", + "rp = 1.8*10**-3 \t\t\t#ohm cm\n", + "zp = 1.7*10**-3 \t\t\t#K**-1\n", + "T = 200.+273 \t\t\t#K\n", + "Tc = 373. \t\t\t#K\n", + "Th = 573. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "Ktn = an**2/(rn*zn)\n", + "Ktp = ap**2/(rp*zp)\n", + "Z = (an-ap)**2 /(math.sqrt(rn*Ktn) + math.sqrt(rp*Ktp))**2\n", + "Ap = math.sqrt(Ktn*rp/Ktp/rn)\n", + "An = 1\n", + "K = Ktn*An+ Ktp*Ap\n", + "R = rn/An + rp/Ap\n", + "mopt = math.sqrt(1+ Z*T)\n", + "RL = mopt*R\n", + "nopt = (T-273)*(mopt-1)/(Th*(mopt+ Tc/Th))\n", + "nmax = T/(Th*(1+1- T/Th/2 + 4/Th/Z))\n", + "nmax = 0.0624\n", + "dT = T-273\n", + "Popt = (an-ap)**2 *dT**2 /((1+mopt)**2 *RL)\n", + "Pmax = (an-ap)**2 *dT**2 /((1+1)**2 *R)\n", + "\t\t\t\n", + "# Results\n", + "print \"Optimum efficiency = %.2f percent\"%(nopt*100)\n", + "print \" Max. efficiency = %.2f percent\"%(nmax*100)\n", + "print \" Optimum power = %.3f Watt\"%(Popt)\n", + "print \" Maximum power = %.3f Watt\"%(Pmax)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Optimum efficiency = 6.36 percent\n", + " Max. efficiency = 6.24 percent\n", + " Optimum power = 0.249 Watt\n", + " Maximum power = 0.478 Watt\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.3 pg : 399" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "phic = 2.5 \t\t\t#V\n", + "phia = 2. \t\t\t#V\n", + "phip = 0.1\t\t\t#V\n", + "Th = 2000. \t\t\t#K\n", + "Tc = 1000. \t\t\t#K\n", + "eff = 0.2\n", + "k = 1.38*10**-23\n", + "e = 1.6*10**-19\n", + "sigma = 5.67*10**-12\n", + "\t\t\t\n", + "# Calculations\n", + "V = phic-phia-phip\n", + "Jc = 1.2*10**6 *Th**2 *math.exp(-e*phic/(k*Th))\n", + "Ja = 1.2*10**6 *Tc**2 *math.exp(-e*phia/(k*Tc))\n", + "J = Jc\n", + "Qc1 = J*(phic + 2*k*Th/e) + eff*sigma*10**4 *(Th**4 - Tc**4)\n", + "eta1 = J*0.4/Qc1\n", + "eta2 = (Th-Tc)/Th\n", + "\t\t\t\n", + "# Results\n", + "print \"Efficiency of the device = %.1f percent\"%(eta1*100)\n", + "print \" Carnot efficiency = %d percent\"%(eta2*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of the device = 13.7 percent\n", + " Carnot efficiency = 50 percent\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch14_1.ipynb b/Thermodynamics_by_J._P._Holman/ch14_1.ipynb new file mode 100755 index 00000000..b28135ae --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch14_1.ipynb @@ -0,0 +1,189 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:af8a4c7e1aee0095ba7f54013d97317f8251c73de6783cf6d6c6f47de9fd5e14" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14 :\n", + "direct energy conversion" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1 pg : 385" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 25.+273 \t\t\t#K\n", + "F = 23060.\n", + "\t\t\t\n", + "# Calculations\n", + "H = -68317.\n", + "G = -56690.\n", + "Er = -G/(2*F)\n", + "eta = G/H\n", + "W = -G\n", + "Q = H-G\n", + "\t\t\t\n", + "# Results\n", + "print \"Voltage output of the cell = %.3f volts\"%(Er)\n", + "print \" Efficiency = %d percent\"%(eta*100 +1)\n", + "print \" Electrical Work output = %d cal/mol H2\"%(W)\n", + "print \" Heat transfer to the surroundings = %d cal/mol H2\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Voltage output of the cell = 1.229 volts\n", + " Efficiency = 83 percent\n", + " Electrical Work output = 56690 cal/mol H2\n", + " Heat transfer to the surroundings = -11627 cal/mol H2\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2 pg : 395" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "x1 = 0.75\n", + "x2 = 0.25\n", + "an = -190*10**-6 \t\t\t#volt/C\n", + "rn = 1.45*10**-3 \t\t\t#ohm cm\n", + "zn = 2*10**-3 \t\t\t#K**-1\n", + "ap = 190*10**-6 \t\t\t#volt/C\n", + "rp = 1.8*10**-3 \t\t\t#ohm cm\n", + "zp = 1.7*10**-3 \t\t\t#K**-1\n", + "T = 200.+273 \t\t\t#K\n", + "Tc = 373. \t\t\t#K\n", + "Th = 573. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "Ktn = an**2/(rn*zn)\n", + "Ktp = ap**2/(rp*zp)\n", + "Z = (an-ap)**2 /(math.sqrt(rn*Ktn) + math.sqrt(rp*Ktp))**2\n", + "Ap = math.sqrt(Ktn*rp/Ktp/rn)\n", + "An = 1\n", + "K = Ktn*An+ Ktp*Ap\n", + "R = rn/An + rp/Ap\n", + "mopt = math.sqrt(1+ Z*T)\n", + "RL = mopt*R\n", + "nopt = (T-273)*(mopt-1)/(Th*(mopt+ Tc/Th))\n", + "nmax = T/(Th*(1+1- T/Th/2 + 4/Th/Z))\n", + "nmax = 0.0624\n", + "dT = T-273\n", + "Popt = (an-ap)**2 *dT**2 /((1+mopt)**2 *RL)\n", + "Pmax = (an-ap)**2 *dT**2 /((1+1)**2 *R)\n", + "\t\t\t\n", + "# Results\n", + "print \"Optimum efficiency = %.2f percent\"%(nopt*100)\n", + "print \" Max. efficiency = %.2f percent\"%(nmax*100)\n", + "print \" Optimum power = %.3f Watt\"%(Popt)\n", + "print \" Maximum power = %.3f Watt\"%(Pmax)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Optimum efficiency = 6.36 percent\n", + " Max. efficiency = 6.24 percent\n", + " Optimum power = 0.249 Watt\n", + " Maximum power = 0.478 Watt\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.3 pg : 399" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "phic = 2.5 \t\t\t#V\n", + "phia = 2. \t\t\t#V\n", + "phip = 0.1\t\t\t#V\n", + "Th = 2000. \t\t\t#K\n", + "Tc = 1000. \t\t\t#K\n", + "eff = 0.2\n", + "k = 1.38*10**-23\n", + "e = 1.6*10**-19\n", + "sigma = 5.67*10**-12\n", + "\t\t\t\n", + "# Calculations\n", + "V = phic-phia-phip\n", + "Jc = 1.2*10**6 *Th**2 *math.exp(-e*phic/(k*Th))\n", + "Ja = 1.2*10**6 *Tc**2 *math.exp(-e*phia/(k*Tc))\n", + "J = Jc\n", + "Qc1 = J*(phic + 2*k*Th/e) + eff*sigma*10**4 *(Th**4 - Tc**4)\n", + "eta1 = J*0.4/Qc1\n", + "eta2 = (Th-Tc)/Th\n", + "\t\t\t\n", + "# Results\n", + "print \"Efficiency of the device = %.1f percent\"%(eta1*100)\n", + "print \" Carnot efficiency = %d percent\"%(eta2*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of the device = 13.7 percent\n", + " Carnot efficiency = 50 percent\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch1_1.ipynb b/Thermodynamics_by_J._P._Holman/ch1_1.ipynb new file mode 100755 index 00000000..e80dd8df --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch1_1.ipynb @@ -0,0 +1,157 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:63e7a1dd37e633f9295c9d960c0e205303b570a077850a55f1a7161c70b32cb5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Introduction" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "d = 8. \t\t\t#in\n", + "ir = 16. \t\t\t#in\n", + "MW = 28.97\n", + "T = 70.+460 \t\t\t#R\n", + "P = 30+14.7 \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "V = math.pi**2 *d**2 *(d+ir)/4\n", + "V = V*10./12**3\n", + "Rair = 1545/MW\n", + "m = P*144*V/(Rair*T)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass of air = %.2f lbm\"%(m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of air = 4.99 lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V = 4. \t\t\t#in**3\n", + "P = 30. \t\t\t#psia\n", + "T = 500.\t\t\t#R\n", + "MW = 32.\n", + "\t\t\t\n", + "# Calculations\n", + "print (\"Metric unit conversion,\")\n", + "V = V*2.54**3 *10**-3\n", + "P = 30*4.448/(2.54**2 *10**-4)\n", + "T = 5*(T-32)/9 +273\n", + "n = P*V/(8314.5*T)\n", + "eta = n*1000\n", + "N = eta*6.025*10**23\n", + "m = eta*MW\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of molecules of oxygen = %.3e molecules\"%(N)\n", + "print \" Mass of molecules = %.1f g\"%(m)\n", + "\n", + "#The answer in the textbook is a bit different due to rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Metric unit conversion,\n", + "No. of molecules of oxygen = 1.843e+24 molecules\n", + " Mass of molecules = 97.9 g\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P = 14.7 \t\t\t#psia\n", + "T = 70.+460 \t\t\t#R\n", + "M = 32.\n", + "\t\t\t\n", + "# Calculations\n", + "Ro = 1545/M\n", + "V2 = 3*Ro*T\n", + "V2 = V2*32.174\n", + "vrms = math.sqrt(V2)\n", + "\t\t\t\n", + "# Results\n", + "print \"rms velocity = %d ft/sec\"%(vrms)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "rms velocity = 1571 ft/sec\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch2.ipynb b/Thermodynamics_by_J._P._Holman/ch2.ipynb new file mode 100755 index 00000000..bfbcf6e6 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch2.ipynb @@ -0,0 +1,240 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f1d828103bb270e68cac7fea789e3b42ea64320d86ed9fcc67d96c498216f06e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : The first law of Thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 200. \t\t\t#psia\n", + "P2 = 15. \t\t\t#psia\n", + "V1 = 1. \t\t\t#ft**3\n", + "g = 1.3\n", + "\t\t\t\n", + "# Calculations\n", + "V2 = V1*(P1/P2)**(1/g)\n", + "W = -(144*(P2*V2 - P1*V1)/(g-1))\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2e ft. lbf\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 4.32e+04 ft. lbf\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.2 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "L = 0.305 \t\t\t#m\n", + "v = 4.58 \t\t\t#m/s\n", + "i = 10. \t\t\t#A\n", + "B = 1. \t\t\t#W/m**2\n", + "\t\t\t\n", + "# Calculations\n", + "F = i*B*L\n", + "W = F*v\n", + "\t\t\t\n", + "# Results\n", + "print \"Force necessary = %.2f N\"%(F)\n", + "print \" Work per unit time = %.2f W\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Force necessary = 3.05 N\n", + " Work per unit time = 13.97 W\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3 pg : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "U = 2545. \t\t\t#B/hr\n", + "m = 50. \t\t\t#lbm\n", + "cv = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "dT = U/(m*cv)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in temperature = %.1f F\"%(dT)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in temperature = 50.9 F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 pg : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 14.7 \t\t\t#psia\n", + "V1 = 1. \t\t\t#ft**3\n", + "P2 = 14.7 \t\t\t#psia\n", + "M = 28.97\n", + "T1 = 70.+460 \t\t\t#R\n", + "T2 = 500.+460 \t\t\t#R\n", + "cp = 0.24 \t\t\t#B/lbm F\n", + "\t\t\t\n", + "# Calculations\n", + "m = P1*144*V1*M/(1545*T1)\n", + "Qp = m*cp*(T2-T1)\n", + "V2 = V1*P1*T2/(P2*T1)\n", + "\n", + "W = P1*144*(V2-V1)\n", + "W = -W/778\n", + "dU = Qp+W\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2f Btu\"%(W)\n", + "print \" Heat added = %.2f Btu\"%(Qp)\n", + "print \" Change in internal energy = %.2f Btu\"%(dU)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = -2.21 Btu\n", + " Heat added = 7.73 Btu\n", + " Change in internal energy = 5.52 Btu\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "l = 20. \n", + "b = 25.\n", + "h = 8.\n", + "Vp = 2.5\n", + "n = 20.\n", + "P = 14.7 \t\t\t#psia\n", + "T = 530. \t \t\t#R\n", + "t = 15. \t\t \t#min\n", + "Qp = 375. \t\t\t #B/hr\n", + "cv = 0.1715 \t\t\t#B/lbm F\n", + "\t\t\t\n", + "# Calculations\n", + "Vroom = l*b*h\n", + "Vair = Vroom-Vp*n\n", + "m = P*Vair*144/(53.35*T)\n", + "dU = n*Qp\n", + "U = t*dU/60\n", + "dT = U/(m*cv)\n", + "\t\t\t\n", + "# Results\n", + "print \"Air temperature rise = %d F\"%(dT+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air temperature rise = 37 F\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch2_1.ipynb b/Thermodynamics_by_J._P._Holman/ch2_1.ipynb new file mode 100755 index 00000000..bfbcf6e6 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch2_1.ipynb @@ -0,0 +1,240 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f1d828103bb270e68cac7fea789e3b42ea64320d86ed9fcc67d96c498216f06e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : The first law of Thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 200. \t\t\t#psia\n", + "P2 = 15. \t\t\t#psia\n", + "V1 = 1. \t\t\t#ft**3\n", + "g = 1.3\n", + "\t\t\t\n", + "# Calculations\n", + "V2 = V1*(P1/P2)**(1/g)\n", + "W = -(144*(P2*V2 - P1*V1)/(g-1))\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2e ft. lbf\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 4.32e+04 ft. lbf\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.2 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "L = 0.305 \t\t\t#m\n", + "v = 4.58 \t\t\t#m/s\n", + "i = 10. \t\t\t#A\n", + "B = 1. \t\t\t#W/m**2\n", + "\t\t\t\n", + "# Calculations\n", + "F = i*B*L\n", + "W = F*v\n", + "\t\t\t\n", + "# Results\n", + "print \"Force necessary = %.2f N\"%(F)\n", + "print \" Work per unit time = %.2f W\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Force necessary = 3.05 N\n", + " Work per unit time = 13.97 W\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3 pg : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "U = 2545. \t\t\t#B/hr\n", + "m = 50. \t\t\t#lbm\n", + "cv = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "dT = U/(m*cv)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in temperature = %.1f F\"%(dT)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in temperature = 50.9 F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 pg : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 14.7 \t\t\t#psia\n", + "V1 = 1. \t\t\t#ft**3\n", + "P2 = 14.7 \t\t\t#psia\n", + "M = 28.97\n", + "T1 = 70.+460 \t\t\t#R\n", + "T2 = 500.+460 \t\t\t#R\n", + "cp = 0.24 \t\t\t#B/lbm F\n", + "\t\t\t\n", + "# Calculations\n", + "m = P1*144*V1*M/(1545*T1)\n", + "Qp = m*cp*(T2-T1)\n", + "V2 = V1*P1*T2/(P2*T1)\n", + "\n", + "W = P1*144*(V2-V1)\n", + "W = -W/778\n", + "dU = Qp+W\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2f Btu\"%(W)\n", + "print \" Heat added = %.2f Btu\"%(Qp)\n", + "print \" Change in internal energy = %.2f Btu\"%(dU)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = -2.21 Btu\n", + " Heat added = 7.73 Btu\n", + " Change in internal energy = 5.52 Btu\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "l = 20. \n", + "b = 25.\n", + "h = 8.\n", + "Vp = 2.5\n", + "n = 20.\n", + "P = 14.7 \t\t\t#psia\n", + "T = 530. \t \t\t#R\n", + "t = 15. \t\t \t#min\n", + "Qp = 375. \t\t\t #B/hr\n", + "cv = 0.1715 \t\t\t#B/lbm F\n", + "\t\t\t\n", + "# Calculations\n", + "Vroom = l*b*h\n", + "Vair = Vroom-Vp*n\n", + "m = P*Vair*144/(53.35*T)\n", + "dU = n*Qp\n", + "U = t*dU/60\n", + "dT = U/(m*cv)\n", + "\t\t\t\n", + "# Results\n", + "print \"Air temperature rise = %d F\"%(dT+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air temperature rise = 37 F\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch3.ipynb b/Thermodynamics_by_J._P._Holman/ch3.ipynb new file mode 100755 index 00000000..98e0dd2e --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch3.ipynb @@ -0,0 +1,305 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b83edffd06279953e9d9c22648c2ce548f84e9427ec05c98afa676ab5960d29e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Macroscopic properties of pure substances" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 pg : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V = 1. \t\t\t#ft**3\n", + "m = 30. \t\t\t#lbm\n", + "\t\t\t\n", + "# Calculations\n", + "v = V/m\n", + "vf1 = 0.01665\n", + "vfg1 = 32.38 \t\t\t#ft**3/lbm\n", + "x1 = 0.000515\n", + "uf1 = 169.92\n", + "ufg1 = 904.8\n", + "u1 = uf1+x1*ufg1\n", + "vfg = 0.0216\n", + "vfg2 = 0.4240\n", + "v2 = v\n", + "x2 = 0.0277\n", + "uf2 = 538.4\n", + "ufg2 = 571.\n", + "u2 = uf2+x2*ufg2\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat transfer = %d Btu\"%(round(Q,-2))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer = 11500 Btu\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 pg : 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V2 = 2.5 \t\t\t#ft**3\n", + "V1 = 0.5 \t\t\t#ft**3\n", + "P = 100. \t\t\t#psia\n", + "x1 = 0.5\n", + "\t\t\t\n", + "# Calculations\n", + "W = -P*144*(V2-V1)\n", + "vf1 = 0.01774\n", + "vfg1 = 4.414\n", + "v1 = vf1+x1*vfg1\n", + "m = V1/v1\n", + "v2 = V2/m\n", + "uf1 = 298.08\n", + "ufg1 = 807.1\n", + "u1 = uf1+x1*ufg1\n", + "h2 = 1747.9\n", + "u2 = h2-P*144*v2/778\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Amount of heat = %d Btu\"%(Q)\n", + "\t\t\t#The answer for u2 is given wrong in the textbook. Please use a calculator to find it\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of heat = 188 Btu\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 pg : 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V1 = 1.735*10**-4 \t\t\t#ft**3\n", + "v1 = 0.016080 \t\t\t#ft**3/lbm\n", + "h1 = 70.61 \t\t \t #B/lbm\n", + "P1 = 100. \t\t \t#psia\n", + "V2 = 1. \t\t \t #ft**3\n", + "\t\t\t\n", + "# Calculations\n", + "u1 = h1-P1*v1*144/778.\n", + "m = V1/v1\n", + "v2 = V2/m\n", + "vf2 = 0.01613\n", + "vfg2 = 350.3\n", + "x2 = (v2-vf2)/vfg2\n", + "hf2 = 67.97\n", + "hfg2 = 1037.2\n", + "h2 = hf2+x2*hfg2\n", + "P2 = 0.9492\n", + "u2 = h2- P2*144*v2/778.\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Enthalpy change = %.2f Btu\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy change = 2.76 Btu\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 pg : 64" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 20. \t\t\t#psia\n", + "V = 1. \t\t\t#ft**3\n", + "T = 560. \t\t\t#R\n", + "cv = 0.1715\n", + "Q = 10. \t\t\t#Btu\n", + "\t\t\t\n", + "# Calculations\n", + "m = P*144*V/(53.35*T)\n", + "T2 = Q/(m*cv) +T\n", + "P2 = m*53.35*T2/V\n", + "\t\t\t\n", + "# Results\n", + "print \"Fina pressure = %d lbf/ft**2\"%(P2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fina pressure = 5990 lbf/ft**2\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 pg : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from scipy.integrate import quad\n", + "\t\t\t\n", + "# Variables\n", + "T1 = 560 \t\t\t#R\n", + "T2 = 3460 \t\t\t#R\n", + "m = 28.02 \t\t\t#lb\n", + "cv = 0.248\n", + "\t\t\t\n", + "# Calculations\n", + "def fun(T):\n", + " return 9.47 - 3.29*10**3 /T +1.07*10**6 /T**2\n", + "\n", + "Q1 = quad(fun,T1,T2)[0]\n", + "Q2 = m*cv*(T2-T1)\n", + "Error = (Q1-Q2)/Q1\n", + "\t\t\t\n", + "# Results\n", + "print \"Percentage error = %.1f percent\"%(Error*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage error = 12.7 percent\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.6 pg : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "rate = 20. \t\t\t#gal/min\n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 1000. \t\t\t#psia\n", + "T = 100.+460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "vf = 0.01613\n", + "dv = -5.2*10**-5 \t\t\t#ft**3/lbm\n", + "K = -dv/(vf*P2*144)\n", + "wt = K*vf*(P2**2 - P1**2)*144*144*10**4 /2\n", + "m = rate*8.33\n", + "Wt = wt*m\n", + "Wthp = Wt/33000\n", + "\t\t\t\n", + "# Results\n", + "print \"Pump power required = %d hp\"%(Wthp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pump power required = 188 hp\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch3_1.ipynb b/Thermodynamics_by_J._P._Holman/ch3_1.ipynb new file mode 100755 index 00000000..98e0dd2e --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch3_1.ipynb @@ -0,0 +1,305 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b83edffd06279953e9d9c22648c2ce548f84e9427ec05c98afa676ab5960d29e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Macroscopic properties of pure substances" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 pg : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V = 1. \t\t\t#ft**3\n", + "m = 30. \t\t\t#lbm\n", + "\t\t\t\n", + "# Calculations\n", + "v = V/m\n", + "vf1 = 0.01665\n", + "vfg1 = 32.38 \t\t\t#ft**3/lbm\n", + "x1 = 0.000515\n", + "uf1 = 169.92\n", + "ufg1 = 904.8\n", + "u1 = uf1+x1*ufg1\n", + "vfg = 0.0216\n", + "vfg2 = 0.4240\n", + "v2 = v\n", + "x2 = 0.0277\n", + "uf2 = 538.4\n", + "ufg2 = 571.\n", + "u2 = uf2+x2*ufg2\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat transfer = %d Btu\"%(round(Q,-2))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer = 11500 Btu\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 pg : 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V2 = 2.5 \t\t\t#ft**3\n", + "V1 = 0.5 \t\t\t#ft**3\n", + "P = 100. \t\t\t#psia\n", + "x1 = 0.5\n", + "\t\t\t\n", + "# Calculations\n", + "W = -P*144*(V2-V1)\n", + "vf1 = 0.01774\n", + "vfg1 = 4.414\n", + "v1 = vf1+x1*vfg1\n", + "m = V1/v1\n", + "v2 = V2/m\n", + "uf1 = 298.08\n", + "ufg1 = 807.1\n", + "u1 = uf1+x1*ufg1\n", + "h2 = 1747.9\n", + "u2 = h2-P*144*v2/778\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Amount of heat = %d Btu\"%(Q)\n", + "\t\t\t#The answer for u2 is given wrong in the textbook. Please use a calculator to find it\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of heat = 188 Btu\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 pg : 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V1 = 1.735*10**-4 \t\t\t#ft**3\n", + "v1 = 0.016080 \t\t\t#ft**3/lbm\n", + "h1 = 70.61 \t\t \t #B/lbm\n", + "P1 = 100. \t\t \t#psia\n", + "V2 = 1. \t\t \t #ft**3\n", + "\t\t\t\n", + "# Calculations\n", + "u1 = h1-P1*v1*144/778.\n", + "m = V1/v1\n", + "v2 = V2/m\n", + "vf2 = 0.01613\n", + "vfg2 = 350.3\n", + "x2 = (v2-vf2)/vfg2\n", + "hf2 = 67.97\n", + "hfg2 = 1037.2\n", + "h2 = hf2+x2*hfg2\n", + "P2 = 0.9492\n", + "u2 = h2- P2*144*v2/778.\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Enthalpy change = %.2f Btu\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy change = 2.76 Btu\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 pg : 64" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 20. \t\t\t#psia\n", + "V = 1. \t\t\t#ft**3\n", + "T = 560. \t\t\t#R\n", + "cv = 0.1715\n", + "Q = 10. \t\t\t#Btu\n", + "\t\t\t\n", + "# Calculations\n", + "m = P*144*V/(53.35*T)\n", + "T2 = Q/(m*cv) +T\n", + "P2 = m*53.35*T2/V\n", + "\t\t\t\n", + "# Results\n", + "print \"Fina pressure = %d lbf/ft**2\"%(P2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fina pressure = 5990 lbf/ft**2\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 pg : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from scipy.integrate import quad\n", + "\t\t\t\n", + "# Variables\n", + "T1 = 560 \t\t\t#R\n", + "T2 = 3460 \t\t\t#R\n", + "m = 28.02 \t\t\t#lb\n", + "cv = 0.248\n", + "\t\t\t\n", + "# Calculations\n", + "def fun(T):\n", + " return 9.47 - 3.29*10**3 /T +1.07*10**6 /T**2\n", + "\n", + "Q1 = quad(fun,T1,T2)[0]\n", + "Q2 = m*cv*(T2-T1)\n", + "Error = (Q1-Q2)/Q1\n", + "\t\t\t\n", + "# Results\n", + "print \"Percentage error = %.1f percent\"%(Error*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage error = 12.7 percent\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.6 pg : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "rate = 20. \t\t\t#gal/min\n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 1000. \t\t\t#psia\n", + "T = 100.+460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "vf = 0.01613\n", + "dv = -5.2*10**-5 \t\t\t#ft**3/lbm\n", + "K = -dv/(vf*P2*144)\n", + "wt = K*vf*(P2**2 - P1**2)*144*144*10**4 /2\n", + "m = rate*8.33\n", + "Wt = wt*m\n", + "Wthp = Wt/33000\n", + "\t\t\t\n", + "# Results\n", + "print \"Pump power required = %d hp\"%(Wthp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pump power required = 188 hp\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch4.ipynb b/Thermodynamics_by_J._P._Holman/ch4.ipynb new file mode 100755 index 00000000..2420bc0c --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch4.ipynb @@ -0,0 +1,307 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:694b356fc4f85fd8aa841dd0d02eae327738df2eb161cb913631664ccceb9a07" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : principles of energy analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 pg : 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 1.\n", + "he = 1148.8 \t\t\t#B/lbm\n", + "hi = 1357. \t\t\t#B/lbm\n", + "Ve = 100. \t\t\t#ft/sec\n", + "Vi = 800. \t\t\t#ft/sec\n", + "\t\t\t\n", + "# Calculations\n", + "dW = m*(he-hi) + m*(Ve**2 - Vi**2)/(2*32.2*778)\n", + "dWhr = dW*3600\n", + "hp = -dWhr/2545.\n", + "\t\t\t\n", + "# Results\n", + "print \"Horsepower output = %d hp\"%(hp+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horsepower output = 313 hp\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 pg:79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "rate = 80. \t\t\t#lbm/min\n", + "T1 = 100. \t\t\t#F\n", + "P1 = 100. \t\t\t#psia\n", + "P2 = 1000. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "v = 0.01613 \t\t\t#ft**3/lbm\n", + "W = rate*(P2-P1)*144*v\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2f ft-lbf/min\"%(round(W,-3))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 167000.00 ft-lbf/min\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 pg : 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "hi = 1279.1 \t\t\t#B/lbm\n", + "\t\t\t\n", + "# Calculations\n", + "u2 = hi\n", + "T2 = 564. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Temperature of steam = %d F\"%(T2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of steam = 564 F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 pg : 82" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 100. \t\t\t#psia\n", + "V = 3. \t \t\t#ft**3\n", + "T = 560. \t\t\t#R\n", + "ma = 0.289\n", + "\t\t\t\n", + "# Calculations\n", + "ma = P1*V/(53.35*T)\n", + "Wa = -ma*53.35*T*math.log(P1/P2)\n", + "Qa = -Wa\n", + "Va2 = 3/5.\n", + "V2s = V-Va2\n", + "hi = 1279.1 \t\t\t#B/lbm\n", + "T2s = 536. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Final temperature = %d F\"%(T2s)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final temperature = 536 F\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 pg : 87" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "P1 = 200. \t\t\t#psia\n", + "P2 = 100. \t\t\t#psia\n", + "T1 = 300.+460 \t\t\t#R\n", + "g = 1.4\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = (T1)*(P2/P1)**((g-1)/g)\n", + "V2 = math.sqrt(2*32.2*778*cp*(T1-T2))\n", + "\t\t\t\n", + "# Results\n", + "print \"Final velocity = %d ft/sec\"%(V2)\n", + "\n", + "# check answer using calculator" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final velocity = 1281 ft/sec\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 pg : 88" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 500.+460 \t\t\t#R\n", + "P1 = 50. \t\t\t#psia\n", + "P2 = 15. \t\t\t#psia\n", + "g = 1.4\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "W = cp*(T2-T1) + (T1-460)**2 /(2*32.2*778)\n", + "\t\t\t\n", + "# Results\n", + "print \"Net work output from turbine = %.1f B/lbm\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net work output from turbine = -62.1 B/lbm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 pg : 91" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 150.+460 \t\t\t#R\n", + "T1 = 40.+460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "h2 = 43.850 \t\t\t#B/lbm\n", + "hf2 = 17.273\n", + "hfg2 = 64.163\n", + "x2 = (h2-hf2)/hfg2\n", + "\t\t\t\n", + "# Results\n", + "print \"Quality of freon vapor = %.3f\"%(x2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quality of freon vapor = 0.414\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch4_1.ipynb b/Thermodynamics_by_J._P._Holman/ch4_1.ipynb new file mode 100755 index 00000000..2420bc0c --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch4_1.ipynb @@ -0,0 +1,307 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:694b356fc4f85fd8aa841dd0d02eae327738df2eb161cb913631664ccceb9a07" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : principles of energy analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 pg : 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 1.\n", + "he = 1148.8 \t\t\t#B/lbm\n", + "hi = 1357. \t\t\t#B/lbm\n", + "Ve = 100. \t\t\t#ft/sec\n", + "Vi = 800. \t\t\t#ft/sec\n", + "\t\t\t\n", + "# Calculations\n", + "dW = m*(he-hi) + m*(Ve**2 - Vi**2)/(2*32.2*778)\n", + "dWhr = dW*3600\n", + "hp = -dWhr/2545.\n", + "\t\t\t\n", + "# Results\n", + "print \"Horsepower output = %d hp\"%(hp+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horsepower output = 313 hp\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 pg:79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "rate = 80. \t\t\t#lbm/min\n", + "T1 = 100. \t\t\t#F\n", + "P1 = 100. \t\t\t#psia\n", + "P2 = 1000. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "v = 0.01613 \t\t\t#ft**3/lbm\n", + "W = rate*(P2-P1)*144*v\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2f ft-lbf/min\"%(round(W,-3))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 167000.00 ft-lbf/min\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 pg : 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "hi = 1279.1 \t\t\t#B/lbm\n", + "\t\t\t\n", + "# Calculations\n", + "u2 = hi\n", + "T2 = 564. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Temperature of steam = %d F\"%(T2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of steam = 564 F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 pg : 82" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 100. \t\t\t#psia\n", + "V = 3. \t \t\t#ft**3\n", + "T = 560. \t\t\t#R\n", + "ma = 0.289\n", + "\t\t\t\n", + "# Calculations\n", + "ma = P1*V/(53.35*T)\n", + "Wa = -ma*53.35*T*math.log(P1/P2)\n", + "Qa = -Wa\n", + "Va2 = 3/5.\n", + "V2s = V-Va2\n", + "hi = 1279.1 \t\t\t#B/lbm\n", + "T2s = 536. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Final temperature = %d F\"%(T2s)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final temperature = 536 F\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 pg : 87" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "P1 = 200. \t\t\t#psia\n", + "P2 = 100. \t\t\t#psia\n", + "T1 = 300.+460 \t\t\t#R\n", + "g = 1.4\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = (T1)*(P2/P1)**((g-1)/g)\n", + "V2 = math.sqrt(2*32.2*778*cp*(T1-T2))\n", + "\t\t\t\n", + "# Results\n", + "print \"Final velocity = %d ft/sec\"%(V2)\n", + "\n", + "# check answer using calculator" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final velocity = 1281 ft/sec\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 pg : 88" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 500.+460 \t\t\t#R\n", + "P1 = 50. \t\t\t#psia\n", + "P2 = 15. \t\t\t#psia\n", + "g = 1.4\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "W = cp*(T2-T1) + (T1-460)**2 /(2*32.2*778)\n", + "\t\t\t\n", + "# Results\n", + "print \"Net work output from turbine = %.1f B/lbm\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net work output from turbine = -62.1 B/lbm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 pg : 91" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 150.+460 \t\t\t#R\n", + "T1 = 40.+460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "h2 = 43.850 \t\t\t#B/lbm\n", + "hf2 = 17.273\n", + "hfg2 = 64.163\n", + "x2 = (h2-hf2)/hfg2\n", + "\t\t\t\n", + "# Results\n", + "print \"Quality of freon vapor = %.3f\"%(x2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quality of freon vapor = 0.414\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch5.ipynb b/Thermodynamics_by_J._P._Holman/ch5.ipynb new file mode 100755 index 00000000..8df6c255 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch5.ipynb @@ -0,0 +1,207 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:427d2fadecfbb47aca45827faabee15c72f488581939d9b848cacc0b97c7f502" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : principles of statistical\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import factorial\n", + "\t\t\t\n", + "# Variables\n", + "N1 = 1.\n", + "N2 = 1.\n", + "N3 = 3.\n", + "N4 = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "N = N1+N2+N3+N4\n", + "sig = factorial(N) /(factorial(N1) *factorial(N2)*factorial(N3)*factorial(N4))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways of arranging = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways of arranging = 120 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "N = 6.\n", + "g = 4.\n", + "\t\t\t\n", + "# Calculations\n", + "sig = factorial(g+N-1) /(factorial(g-1) *factorial(N))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways of arranging = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways of arranging = 84 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import factorial\t\t\t\n", + "# Variables\n", + "N = 6.\n", + "g = 8.\n", + "\t\t\t\n", + "# Calculations\n", + "sig = factorial(g) /(factorial(N) *factorial(g-N))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways = 28 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4 pg : 121" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%matplotlib inline\n", + "import math \n", + "from matplotlib.pyplot import bar\n", + "\n", + "# Variables\n", + "N0 = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "N1 = 3/math.e\n", + "N2 = 6/math.e**2\n", + "N3 = 10/math.e**3\n", + "N = N0+N1+N2+N3\n", + "ei = [0, 1, 2, 3]\n", + "\n", + "f0 = N0/N\n", + "f1 = N1/N\n", + "f2 = N2/N\n", + "f3 = N3/N\n", + "fi = [f0, f1, f2, f3]\n", + "\t\t\t\n", + "# Results\n", + "print \"fractional population of level 0 = %.3f\"%(f0)\n", + "print \" fractional population of level 1 = %.3f\"%(f1)\n", + "print \" fractional population of level 2 = %.3f\"%(f2)\n", + "print \" fractional population of level 3 = %.3f\"%(f3)\n", + "bar(ei,fi,0.1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "fractional population of level 0 = 0.293\n", + " fractional population of level 1 = 0.323\n", + " fractional population of level 2 = 0.238\n", + " fractional population of level 3 = 0.146\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 2, + "text": [ + "<Container object of 4 artists>" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEACAYAAABfxaZOAAAABHNCSV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wT8Dtt++ve/wVL1V/L/nfzIa86\nKFP/3dw8W9hCWP+vkwnKXcitW+8XTLB0/XXufQP4W+CvbjOnzv0vU3+d+/9rhDV6gF8G/hX4w7Y5\nde5/mfpr2/9uPuRVB7H6/4RwS9tp4N8I3zx18ffAj4D/I6xdPsVo9T5Wf517/zDhx/PT3Lyl7ouM\nTv/L1F/n/j9AWP44DZwF/izfPyr9L1N/nfsvSZIkSZIkSZIkSZIkSZIkSZIkScvD/wNmMBds+uNg\nIAAAAABJRU5ErkJggg==\n", + "text": [ + "<matplotlib.figure.Figure at 0x1085f7050>" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch5_1.ipynb b/Thermodynamics_by_J._P._Holman/ch5_1.ipynb new file mode 100755 index 00000000..eac11d77 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch5_1.ipynb @@ -0,0 +1,209 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7515996c0789938329f86975cb5205356a100488f9513af4795fb2fe55a812d5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : principles of statistical\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import factorial\n", + "\t\t\t\n", + "# Variables\n", + "N1 = 1.\n", + "N2 = 1.\n", + "N3 = 3.\n", + "N4 = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "N = N1+N2+N3+N4\n", + "sig = factorial(N) /(factorial(N1) *factorial(N2)*factorial(N3)*factorial(N4))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways of arranging = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways of arranging = 120 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "N = 6.\n", + "g = 4.\n", + "\t\t\t\n", + "# Calculations\n", + "sig = factorial(g+N-1) /(factorial(g-1) *factorial(N))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways of arranging = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways of arranging = 84 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import factorial\t\t\t\n", + "# Variables\n", + "N = 6.\n", + "g = 8.\n", + "\t\t\t\n", + "# Calculations\n", + "sig = factorial(g) /(factorial(N) *factorial(g-N))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways = 28 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4 pg : 121" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%matplotlib inline\n", + "\n", + "\n", + "import math \n", + "from matplotlib.pyplot import bar\n", + "\n", + "# Variables\n", + "N0 = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "N1 = 3/math.e\n", + "N2 = 6/math.e**2\n", + "N3 = 10/math.e**3\n", + "N = N0+N1+N2+N3\n", + "ei = [0, 1, 2, 3]\n", + "\n", + "f0 = N0/N\n", + "f1 = N1/N\n", + "f2 = N2/N\n", + "f3 = N3/N\n", + "fi = [f0, f1, f2, f3]\n", + "\t\t\t\n", + "# Results\n", + "print \"fractional population of level 0 = %.3f\"%(f0)\n", + "print \" fractional population of level 1 = %.3f\"%(f1)\n", + "print \" fractional population of level 2 = %.3f\"%(f2)\n", + "print \" fractional population of level 3 = %.3f\"%(f3)\n", + "bar(ei,fi,0.1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "fractional population of level 0 = 0.293\n", + " fractional population of level 1 = 0.323\n", + " fractional population of level 2 = 0.238\n", + " fractional population of level 3 = 0.146\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 1, + "text": [ + "<Container object of 4 artists>" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEACAYAAABfxaZOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD7dJREFUeJzt3V+IHed5x/HvidailaxtrFa1qKx0QVbrGGwSU5RtZbcn\nqTCbXESGXMgmwVAHVxdV7YtQhKBE66uigikEgaOCCmlqqotWMYLKlW3oUJG6sjbVv9Zao1UqkBTX\nOLbrWA6hK3R68c5Gk6NdvTPn75x9vx846My875x9eLz+ndl35uyCJEmSJEmSJEmSJEmSJEmSamAK\nmAUuALsXGd8OnAFOAT8AvlAYuwSczcfe6GuVkqSurQDmgAngDuA08Om2OasLzx/I5y/4b2BtH+uT\nJFXwicj4FkKIXwLmgUOEM/uijwvP7wR+3Dbe6KI+SVIPxUJ/A3C5sH0l39fuMeA88DLwTGF/C3gN\nmAGe7rxMSVIvjEXGWyVf56X88QjwXeC38/1bgbeBdcCrhGsDx6uXKUnqhVjoXwU2FrY3Es72l3I8\nf81fBd4jBD7Au8D3CMtFvxD6mzZtal28eLFCyZIk4CJwb9WDYss7M8BmwoXclcAO4EjbnE3cXLd/\nKP/3PWAVsCbfXg08Cpxr/wIXL16k1WqN7GPv3r1Dr8H6h19HivWPcu3Lof48eyuLnelfB3YBxwh3\n8hwk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sd47S936Z+pvUt/8Aq/J/xwi9fbhtvM79h3j9TSr0f1C/e6fTD3ndPaD6Ysp+0Kyut64e\nBz64zXidew/x+qG+vf8fwkkCwDXgPOEzLEV17n+Z+qG+/Qf4af7vSsIJ3Ptt43XuP8Trhwr9H1To\nd/ohr3v6XFdZZepvAb9H+PHwKOFXT4yKOve+jFHp/QThJ5YTbftHpf8TLF5/3fv/CcIb1zuEpao3\n28br3v9Y/ZX6P9aHAhfTKjmv/d2q7HH9VqaO/yCsf/6UcNfSS8Bv9bOoHqtr78sYhd7fCfwD8Czh\njLld3ft/u/rr3v8bhCWqXwGOEZZDsrY5de5/rP5K/R/Umf7VvKgFGwnvprebc0++rw7K1P8RN38M\ne5mw9r+2/6X1RJ17X0bde38H8I/A3xH+h2xX9/7H6q97/xd8CPwT8Dtt++ve/wVL1V/L/nfzIa86\nKFP/3dw8W9hCWP+vkwnKXcitW+8XTLB0/XXufQP4W+CvbjOnzv0vU3+d+/9rhDV6gF8G/hX4w7Y5\nde5/mfpr2/9uPuRVB7H6/4RwS9tp4N8I3zx18ffAj4D/I6xdPsVo9T5Wf517/zDhx/PT3Lyl7ouM\nTv/L1F/n/j9AWP44DZwF/izfPyr9L1N/nfsvSZIkSZIkSZIkSZIkSZIkSZIkScvD/wNmMBds+uNg\nIAAAAABJRU5ErkJggg==\n", + "text": [ + "<matplotlib.figure.Figure at 0x103672c90>" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch6.ipynb b/Thermodynamics_by_J._P._Holman/ch6.ipynb new file mode 100755 index 00000000..489db493 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch6.ipynb @@ -0,0 +1,263 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8b62be1f41dd311c1ab38e8f1f5050fc85b3e25eb123d081120fb3bbfeaaa74a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 :\n", + "The second law of\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 pg : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 5. \t \t \t#lbm\n", + "P = 50. \t \t\t#psia\n", + "T = 500. + 460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "s1 = 0.4110 \t\t\t#B/lbm R\n", + "s2 = 1.7887 \t\t\t#B/lbm R\n", + "dS = m*(s2-s1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.3f B/R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 6.888 B/R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 pg : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 20. \t\t\t#psia\n", + "T = 227.96+ 459.69 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "sfg = 1.3962 \t\t\t#B/ R lbm\n", + "Q = T*sfg\n", + "\t\t\t\n", + "# Results\n", + "print \"heat transfer = %.1f B/lbm\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "heat transfer = 960.1 B/lbm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 pg : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "# Variables\n", + "T1 = 100.+460 \t\t\t#R\n", + "P1 = 15. \t\t\t#psia\n", + "P2 = 50. \t \t\t#psia\n", + "n = 1.3\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((n-1)/n)\n", + "dS = cp*math.log(T2/T1) - 53.35/778 *math.log(P2/P1) \n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.3f B/lbm R\"%(dS)\n", + "\t\t\t#the answer given in textbook is wrong. Please check it using a calculator\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = -0.016 B/lbm R\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 pg : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "# Variables\n", + "T1 = 85.+460 \t\t\t#R\n", + "T2 = T1\n", + "cp = 0.24\n", + "P2 = 15. \t\t\t#psia\n", + "P1 = 30. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dS = cp*math.log(T2/T1) - 53.35/778 *math.log(P2/P1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.4f B/lbm R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 0.0475 B/lbm R\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 pg : 142" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Qh = -1000. \t\t\t#Btu\n", + "Ql = 1000. \t\t\t#Btu\n", + "Th = 1460. \t \t\t#R\n", + "Tl = 960. \t\t \t#R\n", + "\t\t\t\n", + "# Calculations\n", + "Sh = Qh/Th\n", + "Sl = Ql/Tl\n", + "S = Sh+Sl\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy of the universe = %.3f B/R\"%(S)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy of the universe = 0.357 B/R\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 pg : 143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1416.4 \t\t\t#B/lbm\n", + "s1 = 1.6842 \t\t\t#B/lbm R\n", + "\t\t\t\n", + "# Calculations\n", + "s2 = s1\n", + "P2 = 50. \t\t\t#psia\n", + "T2 = 317.5 \t\t\t#F\n", + "h2 = 1193.7\n", + "W = h2-h1\n", + "\t\t\t\n", + "# Results\n", + "print \"Work calculated = %.1f B/lbm\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work calculated = -222.7 B/lbm\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch6_1.ipynb b/Thermodynamics_by_J._P._Holman/ch6_1.ipynb new file mode 100755 index 00000000..489db493 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch6_1.ipynb @@ -0,0 +1,263 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8b62be1f41dd311c1ab38e8f1f5050fc85b3e25eb123d081120fb3bbfeaaa74a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 :\n", + "The second law of\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 pg : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 5. \t \t \t#lbm\n", + "P = 50. \t \t\t#psia\n", + "T = 500. + 460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "s1 = 0.4110 \t\t\t#B/lbm R\n", + "s2 = 1.7887 \t\t\t#B/lbm R\n", + "dS = m*(s2-s1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.3f B/R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 6.888 B/R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 pg : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 20. \t\t\t#psia\n", + "T = 227.96+ 459.69 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "sfg = 1.3962 \t\t\t#B/ R lbm\n", + "Q = T*sfg\n", + "\t\t\t\n", + "# Results\n", + "print \"heat transfer = %.1f B/lbm\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "heat transfer = 960.1 B/lbm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 pg : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "# Variables\n", + "T1 = 100.+460 \t\t\t#R\n", + "P1 = 15. \t\t\t#psia\n", + "P2 = 50. \t \t\t#psia\n", + "n = 1.3\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((n-1)/n)\n", + "dS = cp*math.log(T2/T1) - 53.35/778 *math.log(P2/P1) \n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.3f B/lbm R\"%(dS)\n", + "\t\t\t#the answer given in textbook is wrong. Please check it using a calculator\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = -0.016 B/lbm R\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 pg : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "# Variables\n", + "T1 = 85.+460 \t\t\t#R\n", + "T2 = T1\n", + "cp = 0.24\n", + "P2 = 15. \t\t\t#psia\n", + "P1 = 30. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dS = cp*math.log(T2/T1) - 53.35/778 *math.log(P2/P1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.4f B/lbm R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 0.0475 B/lbm R\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 pg : 142" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Qh = -1000. \t\t\t#Btu\n", + "Ql = 1000. \t\t\t#Btu\n", + "Th = 1460. \t \t\t#R\n", + "Tl = 960. \t\t \t#R\n", + "\t\t\t\n", + "# Calculations\n", + "Sh = Qh/Th\n", + "Sl = Ql/Tl\n", + "S = Sh+Sl\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy of the universe = %.3f B/R\"%(S)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy of the universe = 0.357 B/R\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 pg : 143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1416.4 \t\t\t#B/lbm\n", + "s1 = 1.6842 \t\t\t#B/lbm R\n", + "\t\t\t\n", + "# Calculations\n", + "s2 = s1\n", + "P2 = 50. \t\t\t#psia\n", + "T2 = 317.5 \t\t\t#F\n", + "h2 = 1193.7\n", + "W = h2-h1\n", + "\t\t\t\n", + "# Results\n", + "print \"Work calculated = %.1f B/lbm\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work calculated = -222.7 B/lbm\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch7.ipynb b/Thermodynamics_by_J._P._Holman/ch7.ipynb new file mode 100755 index 00000000..906a386e --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch7.ipynb @@ -0,0 +1,373 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:718f559da4ae2a13e9c934b6162f71a824de61441f47a14a1f58cca792ea40ff" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 :\n", + "equations of state and general\n", + "thermodynamic relations" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 pg : 158" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 1160. \t\t\t#R\n", + "h1 = 281.14 \t\t\t#B/lbm\n", + "Pr1 = 21.18 \n", + "P2 = 30. \t\t\t#psia\n", + "P1 = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "Pr2 = Pr1*P2/P1\n", + "T2 = 833. \t\t\t#R\n", + "h2 = 199.45 \t\t\t#B/lbm\n", + "dh = h2-h1\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in enthalpy = %.2f B/lbm\"%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = -81.69 B/lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 pg : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "T2 = 860. \t\t\t#R\n", + "phi1 = 0.78767\n", + "phi2 = 0.71323\n", + "P2 = 30. \t\t\t#psia\n", + "P1 = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dS = phi2-phi1- 53.35/778 *math.log(P2/P1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Net change of entropy = %.5f B/lbm R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net change of entropy = 0.00812 B/lbm R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 pg : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 540. \t\t\t#R\n", + "T2 = 960. \t\t\t#R\n", + "h2 = 231.06 \t\t\t#B/lbm\n", + "h1 = 129.06 \t\t\t#B/lbm\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "W = h2-h1\n", + "dh = cp*(T2-T1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in enthalpy = %.1f B/lbm\"%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = 100.8 B/lbm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 pg : 161" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\t\t\t\n", + "# Variables\n", + "T1 = 420. \t\t\t#R\n", + "T2 = 380. \t\t\t#R\n", + "hig = 1221.2\n", + "P1 = 0.0019\n", + "\t\t\t\n", + "# Calculations\n", + "lnp = hig*778*(1/T1 - 1/T2)/85.6\n", + "pra = math.exp(lnp)\n", + "P2 = pra*P1\n", + "\t\t\t\n", + "# Results\n", + "print \"Final pressure = %.3e psia\"%(P2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 1.177e-04 psia\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 pg : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "pc = 482.\t\t\t#psia\n", + "Tc = 227. \t\t\t#R\n", + "vc = 1.44 \t\t\t#ft**3/lbm mol\n", + "P = 600. \t\t\t#psia\n", + "T = 310. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "Pr = P/pc\n", + "Tr = T/Tc\n", + "Z = 0.83\n", + "v = Z*55.12*T/(P*144)\n", + "rho = 1/v\n", + "\t\t\t\n", + "# Results\n", + "print \"Density = %.1f lbm/ft**3\"%(rho)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Density = 6.1 lbm/ft**3\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 pg : 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = -150.+460 \t\t\t#R\n", + "v = 0.6 \t\t \t#ft**3/lbm\n", + "vc = 1.44\n", + "Tc = 227. \t \t\t#R\n", + "Pc = 482. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "vr = v/vc\n", + "Tr = T/Tc\n", + "Pr = 1.75\n", + "P = Pr*Pc\n", + "\t\t\t\n", + "# Results\n", + "print \"Final pressure = %d psia\"%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 843 psia\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 pg : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Tc = 344. \t\t\t#R\n", + "Pc = 673. \t\t\t#psia\n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 500. \t\t\t#psia\n", + "M = 16.\n", + "T = 560. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "pr1 = P1/Pc\n", + "pr2 = P2/Pc\n", + "Tr = T/Tc\n", + "dh2 = 0.65*Tc\n", + "dsp = 0.35 \t\t\t#B/lbm mol R\n", + "dsp2 = 0.018-dsp- 1545/778 *math.log(P2/P1)\n", + "W = dh2-dsp2*T\n", + "W2 = W/M\n", + "\t\t\t\n", + "# Results\n", + "print \"Work per pound mass = %d B/lbm\"%(W2)\n", + "\n", + "#The answer is a bit different due to rounding off error. check using calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work per pound mass = 138 B/lbm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 pg : 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 1000. \t \t\t#psia\n", + "T1 = 100. + 460 \t\t\t#R\n", + "T2 = 800. + 460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "pc = 1070. \t\t\t#psia\n", + "Tc = 548. \t\t\t#R\n", + "pr1 = P/pc\n", + "Tr1 = T1/Tc\n", + "Tr2 = T2/Tc\n", + "M = 44.\n", + "h1 = 4235.8 \t\t\t#B/lbm mol\n", + "h2 = 11661 \t\t\t#B/lbm mol\n", + "h2bar = 3.5 \t\t\t#B/lbm mol\n", + "h1bar = 0.48 \t\t\t#B/lbm mol\n", + "dhbar = Tc*(h2bar-h1bar) + h2-h1\n", + "Q = dhbar/M\n", + "cp = 0.202 \t\t\t#B/lbm F\n", + "Q2 = cp*(T2-T1)\n", + "Error = (Q-Q2)/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Error in calculation = %d percent\"%(Error*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Error in calculation = 31 percent\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch7_1.ipynb b/Thermodynamics_by_J._P._Holman/ch7_1.ipynb new file mode 100755 index 00000000..906a386e --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch7_1.ipynb @@ -0,0 +1,373 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:718f559da4ae2a13e9c934b6162f71a824de61441f47a14a1f58cca792ea40ff" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 :\n", + "equations of state and general\n", + "thermodynamic relations" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 pg : 158" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 1160. \t\t\t#R\n", + "h1 = 281.14 \t\t\t#B/lbm\n", + "Pr1 = 21.18 \n", + "P2 = 30. \t\t\t#psia\n", + "P1 = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "Pr2 = Pr1*P2/P1\n", + "T2 = 833. \t\t\t#R\n", + "h2 = 199.45 \t\t\t#B/lbm\n", + "dh = h2-h1\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in enthalpy = %.2f B/lbm\"%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = -81.69 B/lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 pg : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "T2 = 860. \t\t\t#R\n", + "phi1 = 0.78767\n", + "phi2 = 0.71323\n", + "P2 = 30. \t\t\t#psia\n", + "P1 = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dS = phi2-phi1- 53.35/778 *math.log(P2/P1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Net change of entropy = %.5f B/lbm R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net change of entropy = 0.00812 B/lbm R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 pg : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 540. \t\t\t#R\n", + "T2 = 960. \t\t\t#R\n", + "h2 = 231.06 \t\t\t#B/lbm\n", + "h1 = 129.06 \t\t\t#B/lbm\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "W = h2-h1\n", + "dh = cp*(T2-T1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in enthalpy = %.1f B/lbm\"%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = 100.8 B/lbm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 pg : 161" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\t\t\t\n", + "# Variables\n", + "T1 = 420. \t\t\t#R\n", + "T2 = 380. \t\t\t#R\n", + "hig = 1221.2\n", + "P1 = 0.0019\n", + "\t\t\t\n", + "# Calculations\n", + "lnp = hig*778*(1/T1 - 1/T2)/85.6\n", + "pra = math.exp(lnp)\n", + "P2 = pra*P1\n", + "\t\t\t\n", + "# Results\n", + "print \"Final pressure = %.3e psia\"%(P2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 1.177e-04 psia\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 pg : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "pc = 482.\t\t\t#psia\n", + "Tc = 227. \t\t\t#R\n", + "vc = 1.44 \t\t\t#ft**3/lbm mol\n", + "P = 600. \t\t\t#psia\n", + "T = 310. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "Pr = P/pc\n", + "Tr = T/Tc\n", + "Z = 0.83\n", + "v = Z*55.12*T/(P*144)\n", + "rho = 1/v\n", + "\t\t\t\n", + "# Results\n", + "print \"Density = %.1f lbm/ft**3\"%(rho)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Density = 6.1 lbm/ft**3\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 pg : 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = -150.+460 \t\t\t#R\n", + "v = 0.6 \t\t \t#ft**3/lbm\n", + "vc = 1.44\n", + "Tc = 227. \t \t\t#R\n", + "Pc = 482. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "vr = v/vc\n", + "Tr = T/Tc\n", + "Pr = 1.75\n", + "P = Pr*Pc\n", + "\t\t\t\n", + "# Results\n", + "print \"Final pressure = %d psia\"%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 843 psia\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 pg : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Tc = 344. \t\t\t#R\n", + "Pc = 673. \t\t\t#psia\n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 500. \t\t\t#psia\n", + "M = 16.\n", + "T = 560. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "pr1 = P1/Pc\n", + "pr2 = P2/Pc\n", + "Tr = T/Tc\n", + "dh2 = 0.65*Tc\n", + "dsp = 0.35 \t\t\t#B/lbm mol R\n", + "dsp2 = 0.018-dsp- 1545/778 *math.log(P2/P1)\n", + "W = dh2-dsp2*T\n", + "W2 = W/M\n", + "\t\t\t\n", + "# Results\n", + "print \"Work per pound mass = %d B/lbm\"%(W2)\n", + "\n", + "#The answer is a bit different due to rounding off error. check using calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work per pound mass = 138 B/lbm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 pg : 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 1000. \t \t\t#psia\n", + "T1 = 100. + 460 \t\t\t#R\n", + "T2 = 800. + 460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "pc = 1070. \t\t\t#psia\n", + "Tc = 548. \t\t\t#R\n", + "pr1 = P/pc\n", + "Tr1 = T1/Tc\n", + "Tr2 = T2/Tc\n", + "M = 44.\n", + "h1 = 4235.8 \t\t\t#B/lbm mol\n", + "h2 = 11661 \t\t\t#B/lbm mol\n", + "h2bar = 3.5 \t\t\t#B/lbm mol\n", + "h1bar = 0.48 \t\t\t#B/lbm mol\n", + "dhbar = Tc*(h2bar-h1bar) + h2-h1\n", + "Q = dhbar/M\n", + "cp = 0.202 \t\t\t#B/lbm F\n", + "Q2 = cp*(T2-T1)\n", + "Error = (Q-Q2)/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Error in calculation = %d percent\"%(Error*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Error in calculation = 31 percent\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch8.ipynb b/Thermodynamics_by_J._P._Holman/ch8.ipynb new file mode 100755 index 00000000..34ac501d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch8.ipynb @@ -0,0 +1,300 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:79ebced3b14c5bbd0f1f1f599d71ac5841752e19c3ef6de2a5a4223855b1a785" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 :\n", + "applications of statistical\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 pg : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 70. \t\t\t#K\n", + "Tr = 85.5 \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cvrot = 1.1\n", + "cvtra = 1.5\n", + "cv = cvtra+cvrot\n", + "\t\t\t\n", + "# Results\n", + "print \"Cv total = %.1f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cv total = 2.6 R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 pg : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 2000. \t\t\t#K\n", + "Tr = 3340. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "print (\"From fig 8.2\")\n", + "cvrot = 0.85\n", + "cvtra = 1.5\n", + "cvvib = 1.\n", + "cv = cvtra+cvrot+cvvib\n", + "\t\t\t\n", + "# Results\n", + "print \"Cv total = %.2f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From fig 8.2\n", + "Cv total = 3.35 R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 pg : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 200. \t\t\t#K\n", + "the = 398. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "ratio = T/the\n", + "cv = 4.9\n", + "\t\t\t\n", + "# Results\n", + "print \"Specific heat of aluminium = %.1f cal/g mol K\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific heat of aluminium = 4.9 cal/g mol K\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 pg : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 10. \t\t\t#K\n", + "td = 315. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cv = 464.4 *(T/td)**3\n", + "\t\t\t\n", + "# Results\n", + "print \"specific heat of copper = %.5f cal/g mol K\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "specific heat of copper = 0.01486 cal/g mol K\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5 pg : 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "N0 = 6.025*10**23\n", + "M = 63.57 \n", + "d = 8.94 \t\t\t#g/cc\n", + "h = 6.624*10**-27\n", + "me = 9.1*10**-28\n", + "\t\t\t\n", + "# Calculations\n", + "NbyV = N0*d/M\n", + "mu0 = h**2 *(3*NbyV/ math.pi)**(2./3) /(8*me)\n", + "e0 = 0.6*mu0*10**-7\n", + "Teq = 2*e0/(3*1.38*10**-23)\n", + "\t\t\t\n", + "# Results\n", + "print \"Equivalent temperature = %d K\"%(Teq)\n", + "\n", + "# check using calculator" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent temperature = 32681 K\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6 pg : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T = 300. \t\t\t#K\n", + "mu = 1.13*10**-18\n", + "k = 1.38*10**-23\n", + "\t\t\t\n", + "# Calculations\n", + "cv = math.pi**2 *k*T/(2*mu)\n", + "\t\t\t\n", + "# Results\n", + "print \"Electron contribution = %.4f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Electron contribution = 0.0181 R\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7 pg : 223" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "sig = 5.668*10**-5\n", + "T1 = 1000. \t\t\t#K\n", + "T2 = 2000. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "Eb1 = sig*T1**4 *10**-7\n", + "Eb2 = sig*T2**4 *10**-7\n", + "\t\t\t\n", + "# Results\n", + "print \"total energy emitted in case 1 = %.3f Watts/cm**2\"%(Eb1)\n", + "print \" total energy emitted in case 2 = %.3f Watts/cm**2\"%(Eb2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total energy emitted in case 1 = 5.668 Watts/cm**2\n", + " total energy emitted in case 2 = 90.688 Watts/cm**2\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch8_1.ipynb b/Thermodynamics_by_J._P._Holman/ch8_1.ipynb new file mode 100755 index 00000000..34ac501d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch8_1.ipynb @@ -0,0 +1,300 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:79ebced3b14c5bbd0f1f1f599d71ac5841752e19c3ef6de2a5a4223855b1a785" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 :\n", + "applications of statistical\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 pg : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 70. \t\t\t#K\n", + "Tr = 85.5 \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cvrot = 1.1\n", + "cvtra = 1.5\n", + "cv = cvtra+cvrot\n", + "\t\t\t\n", + "# Results\n", + "print \"Cv total = %.1f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cv total = 2.6 R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 pg : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 2000. \t\t\t#K\n", + "Tr = 3340. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "print (\"From fig 8.2\")\n", + "cvrot = 0.85\n", + "cvtra = 1.5\n", + "cvvib = 1.\n", + "cv = cvtra+cvrot+cvvib\n", + "\t\t\t\n", + "# Results\n", + "print \"Cv total = %.2f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From fig 8.2\n", + "Cv total = 3.35 R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 pg : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 200. \t\t\t#K\n", + "the = 398. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "ratio = T/the\n", + "cv = 4.9\n", + "\t\t\t\n", + "# Results\n", + "print \"Specific heat of aluminium = %.1f cal/g mol K\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific heat of aluminium = 4.9 cal/g mol K\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 pg : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 10. \t\t\t#K\n", + "td = 315. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cv = 464.4 *(T/td)**3\n", + "\t\t\t\n", + "# Results\n", + "print \"specific heat of copper = %.5f cal/g mol K\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "specific heat of copper = 0.01486 cal/g mol K\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5 pg : 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "N0 = 6.025*10**23\n", + "M = 63.57 \n", + "d = 8.94 \t\t\t#g/cc\n", + "h = 6.624*10**-27\n", + "me = 9.1*10**-28\n", + "\t\t\t\n", + "# Calculations\n", + "NbyV = N0*d/M\n", + "mu0 = h**2 *(3*NbyV/ math.pi)**(2./3) /(8*me)\n", + "e0 = 0.6*mu0*10**-7\n", + "Teq = 2*e0/(3*1.38*10**-23)\n", + "\t\t\t\n", + "# Results\n", + "print \"Equivalent temperature = %d K\"%(Teq)\n", + "\n", + "# check using calculator" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent temperature = 32681 K\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6 pg : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T = 300. \t\t\t#K\n", + "mu = 1.13*10**-18\n", + "k = 1.38*10**-23\n", + "\t\t\t\n", + "# Calculations\n", + "cv = math.pi**2 *k*T/(2*mu)\n", + "\t\t\t\n", + "# Results\n", + "print \"Electron contribution = %.4f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Electron contribution = 0.0181 R\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7 pg : 223" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "sig = 5.668*10**-5\n", + "T1 = 1000. \t\t\t#K\n", + "T2 = 2000. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "Eb1 = sig*T1**4 *10**-7\n", + "Eb2 = sig*T2**4 *10**-7\n", + "\t\t\t\n", + "# Results\n", + "print \"total energy emitted in case 1 = %.3f Watts/cm**2\"%(Eb1)\n", + "print \" total energy emitted in case 2 = %.3f Watts/cm**2\"%(Eb2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total energy emitted in case 1 = 5.668 Watts/cm**2\n", + " total energy emitted in case 2 = 90.688 Watts/cm**2\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch9.ipynb b/Thermodynamics_by_J._P._Holman/ch9.ipynb new file mode 100755 index 00000000..838e6d3d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch9.ipynb @@ -0,0 +1,275 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d5accb40ab200594c5bee653d2ffb7fee1e29e674b04c22a54296f7e8cb68080" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Kinetic theory and transport\n", + "phenomena" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 pg : 232" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "N0 = 6.025*10**26\n", + "M = 32.\n", + "k = 1.38*10**-23\n", + "T = 300. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "m = M/N0\n", + "vavg = math.sqrt(8*k*T/(math.pi*m))\n", + "vrms = math.sqrt(3*k*T/m)\n", + "vm = math.sqrt(2*k*T/m)\n", + "\t\t\t\n", + "# Results\n", + "print \"Average velocity = %d m/sec\"%(vavg)\n", + "print \" RMS velocity = %d m/sec\"%(vrms)\n", + "print \" Most probable velocity = %.f m/sec\"%(vm)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average velocity = 445 m/sec\n", + " RMS velocity = 483 m/sec\n", + " Most probable velocity = 395 m/sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 pg : 233" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T = 300. \t\t\t#K\n", + "dv = 0.02\n", + "vm = 395. \t\t\t#m/s\n", + "m = 5.32*10**-26 \t\t\t#kg\n", + "k = 1.38*10**-23\n", + "vrms = 483. \t\t\t#m/s\n", + "\t\t\t\n", + "# Calculations\n", + "N1 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vm**2 *math.exp(-1) *dv*vm\n", + "N2 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vrms**2 *math.exp(-3/2) *dv*vrms\n", + "\t\t\t\n", + "# Results\n", + "print \"Fraction of oxygen molecules at v most probable speed = %.4f \"%(N1)\n", + "print \" Fraction of oxygen molecules at v rms speed = %.4f \"%(N2)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fraction of oxygen molecules at v most probable speed = 0.0167 \n", + " Fraction of oxygen molecules at v rms speed = 0.0112 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 pg : 236" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "p = 1.013*10**5 \t\t\t#N/m**2\n", + "k = 1.38*10**-23\n", + "T = 300. \t \t\t#K\n", + "v = 445. \t \t \t#m/s\n", + "A = 0.001*10**-6 \t\t\t#m**2\n", + "\t\t\t\n", + "# Calculations\n", + "n = p/(k*T)\n", + "J = n*v/4\n", + "escaping = J*A\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of molecules escaping per unit time = %.2e mol/sec\"%(escaping)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of molecules escaping per unit time = 2.72e+18 mol/sec\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 pg : 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "d = 3.5*10**-10 \t\t\t#m\n", + "n = 2.45*10**25\n", + "\t\t\t\n", + "# Calculations\n", + "sig = math.pi*d**2\n", + "lambda_ = 1./(math.sqrt(2) *sig*n) \n", + "frac = math.exp(-2)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mean free path = %.2e m\"%(lambda_)\n", + "print \" fraction of molecules = %.3f\"%(frac)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mean free path = 7.50e-08 m\n", + " fraction of molecules = 0.135\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5 pg : 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 1. \t \t\t#atm\n", + "T = 300. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cv = 4.97\n", + "vavg = 1580. \t\t\t#ft/s\n", + "sig = 4.13*10**-18 \t\t\t#ft**2\n", + "N0 = 6.025*10**26 *0.4536\n", + "K = vavg*3600.*cv/(3*N0*sig)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal conductivity = %.2e B/hr ft F\"%(K)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal conductivity = 8.35e-03 B/hr ft F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.6 pg : 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 5.32*10**-26 \t\t\t#kg\n", + "v = 445. \t \t\t#m/s\n", + "sigma = 3.84*10**-19 \t\t\t#m**2\n", + "\t\t\t\n", + "# Calculations\n", + "mu = m*v/(3*sigma)\n", + "\t\t\t\n", + "# Results\n", + "print \"Dynamic viscosity of oxygen = %.2e newton sec/m**2\"%(mu)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Dynamic viscosity of oxygen = 2.06e-05 newton sec/m**2\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch9_1.ipynb b/Thermodynamics_by_J._P._Holman/ch9_1.ipynb new file mode 100755 index 00000000..838e6d3d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch9_1.ipynb @@ -0,0 +1,275 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d5accb40ab200594c5bee653d2ffb7fee1e29e674b04c22a54296f7e8cb68080" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Kinetic theory and transport\n", + "phenomena" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 pg : 232" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "N0 = 6.025*10**26\n", + "M = 32.\n", + "k = 1.38*10**-23\n", + "T = 300. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "m = M/N0\n", + "vavg = math.sqrt(8*k*T/(math.pi*m))\n", + "vrms = math.sqrt(3*k*T/m)\n", + "vm = math.sqrt(2*k*T/m)\n", + "\t\t\t\n", + "# Results\n", + "print \"Average velocity = %d m/sec\"%(vavg)\n", + "print \" RMS velocity = %d m/sec\"%(vrms)\n", + "print \" Most probable velocity = %.f m/sec\"%(vm)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average velocity = 445 m/sec\n", + " RMS velocity = 483 m/sec\n", + " Most probable velocity = 395 m/sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 pg : 233" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T = 300. \t\t\t#K\n", + "dv = 0.02\n", + "vm = 395. \t\t\t#m/s\n", + "m = 5.32*10**-26 \t\t\t#kg\n", + "k = 1.38*10**-23\n", + "vrms = 483. \t\t\t#m/s\n", + "\t\t\t\n", + "# Calculations\n", + "N1 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vm**2 *math.exp(-1) *dv*vm\n", + "N2 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vrms**2 *math.exp(-3/2) *dv*vrms\n", + "\t\t\t\n", + "# Results\n", + "print \"Fraction of oxygen molecules at v most probable speed = %.4f \"%(N1)\n", + "print \" Fraction of oxygen molecules at v rms speed = %.4f \"%(N2)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fraction of oxygen molecules at v most probable speed = 0.0167 \n", + " Fraction of oxygen molecules at v rms speed = 0.0112 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 pg : 236" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "p = 1.013*10**5 \t\t\t#N/m**2\n", + "k = 1.38*10**-23\n", + "T = 300. \t \t\t#K\n", + "v = 445. \t \t \t#m/s\n", + "A = 0.001*10**-6 \t\t\t#m**2\n", + "\t\t\t\n", + "# Calculations\n", + "n = p/(k*T)\n", + "J = n*v/4\n", + "escaping = J*A\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of molecules escaping per unit time = %.2e mol/sec\"%(escaping)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of molecules escaping per unit time = 2.72e+18 mol/sec\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 pg : 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "d = 3.5*10**-10 \t\t\t#m\n", + "n = 2.45*10**25\n", + "\t\t\t\n", + "# Calculations\n", + "sig = math.pi*d**2\n", + "lambda_ = 1./(math.sqrt(2) *sig*n) \n", + "frac = math.exp(-2)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mean free path = %.2e m\"%(lambda_)\n", + "print \" fraction of molecules = %.3f\"%(frac)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mean free path = 7.50e-08 m\n", + " fraction of molecules = 0.135\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5 pg : 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 1. \t \t\t#atm\n", + "T = 300. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cv = 4.97\n", + "vavg = 1580. \t\t\t#ft/s\n", + "sig = 4.13*10**-18 \t\t\t#ft**2\n", + "N0 = 6.025*10**26 *0.4536\n", + "K = vavg*3600.*cv/(3*N0*sig)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal conductivity = %.2e B/hr ft F\"%(K)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal conductivity = 8.35e-03 B/hr ft F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.6 pg : 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 5.32*10**-26 \t\t\t#kg\n", + "v = 445. \t \t\t#m/s\n", + "sigma = 3.84*10**-19 \t\t\t#m**2\n", + "\t\t\t\n", + "# Calculations\n", + "mu = m*v/(3*sigma)\n", + "\t\t\t\n", + "# Results\n", + "print \"Dynamic viscosity of oxygen = %.2e newton sec/m**2\"%(mu)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Dynamic viscosity of oxygen = 2.06e-05 newton sec/m**2\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/AlokDadlani/ALOK_DADLANI_1.ipynb b/sample_notebooks/AlokDadlani/ALOK_DADLANI_1.ipynb new file mode 100755 index 00000000..fb112015 --- /dev/null +++ b/sample_notebooks/AlokDadlani/ALOK_DADLANI_1.ipynb @@ -0,0 +1,181 @@ +{ + "metadata": { + "celltoolbar": "Raw Cell Format", + "name": "", + "signature": "sha256:3b06b8823767b3825269a747c05fd26d974c2716df62f30b0a870614bf61c112" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Introduction To Special Relativity And Space Science (By S.P. Singh)" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "CHAPTER NUMBER 1 : Interference Diffraction and Polarization" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 1.1 : (PAGE NUMBER 46)" + ] + }, + { + "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 1.2 : (PAGE NUMBER 47)" + ] + }, + { + "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 1.3 : (Page Number 47)" + ] + }, + { + "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 1.4 : (Page Number 47)" + ] + }, + { + "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 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/AshvaniKumar/CH2.ipynb b/sample_notebooks/AshvaniKumar/CH2.ipynb new file mode 100755 index 00000000..66f57963 --- /dev/null +++ b/sample_notebooks/AshvaniKumar/CH2.ipynb @@ -0,0 +1,300 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:e3537477beffef32716056a02b1119855be97d741374cf7c8e1075a3a804210f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-2, Optical Fibers & its types" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.1 ; page 146" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#Given data :\n", + "n1=1.40 #refractive index\n", + "delta=1 #relative refractive index difference in %\n", + "#Formula : n2/n1=1-delta\n", + "n2=n1*(1-delta/100) #refractive index(unitless)\n", + "print \"Refractive index of cladding is\",n2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Refractive index of cladding is 1.386\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.2 ; page 149" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from numpy import sin, arcsin, pi\n", + "#Given data :\n", + "fi_o=22 #in Degree\n", + "delta=3 #relative refractive index difference in %\n", + "#Part (a) :\n", + "#Formula : NA=sin(fi_o).....(max)\n", + "NA=sin(fi_o*pi/180) #Numerical Aperture(Unitless)\n", + "print \"Numerical Aperture : \",round(NA,2)\n", + "#Part (b) :\n", + "#Formula : n2/n1=1-delta\n", + "#Let say, n2/n1=n2byn1\n", + "n2byn1=(1-delta/100) #refractive index(unitless)\n", + "#Formula : sin(fi_C)=n2/n1 \n", + "fi_c=arcsin(n2byn1) #in degree\n", + "print \"Critical Angle at core cladding interface is\",round(fi_c,2),\"Degree\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Numerical Aperture : 0.37\n", + "Critical Angle at core cladding interface is 1.33 Degree\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.3; page 156" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from numpy import sqrt\n", + "#Given data :\n", + "delta=0.45 #relative refractive index difference in %\n", + "fi_o=0.115 #in Radian\n", + "c=3*10**8 #speed of light in m/s\n", + "#Formula : NA=sin(fi_o).....(max)\n", + "NA=sin(fi_o) #Numerical Aperture(Unitless)\n", + "#Formula : NA=n1*sqrt(2*delta)\n", + "n1=NA/sqrt(2*delta/100) #unitless\n", + "#Formula : n1=c/v \n", + "v=c/n1 #in m/s\n", + "print \"Speed of light in fibre core is \",round(v,2),\" m/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of light in fibre core is 248028935.21 m/s\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.4; page 157" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from numpy import sqrt, pi\n", + "#Given data :\n", + "n1=1.5 #Unitless\n", + "delta=1 #relative refractive index difference in %\n", + "lamda=1.3 #in um\n", + "N=1100 #No. of modes\n", + "#Formula : v=2*%pi*a*n1*NA/lambda \n", + "#NA=sqrt(2*delta)\n", + "#v=sqrt(2*N)\n", + "a=(sqrt(2*N)*lamda)/(2*pi*n1*sqrt(2*delta/100)) #Normalized frequency\n", + "d=2*a # um\n", + "print \"Diameter of the fiber core is\",round(d,2),\"um\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter of the fiber core is 91.5 um\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.5; page 159" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from numpy import sin, pi\n", + "#Given data :\n", + "\n", + "n1=1.52 #unitless\n", + "fi_o=8 #in Degree\n", + "#Formula : sin(fi_o)=n1*sqrt(2*delta)\n", + "delta=(sin(fi_o*pi/180)/n1)**2/2 #Relative refractive index\n", + "delta*=100 # in %\n", + "print \"The value of relative refractive index difference is \",round(delta,2),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of relative refractive index difference is 0.42 %\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.6; page 162" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from numpy import pi, sqrt\n", + "#Given data :\n", + "N=700 #No. of modes\n", + "d=30 #in um\n", + "a=d/2 #in um\n", + "NA=0.62 #Numerical Aperture\n", + "#Formula : v=2*sqrt(N) and v=2*%pi*a*NA/lambda\n", + "lamda=2*pi*a*NA/(2*sqrt(N)) #in um\n", + "print \"Wavelength of light propagating in fibre is\",round(lamda,2),\" micro meter\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Wavelength of light propagating in fibre is 1.1 micro meter\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.7;page 165" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from numpy import pi, sqrt\n", + "#Given data :\n", + "n1=1.5 #unitless\n", + "alfa=2 #characteristic index profile\n", + "d=40 #in um\n", + "a=d/2 #in um\n", + "#Part (a) :\n", + "lamda=1.3 #in um\n", + "delta=1 \n", + "#Formula : v=2*%pi*a*NA/lambda=2*%pi*a*(n1*sqrt(2*delta))/lambda\n", + "v=2*pi*a*(n1*sqrt(2*delta/100))/lamda #Unitless\n", + "print \"Normalized Frequency for single mode transmission : \",round(v,2) \n", + "#Part (b) :\n", + "#Formula : N=(alfa/alfa+2)*(v**2/2)\n", + "N=(alfa/(alfa+2))*(v**2/2) #No. of guided modes\n", + "print \"No. of guided modes propagating in the fibre is %d\" %N" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Normalized Frequency for single mode transmission : 20.51\n", + "No. of guided modes propagating in the fibre is 105" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n" + ] + } + ], + "prompt_number": 20 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/MayurSabban/ChapterNo04.ipynb b/sample_notebooks/MayurSabban/ChapterNo04.ipynb new file mode 100755 index 00000000..c6f434bb --- /dev/null +++ b/sample_notebooks/MayurSabban/ChapterNo04.ipynb @@ -0,0 +1,257 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 02 : Capacitance Of Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1, Page No 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "D = 20.0 #in ft\n",
+ "f = 60.0 #in Hz\n",
+ "\n",
+ "#From Table A.1 and A.3\n",
+ "d = 0.642 \t\t\t#in inches\n",
+ "X_a = 0.1074e6 \t\t#in ohm-mi\n",
+ "X_d = 0.0889e6 \t\t#in ohm-mi\n",
+ "\n",
+ "#finding radius\n",
+ "r = d/(2*12) \t\t#divided by 12 convert in to ft\n",
+ "\n",
+ "#Calculations\n",
+ "print('Calculations using conductor spacing and radius')\n",
+ "X_c = 1.779 * math.log(D/r)/f\n",
+ "B_c = 1 / X_c\n",
+ "print(\" Capactive reatance = %.4fe6 ohm mi to neutral \" %X_c)\n",
+ "print(\" Capactive susceptance = %.4fe-6 mho/mi to neutral \" %B_c)\n",
+ "\n",
+ "#calculations using capacitive reactance at 1-ft spacing and spacing factor\n",
+ "print('Calculations using capacitive reactance at 1-ft spacing and spacing factor')\n",
+ "X_c1 = X_a + X_d\n",
+ "print(\" Capactive reatance = %.4fe6 ohm mi per conductor \" %(X_c1/10**6))\n",
+ "X_c11 = 2 * X_c1\n",
+ "B_c1 = 1 / X_c11\n",
+ "\n",
+ "#Results\n",
+ "print(\" Line-to-line capactive reatance = %.4fe6 ohm mi \" %(X_c11/10**6))\n",
+ "print(\" Line-to-line capactive susceptance = %.4fe-6 mho mi \" %(B_c1*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Calculations using conductor spacing and radius\n",
+ " Capactive reatance = 0.1962e6 ohm mi to neutral \n",
+ " Capactive susceptance = 5.0970e-6 mho/mi to neutral \n",
+ "Calculations using capacitive reactance at 1-ft spacing and spacing factor\n",
+ " Capactive reatance = 0.1963e6 ohm mi per conductor \n",
+ " Line-to-line capactive reatance = 0.3926e6 ohm mi \n",
+ " Line-to-line capactive susceptance = 2.5471e-6 mho mi \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2, Page No 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "D_12 = 20.0\t\t\t#in ft\n",
+ "D_23 = D_12\n",
+ "D_31 = 38.0\t\t\t#in ft\n",
+ "f = 60.0\t\t\t#in Hz\n",
+ "V = 220e3\t\t\t#in volts\n",
+ "l = 175\t\t\t\t#in mi\n",
+ "k = 8.85e-12\t\t#permittivity in F/m\n",
+ "#From tables A.1 and A.3\n",
+ "d = 1.108#in inches\n",
+ "X_a1 = 0.0912e6#in ohm mi\n",
+ "X_d1 = 0.0952e6#in ohm mi\n",
+ "\n",
+ "#Calculations\n",
+ "r = d / ( 2 * 12)#division by 12 to convert in to ft\n",
+ "D_eq = (D_12*D_23*D_31)**(1.0/3)\n",
+ "C_n = (2*math.pi*k)/math.log(D_eq/r)\n",
+ "X_c = 1.0/(2*math.pi*f*C_n*1609)\t\t#division by 1609 to convert to ohm mi\n",
+ "\n",
+ "print(\" Capacitance = %.4fe-12 F/m \" %(C_n*1e12))\n",
+ "print(\" Capacitive reactance = %.4fe6 ohm mi \" %(X_c/1e6))\n",
+ "\n",
+ "#Calculations From tables\n",
+ "X_c1 = X_a1 + X_d1\n",
+ "print('Using capacitive reactance at 1-ft spacing and spacing factor')\n",
+ "print(\" Capacitive reactance = %.4fe6 ohm mi \" %(X_c1/1e6))\n",
+ "X_c_l = X_c1/l\t\t\t#Capacitive reactance for 175mi\n",
+ "I_chg = 2*math.pi*f*V*C_n*1609/math.sqrt(3.0)\n",
+ "I_chg_l = I_chg * l\n",
+ "Q =math.sqrt(3)*V*I_chg_l\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print('For a lenght of 175mi')\n",
+ "print(\" Capacitive reactance = %.4f ohm to neutral \" %X_c_l)\n",
+ "print(\" Charging current per mile = %.3f A/mi \" %I_chg)\n",
+ "print('For a lenght of 175mi')\n",
+ "print(\" Charging current = %.0f A \" %I_chg_l)\n",
+ "print(\" Total charging megavolt-amperes = %.1f Mvar \" %(Q/1e6))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Capacitance = 8.8472e-12 F/m \n",
+ " Capacitive reactance = 0.1863e6 ohm mi \n",
+ "Using capacitive reactance at 1-ft spacing and spacing factor\n",
+ " Capacitive reactance = 0.1864e6 ohm mi \n",
+ "For a lenght of 175mi\n",
+ " Capacitive reactance = 1065.1429 ohm to neutral \n",
+ " Charging current per mile = 0.682 A/mi \n",
+ "For a lenght of 175mi\n",
+ " Charging current = 119 A \n",
+ " Total charging megavolt-amperes = 45.5 Mvar \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3, Page No 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "d = 0.45 #in m\n",
+ "k = 8.85e-12 #in F/m\n",
+ "D_ab = 8 #in m\n",
+ "D_bc = D_ab\n",
+ "D_ca = 16 #in m\n",
+ "f = 60 #in Hz\n",
+ "\n",
+ "#From tables\n",
+ "D = 1.382 #in inches\n",
+ "\n",
+ "#Calculations\n",
+ "r = D*0.3048/(2.0*12) #divison by 12 to convert in to ft\n",
+ " #multiplication by 0.3048 to convert ft to m\n",
+ "D_b_sC = math.sqrt( r * d)\n",
+ "D_eq = (D_ab * D_bc * D_ca)**(1/3)\n",
+ "C_m = 2* math.pi*k/math.log(D_eq / D_b_sC)\n",
+ "X_c = 1e-3/(2*math.pi*f*C_m) #1e-3 #to convert m to km\n",
+ "\n",
+ "#Results\n",
+ "print(\" Capacitance = %.3fe-12 F/m \" %(C_m * 1e12))\n",
+ "print(\" Capacitive reactance = %.4fe6 ohm km per phase to neutral\" %(X_c/1e6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Capacitance = 22.972e-12 F/m \n",
+ " Capacitive reactance = 0.1155e6 ohm km per phase to neutral\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page No 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "f = 60.0\t\t#in Hz\n",
+ "k = 8.85e-12\t#in F/m\n",
+ "D_eq = 16.1\t\t#in ft\n",
+ "D_a_a1 = 26.9\n",
+ "D_b_b1 = 21.0\n",
+ "D_c_c1 = D_a_a1 #in ft\n",
+ "\n",
+ "#From Table A.1\n",
+ "d = 0.680#in inches\n",
+ "\n",
+ "#calculations\n",
+ "r = d /(2*12)\n",
+ "D_p_sC = (math.sqrt(D_a_a1 * r) * math.sqrt(D_b_b1 * r) * math.sqrt(D_c_c1 * r))**(1.0/3)\n",
+ "C_n = 2 * math.pi * k / math.log(D_eq / D_p_sC)\n",
+ "B_c = 2 * math.pi * f * C_n * 1609.0\t#1609 to convert from m to mi\n",
+ "\n",
+ "#Results\n",
+ "print(\"printprint Capacitance = %.3fe-12 F/m printprint\" %(C_n*1e12))\n",
+ "print(\"printprint Capacitive susceptance = %.2fe-6 mho per mi per phase to neutral\" %(B_c*1e6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "printprint Capacitance = 18.812e-12 F/m printprint\n",
+ "printprint Capacitive susceptance = 11.41e-6 mho per mi per phase to neutral\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/MohdAsif/Chapter5.ipynb b/sample_notebooks/MohdAsif/Chapter5.ipynb new file mode 100755 index 00000000..e36093b9 --- /dev/null +++ b/sample_notebooks/MohdAsif/Chapter5.ipynb @@ -0,0 +1,247 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:abf9f7aa50395283288e62f0f85bd91bae92b4155380f5c281c2602a3861ceb7" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter - 5 Wave Motion and speed" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1, page : 115" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import pi\n", + "#frequency\n", + "r=3 #m\n", + "w=10 #s**-1\n", + "vs=r*w #m/s\n", + "A=6 #m\n", + "fd=5/pi #s**-1\n", + "vmax=A*2*pi*fd #m/s\n", + "v=330 #m/s\n", + "n=340 #Hz\n", + "nmax=((v+vmax)/(v-vs))*n #Hz\n", + "nmin=((v-vmax)/(v+vs))*n #Hz\n", + "print \"Maximum frequency is \",nmax,\" Hz\"\n", + "print \"Minimum frequency is \",nmin,\" Hz\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum frequency is 442.0 Hz\n", + "Minimum frequency is 255.0 Hz\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2, page : 118" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "# frequency\n", + "#given data :\n", + "N=400 #hZ\n", + "V=340 #M/S\n", + "VS=60 #M/S\n", + "N2=((V/(V-VS))*N) #Hz\n", + "print \"Frequency when engine is approaching to the listner is \",round(N2,2),\" Hz\"\n", + "N3=((V/(V+VS))*N) #Hz\n", + "print \"Frequency when engine is moving away from the listner is \",round(N3,2),\" Hz\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency when engine is approaching to the listner is 485.71 Hz\n", + "Frequency when engine is moving away from the listner is 340.0 Hz\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3, page : 120" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#frequency\n", + "v=1200 #km/h\n", + "w=40 #km/h\n", + "vs=40 #km/h\n", + "n=580 #Hz\n", + "nd=((v+vs)/((v+vs)-vs))*n #Hz\n", + "print \"Frequency of the whistle as heared by an observer on the hill is \",round(nd,2),\" Hz\"\n", + "x=29/30 #km\n", + "x*=1000 #m\n", + "print \"Distance is \",round(x,2),\" m\"\n", + "ndd=((v-w)+vs)/((v-w))*nd #Hz\n", + "print \"Frequency heared by driver is \",round(nd,2),\" Hz\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency of the whistle as heared by an observer on the hill is 599.33 Hz\n", + "Distance is 966.67 m\n", + "Frequency heared by driver is 599.33 Hz\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5, page :125" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#frequency\n", + "v=340 #m/s\n", + "n=600 #Hz\n", + "vs=36 #km h**-1\n", + "vs1=vs*(1000/3600) #m/s\n", + "apf=((v)/(v-vs1))*n #Hz\n", + "vs2=54 #km h**-1\n", + "vs3=vs2*(1000/3600) #m/s\n", + "apf1=((v)/(v+vs3))*n #Hz\n", + "print \"Two apparent frequencies are \",round(apf,2),\" Hz and \",round(apf1,2),\" Hz\"\n", + "df=apf-apf1 #Hz\n", + "print \"Difference in frequencies is \",round(df,2),\" Hz\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Two apparent frequencies are 618.18 Hz and 574.65 Hz\n", + "Difference in frequencies is 43.53 Hz\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9, page : 135" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import sqrt, pi\n", + "#foce constant,displacement , acceleration and energy\n", + "x1=.10 # in m\n", + "F1=4 # in N\n", + "K=F1/x1 \n", + "x2=0.12 # in m\n", + "print \"(a) The force constant, K = \",K,\" N/m \"\n", + "F=-K*x2 \n", + "print \"(b) The force, F = \",F, \" N\"\n", + "m=1.6 # in kg\n", + "T=2*pi*sqrt(m/K) \n", + "print \"(c) Period of pscillation, T = \",round(T,2), \" s\"\n", + "A=x2 \n", + "print \"(d) Amplitude of motion,A = \",A, \" m\"\n", + "alfa=A*K/m \n", + "print \"(e) Maximum acceleration,alfa = \",alfa,\" m/s**2\"\n", + "x=A/2 # in m\n", + "w=sqrt(K/m) \n", + "v=w*sqrt(A**2-x**2) \n", + "a=w**2*x # in m/s**2\n", + "KE=(1/2)*m*v**2 # in J\n", + "PE=(1/2)*K*x**2 # in J\n", + "TE=KE+PE \n", + "print \"\"\"(f) velocity is %0.2f m/s\n", + "acceleration %0.2f m/s**2\n", + "Kinetic energy is %0.2f J\n", + "Potential energy is %0.2f J\"\"\" %(v,a,KE,PE)\n", + "print \"(g) Total energy of the oscillating system %0.2f J\" %TE" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) The force constant, K = 40.0 N/m \n", + "(b) The force, F = -4.8 N\n", + "(c) Period of pscillation, T = 1.26 s\n", + "(d) Amplitude of motion,A = 0.12 m\n", + "(e) Maximum acceleration,alfa = 3.0 m/s**2\n", + "(f) velocity is 0.52 m/s\n", + "acceleration 1.50 m/s**2\n", + "Kinetic energy is 0.22 J\n", + "Potential energy is 0.07 J\n", + "(g) Total energy of the oscillating system 0.29 J\n" + ] + } + ], + "prompt_number": 22 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/MohdRizwan/Chapter8.ipynb b/sample_notebooks/MohdRizwan/Chapter8.ipynb new file mode 100755 index 00000000..0017f769 --- /dev/null +++ b/sample_notebooks/MohdRizwan/Chapter8.ipynb @@ -0,0 +1,253 @@ +{ + "metadata": { + "name": "Rijwan", + "signature": "sha256:ccfeb26b31d807a5210cb280c22c39e23c0906566f59b1bedfeb5dfebe856c36" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-8 Oscillators" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.1, page 272 " + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#Given data\n", + "A=50 #unitless\n", + "criteria = \"Barkhausen criterion for oscillator : Beta*A=1\"\n", + "Beta=1/A #unitless\n", + "print criteria,\"\\nFeedback Factor for oscillator : \",Beta" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Barkhausen criterion for oscillator : Beta*A=1 \n", + "Feedback Factor for oscillator : 0.02\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.2, page 279" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import pi\n", + "#Given data\n", + "L=100 #in uH\n", + "L=L*10**-6 #in H\n", + "f1=500 #in kHz\n", + "f1=f1*10**3 #in Hz\n", + "f2=1500 #in kHz\n", + "f2=f2*10**3 #in Hz\n", + "#Formula : f=1/(2*%pi*sqrt(L*C))\n", + "C1=1/(4*pi**2*f1**2*L) #in F\n", + "C2=1/(4*pi**2*f2**2*L) #in F\n", + "C1*=10**12 #pF\n", + "C2*=10**12 #pF\n", + "print \"Range of capacitor : %0.2f pf to %0.2f pf\" %(C2, C1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Range of capacitor : 112.58 pf to 1013.21 pf\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.3, page 285" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import pi \n", + "#Given data\n", + "R=100 #in kOhm\n", + "R=R*10**3 #in Ohm\n", + "C=0.01 #in uF\n", + "C=C*10**-6 #in F\n", + "fo=sqrt(6)/(2*pi*R*C) #in Hz\n", + "print \"Frequency of oscillation is %0.3f Hz\" %fo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency of oscillation is 389.848 Hz\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.4, page 288" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import sqrt\n", + "#Given data\n", + "assumed = \"Assume alfa=sqrt(6) to find the gain.\"\n", + "alfa=sqrt(6) #unitless\n", + "Beta=1/(1-5*alfa**2) \n", + "criteria = \"Barkhausen critera : A*|Beta|>=1\"\n", + "Beta=-Beta #\n", + "A=1/Beta #unitless\n", + "print assumed,\"\\n\",criteria,\"\\nMinimum Gain of Amplifier must be \",A" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Assume alfa=sqrt(6) to find the gain. \n", + "Barkhausen critera : A*|Beta|>=1 \n", + "Minimum Gain of Amplifier must be 29.0\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.6, page 289" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import pi, sqrt\n", + "#Given data :\n", + "R1=50 #in kohm\n", + "R1=R1*10**3 #in ohm\n", + "C1=0.001 #in uF\n", + "C1=C1*10**-6 #in F\n", + "R2=1 #in kohm\n", + "R2=R2*10**3 #in ohm\n", + "C2=0.01 #in uF\n", + "C2=C2*10**-6 #in F\n", + "#Part (i)\n", + "#Formula : f=1/(2*pi*sqrt(C1*C2*R1*R2))\n", + "f=1/(2*pi*sqrt(C1*C2*R1*R2)) #in Hz\n", + "f/=1000 #kHz\n", + "print \"(i) Frequency of oscillations is %0.3f kHz\" %f\n", + "#Part (ii)\n", + "CurrentGain=1+C2/C1+R1/R2 #unitless\n", + "print \"(ii) Current Gain : \",CurrentGain" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(i) Frequency of oscillations is 7.118 kHz\n", + "(ii) Current Gain : 61.0\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.7, page 295" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import sqrt, pi\n", + "#Given data :\n", + "fmin=20 #in Hz\n", + "fmax=20 #in kHz\n", + "Cmin=30 #in pF\n", + "Cmax=300 #in pF\n", + "#Formula : fo=1/(2*pi*R*C))\n", + "R=1/(2*pi*fmin*Cmax*10**-12) # ohm\n", + "R/=10**6 # Mohm\n", + "print \"Required resistance is %0.3f Mohm\" %R" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required resistance is 26.526 Mohm\n" + ] + } + ], + "prompt_number": 21 + } + ], + "metadata": {} + } + ] +} diff --git a/sample_notebooks/MohdRizwan/Chapter8_1.ipynb b/sample_notebooks/MohdRizwan/Chapter8_1.ipynb new file mode 100755 index 00000000..7882afef --- /dev/null +++ b/sample_notebooks/MohdRizwan/Chapter8_1.ipynb @@ -0,0 +1,253 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:cc1e0bf9fd21090c1f4f51c5610a5d1ad82c8e491a8eb621bca23a14ca4e6993" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-8 Oscillators" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.1, page 272 " + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#Given data\n", + "A=50 #unitless\n", + "criteria = \"Barkhausen criterion for oscillator : Beta*A=1\"\n", + "Beta=1/A #unitless\n", + "print criteria,\"\\nFeedback Factor for oscillator : \",Beta" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Barkhausen criterion for oscillator : Beta*A=1 \n", + "Feedback Factor for oscillator : 0.02\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.2, page 279" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import pi\n", + "#Given data\n", + "L=100 #in uH\n", + "L=L*10**-6 #in H\n", + "f1=500 #in kHz\n", + "f1=f1*10**3 #in Hz\n", + "f2=1500 #in kHz\n", + "f2=f2*10**3 #in Hz\n", + "#Formula : f=1/(2*%pi*sqrt(L*C))\n", + "C1=1/(4*pi**2*f1**2*L) #in F\n", + "C2=1/(4*pi**2*f2**2*L) #in F\n", + "C1*=10**12 #pF\n", + "C2*=10**12 #pF\n", + "print \"Range of capacitor : %0.2f pf to %0.2f pf\" %(C2, C1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Range of capacitor : 112.58 pf to 1013.21 pf\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.3, page 285" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import pi, sqrt \n", + "#Given data\n", + "R=100 #in kOhm\n", + "R=R*10**3 #in Ohm\n", + "C=0.01 #in uF\n", + "C=C*10**-6 #in F\n", + "fo=sqrt(6)/(2*pi*R*C) #in Hz\n", + "print \"Frequency of oscillation is %0.3f Hz\" %fo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency of oscillation is 389.848 Hz\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.4, page 288" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import sqrt\n", + "#Given data\n", + "assumed = \"Assume alfa=sqrt(6) to find the gain.\"\n", + "alfa=sqrt(6) #unitless\n", + "Beta=1/(1-5*alfa**2) \n", + "criteria = \"Barkhausen critera : A*|Beta|>=1\"\n", + "Beta=-Beta #\n", + "A=1/Beta #unitless\n", + "print assumed,\"\\n\",criteria,\"\\nMinimum Gain of Amplifier must be \",A" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Assume alfa=sqrt(6) to find the gain. \n", + "Barkhausen critera : A*|Beta|>=1 \n", + "Minimum Gain of Amplifier must be 29.0\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.6, page 289" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import pi, sqrt\n", + "#Given data :\n", + "R1=50 #in kohm\n", + "R1=R1*10**3 #in ohm\n", + "C1=0.001 #in uF\n", + "C1=C1*10**-6 #in F\n", + "R2=1 #in kohm\n", + "R2=R2*10**3 #in ohm\n", + "C2=0.01 #in uF\n", + "C2=C2*10**-6 #in F\n", + "#Part (i)\n", + "#Formula : f=1/(2*pi*sqrt(C1*C2*R1*R2))\n", + "f=1/(2*pi*sqrt(C1*C2*R1*R2)) #in Hz\n", + "f/=1000 #kHz\n", + "print \"(i) Frequency of oscillations is %0.3f kHz\" %f\n", + "#Part (ii)\n", + "CurrentGain=1+C2/C1+R1/R2 #unitless\n", + "print \"(ii) Current Gain : \",CurrentGain" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(i) Frequency of oscillations is 7.118 kHz\n", + "(ii) Current Gain : 61.0\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 8.7, page 295" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import sqrt, pi\n", + "#Given data :\n", + "fmin=20 #in Hz\n", + "fmax=20 #in kHz\n", + "Cmin=30 #in pF\n", + "Cmax=300 #in pF\n", + "#Formula : fo=1/(2*pi*R*C))\n", + "R=1/(2*pi*fmin*Cmax*10**-12) # ohm\n", + "R/=10**6 # Mohm\n", + "print \"Required resistance is %0.3f Mohm\" %R" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required resistance is 26.526 Mohm\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/Mohdarif/Chapter2.ipynb b/sample_notebooks/Mohdarif/Chapter2.ipynb new file mode 100755 index 00000000..588b4703 --- /dev/null +++ b/sample_notebooks/Mohdarif/Chapter2.ipynb @@ -0,0 +1,239 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:682987e4618d85f3223ce09c9f676959c97dc81b85e6ff92270d30168f8d3c6a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 - Optical Fibers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.4.1 - p:2-10" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "n1=1.46 #refractive index\n", + "d=0.01 #difference\n", + "na=n1*(2*d)**(1.0/2) #numerical aperture\n", + "x=1-d #\n", + "oc=math.asin(x) #in radian\n", + "oc*=180/math.pi # in degree\n", + "print \"Numerical Aperture is \",round(na,2)\n", + "print \"Critical angle at core cladding interface is \",round(oc,1),\" degree.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Numerical Aperture is 0.21\n", + "Critical angle at core cladding interface is 81.9 degree.\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.5.1 - p:2-11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "n2=1.45 #core refrative index\n", + "n1=1.49 #cladding refrative index\n", + "oc=math.asin(n2/n1) #in radian\n", + "oc*=180/math.pi # in degree\n", + "na=(n1**2-n2**2)**(1.0/2) #numerical aperture\n", + "pc=math.asin(na) # in radian\n", + "pc*=180/math.pi # in degree\n", + "print oc,\"Critical angle is \",round(oc,2),\" degree.\"\n", + "print \"Numerical aperture is \",round(na,3)\n", + "print \"Acceptance angle is \",round(pc,2),\" degree.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "76.693896868 Critical angle is 76.69 degree.\n", + "Numerical aperture is 0.343\n", + "Acceptance angle is 20.06 degree.\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.5.2 - p:2-11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "delta = 1.2/100 # Relative refractive difference index\n", + "n1=1.45 # Core refractive index \n", + "NA= n1*(2*delta)**(1.0/2) #computing numerical aperture\n", + "Acceptance_angle = math.asin(NA) #computing acceptance angle\n", + "si = math.pi*NA**2 #computing solid acceptance angle\n", + "print \"Numerical aperture is %.3f.\\nAcceptance angle is %.2f degree.\\nSolid acceptance angle is %.3f radians.\"%(NA,Acceptance_angle,si)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Numerical aperture is 0.225.\n", + "Acceptance angle is 0.23 degree.\n", + "Solid acceptance angle is 0.159 radians.\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.5.4 - p:2-12" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "diameter = 1.0 #Diameter in centimeter\n", + "Focal_length = 10.0 #Focal length in centimeter\n", + "radius=diameter/2.0 #computing radius\n", + "Acceptance_angle = math.atan(radius/Focal_length) #computing acceptance angle in radian\n", + "Acceptance_angle*=180/math.pi # in degree\n", + "Conical_full_angle = 2*Acceptance_angle #computing conical angle in degree\n", + "Solid_acceptance_angle = math.pi*Acceptance_angle**2 #computing solid acceptance angle in degree\n", + "NA = (Solid_acceptance_angle/math.pi)**(1.0/2) #computing Numerical aperture\n", + "print \"Numerical aperture is %.2f.\\nConical full angle is %.2f degree.\" %(NA,Conical_full_angle)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Numerical aperture is 2.86.\n", + "Conical full angle is 5.72 degree.\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.8.1 - p:2-21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "core_diameter=78*10**-6 #core diameter\n", + "delta=1.4/100 #relative index difference\n", + "lamda=0.8*10**-6 #operating wavelength\n", + "n1=1.47 #core refractive index\n", + "a=core_diameter/2 #computing core radius\n", + "v= 2*3.14*a*n1*(2*delta)**(1.0/2)/lamda #computing normalized frequency\n", + "M=(v)**2/2 #computing guided modes\n", + "print \"Normalized Frequency is %.3f.\\nTotal number of guided modes are %.1f\" %(v,M) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Normalized Frequency is 75.306.\n", + "Total number of guided modes are 2835.5\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.8.2 - p:2-23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "n1=1.47 #refractive index of core\n", + "a=4.3 #radius of core in um\n", + "delta=0.2/100 #relative index difference\n", + "lamda= 2*math.pi*a*n1*(2*delta)**(1.0/2)/2.405 #computing wavelength in um\n", + "lamda=lamda*10**3 # nm\n", + "\n", + "print \"Wavelength of fiber is %0.2f nm.\" %lamda" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Wavelength of fiber is 1044.43 nm.\n" + ] + } + ], + "prompt_number": 30 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/NishthaRani/CH8(1).ipynb b/sample_notebooks/NishthaRani/CH8(1).ipynb new file mode 100755 index 00000000..cae42a72 --- /dev/null +++ b/sample_notebooks/NishthaRani/CH8(1).ipynb @@ -0,0 +1,378 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:93168f4fdcda81fb8a5194b03c33462ec0c810df117544b3470474e9e7f2fcbf" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-8 : Control of DC Drivers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.12.4: p-275" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Motor torque \n", + "import numpy as np \n", + "#given data :\n", + "Vs_rms=230 # in volts\n", + "N=1200 # in rpm\n", + "Ia=40 # in A\n", + "Ra=0.25 #in ohm\n", + "Ka_fi1=0.182 # in V/rpm\n", + "Ka_fi=(0.182*60)/(2*np.pi) \n", + "alfa_a=30 \n", + "T=Ka_fi*Ia \n", + "print \"(a) Motor torque, T =\",round(T,2),\"N-m \"\n", + "Ea=((2*np.sqrt(2)*Vs_rms)/np.pi)*(np.cos(alfa_a*np.pi/180)) \n", + "N=(Ea-(Ra*Ia))/Ka_fi1 \n", + "print \"(b) Speed of the motor, N =\",round(N,2),\"rpm\"\n", + "Is_rms=Ia \n", + "PF=(Ea*Ia)/(Vs_rms*Is_rms) \n", + "print \"(c) Power factor, PF =\",round(PF,2),\"lagging\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Motor torque, T = 69.52 N-m \n", + "(b) Speed of the motor, N = 930.39 rpm\n", + "(c) Power factor, PF = 0.78 lagging\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.13.2: p-278" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Delay Angel of Armature,No load speed and speed regulation\n", + "import numpy as np\n", + "#given data :\n", + "VL_rms=208 # in volts\n", + "Kv=1.2 # in V/A-rad/sec\n", + "Vs_rms=round(VL_rms/np.sqrt(3),2) \n", + "Vm=np.sqrt(2)*Vs_rms \n", + "Rf=240 # in ohm\n", + "Ra=0.25 # in ohm\n", + "alfa_f=0 # in degree\n", + "V=280 # in volts\n", + "Twenty_HP=20*746 #in watt\n", + "Ia=Twenty_HP/V\n", + "Ef=round((3*np.sqrt(3)*Vm*np.cos(alfa_f*np.pi/180))/np.pi,2) \n", + "N=1800 \n", + "w=(N*2*np.pi)/60 \n", + "If=Ef/Rf \n", + "Eg=Kv*w*If \n", + "Ea=round(Eg+(Ia*Ra),2) \n", + "alfa_a=(np.arccos((Ea*np.pi)/(3*np.sqrt(3)*Vm))) \n", + "print \"(a) Delay Angel Of Armature, alfa_a = \",round(alfa_a,2),\"degree\"\n", + "Ia1=(Ia*10)/100\n", + "Eg_noL=Ea-(Ia1*Ra) \n", + "w_0=(Eg_noL/(1.2*1.17)) # rad/sec\n", + "N_0=(w_0*60)/(2*np.pi) \n", + "print \"(b) NO load speed at alfa|_a =\",round(N_0,2),\"rpm\"\n", + "SR=((N_0-N)/N)*100 \n", + "print \"(c) Speed Regulation, SR =\",round(SR,2),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Delay Angel Of Armature, alfa_a = 0.14 degree\n", + "(b) NO load speed at alfa|_a = 1882.25 rpm\n", + "(c) Speed Regulation, SR = 4.57 %\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.14.3 - P : 284" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#alpha, speed and delay angle\n", + "from __future__ import division\n", + "import numpy as np\n", + "#given data :\n", + "v1=208 #\n", + "vsrms=v1/np.sqrt(3) #\n", + "n=1000 #rpm\n", + "w=n*(np.pi/30) #in rad/s\n", + "ang=0 #\n", + "ef=((3*np.sqrt(3)*np.sqrt(2)*vsrms*np.cos(ang))/np.pi) #in volts\n", + "rf=140 #in ohms\n", + "If=ef/rf #in amperes\n", + "t=120 #N-m\n", + "kv=1.2 #\n", + "ia=(t)/(kv*If) #in amperes\n", + "eg=kv*If*w #in volts\n", + "ra=0.25 #in ohms\n", + "ea=eg+(ia*ra) #\n", + "alpha=np.arccos((ea*np.pi)/(3*np.sqrt(3)*np.sqrt(2)*vsrms))\n", + "print \"(a) alpha is\",round(alpha,2),\"degree\"\n", + "rf=140 #in ohms\n", + "If=ea/rf #in amperes\n", + "t=120 #N-m\n", + "kv=1.2 #\n", + "ia=(t)/(kv*If) #in amperes\n", + "ra=0.25 #in ohms\n", + "eg=ea-(ia*ra) #\n", + "w=(eg/(kv*If)) #in rad/s\n", + "N=w*(30/np.pi) #rpm\n", + "print \"(b) Speed is\",round(N,2),\"rpm\"\n", + "n1=1000 #rpm\n", + "w=n1*(np.pi/30) #in rad/s\n", + "v1=208 #\n", + "vsrms=v1/np.sqrt(3) #\n", + "w1=(1800*(np.pi/30)) #\n", + "n=1800 #rpm\n", + "ang=0 #\n", + "T=120 #n-m\n", + "alphas=0 #\n", + "ang=0 #\n", + "ea=((3*np.sqrt(3)*np.sqrt(2)*vsrms*np.arccos(ang))/np.pi) #in volts\n", + "rf=140 #in ohms\n", + "If=ea/rf #in amperes\n", + "t=120 #N-m\n", + "kv=1.2 #\n", + "ia=(t)/(kv*If) #in amperes\n", + "ra=0.25 #in ohms\n", + "eg=ea-(ia*ra) #\n", + "if1=eg/(kv*w1) #in amperese\n", + "ef1=if1*rf #in volts\n", + "alphaf=np.arccos((ef1*np.pi)/(3*np.sqrt(3)*120*np.sqrt(2))) \n", + "print \"(c) Delay angle is\",round(alphaf,2),\"degree\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) alpha is 0.34 degree\n", + "(b) Speed is 1058.39 rpm\n", + "(c) Delay angle is 0.3 degree\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.15.1: p-296" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Firing angle to keep the motor current and Power fed back \n", + "from numpy import pi, sqrt, arccos\n", + "#given data :\n", + "Vs_rms=260 # in volts\n", + "Ia=40 # in A\n", + "Eg=192 #in volts\n", + "kv=0.182 # in V/rpm\n", + "Ra=0.3 # in ohm\n", + "Ea=Eg+(Ia*Ra) \n", + "alfa_a=arccos((Ea*pi)/(2*Vs_rms*sqrt(2))) \n", + "print \"(a) Firing angle to keep motor current, alfa_a =\",round(alfa_a,2),\"degree\"\n", + "Ea1=-Eg+(Ia*Ra) \n", + "alfa_b=arccos((Ea1*pi)/(2*Vs_rms*sqrt(2))) \n", + "print \"(b) Firing angle, alfa_b =\",round(alfa_b,2),\"degree\"\n", + "Ia=40 # in A\n", + "Eg=192 #in volts\n", + "Ra=0.3 # in ohm\n", + "Ea=-Eg+(Ia*Ra) \n", + "P=abs(Ea)*Ia \n", + "print \"(c) Power fed back, P =\",round(P,2),\"Watt\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Firing angle to keep motor current, alfa_a = 0.51 degree\n", + "(b) Firing angle, alfa_b = 2.45 degree\n", + "(c) Power fed back, P = 7200.0 Watt\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.15.3: p-312" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# torque developed,speed and input power factor\n", + "from numpy import pi, sqrt, arccos, cos\n", + "#given data :\n", + "v=208 #in volts\n", + "f=50 #in Hz\n", + "ra=0.5 #in ohms\n", + "rf=345 #in ohms\n", + "kv=0.71 #in V/A-rad/sec\n", + "alpha=45 #in degree\n", + "ia=55 #in amperes\n", + "If=((2*sqrt(2)*v*cos(0))/(pi*rf)) #in amperes\n", + "t=kv*If*ia #in N/m\n", + "print \"(a) Torque is\",round(t,2),\"N/m\"\n", + "eb=((2*sqrt(2)*v*cos(alpha))/pi)-(ia*ra) #in volts\n", + "w=eb/(kv*If) #in rad/sec\n", + "N=w/(2*pi) #rps\n", + "print \"(b) speed is\",round(N*60,2),\"rpm\"\n", + "#speed is calculated wrong in the textbook\n", + "ea=132.4 #in volts\n", + "ef=187.3 #in volts\n", + "pi=(ea*ia)+(ef*If) #in watts\n", + "Isrms=sqrt((ia)**2+(If)**2) #in amperes\n", + "va1=Isrms*v #in VA\n", + "Pf=pi/va1 #\n", + "print \"(d) power factor is\",round(Pf,2), \"lagging\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Torque is 21.2 N/m\n", + "(b) speed is 1756.17 rpm\n", + "(d) power factor is 0.65 lagging\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.16.1: p-318" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# No load speed ,firing angle ,Power Factor and speed regulation\n", + "from numpy import pi, sqrt, arccos, cos\n", + "#given data :\n", + "Ra=0.075 #in ohm\n", + "alfa1=0 # in degree\n", + "alfa2=30 # in degree\n", + "VL_rms=480 # in volts\n", + "Ka_fi=0.3 # in V/rms\n", + "Vs_rms=round(VL_rms/sqrt(3),2) \n", + "Vm=sqrt(2)*Vs_rms \n", + "Ea=round((3*sqrt(3)*Vm*cos(alfa1))/pi) \n", + "Ea1=((3*sqrt(3)*Vm*cos(alfa2))/pi) \n", + "Ia=(10/100)*160 # in A\n", + "N_0=(Ea-Ia*Ra)/Ka_fi \n", + "N_30=(Ea1-Ia*Ra)/Ka_fi \n", + "print \"part (a)\"\n", + "print \"No load speed at alfa=0 degree is\",round(N_0,2),\"rpm\"\n", + "print \"No load speed at alfa=30 degree is\",round(N_30,2),\"rpm\"\n", + "print \"part (b)\"\n", + "Ia=160 # in A\n", + "N=1800 # in rpm\n", + "Eg=540 # in volts\n", + "Ea=(Eg+(Ia*Ra)) \n", + "alfa=(arccos((Ea*pi)/(3*sqrt(3)*Vm))) \n", + "print \"The firng angel, alfa is\",round(alfa,2),\"degree\"\n", + "Is_rms=sqrt(2/3)*Ia \n", + "Sva=3*Vs_rms*Is_rms \n", + "PF=(Ea*Ia)/(Sva) \n", + "print \"(c) Power Factor, PF =\",round(PF,2),\"lagging\"\n", + "Ra=0.075 #in ohm\n", + "Ia=160 # in A\n", + "Ia1=16 # in A\n", + "Eg=540 # in volts\n", + "Ka_fi=0.3 # in V/rms\n", + "N=1800 # in rpm\n", + "Ea=(Eg+(Ia*Ra)) \n", + "Eg1=Ea-(Ia1*Ra) \n", + "N_0=Eg1/Ka_fi \n", + "SR=((N_0-N)/N)*100 \n", + "print \"(d) Speed Regulation, SR =\",round(SR,2),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "part (a)\n", + "No load speed at alfa=0 degree is 2156.0 rpm\n", + "No load speed at alfa=30 degree is 329.3 rpm\n", + "part (b)\n", + "The firng angel, alfa is 0.55 degree\n", + "(c) Power Factor, PF = 0.81 lagging\n", + "(d) Speed Regulation, SR = 2.0 %\n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/NishthaRani/CH8.ipynb b/sample_notebooks/NishthaRani/CH8.ipynb new file mode 100755 index 00000000..271f161a --- /dev/null +++ b/sample_notebooks/NishthaRani/CH8.ipynb @@ -0,0 +1,378 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7b72a03e09ce03ad176a3887f05ee855123808690595d82c69513fb81e0bbc2c" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-8 : Control of DC Drivers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.12.4: p-275" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "# Motor torque \n", + "import numpy as np \n", + "#given data :\n", + "Vs_rms=230 # in volts\n", + "N=1200 # in rpm\n", + "Ia=40 # in A\n", + "Ra=0.25 #in ohm\n", + "Ka_fi1=0.182 # in V/rpm\n", + "Ka_fi=(0.182*60)/(2*np.pi) \n", + "alfa_a=30 \n", + "T=Ka_fi*Ia \n", + "print \"(a) Motor torque, T =\",round(T,2),\"N-m \"\n", + "Ea=((2*sqrt(2)*Vs_rms)/np.pi)*(np.cos(alfa_a*np.pi/180)) \n", + "N=(Ea-(Ra*Ia))/Ka_fi1 \n", + "print \"(b) Speed of the motor, N =\",round(N,2),\"rpm\"\n", + "Is_rms=Ia \n", + "PF=(Ea*Ia)/(Vs_rms*Is_rms) \n", + "print \"(c) Power factor, PF =\",round(PF,2),\"lagging\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Motor torque, T = 69.52 N-m \n", + "(b) Speed of the motor, N = 930.39 rpm\n", + "(c) Power factor, PF = 0.78 lagging\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.13.2: p-278" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "# Delay Angel of Armature,No load speed and speed regulation\n", + "import numpy as np\n", + "#given data :\n", + "VL_rms=208 # in volts\n", + "Kv=1.2 # in V/A-rad/sec\n", + "Vs_rms=round(VL_rms/np.sqrt(3),2) \n", + "Vm=np.sqrt(2)*Vs_rms \n", + "Rf=240 # in ohm\n", + "Ra=0.25 # in ohm\n", + "alfa_f=0 # in degree\n", + "V=280 # in volts\n", + "Twenty_HP=20*746 #in watt\n", + "Ia=Twenty_HP/V\n", + "Ef=round((3*np.sqrt(3)*Vm*np.cos(alfa_f*np.pi/180))/np.pi,2) \n", + "N=1800 \n", + "w=(N*2*np.pi)/60 \n", + "If=Ef/Rf \n", + "Eg=Kv*w*If \n", + "Ea=round(Eg+(Ia*Ra),2) \n", + "alfa_a=(np.arccos((Ea*np.pi)/(3*np.sqrt(3)*Vm))) \n", + "print \"(a) Delay Angel Of Armature, alfa_a = \",round(alfa_a,2),\"degree\"\n", + "Ia1=(Ia*10)/100\n", + "Eg_noL=Ea-(Ia1*Ra) \n", + "w_0=(Eg_noL/(1.2*1.17)) # rad/sec\n", + "N_0=(w_0*60)/(2*np.pi) \n", + "print \"(b) NO load speed at alfa|_a =\",round(N_0,2),\"rpm\"\n", + "SR=((N_0-N)/N)*100 \n", + "print \"(c) Speed Regulation, SR =\",round(SR,2),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Delay Angel Of Armature, alfa_a = 0.14 degree\n", + "(b) NO load speed at alfa|_a = 1882.16 rpm\n", + "(c) Speed Regulation, SR = 4.56 %\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.14.3 - P : 284" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "#alpha, speed and delay angle\n", + "from __future__ import division\n", + "import numpy as np\n", + "#given data :\n", + "v1=208 #\n", + "vsrms=v1/np.sqrt(3) #\n", + "n=1000 #rpm\n", + "w=n*(pi/30) #in rad/s\n", + "ang=0 #\n", + "ef=((3*sqrt(3)*np.sqrt(2)*vsrms*np.cos(ang))/pi) #in volts\n", + "rf=140 #in ohms\n", + "If=ef/rf #in amperes\n", + "t=120 #N-m\n", + "kv=1.2 #\n", + "ia=(t)/(kv*If) #in amperes\n", + "eg=kv*If*w #in volts\n", + "ra=0.25 #in ohms\n", + "ea=eg+(ia*ra) #\n", + "alpha=np.arccos((ea*np.pi)/(3*np.sqrt(3)*np.sqrt(2)*vsrms))\n", + "print \"(a) alpha is\",round(alpha,2),\"degree\"\n", + "rf=140 #in ohms\n", + "If=ea/rf #in amperes\n", + "t=120 #N-m\n", + "kv=1.2 #\n", + "ia=(t)/(kv*If) #in amperes\n", + "ra=0.25 #in ohms\n", + "eg=ea-(ia*ra) #\n", + "w=(eg/(kv*If)) #in rad/s\n", + "N=w*(30/pi) #rpm\n", + "print \"(b) Speed is\",round(N,2),\"rpm\"\n", + "n1=1000 #rpm\n", + "w=n1*(np.pi/30) #in rad/s\n", + "v1=208 #\n", + "vsrms=v1/np.sqrt(3) #\n", + "w1=(1800*(np.pi/30)) #\n", + "n=1800 #rpm\n", + "ang=0 #\n", + "T=120 #n-m\n", + "alphas=0 #\n", + "ang=0 #\n", + "ea=((3*np.sqrt(3)*np.sqrt(2)*vsrms*np.arccos(ang))/np.pi) #in volts\n", + "rf=140 #in ohms\n", + "If=ea/rf #in amperes\n", + "t=120 #N-m\n", + "kv=1.2 #\n", + "ia=(t)/(kv*If) #in amperes\n", + "ra=0.25 #in ohms\n", + "eg=ea-(ia*ra) #\n", + "if1=eg/(kv*w1) #in amperese\n", + "ef1=if1*rf #in volts\n", + "alphaf=np.arccos((ef1*np.pi)/(3*np.sqrt(3)*120*np.sqrt(2))) \n", + "print \"(c) Delay angle is\",round(alphaf,2),\"degree\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) alpha is 0.34 degree\n", + "(b) Speed is 1058.39 rpm\n", + "(c) Delay angle is 0.3 degree\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.15.1: p-296" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "# Firing angle to keep the motor current and Power fed back \n", + "from numpy import pi, sqrt, arccos\n", + "#given data :\n", + "Vs_rms=260 # in volts\n", + "Ia=40 # in A\n", + "Eg=192 #in volts\n", + "kv=0.182 # in V/rpm\n", + "Ra=0.3 # in ohm\n", + "Ea=Eg+(Ia*Ra) \n", + "alfa_a=arccos((Ea*pi)/(2*Vs_rms*sqrt(2))) \n", + "print \"(a) Firing angle to keep motor current, alfa_a =\",round(alfa_a,2),\"degree\"\n", + "Ea1=-Eg+(Ia*Ra) \n", + "alfa_b=arccos((Ea1*pi)/(2*Vs_rms*sqrt(2))) \n", + "print \"(b) Firing angle, alfa_b =\",round(alfa_b,2),\"degree\"\n", + "Ia=40 # in A\n", + "Eg=192 #in volts\n", + "Ra=0.3 # in ohm\n", + "Ea=-Eg+(Ia*Ra) \n", + "P=abs(Ea)*Ia \n", + "print \"(c) Power fed back, P =\",round(P,2),\"Watt\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Firing angle to keep motor current, alfa_a = 0.51 degree\n", + "(b) Firing angle, alfa_b = 2.45 degree\n", + "(c) Power fed back, P = 7200.0 Watt\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.15.3: p-312" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "# torque developed,speed and input power factor\n", + "from numpy import pi, sqrt, arccos, cos\n", + "#given data :\n", + "v=208 #in volts\n", + "f=50 #in Hz\n", + "ra=0.5 #in ohms\n", + "rf=345 #in ohms\n", + "kv=0.71 #in V/A-rad/sec\n", + "alpha=45 #in degree\n", + "ia=55 #in amperes\n", + "If=((2*sqrt(2)*v*cos(0))/(pi*rf)) #in amperes\n", + "t=kv*If*ia #in N/m\n", + "print \"(a) Torque is\",round(t,2),\"N/m\"\n", + "eb=((2*sqrt(2)*v*cos(alpha))/pi)-(ia*ra) #in volts\n", + "w=eb/(kv*If) #in rad/sec\n", + "N=w/(2*pi) #rps\n", + "print \"(b) speed is\",round(N*60,2),\"rpm\"\n", + "#speed is calculated wrong in the textbook\n", + "ea=132.4 #in volts\n", + "ef=187.3 #in volts\n", + "pi=(ea*ia)+(ef*If) #in watts\n", + "Isrms=sqrt((ia)**2+(If)**2) #in amperes\n", + "va1=Isrms*v #in VA\n", + "Pf=pi/va1 #\n", + "print \"(d) power factor is\",round(Pf,2), \"lagging\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Torque is 21.2 N/m\n", + "(b) speed is 1756.17 rpm\n", + "(d) power factor is 0.65 lagging\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.16.1: p-318" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "# No load speed ,firing angle ,Power Factor and speed regulation\n", + "from numpy import pi, sqrt, arccos, cos\n", + "#given data :\n", + "Ra=0.075 #in ohm\n", + "alfa1=0 # in degree\n", + "alfa2=30 # in degree\n", + "VL_rms=480 # in volts\n", + "Ka_fi=0.3 # in V/rms\n", + "Vs_rms=round(VL_rms/sqrt(3),2) \n", + "Vm=sqrt(2)*Vs_rms \n", + "Ea=round((3*sqrt(3)*Vm*cos(alfa1))/pi) \n", + "Ea1=((3*sqrt(3)*Vm*cos(alfa2))/pi) \n", + "Ia=(10/100)*160 # in A\n", + "N_0=(Ea-Ia*Ra)/Ka_fi \n", + "N_30=(Ea1-Ia*Ra)/Ka_fi \n", + "print \"part (a)\"\n", + "print \"No load speed at alfa=0 degree is\",round(N_0,2),\"rpm\"\n", + "print \"No load speed at alfa=30 degree is\",round(N_30,2),\"rpm\"\n", + "print \"part (b)\"\n", + "Ia=160 # in A\n", + "N=1800 # in rpm\n", + "Eg=540 # in volts\n", + "Ea=(Eg+(Ia*Ra)) \n", + "alfa=(arccos((Ea*pi)/(3*sqrt(3)*Vm))) \n", + "print \"The firng angel, alfa is\",round(alfa,2),\"degree\"\n", + "Is_rms=sqrt(2/3)*Ia \n", + "Sva=3*Vs_rms*Is_rms \n", + "PF=(Ea*Ia)/(Sva) \n", + "print \"(c) Power Factor, PF =\",round(PF,2),\"lagging\"\n", + "Ra=0.075 #in ohm\n", + "Ia=160 # in A\n", + "Ia1=16 # in A\n", + "Eg=540 # in volts\n", + "Ka_fi=0.3 # in V/rms\n", + "N=1800 # in rpm\n", + "Ea=(Eg+(Ia*Ra)) \n", + "Eg1=Ea-(Ia1*Ra) \n", + "N_0=Eg1/Ka_fi \n", + "SR=((N_0-N)/N)*100 \n", + "print \"(d) Speed Regulation, SR =\",round(SR,2),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "part (a)\n", + "No load speed at alfa=0 degree is 2156.0 rpm\n", + "No load speed at alfa=30 degree is 329.3 rpm\n", + "part (b)\n", + "The firng angel, alfa is 0.55 degree\n", + "(c) Power Factor, PF = 0.81 lagging\n", + "(d) Speed Regulation, SR = 2.0 %\n" + ] + } + ], + "prompt_number": 41 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/SINDHUARROJU/Chapter10.ipynb b/sample_notebooks/SINDHUARROJU/Chapter10.ipynb new file mode 100755 index 00000000..e1e3146e --- /dev/null +++ b/sample_notebooks/SINDHUARROJU/Chapter10.ipynb @@ -0,0 +1,410 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#10: Dielectric properties"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.1, Page number 10.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy stored in the condenser is 1.0 J\n",
+ "energy stored in the dielectric is 0.99 J\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "C=2*10**-6; #capacitance(F)\n",
+ "V=1000; #voltage(V)\n",
+ "epsilon_r=100;\n",
+ "\n",
+ "#Calculation\n",
+ "W=C*V**2/2; #energy stored in the condenser(J)\n",
+ "C0=C/epsilon_r;\n",
+ "W0=C0*V**2/2;\n",
+ "E=1-W0; #energy stored in the dielectric(J)\n",
+ "\n",
+ "#Result\n",
+ "print \"energy stored in the condenser is\",W,\"J\"\n",
+ "print \"energy stored in the dielectric is\",E,\"J\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.2, Page number 10.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio betwen electronic and ionic polarizability is 1.738\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "epsilon_r=4.94;\n",
+ "n2=2.69;\n",
+ "\n",
+ "#Calculation\n",
+ "x=(epsilon_r-1)/(epsilon_r+2);\n",
+ "y=(n2-1)/(n2+2);\n",
+ "r=(x/y)-1; #ratio betwen electronic and ionic polarizability\n",
+ "\n",
+ "#Result\n",
+ "print \"ratio betwen electronic and ionic polarizability is\",round(1/r,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.3, Page number 10.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "parallel loss resistance is 10.0 ohm\n",
+ "answer varies due to rounding off errors\n",
+ "parallel loss capacitance is 226.56 *10**-12 Farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "epsilon_r=2.56;\n",
+ "epsilon_R=2.65*0.7*10**-4;\n",
+ "tan_delta=0.7*10**-4; \n",
+ "A=8*10**-4; #area(m**2)\n",
+ "d=0.08*10**-3; #diameter(m)\n",
+ "f=1*10**6; #frequency(Hz)\n",
+ "epsilon0=8.85*10**-12;\n",
+ "\n",
+ "#Calculation\n",
+ "Rp=d/(2*math.pi*f*epsilon0*epsilon_R*A); #parallel loss resistance(ohm)\n",
+ "Cp=A*epsilon0*epsilon_r/d; #parallel loss capacitance(Farad)\n",
+ "\n",
+ "#Result\n",
+ "print \"parallel loss resistance is\",round(Rp/10**6),\"ohm\"\n",
+ "print \"answer varies due to rounding off errors\"\n",
+ "print \"parallel loss capacitance is\",round(Cp*10**12,2),\"*10**-12 Farad\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.4, Page number 10.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "dielectric constant of material is 1.339\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "N=3*10**28; #number of atoms(per m**3)\n",
+ "alphae=10**-40; \n",
+ "epsilon0=8.854*10**-12;\n",
+ "\n",
+ "#Calculation\n",
+ "epsilon_r=1+(N*alphae/epsilon0); #dielectric constant of material\n",
+ "\n",
+ "#Result\n",
+ "print \"dielectric constant of material is\",round(epsilon_r,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.5, Page number 10.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "electronic polarizability is 2.243 *10**-41 Fm**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "N=2.7*10**25; #number of atoms(per m**3)\n",
+ "epsilon0=8.854*10**-12;\n",
+ "epsilon_r=1.0000684;\n",
+ "\n",
+ "#Calculation\n",
+ "alphae=epsilon0*(epsilon_r-1)/N; #electronic polarizability(Fm**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"electronic polarizability is\",round(alphae*10**41,3),\"*10**-41 Fm**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.6, Page number 10.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance is 8.85e-12 F\n",
+ "charge on plates is 8.85e-10 coulomb\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "epsilon0=8.85*10**-12;\n",
+ "A=100*10**-4; #area(m**2)\n",
+ "d=10**-2; #diameter(m)\n",
+ "V=100; #potential(V)\n",
+ "\n",
+ "#Calculation\n",
+ "C=epsilon0*A/d; #capacitance(F)\n",
+ "Q=C*V; #charge on plates(coulomb)\n",
+ "\n",
+ "#Result\n",
+ "print \"capacitance is\",C,\"F\"\n",
+ "print \"charge on plates is\",Q,\"coulomb\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.7, Page number 10.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "electronic polarizability is 3.181 *10**-40 Fm**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=6.02*10**26; #avagadro number\n",
+ "d=2050; #density(kg/m**3)\n",
+ "w=32; #atomic weight\n",
+ "gama=1/3; #internal field constant\n",
+ "epsilon0=8.55*10**-12;\n",
+ "epsilon_r=3.75;\n",
+ "\n",
+ "#Calculation\n",
+ "N=n*d/w; #number of atoms(per m**3)\n",
+ "alphae=3*epsilon0*((epsilon_r-1)/(epsilon_r+2))/N; #electronic polarizability(Fm**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"electronic polarizability is\",round(alphae*10**40,3),\"*10**-40 Fm**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.8, Page number 10.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resultant voltage is 39.73 Volts\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Q=2*10**-10; #charge(C)\n",
+ "d=4*10**-3; #seperation(m)\n",
+ "epsilon_r=3.5;\n",
+ "A=650*10**-6; #area(m**2)\n",
+ "epsilon0=8.85*10**-12;\n",
+ "\n",
+ "#Calculation\n",
+ "V=Q*d/(epsilon0*epsilon_r*A); #resultant voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print \"resultant voltage is\",round(V,2),\"Volts\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.9, Page number 10.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "dielectric displacement is 265.5 *10**-9 C m**-2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=2*10**-3; #seperation(m)\n",
+ "epsilon_r=6;\n",
+ "V=10; #voltage(V)\n",
+ "epsilon0=8.85*10**-12;\n",
+ "\n",
+ "#Calculation\n",
+ "E=V/d;\n",
+ "D=epsilon0*epsilon_r*E; #dielectric displacement(C m**-2)\n",
+ "\n",
+ "#Result\n",
+ "print \"dielectric displacement is\",round(D*10**9,1),\"*10**-9 C m**-2\""
+ ]
+ }
+ ],
+ "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/Suhaib Alam/chapter-4.ipynb b/sample_notebooks/Suhaib Alam/chapter-4.ipynb new file mode 100755 index 00000000..c7c62a77 --- /dev/null +++ b/sample_notebooks/Suhaib Alam/chapter-4.ipynb @@ -0,0 +1,380 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:31dcf77e65a826bbecccd0c8b7094f24a045faabd3e68c38af8ed1add965bf7a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter-4 : Bipolar Junction & Field Effect Transistors" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.1, p-175" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "VGS=10 #in Volt\n", + "IG=0.001 #in uAmpere\n", + "IG=IG*10**-6 #in Ampere\n", + "RGS=VGS/IG #in Ohm\n", + "RGS*=10**-6 #Mohm\n", + "print \"Resistance between gate and source is\",round(RGS,2),\"Mohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resistance between gate and source is 10000.0 Mohm\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.2, p-176" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "delVDS=1.5 #in Volt\n", + "delID=120 #in uAmpere\n", + "delID=delID*10**-6 #in Ampere\n", + "rd=delVDS/delID #in Ohm\n", + "rd*=10**-3 # Mohm\n", + "print \"AC drain Resistance of JFET is\",round(rd,2),\"Kohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "AC drain Resistance of JFET is 12.5 Kohm\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.3, p-179" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "ID2=1.5 #in mAmpere\n", + "ID1=1.2 #in mAmpere\n", + "delID=ID2-ID1 #in Ampere\n", + "VGS1=-4.25 #in Volt\n", + "VGS2=-4.10 #in Volt\n", + "delVGS=VGS2-VGS1 #in Volt\n", + "gm=delID/delVGS #in Ohm\n", + "print \"Transconductance is\",round(gm,2),\"mA/V\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Transconductance is 2.0 mA/V\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.4, p-182" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "VDS1=5 #in Volt\n", + "VDS2=12 #in Volt\n", + "VDS3=12 #in Volt\n", + "VGS1=0 #in Volt\n", + "VGS2=0 #in Volt\n", + "VGS3=-0.25 #in Volt\n", + "ID1=8 #in mAmpere\n", + "ID2=8.2 #in mAmpere\n", + "ID3=7.5 #in mAmpere\n", + "#AC drain resistance\n", + "delVDS=VDS2-VDS1 #in Volt\n", + "delID=ID2-ID1 #in mAmpere\n", + "rd=delVDS/delID #in Kohm\n", + "print \"AC Drain resistance is\",round(rd,2),\"Kohm\"\n", + "#Transconductance\n", + "delID=ID3-ID2 #in mAmpere\n", + "delVGS=VGS3-VGS2 #in Volt\n", + "gm=delID/delVGS #in mA/V or mS\n", + "print \"Transconductance is\",round(gm,2),\"mA/V\"\n", + "#Amplification Factor\n", + "meu=rd*1000*gm*10**-3 #unitless\n", + "print \"Amplification Factor is\",round(meu,2) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "AC Drain resistance is 35.0 Kohm\n", + "Transconductance is 2.8 mA/V\n", + "Amplification Factor is 98.0\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.5, p-188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import sqrt\n", + "#given data :\n", + "VP=-4.5 #in Volt\n", + "IDSS=10 #in mAmpere\n", + "IDS=2.5 #in mAmpere\n", + "#Formula : IDS=IDSS*[1-VGS/VP]**2\n", + "VGS=VP*(1-sqrt(IDS/IDSS)) #in Volt\n", + "gm=(-2*IDSS*10**-3)*(1-VGS/VP)/VP #in A/V\n", + "gm*=1000 # mA/V\n", + "print \"Transconductance is\",round(gm,2),\"mA/V\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Transconductance is 2.22 mA/V\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.6, p-192" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "gm=10 #in mS\n", + "gm=gm*10**-3 #in S\n", + "IDSS=10 #in uAmpere\n", + "IDSS=IDSS*10**-6 #in Ampere\n", + "#VGS(OFF):VGS=VP\n", + "#Formula : gm=gmo=-2*IDSS/VP=-2*IDSS/VG(Off)\n", + "VGS_OFF=-2*IDSS/gm #in Volt\n", + "VGS_OFF*=1000 # mV\n", + "print \"VGS(OFF) is\",round(VGS_OFF),\"mV\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "VGS(OFF) is -2.0 mV\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.7, p-195" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "VP=-4 #in Volt\n", + "VGS=-2 #in Volt\n", + "IDSS=10 #in mAmpere\n", + "IDSS=IDSS*10**-3 #in Ampere\n", + "#Formula : ID=IDSS*[1-VGS/VP]**2\n", + "ID=IDSS*(1-VGS/VP)**2 #in Ampere\n", + "ID*=1000 #mA\n", + "print \"Drain Current is\",round(ID,2),\"mA\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drain Current is 2.5 mA\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.8, p-206" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "IDSS=8.7 #in mAmpere\n", + "IDSS=IDSS*10**-3 #in Ampere\n", + "VP=-3 #in Volt\n", + "VGS=-1 #in Volt\n", + "#ID\n", + "ID=IDSS*(1-VGS/VP)**2\n", + "ID*=1000 #mA\n", + "print \"Drain current ID is\",round(ID,2),\"mA\"\n", + "#gmo\n", + "gmo=-2*IDSS/VP #in S\n", + "gmo*=1000 # mA/V or mS\n", + "print \"Transconductance for VGS=0V is\",round(gmo,2),\"mA/V or mS\"\n", + "#gm\n", + "gm=gmo*(1-VGS/VP) #in S\n", + "gm*=1000 # mA/V or mS\n", + "print \"Transconductance is\",round(gm,2),\"mA/V or mS\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drain current ID is 3.87 mA\n", + "Transconductance for VGS=0V is 5.8 mA/V or mS\n", + "Transconductance is 3866.67 mA/V or mS\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.9, p-209" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "IDSS=8.4 #in mAmpere\n", + "IDSS=IDSS*10**-3 #in Ampere\n", + "VP=-3 #in Volt\n", + "VGS=-1.5 #in Volt\n", + "#ID\n", + "ID=IDSS*array(1-VGS/VP)**2\n", + "ID*=1000 # mA\n", + "print \"Drain current ID is\",round(ID,2),\"mA\"\n", + "#gmo\n", + "gmo=-2*IDSS/VP #in S\n", + "gmo*=1000 #mS\n", + "print \"Transconductance for VGS=0V is\",round(gmo,2),\"mA/V or mS\"\n", + "gm=gmo*(1-VGS/VP) #in S\n", + "gm*=1000 #mS\n", + "print \"Transconductance is\",round(gm,2),\"mA/V or mS\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drain current ID is 2.1 mA\n", + "Transconductance for VGS=0V is 5.6 mA/V or mS\n", + "Transconductance is 2800.0 mA/V or mS\n" + ] + } + ], + "prompt_number": 21 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/Suhaib Alam/chapter-4_1.ipynb b/sample_notebooks/Suhaib Alam/chapter-4_1.ipynb new file mode 100755 index 00000000..6ffa60c7 --- /dev/null +++ b/sample_notebooks/Suhaib Alam/chapter-4_1.ipynb @@ -0,0 +1,380 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:a6f6496f7d8520d91394edb58e855ee90407c632c03d5cd3142b85830a4324b1" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter-4 : Bipolar Junction & Field Effect Transistors" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.1, p-175" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "VGS=10 #in Volt\n", + "IG=0.001 #in uAmpere\n", + "IG=IG*10**-6 #in Ampere\n", + "RGS=VGS/IG #in Ohm\n", + "RGS*=10**-6 #Mohm\n", + "print \"Resistance between gate and source is\",round(RGS,2),\"Mohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resistance between gate and source is 10000.0 Mohm\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.2, p-176" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "delVDS=1.5 #in Volt\n", + "delID=120 #in uAmpere\n", + "delID=delID*10**-6 #in Ampere\n", + "rd=delVDS/delID #in Ohm\n", + "rd*=10**-3 # Mohm\n", + "print \"AC drain Resistance of JFET is\",round(rd,2),\"Kohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "AC drain Resistance of JFET is 12.5 Kohm\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.3, p-179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "ID2=1.5 #in mAmpere\n", + "ID1=1.2 #in mAmpere\n", + "delID=ID2-ID1 #in Ampere\n", + "VGS1=-4.25 #in Volt\n", + "VGS2=-4.10 #in Volt\n", + "delVGS=VGS2-VGS1 #in Volt\n", + "gm=delID/delVGS #in Ohm\n", + "print \"Transconductance is\",round(gm,2),\"mA/V\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Transconductance is 2.0 mA/V\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.4, p-182" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "VDS1=5 #in Volt\n", + "VDS2=12 #in Volt\n", + "VDS3=12 #in Volt\n", + "VGS1=0 #in Volt\n", + "VGS2=0 #in Volt\n", + "VGS3=-0.25 #in Volt\n", + "ID1=8 #in mAmpere\n", + "ID2=8.2 #in mAmpere\n", + "ID3=7.5 #in mAmpere\n", + "#AC drain resistance\n", + "delVDS=VDS2-VDS1 #in Volt\n", + "delID=ID2-ID1 #in mAmpere\n", + "rd=delVDS/delID #in Kohm\n", + "print \"AC Drain resistance is\",round(rd,2),\"Kohm\"\n", + "#Transconductance\n", + "delID=ID3-ID2 #in mAmpere\n", + "delVGS=VGS3-VGS2 #in Volt\n", + "gm=delID/delVGS #in mA/V or mS\n", + "print \"Transconductance is\",round(gm,2),\"mA/V\"\n", + "#Amplification Factor\n", + "meu=rd*1000*gm*10**-3 #unitless\n", + "print \"Amplification Factor is\",round(meu,2) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "AC Drain resistance is 35.0 Kohm\n", + "Transconductance is 2.8 mA/V\n", + "Amplification Factor is 98.0\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.5, p-188" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from __future__ import division\n", + "from math import sqrt\n", + "#given data :\n", + "VP=-4.5 #in Volt\n", + "IDSS=10 #in mAmpere\n", + "IDS=2.5 #in mAmpere\n", + "#Formula : IDS=IDSS*[1-VGS/VP]**2\n", + "VGS=VP*(1-sqrt(IDS/IDSS)) #in Volt\n", + "gm=(-2*IDSS*10**-3)*(1-VGS/VP)/VP #in A/V\n", + "gm*=1000 # mA/V\n", + "print \"Transconductance is\",round(gm,2),\"mA/V\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Transconductance is 2.22 mA/V\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.6, p-192" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "gm=10 #in mS\n", + "gm=gm*10**-3 #in S\n", + "IDSS=10 #in uAmpere\n", + "IDSS=IDSS*10**-6 #in Ampere\n", + "#VGS(OFF):VGS=VP\n", + "#Formula : gm=gmo=-2*IDSS/VP=-2*IDSS/VG(Off)\n", + "VGS_OFF=-2*IDSS/gm #in Volt\n", + "VGS_OFF*=1000 # mV\n", + "print \"VGS(OFF) is\",round(VGS_OFF),\"mV\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "VGS(OFF) is -2.0 mV\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.7, p-195" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "VP=-4 #in Volt\n", + "VGS=-2 #in Volt\n", + "IDSS=10 #in mAmpere\n", + "IDSS=IDSS*10**-3 #in Ampere\n", + "#Formula : ID=IDSS*[1-VGS/VP]**2\n", + "ID=IDSS*(1-VGS/VP)**2 #in Ampere\n", + "ID*=1000 #mA\n", + "print \"Drain Current is\",round(ID,2),\"mA\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drain Current is 2.5 mA\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.8, p-206" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "IDSS=8.7 #in mAmpere\n", + "IDSS=IDSS*10**-3 #in Ampere\n", + "VP=-3 #in Volt\n", + "VGS=-1 #in Volt\n", + "#ID\n", + "ID=IDSS*(1-VGS/VP)**2\n", + "ID*=1000 #mA\n", + "print \"Drain current ID is\",round(ID,2),\"mA\"\n", + "#gmo\n", + "gmo=-2*IDSS/VP #in S\n", + "gmo*=1000 # mA/V or mS\n", + "print \"Transconductance for VGS=0V is\",round(gmo,2),\"mA/V or mS\"\n", + "#gm\n", + "gm=gmo*(1-VGS/VP) #in S\n", + "gm*=1000 # mA/V or mS\n", + "print \"Transconductance is\",round(gm,2),\"mA/V or mS\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drain current ID is 3.87 mA\n", + "Transconductance for VGS=0V is 5.8 mA/V or mS\n", + "Transconductance is 3866.67 mA/V or mS\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.9, p-209" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#given data :\n", + "IDSS=8.4 #in mAmpere\n", + "IDSS=IDSS*10**-3 #in Ampere\n", + "VP=-3 #in Volt\n", + "VGS=-1.5 #in Volt\n", + "#ID\n", + "ID=IDSS*(1-VGS/VP)**2\n", + "ID*=1000 # mA\n", + "print \"Drain current ID is\",round(ID,2),\"mA\"\n", + "#gmo\n", + "gmo=-2*IDSS/VP #in S\n", + "gmo*=1000 #mS\n", + "print \"Transconductance for VGS=0V is\",round(gmo,2),\"mA/V or mS\"\n", + "gm=gmo*(1-VGS/VP) #in S\n", + "gm*=1000 #mS\n", + "print \"Transconductance is\",round(gm,2),\"mA/V or mS\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drain current ID is 2.1 mA\n", + "Transconductance for VGS=0V is 5.6 mA/V or mS\n", + "Transconductance is 2800.0 mA/V or mS\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/yashwanth kumarmada/sample_notes.ipynb b/sample_notebooks/yashwanth kumarmada/sample_notes.ipynb new file mode 100755 index 00000000..24fbec2e --- /dev/null +++ b/sample_notebooks/yashwanth kumarmada/sample_notes.ipynb @@ -0,0 +1,414 @@ +{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "#CHAPTER 2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the weight is 128.8\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_1\n",
+ "# Aim:To Find Weight of Body\n",
+ "# Given:\n",
+ "# Mass of the Body:\n",
+ "m=4; #slugs\n",
+ "\n",
+ "# Solutions:\n",
+ "# we know acceleration due to gravity,\n",
+ "g=32.2; #ft/s**2\n",
+ "W=(m*g);\n",
+ "\n",
+ "# Results:\n",
+ "print \"the weight is\",W\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The specific weight of Body is lb/ft**3. 71.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_2\n",
+ "# Aim:To find the specific weight of a body\n",
+ "# Given:\n",
+ "# Weigth of the Body:\n",
+ "W=129; #lb\n",
+ "# Volume of the Body:\n",
+ "V=1.8; #ft**3\n",
+ "\n",
+ "# Solution:\n",
+ "# we know specific weight,\n",
+ "# gamma=(Weigth of the Body/Volume of the Body)\n",
+ "gamma1=(W/V); #lb/ft^3\n",
+ "# rounding off the above answer\n",
+ "gamma1=round(gamma1)+(round((gamma1-round(gamma1))*10)/10); #lb/ft^3\n",
+ " \n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The specific weight of Body is lb/ft**3.\",gamma1\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Results: \n",
+ "The specific gravity of air 0.00120512820513\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_3\n",
+ "# Aim:To find the specific gravity of air at 68 degF\n",
+ "# Given:\n",
+ "# specific weight of air at 68 degF:\n",
+ "gamma_air=0.0752; #lb/ft**3\n",
+ "\n",
+ "\n",
+ "# Solution:\n",
+ "# we know,\n",
+ "# specific gravity of air=(specific weight of air/specific weight of water)\n",
+ "# also we know,specific weight of water at 68 degF,\n",
+ "gamma_water=62.4; #lb/ft**3\n",
+ "SG_air=gamma_air/gamma_water;\n",
+ "\n",
+ "# Results:\n",
+ "print \"Results: \"\n",
+ "print \"The specific gravity of air \",SG_air \n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Results: \n",
+ "The Density of Body is slugs/ft**3. 2.22222222222\n",
+ "The Density of Body is slugs/ft**3. 2.22360248447\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_4\n",
+ "# Aim:To find Density of body of Example 2-1 and 2-2\n",
+ "# Given:\n",
+ "# mass of the Body:\n",
+ "m=4; #slugs\n",
+ "# Volume of the Body:\n",
+ "V=1.8; #ft**3\n",
+ "\n",
+ "# Solution:\n",
+ "# we know density,\n",
+ "# rho1=(mass of the Body/Volume of the Body)\n",
+ "rho1=(m/V); #slugs/ft**3\n",
+ "# also density,rho2=(specific weight/acceleration due to gravity)\n",
+ "g=32.2; #ft/s**2\n",
+ "gamma1=71.6; #lb/ft**3\n",
+ "rho2=(gamma1/g); #slugs/ft**3\n",
+ "\n",
+ "# Results:\n",
+ "print \"Results: \"\n",
+ "print \"The Density of Body is slugs/ft**3.\",rho1\n",
+ "print \"The Density of Body is slugs/ft**3.\",rho2\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The pressure on skin diver is % psi. 25.992\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_5\n",
+ "# Aim:To find pressure on the skin diver\n",
+ "# Given:\n",
+ "# Depth of Water Body:\n",
+ "H=60; #ft\n",
+ "\n",
+ "# Solution:\n",
+ "# specific Weight of water,\n",
+ "gamma1=0.0361; #lb/in**3 \n",
+ "# Conversion: \n",
+ "# 1 feet = 12 inches\n",
+ "# 1 lb/in**2 = 1 psi \n",
+ "# we know pressure,\n",
+ "# p=(specific weight of liquid * liquid column height)\n",
+ "p=(gamma1*H*12); #psi\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The pressure on skin diver is % psi.\",p\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The Height of water column is ft. 33.7977839335\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_6\n",
+ "# Aim:To find tube height of a Barometer\n",
+ "# Given:\n",
+ "# liquid used is Water instead of Mercury.\n",
+ "\n",
+ "# Solution:\n",
+ "# specific Weight of water,\n",
+ "gamma1=0.0361; #lb/in**3 \n",
+ "# We also knows Atmospheric Pressure,\n",
+ "p=14.7; #psi\n",
+ "# Conversion: \n",
+ "# 1 feet = 12 inches\n",
+ "# 1 lb/in**2 = 1 psi \n",
+ "# we know pressure,\n",
+ "# p=(specific weight of liquid * liquid column height)\n",
+ "# Therefore,\n",
+ "H=(p/gamma1); #in\n",
+ "# He=Height in Feet.\n",
+ "He=H*0.083; #ft\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The Height of water column is ft.\",He\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The Absolute Pressure is psi. 9.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_7\n",
+ "# Aim:To convert given pressure into absolute pressure\n",
+ "# Given:\n",
+ "# Gage Pressure:\n",
+ "Pg=-5; #psi\n",
+ "\n",
+ "# Solution:\n",
+ "# Atmospheric Pressure,\n",
+ "Po=14.7; #psi \n",
+ "# Absolute Pressure(Pa) =Gage Pressure + Atmospheric Pressure\n",
+ "Pa=Pg+Po;\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The Absolute Pressure is psi.\",Pa\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ "The Absolute Pressure is psi. 40.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_8\n",
+ "# Aim:To find absolute pressure on skin diver of Example 2-5\n",
+ "# Given:\n",
+ "# Gage Pressure:\n",
+ "Pg=26; #psi\n",
+ "\n",
+ "# Solution:\n",
+ "# Atmospheric Pressure,\n",
+ "Po=14.7; #psi \n",
+ "# Absolute Pressure(Pa) =Gage Pressure + Atmospheric Pressure\n",
+ "Pa=Pg+Po; #psi\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \"The Absolute Pressure is psi.\",Pa\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ "The specific weights is N/m**3. 8792\n",
+ " The answer in the program is different than that in textbook. It may be due to no.s of significant digit in data and calculation\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_9\n",
+ "# Aim:To Determine specific weights in N/m**3\n",
+ "# Given:\n",
+ "# specific weight:\n",
+ "gamma1=56; #lb/ft**3\n",
+ "\n",
+ "\n",
+ "# Solution:\n",
+ "# We know,\n",
+ "# 1 N/m**3 = 157 lb/ft**3\n",
+ "gamma2=157*gamma1; #N/m**3\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \"The specific weights is N/m**3.\",gamma2\n",
+ "print \" The answer in the program is different than that in textbook. It may be due to no.s of significant digit in data and calculation\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The temp at which Fahrenheit and Celsius values are equal is deg. -40.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "##Example2_10\n",
+ "# Aim:To find Temperature at which Fahrenheit and Celsius values are equal \n",
+ "# Given:\n",
+ "# T(degF) = T(degC) #Eqn - 1\n",
+ "\n",
+ "# Solution:\n",
+ "# We know that,\n",
+ "# T(degF)=((1.8*T(degC))+32) #Eqn - 2 \n",
+ "# From Eqn 1 and 2\n",
+ "# ((1.8*T(degC))+32)= T(degC)\n",
+ "# (1-1.8)*T(degC)=32\n",
+ "# -0.8*T(degC)=32\n",
+ "TdegC=-32/0.8;\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The temp at which Fahrenheit and Celsius values are equal is deg.\",TdegC\n"
+ ]
+ },
+ {
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/yashwanth kumarmada/sample_notes_1.ipynb b/sample_notebooks/yashwanth kumarmada/sample_notes_1.ipynb new file mode 100755 index 00000000..faacb548 --- /dev/null +++ b/sample_notebooks/yashwanth kumarmada/sample_notes_1.ipynb @@ -0,0 +1,480 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "# CHAPTER 2 :Physical Properties of Hydraulic Fluids"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
+ "source": [
+ "##Example2_1"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the weight is 129.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Aim:To Find Weight of Body\n",
+ "# Given:\n",
+ "# Mass of the Body:\n",
+ "m=4; #slugs\n",
+ "\n",
+ "# Solutions:\n",
+ "# we know acceleration due to gravity,\n",
+ "g=32.2; #ft/s**2\n",
+ "W=(m*g);\n",
+ "\n",
+ "# Results:\n",
+ "print \"the weight(lbs) is\",round(W,0)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The specific weight of Body is lb/ft**3. 71.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Aim:To find the specific weight of a body\n",
+ "# Given:\n",
+ "# Weigth of the Body:\n",
+ "W=129; #lb\n",
+ "# Volume of the Body:\n",
+ "V=1.8; #ft**3\n",
+ "\n",
+ "# Solution:\n",
+ "# we know specific weight,\n",
+ "# gamma=(Weigth of the Body/Volume of the Body)\n",
+ "gamma1=(W/V); #lb/ft^3\n",
+ "# rounding off the above answer\n",
+ "gamma1=round(gamma1)+(round((gamma1-round(gamma1))*10)/10); #lb/ft^3\n",
+ " \n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The specific weight of Body is lb/ft**3.\",gamma1\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Results: \n",
+ "The specific gravity of air 0.00121\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Aim:To find the specific gravity of air at 68 degF\n",
+ "# Given:\n",
+ "# specific weight of air at 68 degF:\n",
+ "gamma_air=0.0752; #lb/ft**3\n",
+ "\n",
+ "\n",
+ "# Solution:\n",
+ "# we know,\n",
+ "# specific gravity of air=(specific weight of air/specific weight of water)\n",
+ "# also we know,specific weight of water at 68 degF,\n",
+ "gamma_water=62.4; #lb/ft**3\n",
+ "SG_air=gamma_air/gamma_water;\n",
+ "\n",
+ "# Results:\n",
+ "print \"Results: \"\n",
+ "print \"The specific gravity of air \",round(SG_air,5) \n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Results: \n",
+ "The Density of Body is slugs/ft**3. 2.2222\n",
+ "The Density of Body is slugs/ft**3. 2.2236\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Aim:To find Density of body of Example 2-1 and 2-2\n",
+ "# Given:\n",
+ "# mass of the Body:\n",
+ "m=4; #slugs\n",
+ "# Volume of the Body:\n",
+ "V=1.8; #ft**3\n",
+ "\n",
+ "# Solution:\n",
+ "# we know density,\n",
+ "# rho1=(mass of the Body/Volume of the Body)\n",
+ "rho1=(m/V); #slugs/ft**3\n",
+ "# also density,rho2=(specific weight/acceleration due to gravity)\n",
+ "g=32.2; #ft/s**2\n",
+ "gamma1=71.6; #lb/ft**3\n",
+ "rho2=(gamma1/g); #slugs/ft**3\n",
+ "\n",
+ "# Results:\n",
+ "print \"Results: \"\n",
+ "print \"The Density of Body is slugs/ft**3.\",round(rho1,4)\n",
+ "print \"The Density of Body is slugs/ft**3.\",round(rho2,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The pressure on skin diver is psi. 26.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Aim:To find pressure on the skin diver\n",
+ "# Given:\n",
+ "# Depth of Water Body:\n",
+ "H=60; #ft\n",
+ "\n",
+ "# Solution:\n",
+ "# specific Weight of water,\n",
+ "gamma1=0.0361; #lb/in**3 \n",
+ "# Conversion: \n",
+ "# 1 feet = 12 inches\n",
+ "# 1 lb/in**2 = 1 psi \n",
+ "# we know pressure,\n",
+ "# p=(specific weight of liquid * liquid column height)\n",
+ "p=(gamma1*H*12); #psi\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The pressure on skin diver is psi.\",round(p,1)\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The Height of water column is ft. 33.8\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Aim:To find tube height of a Barometer\n",
+ "# Given:\n",
+ "# liquid used is Water instead of Mercury.\n",
+ "\n",
+ "# Solution:\n",
+ "# specific Weight of water,\n",
+ "gamma1=0.0361; #lb/in**3 \n",
+ "# We also knows Atmospheric Pressure,\n",
+ "p=14.7; #psi\n",
+ "# Conversion: \n",
+ "# 1 feet = 12 inches\n",
+ "# 1 lb/in**2 = 1 psi \n",
+ "# we know pressure,\n",
+ "# p=(specific weight of liquid * liquid column height)\n",
+ "# Therefore,\n",
+ "H=(p/gamma1); #in\n",
+ "# He=Height in Feet.\n",
+ "He=H*0.083; #ft\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The Height of water column is ft.\",round(He,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The Absolute Pressure is psi. 9.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Aim:To convert given pressure into absolute pressure\n",
+ "# Given:\n",
+ "# Gage Pressure:\n",
+ "Pg=-5; #psi\n",
+ "\n",
+ "# Solution:\n",
+ "# Atmospheric Pressure,\n",
+ "Po=14.7; #psi \n",
+ "# Absolute Pressure(Pa) =Gage Pressure + Atmospheric Pressure\n",
+ "Pa=Pg+Po;\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The Absolute Pressure is psi.\",Pa\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ "The Absolute Pressure is psi. 40.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Aim:To find absolute pressure on skin diver of Example 2-5\n",
+ "# Given:\n",
+ "# Gage Pressure:\n",
+ "Pg=26; #psi\n",
+ "\n",
+ "# Solution:\n",
+ "# Atmospheric Pressure,\n",
+ "Po=14.7; #psi \n",
+ "# Absolute Pressure(Pa) =Gage Pressure + Atmospheric Pressure\n",
+ "Pa=Pg+Po; #psi\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \"The Absolute Pressure is psi.\",Pa\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ "The specific weights is N/m**3. 8792\n",
+ " The answer in the program is different than that in textbook. It may be due to no.s of significant digit in data and calculation\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Aim:To Determine specific weights in N/m**3\n",
+ "# Given:\n",
+ "# specific weight:\n",
+ "gamma1=56; #lb/ft**3\n",
+ "\n",
+ "\n",
+ "# Solution:\n",
+ "# We know,\n",
+ "# 1 N/m**3 = 157 lb/ft**3\n",
+ "gamma2=157*gamma1; #N/m**3\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \"The specific weights is N/m**3.\",gamma2\n",
+ "print \" The answer in the program is different than that in textbook. It may be due to no.s of significant digit in data and calculation\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example2_10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Results: \n",
+ " The temp at which Fahrenheit and Celsius values are equal is deg. -40.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Aim:To find Temperature at which Fahrenheit and Celsius values are equal \n",
+ "# Given:\n",
+ "# T(degF) = T(degC) #Eqn - 1\n",
+ "\n",
+ "# Solution:\n",
+ "# We know that,\n",
+ "# T(degF)=((1.8*T(degC))+32) #Eqn - 2 \n",
+ "# From Eqn 1 and 2\n",
+ "# ((1.8*T(degC))+32)= T(degC)\n",
+ "# (1-1.8)*T(degC)=32\n",
+ "# -0.8*T(degC)=32\n",
+ "TdegC=-32/0.8;\n",
+ "\n",
+ "# Results:\n",
+ "print \" Results: \"\n",
+ "print \" The temp at which Fahrenheit and Celsius values are equal is deg.\",TdegC\n"
+ ]
+ },
+ {
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
|