summaryrefslogtreecommitdiff
path: root/Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch1.ipynb
diff options
context:
space:
mode:
authorTrupti Kini2016-03-09 23:30:21 +0600
committerTrupti Kini2016-03-09 23:30:21 +0600
commit1ab1ae28c5ba41d5159b2f2922447419e2d64eb9 (patch)
tree80c774566b5405892b20e84da74c1143459af1a3 /Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch1.ipynb
parent50a467f02f972299984d596c5e12122606fd092a (diff)
downloadPython-Textbook-Companions-1ab1ae28c5ba41d5159b2f2922447419e2d64eb9.tar.gz
Python-Textbook-Companions-1ab1ae28c5ba41d5159b2f2922447419e2d64eb9.tar.bz2
Python-Textbook-Companions-1ab1ae28c5ba41d5159b2f2922447419e2d64eb9.zip
Added(A)/Deleted(D) following books
A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter10_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter12_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter13_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter14_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter15_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter16_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter1_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter2_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter6_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter7_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter8_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/chapter9_1.ipynb A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/screenshots/Screenshot_from_2016-01-14_17:01:00_1.png A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/screenshots/Screenshot_from_2016-01-14_17:01:25_1.png A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/screenshots/Screenshot_from_2016-01-14_17:02:44_1.png A Applied_Chemistry_by_Dr._Mrs.Trupti_Paradkar/chapter1.ipynb A Applied_Chemistry_by_Dr._Mrs.Trupti_Paradkar/chapter3.ipynb A Applied_Chemistry_by_Dr._Mrs.Trupti_Paradkar/screenshots/1.png A Applied_Chemistry_by_Dr._Mrs.Trupti_Paradkar/screenshots/2.png A Applied_Chemistry_by_Dr._Mrs.Trupti_Paradkar/screenshots/3.png A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter10_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter11_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter12_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter13_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter14_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter15_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter1_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter2_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter3_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter4_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter5_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter6_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/chapter7_1.ipynb A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/screenshots/Screenshot_from_2016-03-09_13:50:16.png A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/screenshots/Screenshot_from_2016-03-09_13:52:27.png A Basic_Mathematics_for_Electricity_and_Electronics_by_Arthur_Beiser/screenshots/Screenshot_from_2016-03-09_13:53:23.png A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch1.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch10.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch11.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch12.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch2.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch3.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch4.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch5.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch6.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch7.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch8.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch9.ipynb A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/screenshots/Ch9MolFracNMolVol.png A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/screenshots/Ch9_molarFracNMolVol.png A Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/screenshots/ch10_consistency.png A Machine_Design_by_T._H._Wentzell,_P._E/README.txt A Microwaves_and_Radar_Principles_and_Applications_by_A._K._Maini/README.txt A Network_Analysis_and_Synthesis_by_B_R_Gupta/README.txt
Diffstat (limited to 'Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch1.ipynb')
-rw-r--r--Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch1.ipynb645
1 files changed, 645 insertions, 0 deletions
diff --git a/Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch1.ipynb b/Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch1.ipynb
new file mode 100644
index 00000000..60cbc213
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering_Thermodynamics_by_G._Halder/Ch1.ipynb
@@ -0,0 +1,645 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 - Introduction and basic concepts"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.1 Page: 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.1 - Page: 4\n",
+ "\n",
+ "\n",
+ "Weight of the man on the moon is 260.43 N\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "from __future__ import division\n",
+ "# Soltion\n",
+ "\n",
+ "print \"Example: 1.1 - Page: 4\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "g_Earth = 9.83 # [m/square s]\n",
+ "F_Earth = 800 # [N]\n",
+ "g_Moon = 3.2 # [m/square s]\n",
+ "#************#\n",
+ "\n",
+ "# From the expression of force, the force on the man on the Eath's surface is given by:\n",
+ "# F = m*g_Earth\n",
+ "m = F_Earth/g_Earth # [kg]\n",
+ "\n",
+ "# On the moon, the weight of the mass is equal to the force acting on the mass on the moon and is given by\n",
+ "F_Moon = m*g_Moon # [N]\n",
+ "\n",
+ "print \"Weight of the man on the moon is %0.2f N\\n\"%(F_Moon)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.2 Page: 5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.2 - Page: 5\n",
+ "\n",
+ "\n",
+ "Gravitational force on the body is 16.68 N\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.2 - Page: 5\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "m1 = 1.5 # [mass of the body, kg]\n",
+ "m2 = 6*10**(24) # [mass of the Earth, kg]\n",
+ "G = 6.672*10**(-11) # [N.square m/square.kg]\n",
+ "r = 6000*10**(3) # [m]\n",
+ "#************#\n",
+ "\n",
+ "# According to Newton's universal law of gravity:\n",
+ "F = G*m1*m2/r**2 # [N]\n",
+ "print \"Gravitational force on the body is %.2f N\\n\"%(F)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.3 Page: 5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.3 - Page: 5\n",
+ "\n",
+ "\n",
+ "Mass of 1 kg will weigh 6.92 kg on moon\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.3 - Page: 5\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "r_Moon = 0.3 # [km]\n",
+ "r_Earth = 1 # [km]\n",
+ "m2 = 1 # [mass of body, kg]\n",
+ "mMoon_By_mEarth = 0.013 # [kg/kg]\n",
+ "#***************#\n",
+ "\n",
+ "# According to the Newton's universal law of gravitation:\n",
+ "Fe_By_Fm = (1/mMoon_By_mEarth)*(r_Moon/r_Earth)**2#\n",
+ "print \"Mass of 1 kg will weigh %.2f kg on moon\\n\"%(Fe_By_Fm)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.4 Page: 6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.4 - Page: 6\n",
+ "\n",
+ "\n",
+ "The absolute pressure is 54.914 kPa\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.4 - Page: 6\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "h = 40 # [cm]\n",
+ "density = 14.02 # [g/cubic cm]\n",
+ "g = 9.792 # [m/square s]\n",
+ "#*************#\n",
+ "\n",
+ "P = h*density*g/1000 # [N/square cm]\n",
+ "P = P*10 # [kPa]\n",
+ "\n",
+ "print \"The absolute pressure is %.3f kPa\\n\"%(P)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.5 Page: 7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.5 - Page: 7\n",
+ "\n",
+ "\n",
+ "The absolute pressure within the container is 119.299 kPa\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.5 - Page: 7\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "Patm = 112 # [kPa]\n",
+ "density = 1200 # [kg/cubic m]\n",
+ "g = 9.81 # [m/sqaure s]\n",
+ "h = 0.62 # [m]\n",
+ "#**************#\n",
+ "\n",
+ "P = Patm + (density*g*h/1000) # [kPa]\n",
+ "\n",
+ "print \"The absolute pressure within the container is %.3f kPa\\n\"%(P)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.6 Page: 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.6 - Page: 9\n",
+ "\n",
+ "\n",
+ "Work done by the system is 1500 J\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.6 - Page: 9\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "F = 150 # [N]\n",
+ "Displacement = 10 # [m]\n",
+ "#**************#\n",
+ "\n",
+ "W = F*Displacement # [J]\n",
+ "\n",
+ "print \"Work done by the system is %d J\\n\"%(W)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.7 Page: 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.7 - Page: 9\n",
+ "\n",
+ "\n",
+ "Actual Work done by the system is 9.1e+05 J\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.7 - Page: 9\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "P = 560*10**3 # [Pa]\n",
+ "Vinit = 3 # [cubic m]\n",
+ "Vfinal = 5 # [cubic m]\n",
+ "Wext = 210*10**3 # [J]\n",
+ "#*************#\n",
+ "\n",
+ "W = P*(Vfinal - Vinit) # [J]\n",
+ "# Again the system receives 210 kJ of work from the external agent.\n",
+ "W = W - Wext # [J]\n",
+ "\n",
+ "print \"Actual Work done by the system is %.1e J\\n\"%(W)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.8 Page: 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.8 - Page: 11\n",
+ "\n",
+ "\n",
+ "Change in potential Energy is 981 J\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.8 - Page: 11\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "g = 9.81 # [m/square s]\n",
+ "Z = 100 # [m]\n",
+ "#***************#\n",
+ "\n",
+ "# Basis: 1 kg of water\n",
+ "m = 1 # [kg]\n",
+ "Ep = m*g*Z # [J]\n",
+ "print \"Change in potential Energy is %d J\\n\"%(Ep)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.9 Page: 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.9 - Page: 11\n",
+ "\n",
+ "\n",
+ "The velocity of the metal block is 15.34 m/s\n",
+ "\n",
+ "The final Kinetic Energy is 1765.8 J\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "from __future__ import division\n",
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.9 - Page: 11\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "m = 15# # [kg]\n",
+ "g = 9.81 # [m/square s]\n",
+ "V1 = 0 # [m/square s]\n",
+ "Z1 = 12 # [m]\n",
+ "Z2 = 0 # [m]\n",
+ "#***************#\n",
+ "\n",
+ "# At initial condition, V1 = 0, so kinetic energy is zero.\n",
+ "# At final condition, Z2 = 0, so potential energy is zero.\n",
+ "# Ep1 + Ek1 = Ep2 + Ek2\n",
+ "#deff('[y] = f(V2)','y = ((1/2)*m*V1**2) + (m*g*Z1) - (((1/2)*m*V2**2) + (m*g*Z2))')#\n",
+ "def f(V2):\n",
+ " y = ((1/2)*m*V1**2) + (m*g*Z1) - (((1/2)*m*V2**2) + (m*g*Z2))\n",
+ " return y\n",
+ "from scipy.optimize import fsolve\n",
+ "V2 = fsolve(f,7)#\n",
+ "\n",
+ "print \"The velocity of the metal block is %.2f m/s\\n\"%(V2)#\n",
+ "\n",
+ "Ek2 = (1/2)*m*V2**2 # [J]\n",
+ "print \"The final Kinetic Energy is %.1f J\\n\"%(Ek2)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.10 Page: 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.10 - Page: 12\n",
+ "\n",
+ "\n",
+ "Power required is 7.64 kW\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Solution\n",
+ "\n",
+ "print \"Example: 1.10 - Page: 12\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "m = 1200 # [kg]\n",
+ "v1 = 10 # [km/h]\n",
+ "v2 = 100 # [km/h]\n",
+ "time = 1 # [min]\n",
+ "#***************#\n",
+ "\n",
+ "v1 = 10*1000/3600 # [m/s]\n",
+ "v2 = 100*1000/3600 # [m/s]\n",
+ "W = (1/2)*m*(v2**2 - v1**2) # [J]\n",
+ "time = time*60 # [s]\n",
+ "P = W/time # [W]\n",
+ "print \"Power required is %.2f kW\\n\"%(P/1000)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.11 Page: 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.11 - Page: 13\n",
+ "\n",
+ "\n",
+ "Total Force eacting upon the gas is 8139.7 N\n",
+ "\n",
+ "Pressure exerted is 115.153 kPa\n",
+ "\n",
+ "\n",
+ "Work due to expansion by the gas is 4.070 kJ\n",
+ "\n",
+ "\n",
+ "Change in Potential Energy is 489.6 J\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import pi\n",
+ "print \"Example: 1.11 - Page: 13\\n\\n\"\n",
+ "\n",
+ "#*****Data*****#\n",
+ "dia = 0.3 # [m]\n",
+ "m = 100 # [kg]\n",
+ "P_atm = 1.013*10**5 # [N/square m]\n",
+ "g = 9.792 # [m/square s]\n",
+ "#**************#\n",
+ "\n",
+ "Area = (pi/4)*dia**2 # [square m]\n",
+ "#Solution (a)(i)\n",
+ "# Force exerted by the atmosphere:\n",
+ "F_atm = P_atm*Area # [N]\n",
+ "# Force exerted by piston & metal block:\n",
+ "F_mass = m*g # [N]\n",
+ "# Total force acting upon the gas:\n",
+ "F = F_atm + F_mass # [N]\n",
+ "print \"Total Force eacting upon the gas is %.1f N\\n\"%(F)#\n",
+ "\n",
+ "# Solution (a)(ii)\n",
+ "Pressure = F/Area # [N/square m]\n",
+ "print \"Pressure exerted is %.3f kPa\\n\\n\"%(Pressure/1000)#\n",
+ "\n",
+ "# Solution (b)\n",
+ "# The gas expands on application of heat, the volume of the gas goes on increasing and the piston moves upward.\n",
+ "Z = 0.5 # [m]\n",
+ "# Work done due to expansion of gas:\n",
+ "W = F*Z # [J]\n",
+ "print \"Work due to expansion by the gas is %.3f kJ\\n\\n\"%(W/1000)#\n",
+ "\n",
+ "# Solution (c)\n",
+ "# Change in potential energy of piston and weight after expansion process:\n",
+ "Ep = m*g*Z # [J]\n",
+ "print \"Change in Potential Energy is %.1f J\\n\"%(Ep)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.12 Page: 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.12 - Page: 24\n",
+ "\n",
+ "\n",
+ "The temperature which has the same value on both the centigrade and Fahrenheit scales is -40 degree Celsius or -40 degree Fahrenheit\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "print \"Example: 1.12 - Page: 24\\n\\n\"\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# The relation is:\n",
+ "# (C/5) = ((F - 32)/9)\n",
+ "# For C = F\n",
+ "C = - (32*5/4)# # [degree Celsius]\n",
+ "print \"The temperature which has the same value on both the centigrade and Fahrenheit scales is %d degree Celsius or %d degree Fahrenheit\\n\"%(C,C)#"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example: 1.13 Page: 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example: 1.13 - Page: 24\n",
+ "\n",
+ "\n",
+ "The rise in temperature in the Kelvin scale is 30 K\n",
+ "\n",
+ "The rise in temperature in the Rankine scale is 54 R\n",
+ "\n",
+ "The rise in temperature in the Fahrenheit scale is 54 OF\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "print \"Example: 1.13 - Page: 24\\n\\n\"\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "#*****Data*****#\n",
+ "delta_T_C = 30 # [OC]\n",
+ "#*************#\n",
+ "\n",
+ "# The relation between the Kelvin temperature scale and the Celsius temperature scale:\n",
+ "# T(K) = T(OC) + 273.15\n",
+ "# Here, the temperature rise is to be expressed in terms of K, but the difference in temperature will be the same in the Kelvin and Celsius scales of temperature:\n",
+ "delta_T_K = delta_T_C # [K]\n",
+ "print \"The rise in temperature in the Kelvin scale is %d K\\n\"%(delta_T_K)#\n",
+ "# The emperical relationship between the Rankine and Kelvin scales is given by:\n",
+ "delta_T_R = 1.8*delta_T_K # [R]\n",
+ "print \"The rise in temperature in the Rankine scale is %d R\\n\"%(delta_T_R)#\n",
+ "delta_T_F = delta_T_R # [OF]\n",
+ "print \"The rise in temperature in the Fahrenheit scale is %d OF\\n\"%(delta_T_F)#"
+ ]
+ }
+ ],
+ "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
+}