summaryrefslogtreecommitdiff
path: root/sample_notebooks/Prashanth Kumar Immady/Chapter_1_1.ipynb
blob: 3756f22630fc3f6bd856110983b450e97be9563b (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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
{
 "metadata": {
  "name": "",
  "signature": "sha256:b71c5763a44a53c43becf4b38bc4dc6ca15fcaba00869ac6f1172cbb9803b804"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 - ELECTRONIC MATERIALS AND COMPONENTS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the value of resistor\n",
      "print '%s' %(\"Refer to the figure 1.52\")\n",
      "print '%s' %(\"Hold the resistor as shown in the figure such that tolerance is on your extreme right.\")\n",
      "print '%s' %(\"Now the value of the resistor is equal to\")\n",
      "print '%s' %(\"  Red      Black       Blue        Gold\")\n",
      "print '%s' %(\"   2         0          6         (+/-)5%\")\n",
      "red=2. #red value\n",
      "blk=0 #black value\n",
      "blu=6. #blue value\n",
      "gld=5. #gold value\n",
      "value_res=(red*10.+blk)*10.**blu #value of resistor\n",
      "print '%s %.0f %s %.0f' %(\"\\n The value of resistor is\",value_res,\"ohm (+/-)\",gld)\n",
      "per_val=0.05*value_res\n",
      "pos_value_res=value_res+per_val #positive range of resistor\n",
      "neg_value_res=value_res-per_val #negative range of resistor\n",
      "print '%s %.0f %s %.0f %s ' %(\"\\n The value of resistor is\",neg_value_res*1e-6,\" Mohm and\",pos_value_res*1e-6,\"Mohm\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refer to the figure 1.52\n",
        "Hold the resistor as shown in the figure such that tolerance is on your extreme right.\n",
        "Now the value of the resistor is equal to\n",
        "  Red      Black       Blue        Gold\n",
        "   2         0          6         (+/-)5%\n",
        "\n",
        " The value of resistor is 20000000 ohm (+/-) 5\n",
        "\n",
        " The value of resistor is 19  Mohm and 21 Mohm \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the value of the resistor\n",
      "print '%s' %(\"With the help of colour coding table, one finds\")\n",
      "print '%s' %(\"  1st_Band    2nd_Band    3rd_Band    4th_Band\")\n",
      "print(\"    Yellow      Violet      Orange      Gold\")\n",
      "print '%s' %(\"      4          7         10**3     (+/-)5%\")\n",
      "yel=4. #yellow value\n",
      "vio=7. #violet value\n",
      "org=1e3 #orange value\n",
      "gld=5. #gold value in %\n",
      "val_res=(yel*10.+vio)*org\n",
      "print '%s %.2f %s %.0f' %(\"\\n The value of resistor is\",val_res*1e-3,\"kohm (+/-)\",gld)\n",
      "gld_ab=0.05 #absolute gold value\n",
      "per_val=gld_ab*val_res\n",
      "print '%s %.0f %s'%(\"\\n Now, 5%% of 47k_ohm =\",per_val, \"ohm\")\n",
      "range_high=val_res+per_val #higher range\n",
      "range_low=val_res-per_val #lower range\n",
      "print'%s %.2f %s %.2f %s %.2f %s %.2f %s'%(\"\\n\\n Thus resistance should be within the range\",val_res*1e-3, \"kohm(+/-)\",per_val*1e-3 ,\"Kohm\\n or between\",range_low*1e-3 ,\"kohm and\",range_high*1e-3, \"kohm\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "With the help of colour coding table, one finds\n",
        "  1st_Band    2nd_Band    3rd_Band    4th_Band\n",
        "    Yellow      Violet      Orange      Gold\n",
        "      4          7         10**3     (+/-)5%\n",
        "\n",
        " The value of resistor is 47.00 kohm (+/-) 5\n",
        "\n",
        " Now, 5%% of 47k_ohm = 2350 ohm\n",
        "\n",
        "\n",
        " Thus resistance should be within the range 47.00 kohm(+/-) 2.35 Kohm\n",
        " or between 44.65 kohm and 49.35 kohm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 - Pg 44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the value of the resistor\n",
      "print '%s' %(\"The specification of the resistor from the color coding table is as follows\")\n",
      "print '%s' %(\"  1st_Band    2nd_Band    3rd_Band    4th_Band\")\n",
      "print '%s' %(\"     Gray        Blue        Gold       Silver\")\n",
      "print '%s' %(\"      8          6        10**(-1)     (+/-)10%\")\n",
      "gray=8. #gray value\n",
      "blu=6. #blue value\n",
      "gld=10.**-1 #gold value\n",
      "sil=10. #silver value in %\n",
      "val_res=(gray*10.+blu)*gld\n",
      "print '%s %.2f %s %.2f' %(\"\\n The value of resistor is\",val_res, \"ohm (+/-)\",sil)\n",
      "sil_ab=0.1 #absolute gold value\n",
      "per_val=sil_ab*val_res\n",
      "print '%s %.2f %s' %(\"\\n Now, 10%% of 8.6 ohm =\",per_val,\" ohm\")\n",
      "range_high=val_res+per_val #higher range\n",
      "range_low=val_res-per_val #lower range\n",
      "print '%s %.2f %s %.2f %s %.2f %s %.2f %s' %(\"\\n\\n Obviously resistance should lie within the range\",val_res,\"ohm(+/-)\",per_val,\"ohm\\n or between\",range_high,\"ohm and\",range_low,\"ohm\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The specification of the resistor from the color coding table is as follows\n",
        "  1st_Band    2nd_Band    3rd_Band    4th_Band\n",
        "     Gray        Blue        Gold       Silver\n",
        "      8          6        10**(-1)     (+/-)10%\n",
        "\n",
        " The value of resistor is 8.60 ohm (+/-) 10.00\n",
        "\n",
        " Now, 10%% of 8.6 ohm = 0.86  ohm\n",
        "\n",
        "\n",
        " Obviously resistance should lie within the range 8.60 ohm(+/-) 0.86 ohm\n",
        " or between 9.46 ohm and 7.74 ohm\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the load voltage and load current\n",
      "print '%s' %(\"Refer to the figure 1.53\")\n",
      "Vs=2. #supply voltage in V\n",
      "Rs=1. #resistance in ohm\n",
      "Is=Vs/Rs\n",
      "print '%s %.2f %s' %(\"\\n Current Is =\",Is,\" A \\n\")\n",
      "print '%s' %(\"     Internal resistance remains the same but is now connected in parralel with the current sourceIS,as shown in Figure 1.51(a)\")\n",
      "print '%s' %(\"    Now,we connect a load resistance R_L=1 ohm across the terminals of two representations ,and find I_L and V_L.  From Figure 1.54(b) and using the current-divider concept,one obtains\")\n",
      "RL=1. #load resistance in ohm\n",
      "IL=Is*(Rs/(Rs+RL)) #load current using current-divider\n",
      "VL=IL*RL #load voltage\n",
      "print '%s %.0f %s' %(\"\\n Load voltage =\",VL,\"V\")\n",
      "print '%s %.0f %s' %(\"\\n Load current =\",IL,\"A \\n\")\n",
      "print '%s' %(\"From equation 53(b),using the voltage-divider concept,one obtains\")\n",
      "VD_vl=Vs*(RL/(RL+Rs)) #load voltage using voltage divider \n",
      "VD_il=VL/RL #load current\n",
      "print '%s %.0f %s' %(\"\\n Load voltage =\",VD_vl,\"V\")\n",
      "print '%s %.0f %s' %(\"\\n Load current =\",VD_il,\"A \\n\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refer to the figure 1.53\n",
        "\n",
        " Current Is = 2.00  A \n",
        "\n",
        "     Internal resistance remains the same but is now connected in parralel with the current sourceIS,as shown in Figure 1.51(a)\n",
        "    Now,we connect a load resistance R_L=1 ohm across the terminals of two representations ,and find I_L and V_L.  From Figure 1.54(b) and using the current-divider concept,one obtains\n",
        "\n",
        " Load voltage = 1 V\n",
        "\n",
        " Load current = 1 A \n",
        "\n",
        "From equation 53(b),using the voltage-divider concept,one obtains\n",
        "\n",
        " Load voltage = 1 V\n",
        "\n",
        " Load current = 1 A \n",
        "\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 - Pg 45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the percentage variation in current, current for two extreme values R_L\n",
      "print '%s' %(\"Refer to the figure 1.55\")\n",
      "print '%s' %(\"(a) R_L varies from 1 ohm to 10 ohm.\")\n",
      "print '%s' %(\"Currents for two extreme values of R_L are\")\n",
      "Vs=10. #supply voltage\n",
      "RL1=1. #resistance RL1\n",
      "Rs=100. #source resistance\n",
      "IL1=(Vs/(RL1+Rs))\n",
      "RL2=10.\n",
      "IL2=(Vs/(RL2+Rs))\n",
      "per_var_cur=((IL1-IL2)/IL1)*100.\n",
      "print '%s %.2f %s' %(\"\\n Percentage variation in current =\",per_var_cur,\"\\n\")#answer in the text book took a .3 decimal round off value\n",
      "print '%s' %(\"   Now,load voltage for the two extreme values of R_L are\")\n",
      "VL1=IL1*RL1\n",
      "VL2=IL2*RL2\n",
      "per_var_vol=((VL2-VL1)/VL2)*100.\n",
      "print '%s %.2f %s' %(\"\\n Percentage variation in current =\",per_var_vol,\"\\n\")\n",
      "\n",
      "print '%s' %(\"(b) R_L varies from 1 k-ohm to 10 k-ohm(Figure 1.55(b))\")\n",
      "print '%s' %(\"Currents for the two extreme values R_L are\")\n",
      "RL11=1000.\n",
      "IL11=(Vs/(RL11+Rs))\n",
      "RL22=10000.\n",
      "IL22=(Vs/(RL22+Rs)) #mistake in book value\n",
      "per_var_cur11=((IL11-IL22)/IL11)*100.\n",
      "print '%s %.2f %s' %(\"\\n Percentage variation in current =\",per_var_cur11,\"\\n\") #mistake in book value\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refer to the figure 1.55\n",
        "(a) R_L varies from 1 ohm to 10 ohm.\n",
        "Currents for two extreme values of R_L are\n",
        "\n",
        " Percentage variation in current = 8.18 \n",
        "\n",
        "   Now,load voltage for the two extreme values of R_L are\n",
        "\n",
        " Percentage variation in current = 89.11 \n",
        "\n",
        "(b) R_L varies from 1 k-ohm to 10 k-ohm(Figure 1.55(b))\n",
        "Currents for the two extreme values R_L are\n",
        "\n",
        " Percentage variation in current = 89.11 \n",
        "\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}