{
 "metadata": {
  "name": "",
  "signature": "sha256:c25c8c800dd34f424a4f0cf9e435c0ab4dc67af9251d8f09c564bbab45696729"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 : Temperature and Heat"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1 Page No : 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "#Part(a)\n",
      "print \"Part a\"\n",
      "tf = 98.6 \t\t\t#\u00b0F \t\t\t#average temperature Human Body in \u00b0C\n",
      "tc = (tf - 32)/1.8 \t\t\t#\u00b0C\n",
      "print \"Average human temperature in \u00b0C = %.1f \u00b0C\"%(tc);\n",
      "\n",
      "\n",
      "#Part(b)\n",
      "print \"Part b\"\n",
      "tc = 27 \t\t\t#\u00b0C \t\t\t#Annual average temperature in peninsular India in \u00b0C\n",
      "tf = 1.8*tc+32 \t\t\t#Annual average temperature in peninsular India in \u00b0F\n",
      "print \"Annual average temperature in peninsular India in \u00b0F = %.1f \u00b0F\"%(tf);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part a\n",
        "Average human temperature in \u00b0C = 37.0 \u00b0C\n",
        "Part b\n",
        "Annual average temperature in peninsular India in \u00b0F = 80.6 \u00b0F\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2 Page No : 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "t = 27 \t\t\t#\u00b0C \n",
      "\n",
      "# Calculations\n",
      "T = t + 273.15 \t\t\t#K\n",
      "\n",
      "# Result\n",
      "print \"Temperature in Kelvin = %.2f K\"%(T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Temperature in Kelvin = 300.15 K\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3 Page No : 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# variables\n",
      "T = 250 \t\t\t#K \n",
      "\n",
      "# calculations\n",
      "t = T - 273.15 \t\t\t#\u00b0C\n",
      "\n",
      "# result\n",
      "print \"Temperature in \u00b0C = %.2f \u00b0C\"%(t)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Temperature in \u00b0C = -23.15 \u00b0C\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4 Page No : 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy.linalg import solve\n",
      "# Variables\n",
      "X = solve([[1, 0, 0],[ 1, 100, 100**2],[ 1, 50, 50**2]],[[0], [100], [51]])\n",
      "\n",
      "p = X[0]\n",
      "q = X[1];\n",
      "r = X[2];\n",
      "\n",
      "def  t_A(t_B): \n",
      "    return  q*t_B + r*(t_B**2)\n",
      "t_B = 30;\n",
      "\n",
      "print \"When thermometer B reads %0.1f C then thermometer A reads, t_B = %.02f degree C\"%(t_B,t_A(t_B))\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "When thermometer B reads 30.0 C then thermometer A reads, t_B = 30.84 degree C\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5 Page No : 79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables\n",
      "\n",
      "Rt = 80\n",
      "t = 25\n",
      "\n",
      "# calculations and results\n",
      "#Substituting Rt and t in Rt = Ro(1+0.00395t)\n",
      "Ro = 80/(1+0.00395*25)\n",
      "print \"Ro {Resistance at 0\u00b0C} = %.2f ohm\"%(Ro)\n",
      "\n",
      "#Full load condition\n",
      "Rt = 95\n",
      "#temperature at full load condition\n",
      "print \"t {Temperature at full load condition} = %.2f \u00b0C\"%(((Rt/Ro)-1)/0.00395);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ro {Resistance at 0\u00b0C} = 72.81 ohm\n",
        "t {Temperature at full load condition} = 77.16 \u00b0C\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6 Page No : 80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# calculations\n",
      "def  e(t): \n",
      "\t return  0.0367*t + 1.33 * 10**(-4)*t**2\n",
      "\n",
      "# results\n",
      "print \"Thermometer read in place where gas thermometer reads 50\u00b0C = %.2f \u00b0C\"%((e(50)/e(100)*100))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thermometer read in place where gas thermometer reads 50\u00b0C = 43.35 \u00b0C\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}