summaryrefslogtreecommitdiff
path: root/backup/Electronic_Instrumentation_and_Measurements_version_backup/Chapter5.ipynb
blob: 790db6496d1464c07e828965838e1f396aef6b91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{
 "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": {}
  }
 ]
}