summaryrefslogtreecommitdiff
path: root/sample_notebooks/AditiMalik/Chapter6.ipynb
blob: 4810e6f846810edaa45a28b4d3e2fdeb74dc9518 (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Chapter 6:POWER AND POWER FACTOR"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex6.1:pg-229"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "115.69 =Average Power is(in watts)\n"
     ]
    }
   ],
   "source": [
    "#Example 6_1 page no:229\n",
    "import math \n",
    "phase_angle=30#phase angle in degree\n",
    "Vm=100#maximum voltage\n",
    "Veff=100.0/math.sqrt(2)\n",
    "Ieff=15/math.sqrt(2)\n",
    "Pav=Veff*Ieff*math.cos(phase_angle)\n",
    "print round(Pav,2),\"=Average Power in watts\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex6.2:pg-230"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "62.5 =Average power in watts\n"
     ]
    }
   ],
   "source": [
    "#Example 6_2 page no:230\n",
    "import numpy\n",
    "Z=5+8j\n",
    "Im=5#maximum current\n",
    "Pav=Im**2*numpy.real(Z)/2\n",
    "print Pav,\"=Average power in watts\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex6.3:pg-231"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "625.0 =Apparent Power in VA\n",
      "-0.918 =Power Factor \n",
      "-573.927 =Average Power in watts\n"
     ]
    }
   ],
   "source": [
    "#Example 6_3 page no:231\n",
    " \n",
    "theta=53\n",
    "Vm=50#peak voltage\n",
    "Im=25#peak current\n",
    "Veff=Vm/math.sqrt(2)\n",
    "Ieff=Im/math.sqrt(2)\n",
    "Papp=Veff*Ieff\n",
    "print Papp,\"=Apparent Power in VA\"\n",
    "print round(math.cos(theta),3),\"=Power Factor \"\n",
    "Pav=Veff*Ieff*math.cos(theta)\n",
    "print round(Pav,3),\"=Average Power in watts\"\n",
    "#value of power factor is rounded off in text book so value vary slightly\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
}