{ "metadata": { "name": "", "signature": "sha256:fb80ed0ac7f61070ddb567219b6f89f7b3cc1db175d565fb219507a40eec868c" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter5 - Digital Voltmeters" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 5.10.1 - page5-25" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Resolution\n", "#Given data :\n", "n=4.0 # no. of full digits\n", "R=1/10**n \n", "print \"Resolution of voltmeter, R = \", R" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resolution of voltmeter, R = 0.0001\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 5.10.2 - page5-26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Resolution\n", "#Given data :\n", "n=5.0 # no. of full digits\n", "R=1.0/10**n \n", "print \"Resolution, R = %.5f\" %R" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resolution, R = 0.00001\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 5.10.3 - page5-26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Resolution\n", "#Given data :\n", "n=4.0 # no. of full digits\n", "R=1/10**n \n", "print \"Resolution, R = \", R" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resolution, R = 0.0001\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 5.10.4 - page5-27" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy\n", "import math\n", "#Voltage and time interval\n", "#Given data :\n", "t1=1.0 #sec\n", "R=100.0 #kohm\n", "C=1.0 #micro F\n", "C*=10**-6 # F\n", "Vin=1.0 #V\n", "Vref=5.0 #V\n", "def integrate(a,b,f):\n", " # def function before using this\n", " # eg. : f=lambda t:200**2*t**2\n", " #a=lower limit;b=upper limit;f is a function\n", " import numpy\n", " N=1000 # points for iteration\n", " t=numpy.linspace(a,b,N)\n", " #ft=f(t)\n", " ans=numpy.sum(f)*(b-a)/N\n", " return ans\n", "# Calculating output vl=oltage\n", "a=0\n", "b=t1\n", "Vout=1/R/C*integrate(a,b,Vin) # V\n", "print \"Voltage developed at the output after 1 sec is \",Vout,\" V\"\n", "#Vout=Vref*t2/R/C & Vout=Vin*t1/R/C\n", "t2=t1*Vin/Vref #sec\n", "print \"Time interval t2 is \",t2,\" sec\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Voltage developed at the output after 1 sec is 10.0 V\n", "Time interval t2 is 0.2 sec\n" ] } ], "prompt_number": 11 } ], "metadata": {} } ] }