{
 "metadata": {
  "name": "",
  "signature": "sha256:ecbd49bc184dd134f59e93955453e8d9e5bf67fa157192a3c06878e9e4422d2d"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h1>Chapter 4: Chemical effects of\n",
      "electricity</h1>"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 1, page no. 35</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "#initializing the variables:\n",
      "R = 0.2; # in ohms\n",
      "n = 8; # no. of cells\n",
      "e = 2.2; # in volts\n",
      "\n",
      "#calculation:\n",
      "es = n*e\n",
      "ep = e\n",
      "Rs = n*R\n",
      "Rp = R/n\n",
      "\n",
      "#results\n",
      "print \"(a)Resistance\", Rs,\"ohms; e.m.f\", es,\"Volts(V)\"\n",
      "print \"(b)Resistance\", Rp,\"ohms; e.m.f\", ep,\"Volts(V)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Resistance 1.6 ohms; e.m.f 17.6 Volts(V)\n",
        "(b)Resistance 0.025 ohms; e.m.f 2.2 Volts(V)"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 2, page no. 35</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "#initializing the variables:\n",
      "r = 0.02; # in ohms\n",
      "e = 2; # in volts\n",
      "I1 = 5; # in Amperes\n",
      "I2 = 50; # in Amperes\n",
      "\n",
      "#calculation:\n",
      "pd1 = e - (I1*r)\n",
      "pd2 = e - (I2*r)\n",
      "\n",
      "#results\n",
      "print \"(a)p.d\", pd1,\"Volts(V)\"\n",
      "print \"(b)p.d\", pd2,\"Volts(V)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)p.d 1.9 Volts(V)\n",
        "(b)p.d 1.0 Volts(V)"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 3, page no. 36</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "#initializing the variables:\n",
      "e1 = 25; # in volts\n",
      "e2 = 24; # in volts\n",
      "I2 = 10; # in Amperes\n",
      "\n",
      "#calculation:\n",
      "r = (e1 - e2)/I2\n",
      "\n",
      "#results\n",
      "print \"Resistance\", r,\"Ohms\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resistance 0.1 Ohms"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 4, page no. 36</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "#initializing the variables:\n",
      "r = 0.2; # in ohms\n",
      "n = 10; # no. of cells\n",
      "e = 1.5; # in volts\n",
      "R = 58; # in ohms\n",
      "\n",
      "#calculation:\n",
      "es = n*e\n",
      "rs = n*r\n",
      "I = es/(rs + R)\n",
      "pd = es - (I*rs)\n",
      "\n",
      "#results\n",
      "print \"(a)Current\", I,\"Amperes(A)\"\n",
      "print \"(b)p.d\", pd,\"Volts(V)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Current 0.25 Amperes(A)\n",
        "(b)p.d 14.5 Volts(V)"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}