summaryrefslogtreecommitdiff
path: root/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16.ipynb
blob: 7a471548816392b9082a5934ce9afc24ed15082b (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 16: Power in AC Circuits"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 16.1, Page 329"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) Apparent power, S = 250 VA\n",
      "(b) Power Factor = 0.866\n",
      "(c) Active Power, P = 216.5\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Initialisation\n",
    "V=50                     #Voltage\n",
    "I=5                     #Current in Ampere r.m.s\n",
    "phase=30                 #in degrees\n",
    "\n",
    "#Calculation \n",
    "S=V*I                            #apparent power\n",
    "pf=math.cos(phase*math.pi/180)    #power factor\n",
    "apf=S*pf                          #active power\n",
    "\n",
    "#Result\n",
    "print'(a) Apparent power, S = %d VA'%S\n",
    "print'(b) Power Factor = %.3f'%pf\n",
    "print'(c) Active Power, P = %.1f'%apf"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 16.2, Page 331"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Apparent Power, P = 2000 W\n",
      " Active Power, P = 1500 W\n",
      " Reactive Power, Q = 1322 var\n",
      " Current I = 8.33 A\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Initialisation\n",
    "pf=0.75                          #power factor\n",
    "S=2000                           #apparent power in VA\n",
    "V=240                             #Voltage in volts\n",
    "\n",
    "#Calculation \n",
    "apf=S*pf                          #active power\n",
    "sin=math.sqrt(1-(pf**2)) \n",
    "Q=S*sin                           #Reactive Power\n",
    "I=S*V**-1                          #Current\n",
    "#Result\n",
    "print' Apparent Power, P = %d W'%S\n",
    "print' Active Power, P = %d W'%apf\n",
    "print' Reactive Power, Q = %d var'%Q\n",
    "print' Current I = %.2f A'%I"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 16.3, Page 333"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Apparent Power, S = 1500 W\n",
      " Active Power, P = 1500 W\n",
      " Reactive Power, Q = 1322 var\n",
      " Current I = 6.25 A\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Initialisation\n",
    "pf=0.75                          #power factor\n",
    "S=1500                           #apparent power in W\n",
    "V=240                             #Voltage in volts\n",
    "P1 = 2000                         #apparent power\n",
    "P2 = 1500                          #active power\n",
    "Q = 1322                           #reactive power\n",
    "I = 8.33                            #current in amp\n",
    "f=50                                #frequency in hertz\n",
    "\n",
    "#Calculation \n",
    "Xc=V**2/Q                        #reactive capacitance\n",
    "C=1/(Xc*2*math.pi*f)             #capacitance\n",
    "I=S*V**-1                             #current\n",
    "\n",
    "#Result\n",
    "print' Apparent Power, S = %d W'%S\n",
    "print' Active Power, P = %d W'%apf\n",
    "print' Reactive Power, Q = %d var'%Q\n",
    "print' Current I = %.2f A'%I"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 16.4, Page 335"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Zl = (50+20j)\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "import numpy as np\n",
    "\n",
    "#Initialisation\n",
    "Zo=complex(50,-20)               #complex form of output impedance\n",
    "\n",
    "#Calculation \n",
    "Zl=np.conjugate(Zo)              #complex form of Load impedance\n",
    "\n",
    "#Result\n",
    "print'Zl = %s'%Zl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [Root]",
   "language": "python",
   "name": "Python [Root]"
  },
  "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.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}