summaryrefslogtreecommitdiff
path: root/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb')
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb378
1 files changed, 378 insertions, 0 deletions
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb
new file mode 100644
index 00000000..e56a9323
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb
@@ -0,0 +1,378 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction and Basic Concepts"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1, Page no:5 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#To find mans mass and weight on earth\n",
+ "\n",
+ "# Variables\n",
+ "F = 300; \t\t\t #[N]\n",
+ "g_local = 4.5; \t\t\t#local gravitational acceleration[m/s**2]\n",
+ "g_earth = 9.81; \t\t#earth's gravitational acceleration[m/s**2]\n",
+ "\n",
+ "# Calculations\n",
+ "#To find man's mass and weight on earth\n",
+ "m = F/g_local;\t\t\t#mass of man[kg]\n",
+ "w = m*g_earth; \t\t\t# weight of man on earth[N]\n",
+ "\n",
+ "# Results\n",
+ "print 'Mass of man is %f kg'%m\n",
+ "print '\\nWeight of man on earth is %f N'%w\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of man is 66.666667 kg\n",
+ "\n",
+ "Weight of man on earth is 654.000000 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:6 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find height of manometer fluid\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 1.15*10**5; \t\t\t#measured pressure[N/m**2]\n",
+ "p2 = 1.01325*10**5; \t\t#atmospheric pressure[N/m**2]\n",
+ "rho = 2.95*10**3; \t\t\t#specific gravity of fluid\n",
+ "g = 9.8067\n",
+ "\n",
+ "# Calculations\n",
+ "#To find height of manometer fluid\n",
+ "p = p1-p2; \t \t\t#difference in pressure\n",
+ "h = p/(rho*g); \t\t\t#height of manometer fluid[m]\n",
+ "\n",
+ "# Results\n",
+ "print 'Height of manometer fluid is %f m'%h\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of manometer fluid is 0.472697 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find height from ground and Kinetic Energy\n",
+ "\n",
+ "# Variables\n",
+ "PE = 1.5*10**3; \t#potential energy[J]\n",
+ "m = 10; \t\t\t#mass in kg\n",
+ "u = 50; \t\t\t# velocity in m/s\n",
+ "g = 9.8067\n",
+ "\n",
+ "# Calculations\n",
+ "h = PE/(m*g);\t\t\t# height from ground in m\n",
+ "#Using equation 1.9 (Page no. 8)\n",
+ "KE = 0.5*m*(u**2);\t\t\t# Kinetic energy in J\n",
+ "\n",
+ "# Results\n",
+ "print 'Height from ground is %f m'%h\n",
+ "print '\\nKinetic Energy of body is %3.2e J'%KE\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height from ground is 15.295665 m\n",
+ "\n",
+ "Kinetic Energy of body is 1.25e+04 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4, Page no:9 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the power developed in man\n",
+ "\n",
+ "# Variables\n",
+ "#Given\n",
+ "F = 600.; \t\t\t#weight in N\n",
+ "t = 120.; \t\t\t#time in sec\n",
+ "h = 0.18; \t\t\t#height of stairs in m\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the power developed in man\n",
+ "S = 20*h; \t\t\t#total vertical displacement in m\n",
+ "W = F*S; \t\t\t#work done in J\n",
+ "P = W/t; \t\t\t#power developed\n",
+ "\n",
+ "# Results\n",
+ "print 'Power developed is %i W'%P\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power developed is 18 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5, Page no:9 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the force exerted pressure work done and change in potential energy\n",
+ "\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "A = (math.pi/4)*(0.1**2); \t\t\t#area in m**2\n",
+ "P = 1.01325*10**5; \t\t\t#pressure in N/m**2\n",
+ "m = 50; \t\t\t#mass of piston and weight in kg\n",
+ "g = 9.81; \t\t\t#acceleration due to gravity (N/m**2)\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine the force exerted pressure work done and change in potential energy\n",
+ "#(a)\n",
+ "Fa = P*A; \t\t\t#force exerted by atmosphere in N\n",
+ "Fp = m*g; \t\t\t#force exerted by piston and weight in N\n",
+ "F = Fp+Fa; \t\t\t#total force exerted in N\n",
+ "print 'Total force exerted by the atmosphere, the piston and the weight is %f N'%F\n",
+ "\n",
+ "#(b)\n",
+ "Pg = F/A; \t\t\t#pressure of gas in N/m**2\n",
+ "print 'Pressure of gas is %5.4e N/m^2'%Pg\n",
+ "\n",
+ "#(c)\n",
+ "S = 0.4; \t\t\t#displacement of gas in m\n",
+ "W = F*S; \t\t\t#work done by gas in J\n",
+ "print 'Work done by gas is %f J'%W\n",
+ "\n",
+ "#(d)\n",
+ "PE = m*g*S; \t\t\t#change in potential energy in J\n",
+ "print 'Change in potential energy is %f J'%PE\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total force exerted by the atmosphere, the piston and the weight is 1286.304689 N\n",
+ "Pressure of gas is 1.6378e+05 N/m^2\n",
+ "Work done by gas is 514.521876 J\n",
+ "Change in potential energy is 196.200000 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6, Page no:10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine work done by gas\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "#P =(2*10**5)*D\n",
+ "Df = 2.5; \t\t\t#final diameter (m)\n",
+ "Di = 0.5; \t\t\t#initial diameter(m)\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine work done by gas\n",
+ "W = (math.pi/4)*10**5*((Df**4)-Di**4);\n",
+ "\n",
+ "# Results\n",
+ "print 'Work done by gas is %6.4e J'%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done by gas is 3.0631e+06 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.7, Page no:19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find the work done on surrounding\n",
+ "\n",
+ "# Variables\n",
+ "T = 300.; \t\t\t #temperature in K\n",
+ "P = 6.5*10**5; \t\t\t#pressure in N/m**2\n",
+ "Pa = 1.01325*10**5; \t#atmospheric pressure in N/m**2\n",
+ "R = 8.314; \t\t\t #ideal gas constant\n",
+ "m = 2.; \t\t\t #mass of gas (kg)\n",
+ "M = 44.; \t\t\t #molecular weihgt of gas\n",
+ "\n",
+ "# Calculations\n",
+ "#To find the work done on surrounding\n",
+ "n = m/M; \t\t\t # n is number of kmoles\n",
+ "Vi = (n*R*10**3*T)/P; \t\t\t# initial volume in m**3\n",
+ "Vf = 2*Vi; \t\t \t#final volume in m**3\n",
+ "V = Vf-Vi; \t\t\t #change in volume\n",
+ "Ps = Pa+(5000*9.8067); \t\t\t#pressure on surroundings\n",
+ "W = Ps*V; \t\t\t #work done on the surroundings\n",
+ "\n",
+ "# Results\n",
+ "print 'Work done on surroundings is %5.2e J'%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done on surroundings is 2.62e+04 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from scipy import integrate\n",
+ "\n",
+ "#Taking 3rd and 2nd order derivative respectively, we get the following expression \n",
+ "#x = ((2*10**5*math.pi)/2)*\n",
+ "D = lambda x: x**3\n",
+ "integ,err = integrate.quad(D,0.5,2.5)\n",
+ "print integ\n",
+ "#integ,err = integrate.quad(D**3,0.5,2.5)\n",
+ "#print integ"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file