summaryrefslogtreecommitdiff
path: root/Heat_And_Thermodynamics_by_A._Manna/ch8.ipynb
diff options
context:
space:
mode:
authorkinitrupti2017-05-12 18:53:46 +0530
committerkinitrupti2017-05-12 18:53:46 +0530
commit6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d (patch)
tree22789c9dbe468dae6697dcd12d8e97de4bcf94a2 /Heat_And_Thermodynamics_by_A._Manna/ch8.ipynb
parentd36fc3b8f88cc3108ffff6151e376b619b9abb01 (diff)
downloadPython-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.gz
Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.bz2
Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.zip
Removed duplicates
Diffstat (limited to 'Heat_And_Thermodynamics_by_A._Manna/ch8.ipynb')
-rwxr-xr-xHeat_And_Thermodynamics_by_A._Manna/ch8.ipynb749
1 files changed, 749 insertions, 0 deletions
diff --git a/Heat_And_Thermodynamics_by_A._Manna/ch8.ipynb b/Heat_And_Thermodynamics_by_A._Manna/ch8.ipynb
new file mode 100755
index 00000000..c82c1776
--- /dev/null
+++ b/Heat_And_Thermodynamics_by_A._Manna/ch8.ipynb
@@ -0,0 +1,749 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : First law of thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 page no : 261\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "l = 80;\t\t\t#latent heat of fusion in cal\n",
+ "j = 4.2*10**7;\t\t\t#joules constant in ergs/cal\n",
+ "w = -0.092*10**6;\t\t\t#work done in changing phase change in ergs\n",
+ "\n",
+ "# Calculations\n",
+ "q = l*j;\t\t\t#heat added in ergs\n",
+ "du = q-w;\t\t\t#internal energy in ergs\n",
+ "\n",
+ "# Result\n",
+ "print 'the change in internal energy is %.1e ergs'%(du)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the change in internal energy is 3.4e+09 ergs\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 page no : 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "m = 1.;\t \t\t#mass in gm\n",
+ "l = 536.;\t\t \t#latent heat in cal/gm\n",
+ "j = 4.2*10**7;\t\t\t#joules constant in ergs/cal\n",
+ "v = 1649;\t\t\t #volume of water in cc\n",
+ "p = 76*13.6*981;\t\t#pressure of water in dynes/sq.cm\n",
+ "\n",
+ "# Calculations\n",
+ "dq = m*l*j;\t\t\t#heat supplied in ergs\n",
+ "dw = p*v;\t\t\t#work done in ergs\n",
+ "du = dq-dw;\t\t\t#internal energy developed in ergs\n",
+ "\n",
+ "# Result\n",
+ "print 'internal energy of water is %.2E ergs'%(du)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "internal energy of water is 2.08E+10 ergs\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 pageno : 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "dv = 10;\t\t\t#ratio of original volume to final volume\n",
+ "t1 = 293;\t\t\t#inital temperature in K\n",
+ "y = 1.41;\t\t\t#coefficent of expansion\n",
+ "\n",
+ "# Calculations\n",
+ "t2 = t1*(dv)**(y-1);\t\t\t#final temperature in K\n",
+ "\n",
+ "# Result\n",
+ "print 'the final temperature is %.f K'%(t2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the final temperature is 753 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 pageno : 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "t = 273;\t\t\t#temperature of earth at height h in K\n",
+ "p = 760;\t\t\t#pressure in mm of hg\n",
+ "dp = 1;\t\t\t#change in pressure in mm of hg\n",
+ "y = 1.418;\t\t\t#coefficient of expansion\n",
+ "\n",
+ "# Calculations\n",
+ "dt = ((y-1)/y)*dp*t/p;\t\t\t#change in temperature in deg.C\n",
+ "\n",
+ "# Result\n",
+ "print 'the change in temperature is %3.3f deg.C'%(dt)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the change in temperature is 0.106 deg.C\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 pageno : 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "p1 = 2;\t\t\t#pressure initial in atm\n",
+ "p2 = 1.;\t\t\t#pressure final in atm\n",
+ "t1 = 273 + 15;\t\t\t#inital temperature in K\n",
+ "y = 1.4;\t\t\t#coefficent of expansion\n",
+ "\n",
+ "# Calculations\n",
+ "t2 = t1*(p2/p1)**((y-1)/y);\t\t\t#final temperature in K\n",
+ "dt = t1-t2;\t\t\t#drop in temperature in K\n",
+ "\n",
+ "# Result\n",
+ "print 'drop in temperature is %3.2f K'%(dt)\n",
+ "print \"Note : answer is slightly different because of rounding error\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "drop in temperature is 51.74 K\n",
+ "Note : answer is slightly different because of rounding error\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.6 pageno : 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "t1 = 288;\t\t\t#inital temperature in K\n",
+ "dv = 1./2;\t\t\t#ratio of inital to final volume\n",
+ "y = 1.4;\t\t\t#coefficient of expansion\n",
+ "\n",
+ "# Calculations\n",
+ "t2 = t1*(dv)**(y-1);\t\t\t#final temperature in K\n",
+ "\n",
+ "# Result\n",
+ "print 'the final temperature is %3.1f K'%(t2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the final temperature is 218.3 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7 pageno : 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "y = 1.4;\t\t\t#coefficent of exapnsion\n",
+ "p1 = 1;\t\t\t#standard pressure in atm\n",
+ "dv = 50;\t\t\t#ratio of initial volume to final volume\n",
+ "t1 = 273;\t\t\t#standard temperature in K\n",
+ "\n",
+ "# Calculations\n",
+ "p2 = p1*dv;\t\t\t#final pressure when slowly compressed in atm\n",
+ "p3 = p1*(dv)**(y);\t\t\t#final pressure when suddenly compressed in atm\n",
+ "t2 = t1*(dv)**(y-1);\t\t\t#rise in temperature when it is suddenly compressed in K\n",
+ "\n",
+ "# Result\n",
+ "print 'the final pressure when it is compressed slowly is %.f atm \\\n",
+ "\\nthe final pressure when it is compressed suddenly is %.f atm \\\n",
+ "\\nthe rise in temperature when it is suddenly compressed is %.0f K'%(p2,p3,t2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the final pressure when it is compressed slowly is 50 atm \n",
+ "the final pressure when it is compressed suddenly is 239 atm \n",
+ "the rise in temperature when it is suddenly compressed is 1305 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.8 pageno : 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "y = 1.5;\t\t\t#coefficient of expansion\n",
+ "dp = 1./8;\t\t\t#ratio of inital pressure to final pressure\n",
+ "t1 = 300;\t\t\t#inital tempreature in K\n",
+ "\n",
+ "# Calculations\n",
+ "t2 = t1*(dp)**((1-y)/y);\t\t\t#change in temperature in K\n",
+ "t3 = t2-t1;\t\t\t#rise in temperature in K\n",
+ "\n",
+ "# Result\n",
+ "print 'the rise in temperature is %3.2f K'%(t3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the rise in temperature is 300.00 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.9 pageno : 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "t1 = 400;\t\t\t#inital temperature in K\n",
+ "dv = 2;\t\t\t#ratio of volumes final and inital\n",
+ "r = 8.31*10**7;\t\t\t#universal gas constant in ergs/kg.K\n",
+ "\n",
+ "# Calculations\n",
+ "w = r*t1*math.log(2);\t\t\t#work done in expanding isothermally in ergs\n",
+ "\n",
+ "# Result\n",
+ "print 'the work done in expanding isothermally is %.1e ergs'%(w)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the work done in expanding isothermally is 2.3e+10 ergs\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.10 page no : 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "p1 = 76;\t\t\t#inital pressure in cm\n",
+ "t1 = 290;\t\t\t#inital temperature in K\n",
+ "y = 1.4;\t\t\t#coefficent of expansion\n",
+ "dv = 2;\t\t\t#ratio of inital to fianl volume when air expands isothermally \n",
+ "dv1 = 2;\t\t\t#ratio of inital to final volume when air expands adiabatically\n",
+ "\n",
+ "# Calculations\n",
+ "p2 = p1/dv;\t\t\t#final pressure when air expands isothermally in cm of hg\n",
+ "t2 = t1;\t\t\t#final temperature when air expands isothermally in K\n",
+ "t3 = t2*(1./dv1)**(y-1);\t\t\t#temprature when air expands adiabatically in K\n",
+ "p3 = p2*(1./dv1)**(y);\t\t\t#final pressure when air expands adiabatically in mm of hg\n",
+ "\n",
+ "# Result\n",
+ "print 'final pressure when air expands isothermally in cm of hg %3.2f mm of hg \\\n",
+ "\\nfinal temperature when air expands isothermally is %3.2f K \\\n",
+ "\\ntemprature when air expands adiabatically is %3.1f K \\\n",
+ "\\nfinal pressure when air expands adiabatically is %3.2f cm of mercury'%(p2,t2,t3,p3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "final pressure when air expands isothermally in cm of hg 38.00 mm of hg \n",
+ "final temperature when air expands isothermally is 290.00 K \n",
+ "temprature when air expands adiabatically is 219.8 K \n",
+ "final pressure when air expands adiabatically is 14.40 cm of mercury\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.11 pageno : 264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "p = 76*13.6*981;\t\t\t#pressure of air in dynes/sq.cm\n",
+ "v = 11100.;\t\t\t#volume expanded in ml\n",
+ "t1 = 273.;\t\t\t#inital temperature in K\n",
+ "t2 = 274.;\t\t\t#final temperature in K\n",
+ "cv = 2.411;\t\t\t#specific heat at constant volume in cal/K\n",
+ "j = 4.2*10**7;\t\t\t#joules constant in ergs/cal\n",
+ "\n",
+ "# Calculations\n",
+ "w = p*v*math.log(t2/t1);\t\t\t#work done in ergs\n",
+ "h = cv*(t2-t1)+w/j;\t\t\t #heat supplied in cal\n",
+ "\n",
+ "# Result\n",
+ "print 'the work done is %3.3e erg \\\n",
+ "\\nthe heat supplied is %3.3f cal'%(w,h)\n",
+ "print \"Note : answer is different because of rounding error\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the work done is 4.115e+07 erg \n",
+ "the heat supplied is 3.391 cal\n",
+ "Note : answer is different because of rounding error\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.12 pageno : 264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "p = 10**6;\t\t\t#pressure of air in dynes\n",
+ "d = 0.0001293;\t\t\t#density of air in gm/cc\n",
+ "t1 = 273;\t\t\t#inital temperature in K\n",
+ "dv = 2;\t\t\t#ratio of inital volume to final volume\n",
+ "y = 1.4;\t\t\t#coefficient of expansion\n",
+ "\n",
+ "# Calculations\n",
+ "r = p/(d*t1);\t\t\t#universal gas constant in dynes.cc/gm.K\n",
+ "t2 = round(t1*(dv)**(y-1));\t\t\t#final temperature in K\n",
+ "w = r*(t2-t1)/(y-1);\t\t\t#work done in adiabatic compression in ergs\n",
+ "\n",
+ "# Result\n",
+ "print 'work done in adiabatic compression is %.3e ergs'%(w)\n",
+ "print \"Note : answer is different because of rounding error\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "work done in adiabatic compression is 6.162e+09 ergs\n",
+ "Note : answer is different because of rounding error\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.13 pageno : 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "m = 5;\t\t\t#mass of air in gm\n",
+ "cv = 0.172;\t\t\t#specific heat at consmath.tant volume cal/gm\n",
+ "dt = 10;\t\t\t#changi in temperature in K\n",
+ "\n",
+ "# Calculations\n",
+ "ie = m*cv*dt;\t\t\t#change in internal energy in cal\n",
+ "\n",
+ "# Result\n",
+ "print 'change in internal energy is %3.2f cal'%(ie)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "change in internal energy is 8.60 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.14 pageno : 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "v1 = 10**3;\t\t\t#inital volume in cc\n",
+ "v2 = 2*v1;\t\t\t#final volume in cc\n",
+ "p1 = 76*13.6*981;\t\t\t#pressure in dyne/sq.cm\n",
+ "t1 = 273;\t\t\t#intial temperature in K\n",
+ "d = 1.29;\t\t\t#density of the gas gm/lit\n",
+ "cv = 0.168;\t\t\t#specific heat at constant volume in cal/gm\n",
+ "\n",
+ "# Calculations\n",
+ "t2 = (v2/v1)*t1;\t\t\t#final temperature in K\n",
+ "r = 0.068;\t\t\t#universal gas consmath.tant in cal\n",
+ "cp = cv+r;\t\t\t#specific heat at constant pressure in cal\n",
+ "q = d*cp*(t2-t1);\t\t\t#heat supplied in cal\n",
+ "\n",
+ "# Result\n",
+ "print 'the heat supplied to the gas is %3.2f cal'%(q)\n",
+ "print \"Note: answer is slightly different because of rounding error.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the heat supplied to the gas is 83.11 cal\n",
+ "Note: answer is slightly different because of rounding error.\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.15 pageno : 165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "t = 303;\t\t\t#temperature of the one mole of the argon in K\n",
+ "v1 = 1;\t\t\t#intial volume in litres\n",
+ "v2 = 10;\t\t\t#final volume in litres\n",
+ "r = 8.31*10**7;\t\t\t#universal gas constant in ergs/K.mol\n",
+ "\n",
+ "# Calculations\n",
+ "w = r*t*math.log(v2/v1);\t\t\t#work done in isothermal expansion in ergs\n",
+ "\n",
+ "# Result\n",
+ "print 'the work done in isothermal expansion is %.1e ergs'%(w)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the work done in isothermal expansion is 5.8e+10 ergs\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.16 pageno : 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "dv = 4;\t\t\t#final volume of neon in lit\n",
+ "t = 273;\t\t\t#temperature of the gas in K\n",
+ "n = 2.6/22.4;\t\t\t#the no.of moles of neon\n",
+ "r = 1.98;\t\t\t#universal gas constant in cal/K.mol\n",
+ "\n",
+ "# Calculations\n",
+ "w = n*t*r*math.log(dv);\t\t\t#work done by gas in ergs\n",
+ "\n",
+ "# Result\n",
+ "print 'the work done by 2.6lit of neon is %3.2f ergs'%(w)\n",
+ "print \"Note: answer is slightly different because of rounding error.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the work done by 2.6lit of neon is 86.98 ergs\n",
+ "Note: answer is slightly different because of rounding error.\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.18 page no : 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "dv = 10**(-3);\t\t\t#ratio of initial and final volume\n",
+ "t1 = 10**5;\t\t\t#initial temperature in K\n",
+ "y = 1.66;\t\t\t#coefficient of expansion\n",
+ "\n",
+ "# Calculations\n",
+ "t2 = t1*((4./3*math.pi*10**12)/(4./3*math.pi*10**15))**(y-1);\t\t\t#final temperature in K\n",
+ "\n",
+ "# Result\n",
+ "print 'final temperature of the gas is %3.2f K'%(t2)\n",
+ "print \"Note : Answer in book is wrong. Please calculate manually.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "final temperature of the gas is 1047.13 K\n",
+ "Note : Answer in book is wrong. Please calculate manually.\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.19 pageno : 267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "p1 = 8.;\t\t\t#intial pressure in cm of hg\n",
+ "p2 = 6.;\t\t\t#final pressure in cm of hg\n",
+ "v1 = 1000.;\t\t\t#intial volume in cc\n",
+ "v2 = 1190.;\t\t\t#final volume in cc\n",
+ "\n",
+ "# Calculations\n",
+ "y = math.log(p1/p2)/math.log(v2/v1);\t\t\t#coefficient of expansion\n",
+ "\n",
+ "# Result\n",
+ "print 'the coefficent of expansion is %3.2f'%(y)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the coefficent of expansion is 1.65\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file