summaryrefslogtreecommitdiff
path: root/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter01.ipynb
blob: 76fb6b09d269e04af577e84f1a22253dd19a659b (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:b7a82ebd5adf08f1d2cb1363a68626f83f8a9fdc0fb722a735bf408f1a7aed03"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter01:Introduction to Electronics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Find the range of tolerance\n",
      "#soltion\n",
      "#given\n",
      "#color coding\n",
      "orange=3.#\n",
      "gold=5.#\n",
      "yellow=4.#\n",
      "violet=7.#\n",
      "#band pattern\n",
      "band1=yellow#\n",
      "band2=violet#\n",
      "band3=orange#\n",
      "band4=gold#\n",
      "#resistor color coding\n",
      "r=(band1*10.+band2)*10.**(band3)#\n",
      "tol=r*(band4/100.)#tolerance\n",
      "ulr=r+tol##upper limit of resistance\n",
      "llr=r-tol##lower limit of resistance\n",
      "print 'The range of resistance =',llr/1000. ,'kOhm','to',ulr/1000,'kOhm'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The range of resistance = 44.65 kOhm to 49.35 kOhm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Find the range of tolerance\n",
      "#color coding\n",
      "blue=6.#\n",
      "gold=-1.#\n",
      "gray=8.#\n",
      "silver=10.#\n",
      "#band pattern\n",
      "band1=gray#\n",
      "band2=blue#\n",
      "band3=gold#\n",
      "band4=silver#\n",
      "#resistor color coding\n",
      "r=(band1*10.+band2)*10.**(band3)#\n",
      "tol=r*(band4/100.)#tolerance\n",
      "ulr=r+tol##upper limit of resistance\n",
      "llr=r-tol##lower limit of resistance\n",
      "print 'The Range of resistance is',llr,'ohm','to',ulr,'ohm'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Range of resistance is 7.74 ohm to 9.46 ohm\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 - Pg 19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Find the equivalent current source\n",
      "#given\n",
      "Vs=2.;#Volts             #dc voltage source\n",
      "Rs=1.;#ohm               #internal resistance\n",
      "Rl=1.;#ohm              #load resistance\n",
      "Ise=Vs/Rs;#ampere      #equivalent current source\n",
      "\n",
      "# In accordance to figure 1.23a\n",
      "Il1=Ise*(Rs/(Rs+Rl));#using current divider concept\n",
      "Vl1=Il1*Rl;\n",
      "print \"In accordance to figure 1.23a\\n\"\n",
      "print \"The Load current (current source Il=\",Il1,'A'\n",
      "print \"The Load voltage (current source Vl=\",Vl1,'V','\\n'\n",
      "\n",
      "# In accordance to figure 1.23b\n",
      "Vl2=Vs*(Rs/(Rs+Rl));#using voltage divider concept\n",
      "Il2=Vl2/Rl;\n",
      "print \"\\nIn accordance to figure 1.23b\"\n",
      "print \"\\nThe Load voltage (voltage source) Vl=\",Vl2,'V'\n",
      "print \"The Load current (voltage source) Il=\",Il2,'A'\n",
      "print \"\\nTherefore they both provide same voltage and current to load\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In accordance to figure 1.23a\n",
        "\n",
        "The Load current (current source Il= 1.0 A\n",
        "The Load voltage (current source Vl= 1.0 V \n",
        "\n",
        "\n",
        "In accordance to figure 1.23b\n",
        "\n",
        "The Load voltage (voltage source) Vl= 1.0 V\n",
        "The Load current (voltage source) Il= 1.0 A\n",
        "\n",
        "Therefore they both provide same voltage and current to load\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Find percentage variation in load current and load voltage\n",
      "#given\n",
      "Vs=10.;#volt#Supply voltage\n",
      "Rs=100.;#ohm#internal resistance\n",
      "\n",
      "# In accordance to figure 1.24a\n",
      "#For 1ohm - 10 ohm\n",
      "Rl11=1.;#ohm#min extreme value of Rl\n",
      "Rl12=10.;#ohm#max extreme value of Rl\n",
      "Il11=Vs/(Rs+Rl11);\n",
      "Il12=Vs/(Rs+Rl12);\n",
      "Pi1=(Il11-Il12)*100./Il11;#Percentage variation in current\n",
      "Vl11=Il11*Rl11;\n",
      "Vl12=Il12*Rl12;\n",
      "Pv1=(Vl12-Vl11)*100./Vl12;#Percentage variation in voltage\n",
      "print '%s' %(\"In accordance to figure 1.24a \\n\");\n",
      "print '%s %.2f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi1,'percent');\n",
      "print '%s %.1f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv1,'percent\\n\\n');\n",
      "\n",
      "# In accordance to figure 1.24b\n",
      "#For 1kohm - 10kohm\n",
      "Rl21=1000.;#ohm#min extreme value of Rl\n",
      "Rl22=10000.;#ohm#max extreme value of Rl\n",
      "Il21=Vs/(Rs+Rl21);\n",
      "Il22=Vs/(Rs+Rl22);\n",
      "Pi2=(Il21-Il22)*100./Il21;#Percentage variation in current\n",
      "Vl21=Il21*Rl21;\n",
      "Vl22=Il22*Rl22;\n",
      "Pv2=(Vl22-Vl21)*100./Vl22;#Percentage variation in voltage\n",
      "print '%s' %(\"In accordance to figure 1.24b \\n\");\n",
      "print '%s %.f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi2,'percent');\n",
      "print '%s %.f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv2,'percent \\n');\n",
      "print 'In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to' \n",
      "print 'the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In accordance to figure 1.24a \n",
        "\n",
        "Percentage variation in Current(1-10 ohm)= 8.18 percent\n",
        "Percentage variation in Voltage(1-10 ohm)= 89.1 percent\n",
        "\n",
        " \n",
        "In accordance to figure 1.24b \n",
        "\n",
        "Percentage variation in Current(1-10 ohm)= 89 percent\n",
        "Percentage variation in Voltage(1-10 ohm)= 8 percent \n",
        " \n",
        "In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to\n",
        "the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}