{
 "metadata": {
  "name": "",
  "signature": "sha256:ab1af8c906dca7a8603fae32bb19352b76cb16633983b0c27f5e885cd15f2c9d"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 12:Analog and Digital Data Acquisition Systems"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex12.1:pg-360"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# To find percentage error\n",
      "# Modern Electronic Instrumentation And Measurement Techniques\n",
      "# By Albert D. Helfrick, William D. Cooper\n",
      "# First Edition Second Impression, 2009\n",
      "# Dorling Kindersly Pvt. Ltd. India\n",
      "# Example 12-1 in Page 360\n",
      "\n",
      "\n",
      "\n",
      "import math\n",
      "\n",
      "# Given data\n",
      "R = 1 #Resistance of the wire in ohm\n",
      "R_L = 10*10**3 #Load resistance in ohm\n",
      "I_supply = 50*10**-3 #power supply current in A\n",
      "V_out = 1 #output of the amplifier in V\n",
      "\n",
      "#Calculations\n",
      "V_L = (V_out+(I_supply*R))*R_L/(2*R+R_L)\n",
      "print \"The load voltage calculated = \",round(V_L,2)\n",
      "\n",
      "percenterror = math.ceil((V_L -V_out)/V_L*100)\n",
      "print \"The percentage error is about \",round(percenterror),\"%, which is unacceptable in most systems\"\n",
      "\n",
      "#Result\n",
      "# The load voltage calculated = 1.05\n",
      "# The percentage error is about 5 %, which is unacceptable in most systems \n",
      "\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The load voltage calculated =  1.05\n",
        "The percentage error is about  5.0 %, which is unacceptable in most systems\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}