summaryrefslogtreecommitdiff
path: root/Principles_of_Physics_by_F.J.Bueche/Chapter20_1.ipynb
blob: b8a8511bdf0cf572f0b9d8593dc85878e73d9cfc (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 20: Alternating Currents and Electronics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex20.1:pg-982"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "We have to wait for a time of t= 10.0  sec\n"
     ]
    }
   ],
   "source": [
    "  #Example 20_1\n",
    "import math  \n",
    "#To findout the time that it has to wait after turning off the set before it is safe to touch capacitor\n",
    "r=10.0**6          #Units in Ohms\n",
    "c=10.0**-5             #Units in F\n",
    "ti=r*c           #Units in Sec\n",
    "print \"We have to wait for a time of t=\",round(ti),\" sec\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex20.2:pg-983"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The RMS current when f=20 Hz is= 0.00402  Ohms\n",
      "The RMS current when f=2*10**6 Hz is= 402.12  Ohms\n"
     ]
    }
   ],
   "source": [
    "  #Example 20_2\n",
    "\n",
    "import math\n",
    "  \n",
    "#To find the rms current in the circuit \n",
    "f=20         #Units in Hz\n",
    "c=4*10.0**-7         #Units in F\n",
    "xc=1/(2.0*math.pi*f*c)           #Units in Ohms/sec\n",
    "f=2*10**6          #Units in Hz\n",
    "xc1=1/(2*math.pi*f*c)           #Units in Ohms/sec\n",
    "v=80.0           #Units in V\n",
    "i=v/xc            #Units in A\n",
    "i1=v/xc1            #Units in A\n",
    "print \"The RMS current when f=20 Hz is=\",round(i,5),\" Ohms\\nThe RMS current when f=2*10**6 Hz is=\",round(i1,2),\" Ohms\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex20.3:pg-984"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The current in the inductor when frequency=60 Hz is I= 7.07  A\n",
      "\n",
      "The current in the inductor when frequency=6*10**2 Hz is I= 0.000707  A\n"
     ]
    }
   ],
   "source": [
    "  #Example 20_3\n",
    "import math \n",
    "  \n",
    "#To find the current through the inductor\n",
    "f=60             #Units in Hz\n",
    "l=15.0*10**-3           #Units in H\n",
    "xl=2*math.pi*f*l           #Units in Ohms\n",
    "v=40          #Units in V\n",
    "i=v/xl           #Units in A\n",
    "print \"The current in the inductor when frequency=60 Hz is I=\",round(i,2),\" A\"\n",
    "f=6.0*10**5             #Units in Hz\n",
    "l=15.0*10**-3           #Units in H\n",
    "xl=2*math.pi*f*l           #Units in Ohms\n",
    "v=40          #Units in V\n",
    "i=v/xl           #Units in A\n",
    "print \"\\nThe current in the inductor when frequency=6*10**2 Hz is I=\",round(i,6),\" A\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex20.4:pg-984"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The current in circuit is I= 0.2439  A\n",
      "Volt meter readings across resistor Vr= 73.2  V\n",
      "Readings across capacitor is Vc= 32.3  V\n",
      "Power loss in circuit is= 17.8  W\n"
     ]
    }
   ],
   "source": [
    "  #Example 20_4\n",
    "import math \n",
    "  \n",
    "#To find current in circuit, Voltmeter reading, reading across capacitor and power loss\n",
    "f=2000             #Units in Hz\n",
    "c=0.6*10**-6           #Units in F\n",
    "xc=1/(2*math.pi*f*c)           #Units in Ohms\n",
    "r=300          #Units in Ohms\n",
    "z=math.sqrt(r**2+xc**2)        #Units in Ohms\n",
    "v=80          #Units in V\n",
    "i=v/z            #Units in A\n",
    "vr=i*r      #Units in V\n",
    "vc=i*xc          #Units in V\n",
    "p=i**2*r           #Units in W\n",
    "print \"The current in circuit is I=\",round(i,4),\" A\\nVolt meter readings across resistor Vr=\",round(vr,1),\" V\\nReadings across capacitor is Vc=\",round(vc,1),\" V\\nPower loss in circuit is=\",round(p,1),\" W\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex20.5:pg-984"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The current in circuit is I= 2.17  A\n",
      "Volt meter reading across R Vr= 43.4  V\n",
      "Volt meter reading across L Vl= 32.7  V\n",
      "Volt meter reading across c Vc= 57.6  V\n",
      "\n"
     ]
    }
   ],
   "source": [
    "  #Example 20_5\n",
    "\n",
    "import math  \n",
    "#To find the current in circuit and voltmeters reading across R C and L\n",
    "f=600           #Units in Hz\n",
    "l=4.0*10**-3           #Units in H\n",
    "xl=2*math.pi*f*l          #Units in Ohms\n",
    "c=10.0*10**-6           #Units in F\n",
    "xc=1/(2*math.pi*f*c)         #Units in Ohms\n",
    "r=20.0         #Units in Ohms\n",
    "z=math.sqrt(r**2+(xl-xc)**2)        #Units in Ohms\n",
    "v=50.0           #Units in V\n",
    "i=v/z          #Units in A\n",
    "vr=i*r      #Units in V\n",
    "vl=i*xl        #Units in V\n",
    "vc=i*xc      #Units in V\n",
    "print \"The current in circuit is I=\",round(i,2),\" A\\nVolt meter reading across R Vr=\",round(vr,1),\" V\\nVolt meter reading across L Vl=\",round(vl,1),\" V\\nVolt meter reading across c Vc=\",round(vc,1),\" V\\n\"\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}