{
 "metadata": {
  "name": "",
  "signature": "sha256:1efd7e66d8d5b3c23b92f714b200b05cfd8a4cc13f4d4fc044a7a14cd4d336a9"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 : Introduction"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1 page : 4\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "F = 730.;       \t\t\t#Force(N)\n",
      "g_texas = 9.792;\t\t\t#Acceleration of gravity in Houston,Texas(m/s**2).\n",
      "g_moon = 1.67;\t    \t\t#Acceleration of gravity at moon(m/s**2).\n",
      "\n",
      "# Calculations\n",
      "m = round(F/g_texas,2);\t\t\t#Mass of Astronaut(Kg)\n",
      "F_moon = round(m*g_moon,2);\t\t\t#Force on Moon(N)\n",
      "\n",
      "# Results\n",
      "print 'Mass of Astronaut',m, \"Kg\"\n",
      "print 'Force on Moon',F_moon,'N'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass of Astronaut 74.55 Kg\n",
        "Force on Moon 124.5 N\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3 page : 10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\n",
      "# Variables\n",
      "d = 0.01\t\t\t#Diameter(m)\n",
      "m = 6.14\t\t\t#Mass(Kg)\n",
      "g = 9.82\t\t\t#Acceleration of gravity\n",
      "Pb = 748.\t\t\t#Barometric Pressure(Torr)\n",
      "\n",
      "# Calculations\n",
      "F = round(m*g,3);\t\t\t#Force(N)\n",
      "A = (math.pi/4)*d*d;\t\t\t#Area(m**2)\n",
      "Pg = round(F/A,-2);\t\t\t#Gauge Pressure(N/m**2)\n",
      "Pa = round(Pg+(Pb*0.013332*(10**4)),-2);\t\t\t#Absolute Pressure(Pa)\n",
      "\n",
      "# Results\n",
      "print 'Force ',F,'N'\n",
      "print 'Gauge Pressure ',Pg/10**4,'(X 10**4) N/m**2'\n",
      "print 'Absolute Pressure',Pa/1000,'KPa'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Force  60.295 N\n",
        "Gauge Pressure  76.77 (X 10**4) N/m**2\n",
        "Absolute Pressure 867.4 KPa\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4 page : 11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "T = 300.15;\t    \t\t#Temp = 300.15K(27`C)\n",
      "h = 60.5*(10**-2);\t\t\t#Height = 60.5cm\n",
      "rho = 13530.;\t\t\t#Density(Kg/m**3)\n",
      "g = 9.784;\t\t    \t#Acceleration of gravity(m/s**2)\n",
      "\n",
      "# Calculations\n",
      "P = round(h*rho*g,0);\n",
      "\n",
      "# Results\n",
      "print 'Pressure in KPa %.2f'%(P/1000),'KPa'\n",
      "print 'Pressure in bar %.4f'%(P/100000),'bar'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure in KPa 80.09 KPa\n",
        "Pressure in bar 0.8009 bar\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5 page : 16"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from scipy.integrate import quad \n",
      "\n",
      "# Variables\n",
      "M = 2500.;\t\t\t#Mass = 2500Kg\n",
      "h1 = 10.;\t\t\t#height1 = 10m\n",
      "h2 = 100.;\t\t\t#height2 = 100m\n",
      "g = 9.8;\t\t\t#Acceleration of gravity(m/s**2)\n",
      "\n",
      "# Calculations and Results\n",
      "#(a)\n",
      "PE1 = M*h1*g;\t\t\t#[j]\n",
      "print '(a)Potential energy of the elevator in its Initial Position',PE1,'J'\n",
      "\n",
      "#(b)\n",
      "def f0(l): \n",
      "    return 1\n",
      "\n",
      "W = M*g* quad(f0,h1,h2)[0];\t\t\t#[j][0]\n",
      "print '(b)Work Done in Raimath.sing the Elevator',W,'J'\n",
      "\n",
      "#(c)\n",
      "PE2 = M*g*h2;\t\t\t#[j]\n",
      "print '(c)Potential energy of the elevator in its Highest Position',PE2,'J'\n",
      "\n",
      "#(d)\n",
      "KE2 = 0;\n",
      "PE3 = 0;\n",
      "KE3 = PE2;\t\t\t#[j]   \t\t\t#Conservation Of Mechanical Energy\n",
      "u = round((2*KE3/M)**(1./2),2);\t\t\t#(m/s)\n",
      "print '(d)Velocity of the Elevator',u,'m/s'\n",
      "print '(d)Kinetic Energy of the Elevator',KE3,'J'\n",
      "\n",
      "#(e)\n",
      "PE_Spring = KE3;\t\t\t#[j]\n",
      "print '(e)Potential energy of compressed spring ',PE_Spring,'J'\n",
      "\n",
      "#(f)\n",
      "TE = PE1+W;\n",
      "print '(f)Total Energy of the System',TE,'J'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Potential energy of the elevator in its Initial Position 245000.0 J\n",
        "(b)Work Done in Raimath.sing the Elevator 2205000.0 J\n",
        "(c)Potential energy of the elevator in its Highest Position 2450000.0 J\n",
        "(d)Velocity of the Elevator 44.27 m/s\n",
        "(d)Kinetic Energy of the Elevator 2450000.0 J\n",
        "(e)Potential energy of compressed spring  2450000.0 J\n",
        "(f)Total Energy of the System 2450000.0 J\n"
       ]
      }
     ],
     "prompt_number": 13
    }
   ],
   "metadata": {}
  }
 ]
}