summaryrefslogtreecommitdiff
path: root/Electronic_Instrumentation_and_Measurements_by_U._S._Shah/Chapter1.ipynb
blob: 0132a1329cae19e95de257bc041826e6122e380c (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CHAPTER 1: UNITS, DIMENSIONS AND STANDARDS"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1-1, Page Number: 8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total Magenetic Flux = 5.0 micro weber\n",
      "Cross Section= 6.45e-04 meter square\n",
      "Flux Density(B)= 7.75 mT\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Variable Declaration\n",
    "\n",
    "phi=500*10**-8               #in weber\n",
    "A=(1*1)*(2.54*10**-2)**2     #in meter square \n",
    "\n",
    "#Calculation\n",
    "B=phi/A                      #in tesla  \n",
    "\n",
    "#Results\n",
    "print \"Total Magenetic Flux =\",phi*10**6,\"micro weber\"\n",
    "print \"Cross Section=\",'%.2e' % A,\"meter square\"\n",
    "print \"Flux Density(B)=\",round(B*10**3,2),\"mT\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1-2, Page Number: 8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Celsius Temperature= 37.0 degree celsisus\n",
      "Kelvin Temperature= 310.15 K\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Variable Declaration\n",
    "F=98.6      #Temperature =98.6 Farenheit \n",
    "\n",
    "#Calculations\n",
    "\n",
    "Celsius_temperature=(F-32)/1.8           #in Celsius\n",
    " \n",
    "Kelvin_temperature=(F-32)/1.8+273.15     #in Kelvin\n",
    "\n",
    "#Results\n",
    "print \"Celsius Temperature=\",Celsius_temperature,\"degree celsisus\"\n",
    "print \"Kelvin Temperature=\",round(Kelvin_temperature,2),\"K\"\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1-3, Page Number: 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The dimensions of Voltage and Resistance are expressed in array format[M L T I],\n",
      "Voltage= [ 1  2 -3 -1]\n",
      "Resistance= [ 1  2 -3 -2]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "# Powers of M, L,T,I are expressed in an array consisting of four elements\n",
    "#Each array element represents the power of the corresponding dimension\n",
    "#it is of the form [M,L,T,I]\n",
    "\n",
    "\n",
    "P=np.array([1,2,-3,0])     #Dimesnion of Power\n",
    "I=np.array([0,0,0,1])      #Dimension of Current\n",
    "\n",
    "E=P-I      #As E=P/I, the powers have to be subtracted\n",
    "\n",
    "R=E-I      #As R=E/I, the powers have to be subtracted\n",
    "\n",
    "print \"The dimensions of Voltage and Resistance are expressed in array format[M L T I],\"\n",
    "print \"Voltage=\",E\n",
    "print \"Resistance=\",R"
   ]
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}