{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 0 - Introduction" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E1 - Pg 4" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the final pressure of the gas\n", "#Initialization of variables\n", "P=1.115 #bar\n", "#Calculations\n", "Conv_fac=1/1.01325\n", "FinalP=Conv_fac*P #Final pressure\n", "#Results\n", "print '%s %.3f' %('Final pressure in atmospheres (atm)= ',FinalP)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Final pressure in atmospheres (atm)= 1.100\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example I1 - Pg 5" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the pressure at the foot of the column\n", "#Initialization of variables\n", "h=0.760 #m\n", "d=1.36*10000 #kg/m^3\n", "#Calculations\n", "P=9.81*d*h\n", "#Results\n", "print '%s %.3e' %('Pressure at the foot of the column (Pa)= ',P)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Pressure at the foot of the column (Pa)= 1.014e+05\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example I2 - Pg 6" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#calculate the hydrostatic pressure and pressure in apparatus\n", "#Initialization of variables\n", "h=0.1 #m\n", "d=1000 #Kg/m^3\n", "Patm=100021. #Pa\n", "#Calculations\n", "P=9.81*h*d\n", "Papp=(Patm-P)/1000.\n", "#Results\n", "print '%s %.3f' %('Hydrostatic pressure(Pa) = ',P )\n", "print '%s %.3f' %('\\n Pressure in apparatus(kPa) = ',Papp)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Hydrostatic pressure(Pa) = 981.000\n", "\n", " Pressure in apparatus(kPa) = 99.040\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example I3 - Pg 8" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the no.of moles of copper required\n", "import math\n", "#Initialization of variables\n", "N=8.8*math.pow(10,22)\n", "NA=6.023*math.pow(10,23) #mol^-1\n", "#Calculations\n", "n=N/NA\n", "#Results\n", "print '%s %.2f' %('No. of moles of Cu ( mol Cu)= ',n)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "No. of moles of Cu ( mol Cu)= 0.15\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example I4 - Pg 9" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#calculate the amount of Carbon atoms \n", "#Initialization of variables\n", "m=21.5 #g\n", "Mc=12.01 #g/mol\n", "#Calculations\n", "nc=m/Mc\n", "#Results\n", "print '%s %.2f %s' %(\"Amount of C atoms=\",nc,\"mol C\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Amount of C atoms= 1.79 mol C\n" ] } ], "prompt_number": 5 } ], "metadata": {} } ] }