{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 5: Surface Tension"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 5.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Work (dyn cm or erg) =  5.03e+04\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#If the surface tension of a soap bubble is 0.4 N/m, what work is required to\n",
    "#increase the diameter from 5 to 15 cm?\n",
    "import math\n",
    "#initialisation of variables\n",
    "St= 0.04 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#N/m\n",
    "d1= 5. \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#cm\n",
    "d2= 15. \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#cm\n",
    "#CALCULATIONS\n",
    "W= St*1000.*2*4*math.pi*(math.pow((d2/2),2)-math.pow((d1/2),2))\t\t#Work\n",
    "#RESULTS\n",
    "print '%s %.2e' % ('Work (dyn cm or erg) = ',W)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 5.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Presuure difference (lbf/ft^2) =  14.12\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#By much does the pressure inside a 0.017 in droplet of water at 20C\n",
    "#exceed the outside pressure.\n",
    "import math\n",
    "#initialisation of variables\n",
    "R= 0.017 \t\t\t\t\t\t\t\t\t\t\t\t#in\n",
    "sigma= 72.8 \t\t\t\t\t\t\t\t\t\t\t#m N/m\n",
    "#CALCULATIONS\n",
    "P= (2*sigma*0.005*0.017)/(72.8*R*7.08*math.pow(10,-4))\t#Presuure difference\n",
    "#RESULTS\n",
    "print '%s %.2f' % ('Presuure difference (lbf/ft^2) = ',P)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 5.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Difference in mercury level (cm (depression)) =  -2.48\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#A 0.4 mm diameter glass tube stands vertically in a dish of mercury at 20C.\n",
    "#Determine the difference between the level of mercury in the dish and in\n",
    "#the tube. The specific gravity for mercury is 13.6 and the contact angle \n",
    "#with glass is 130C\n",
    "import math\n",
    "#initialisation of variables\n",
    "d= 13.6 \t\t\t\t\t\t\t#gm/cm^3\n",
    "g= 980 \t\t\t\t\t\t\t\t#cm/s^2\n",
    "D= 0.4 \t\t\t\t\t\t\t\t#mm\n",
    "angle= 130*math.pi/180. \t\t\t#radians\n",
    "s= 514. \t\t\t\t\t\t\t#dyn/cm\n",
    "#CALCULATIONS\n",
    "h= (4*s*10*math.cos(angle))/(d*g*D)\t#Depression in mercury level\n",
    "#RESULTS\n",
    "print '%s %.2f' % (' Difference in mercury level (cm (depression)) = ',h)\n",
    "raw_input('press enter key to exit')"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
