summaryrefslogtreecommitdiff
path: root/A_TEXTBOOK_OF_ELECTRICAL_TECHNOLOGY_(VOL-III)_by_B.L.Thareja/chapter49.ipynb
blob: 43b0f76cd534c811691c59cc94d2a5c6ca08c224 (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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CHAPTER 49 : ILLUMINATION"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.1 , PAGE NO :- 1899"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Illumination at point = 0.76 lm/m^2 .\n"
     ]
    }
   ],
   "source": [
    "'''A lamp giving out 1200 lm in all directions is suspended 8 m above the working plane. Calculate the illumination at a point on\n",
    "the working plane 6 m away from the foot of the lamp.'''\n",
    "\n",
    "import math as m\n",
    "\n",
    "I = 1200/(4*3.14)      #Cd      (luminous intensity of lamp)\n",
    "h = 8.0                #m       (height)\n",
    "b = 6.0                #m       (breadth)  \n",
    "length = m.sqrt(h**2 + b**2)  #m\n",
    "\n",
    "cosQ = h/length\n",
    "E = I*cosQ/length**2    #lm/m^2\n",
    "\n",
    "print \"Illumination at point =\",round(E,2),\"lm/m^2 .\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.2 , PAGE NO :- 1899"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Distance between A and B is = 19.08 m.\n"
     ]
    }
   ],
   "source": [
    "'''A small light source with intensity uniform in all directions is mounted at a height of 10 metres above a horizontal surface.\n",
    "Two points A and B both lie on the surface with point A directly beneath the source. How far is B from A if the illumination at B\n",
    "is only 1/10 as great as at A ?'''\n",
    "\n",
    "from sympy import Eq,solve,Symbol\n",
    "\n",
    "#let the intensity of lamp be I and distance between A and B be x metres\n",
    "x = Symbol('x')\n",
    "\n",
    "l = 10.0        #m     (vertical distance)\n",
    "#Illumination at point A\n",
    "Ea = I/l**2        #lux\n",
    "#Illumination at point B\n",
    "\n",
    "Eb = I/(l**2)*(l/(l**2 + x**2)**0.5)**3\n",
    "\n",
    "I = 10.0           #lm     (assumed value as the equation does not depend on I)\n",
    "#As Eb = 1/10*Ea\n",
    "eq = Eq(Eb,Ea/10.0)\n",
    "x = solve(eq)\n",
    "\n",
    "x1 = x[1]\n",
    "\n",
    "print \"Distance between A and B is =\",round(x1,2),\"m.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## EXAMPLE 49.3 , PAGE NO :- 1900"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Illumination due to 4 lamps =  6.16 lm/m^2 .\n"
     ]
    }
   ],
   "source": [
    "'''A corridor is lighted by 4 lamps spaced 10 m apart and suspended at a height of 5 m above the centre line of the floor.\n",
    "If each lamp gives 200 C.P. in all directions below the horizontal,find the illumination at the point on the floor mid-way\n",
    "between the second and third lamps.'''\n",
    "\n",
    "import math as m\n",
    "\n",
    "I = 200.0    #C.P       (luminous intensity)\n",
    "h = 5.0      #m         (height between lamps and ground)\n",
    "l1 = 15.0    #m         (horizantal distance 1)\n",
    "l2 = 5.0    #m         (horizantal distance 2)\n",
    "\n",
    "d1 = m.sqrt(h**2 + l1**2)    #m   (Dist btwn L1 and mid-pt)\n",
    "d2 = m.sqrt(h**2 + l2**2)    #m   (Dist btwn L2 and mid-pt)\n",
    "\n",
    "#(i)Illumination due to L1\n",
    "#L = (I/r^2)*cosQ\n",
    "L1 = (I/d1**2)*(h/d1)      #lm/m^2\n",
    "\n",
    "#(ii)Illumination due to L2\n",
    "L2 = (I/d2**2)*(h/d2)      #lm/m^2\n",
    "\n",
    "#Illumination at mid-pt due to 4-lamps\n",
    "Lt = 2*(L1+L2)             #lm/m^2\n",
    "\n",
    "print \"Illumination due to 4 lamps = \",round(Lt,2),\"lm/m^2 .\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.4 , PAGE NO :- 1901"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reading of photometer = 0.066 lm/m^2.\n"
     ]
    }
   ],
   "source": [
    "'''Two lamps A and B of 200 candela and 400 candela respectively are situated 100 m apart. The height of A above the ground \n",
    "level is 10 m and that of B is 20 m. If a photometer is placed at the centre of the line joining the two lamp posts,\n",
    "calculate its reading.'''\n",
    "\n",
    "import math as m\n",
    "I1 = 200.0     #Cd    (lamp 1 intensity)\n",
    "I2 = 400.0     #Cd    (lamp 2 intensity)\n",
    "h1 = 10.0      #m     (height between lamp 1 and ground)\n",
    "h2 = 20.0      #m     (height between lamp 2 and ground)\n",
    "d1 = 50.0      #m     (horizontal distance from 1)\n",
    "d2 = 50.0      #m     (horizontal distance from 2)\n",
    "\n",
    "l1 = m.sqrt(h1**2 + d1**2)\n",
    "l2 = m.sqrt(h2**2 + d2**2)\n",
    "\n",
    "cosQ1 = h1/l1\n",
    "cosQ2 = h2/l2\n",
    "\n",
    "#Illumination at point C = Illumination due to 1 + Illumination due to 2\n",
    "I_tot = (I1/l1**2)*cosQ1 + (I2/l2**2)*cosQ2      #lm/m^2\n",
    "\n",
    "print \"Reading of photometer =\",round(I_tot,3),\"lm/m^2.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.5 , PAGE NO :- 1901"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Average Brightness = 6375.22 cd/m^2.\n",
      "cost of running = Rs 150.0\n"
     ]
    }
   ],
   "source": [
    "'''The average luminous output of an 80-W fluorescent lamp 1.5 metre in length and 3.5 cm diameter is 3300 lumens. Calculate its\n",
    "average brightness.If the auxiliary gear associated with the lamp consumes a load equivalent to 25 percent of the lamp,\n",
    "calculate the cost of running a twin unit for 2500 hours at 30 paise per kWh.'''\n",
    "\n",
    "\n",
    "length  = 1.5    #m       (lamp output length)\n",
    "dia = 3.5e-2     #m       (lamp output diameter)\n",
    "l_flux = 3300.0  #lumens  (luminous flux)\n",
    "P = 80.0         #W       (Power output)\n",
    "\n",
    "#Surface area of lamp\n",
    "sa = 3.14*dia*length    #m^2\n",
    "\n",
    "#Flux emmited per unit area\n",
    "fluxA = l_flux/sa          #lm/m^2\n",
    "#Therefore,\n",
    "B = fluxA/3.14             #cd/m^2\n",
    "print \"Average Brightness =\",round(B,2),\"cd/m^2.\"\n",
    "#Total load of twin fitting\n",
    "load = 2*(P +0.25*P)      #W\n",
    "time = 2500.0             #hr\n",
    "enrgy = load*time/1000    #kWh   (Energy consumed)\n",
    "\n",
    "#Total cost\n",
    "cost = enrgy*0.3     #Rs\n",
    "print \"cost of running = Rs\",round(cost)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.6 , PAGE NO :- 1901"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "lamp wattage = 4415.63 W.\n"
     ]
    }
   ],
   "source": [
    "'''A small area 7.5 m in diameter is to be illuminated by a lamp suspended at a height of 4.5 m over the centre of the area.\n",
    "The lamp having an efficiency of 20 lm/w is fitted with a reflector which directs the light output only over the surface to be\n",
    "illuminated,giving uniform candle power over this angle. Utilisation coefficient = 0.40. Find out the wattage of the lamp.\n",
    "Assume 800 lux of illumination level from the lamp.'''\n",
    "\n",
    "dia =  7.5     #m      (diameter)\n",
    "h = 4.5        #m      (height)\n",
    "E = 800.0      #lux    (illumination) \n",
    "eff = 20.0     #lm/w   (lamp efficiency)\n",
    "A = 3.14*(dia**2)/4\n",
    "#Luminous flux reaching the surface\n",
    "flux = A*E      #lm\n",
    "\n",
    "#Total flux emmited is\n",
    "f_out = flux/0.4 #lm\n",
    "\n",
    "#Lamp in watts\n",
    "watt = f_out/eff   #W\n",
    "print \"lamp wattage =\",round(watt,2),\"W.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.7 , PAGE NO :- 1902"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Illumination =  5.0 lux.\n"
     ]
    }
   ],
   "source": [
    "'''A lamp of 100 candela is placed 1 m below a plane mirror which reflects 90% of light falling on it. The lamp is hung 4 m above\n",
    "ground.Find the illumination at a point on the ground 3 m away from the point vertically below the lamp.'''\n",
    "\n",
    "import math as m\n",
    "\n",
    "h1 = 4.0     #m   (height of 1 from ground)\n",
    "d1 = 3.0     #m   (horizontal distance 1)\n",
    "I1 = 100.0   #cd  (intenstity)\n",
    "\n",
    "l1 = m.sqrt(h1**2 + d1**2)  #m\n",
    "cosQ1 = h1/l1\n",
    "#The lamp L1 will produce the image L2 1m behind the mirror.Therefore,\n",
    "\n",
    "h2 = h1+1+1  #m   (height of 2 from ground)\n",
    "d2 = 3.0     #m   (horizontal distance 2)\n",
    "I2 = 0.9*I1  #cd  (intensity)\n",
    "\n",
    "l2 = m.sqrt(h2**2 + d2**2)  #m\n",
    "cosQ2 = h2/l2\n",
    "\n",
    "#Illumination at the required point is\n",
    "\n",
    "E = I1/l1**2*cosQ1 + I2/l2**2*cosQ2   #lux\n",
    "\n",
    "print \"Illumination = \",round(E),\"lux.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.8 , PAGE NO :- 1902"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Average illumination = 924.08 lux .\n"
     ]
    }
   ],
   "source": [
    "'''A light source having an intensity of 500 candle in all directions is fitted with a reflector so that it directs 80% of its\n",
    "light along a beam having a divergence of 15º. What is the total light flux emitted along the beam? What will be the average\n",
    "illumination produced on a surface normal to the beam direction at a distance of 10 m? '''\n",
    "\n",
    "import math as m\n",
    "\n",
    "I = 500.0      #cd        (intensity)\n",
    "Q = 15.0       #degrees   (Beam angle)\n",
    "h = 10.0       #m         (height)\n",
    "\n",
    "#Total flux emmited is\n",
    "flux = 0.8*(4*3.14*I)        #lm\n",
    "#radius of circle to be illuminated\n",
    "r = h*m.tan(Q/2*(3.14/180))       #m\n",
    "\n",
    "#Area of surface to be illuminated is\n",
    "A = 3.14*(r*r)         #m^2\n",
    "\n",
    "#Avg illumination\n",
    "avg = flux/A           #lux\n",
    "\n",
    "print \"Average illumination =\",round(avg,2),\"lux .\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.9  , PAGE NO :- 1902"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "----Without reflector ----\n",
      "Illumination at centre = 0.75 lm/m^2.\n",
      "Illumination at edge = 0.54 lm/m^2.\n",
      "----With reflector ----\n",
      "Illumination at every point = 6.0 lm/m^2\n"
     ]
    }
   ],
   "source": [
    "'''A lamp has a uniform candle power of 300 in all directions and is fitted with a reflector which directs 50% of the total\n",
    "emitted light uniformly on to a flat circular disc of 20 m diameter placed 20 m vertically below the lamp. Calculate the\n",
    "illumination (a) at the centre and (b)at the edge of the surface without the reflector. Repeat these two calculations with\n",
    "the reflector provided.'''\n",
    "\n",
    "import math as m\n",
    "\n",
    "I = 300.0       #Cd   (intensity)\n",
    "h = 20.0        #m    (height)\n",
    "dia = 20.0      #m    (diameter of luminous area)\n",
    "\n",
    "#(i)Without reflector\n",
    "Ec = I/h**2      #lm/m^2  (illumination at centre)\n",
    "\n",
    "theta = m.atan((dia/2)/h)\n",
    "l = m.sqrt(h**2 + (dia/2)**2)     #m    (distance between edge and source lamp)\n",
    "\n",
    "Eb = I/l**2*m.cos(theta)     #lm/m^2   (illuminaton at edge)\n",
    "print \"----Without reflector ----\"\n",
    "print \"Illumination at centre =\",round(Ec,2),\"lm/m^2.\"\n",
    "print \"Illumination at edge =\",round(Eb,2),\"lm/m^2.\"\n",
    "\n",
    "#(ii)With reflector\n",
    "#Luminous output of lamp\n",
    "lflux = I*4*3.14       #lm\n",
    "\n",
    "#flux directed by reflector\n",
    "reflux = 0.5*lflux     #lm\n",
    "\n",
    "#Area of disc\n",
    "A = 3.14*(dia*dia)/4   #m^2\n",
    "\n",
    "#Illumination at every point will be same and will be equal to\n",
    "Et = reflux/A          #lm/m^2\n",
    "\n",
    "print \"----With reflector ----\"\n",
    "print \"Illumination at every point =\",round(Et,2),\"lm/m^2\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.10 , PAGE NO :- 1903"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iluminaton at P =  11.11 cd/m^2\n",
      "Iluminaton at Q =  3.93 cd/m^2\n",
      "Total radiations sent =  314.0 lumens.\n"
     ]
    }
   ],
   "source": [
    "'''A light is placed 3 m above the ground and its candle power is 100 cos θ in any downward direction making an angle q with the\n",
    "vertical. If P and Q are two points on the grond, P being vertically under the light and the distance PQ being 3 m, calculate.\n",
    "(a) the illumination of the ground at P and also at Q.\n",
    "(b) the total radiations sent down by the lamp.'''\n",
    "\n",
    "import math as m\n",
    "from scipy.integrate import quad\n",
    "\n",
    "r1  = 3.0                                   #m\n",
    "r2 = m.sqrt(3**2 + 3**2)                    #m\n",
    "#(a)\n",
    "#Candela Power along LP\n",
    "CP1 = 100.0*m.cos(0)                        #cd\n",
    "#Illumination at P is\n",
    "Ep = CP1/(r1**2)                            #cd/m^2\n",
    "\n",
    "#Candela Power along LQ\n",
    "CP2 = 100.0*m.cos(45*3.14/180)              #cd\n",
    "\n",
    "#Illumination at Q is\n",
    "Eq = CP2/(r2**2)                            #cd/m^2\n",
    "\n",
    "print \"Iluminaton at P = \",round(Ep,2),\"cd/m^2\"\n",
    "print \"Iluminaton at Q = \",round(Eq,2),\"cd/m^2\"\n",
    "\n",
    "#After working out , total flux = integral (100*pi*sin2Q*dQ) 0->pi/2\n",
    "\n",
    "def integrand(Q):\n",
    "    return 100*3.14*m.sin(2*Q)\n",
    "\n",
    "ans, err = quad(integrand, 0,3.14/2)\n",
    "print \"Total radiations sent = \",round(ans),\"lumens.\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.11 , PAGE NO :- 1903"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of lamps = 21.0\n"
     ]
    }
   ],
   "source": [
    "'''A drawing office containing a number of boards and having a total effective area of 70 m2 is lit by a number of 40 W\n",
    "incandescent lamps giving 11 lm/W. An illumination of 80 lux is required on the drawing boards. Assuming that 60% of the\n",
    "total light emitted by the lamps is available for illuminating the drawing boards, estimate the number of lamps required.'''\n",
    "\n",
    "A = 70.0        #m^2    (area)\n",
    "watt = 40.0     #W      (each bulb wattage)\n",
    "eff = 11.0      #lm/W   (luminous efficacy)\n",
    "E = 80.0        #lux    (Illumination)\n",
    "\n",
    "#Output per lamp is\n",
    "oplamp = watt*eff    #lm\n",
    "\n",
    "#Flux actually used per lamp is\n",
    "flux = 0.6*oplamp    #lm\n",
    "\n",
    "#Now, Total flux required is   Illumination*Area\n",
    "flux_tot = E*A       #lm\n",
    "\n",
    "#Therefore number of lamps required are\n",
    "N = flux_tot/flux\n",
    "\n",
    "print \"Number of lamps =\",round(N)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.12 , PAGE NO :- 1904"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total flux radiated = 62.74 lm.\n"
     ]
    }
   ],
   "source": [
    "'''A perfectly diffusing surface has a luminous intensity of 10 candles at an angle of 60º to the normal. If the area of the \n",
    "surface is 100 cm2, determine the brightness and total flux radiated.'''\n",
    "\n",
    "import math as m\n",
    "\n",
    "I = 10.0        #Cd         (Intensity)\n",
    "theta = 60.0    #degrees    (angle to normal)\n",
    "A = 100.0       #cm^2       (Area)\n",
    "\n",
    "proA = A*m.cos(theta*3.14/180)     #cm^2\n",
    "\n",
    "B = I/proA*(10000)       #cd/m^2    (Brightness)\n",
    "B = B*3.14               #lm/m^2    (Brightness)\n",
    "\n",
    "flux = B*A*10e-5     #lm        (Total flux radiated)\n",
    "print \"Total flux radiated =\",round(flux,2),\"lm.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.13 , PAGE NO :- 1904"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Brightness 1 = 1.191083e+04 cd/m^2.\n",
      "Brightness 2 = 0.06 cd/m^2.\n"
     ]
    }
   ],
   "source": [
    "'''Calculate the brightness (or luminance) of snow under an illumination of (a) 44,000 lux and (b) 0.22 lux. Assume that snow\n",
    "behaves like a perfect diffusor having a reflection factor of 85 per cent.'''\n",
    "\n",
    "E1 = 44000.0         #lux      (illumination 1)\n",
    "E2 = 0.22            #lux      (illumination 2)\n",
    "rf = 0.85            #         (reflection factor)\n",
    "\n",
    "L1 = (E1*rf/3.14)    #cd/m^2    (Brightness 1)\n",
    "L2 = (E2*rf/3.14)    #cd/m^2    (Brightness 2)\n",
    "\n",
    "print \"Brightness 1 = %e cd/m^2.\" %round(L1,2)\n",
    "print \"Brightness 2 =\",round(L2,2),\"cd/m^2.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.14 , PAGE NO :- 1904"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "luminous intensity of globe is = 44.0 Cd.\n",
      "percentage absorption =  44.61 %.\n"
     ]
    }
   ],
   "source": [
    "'''A 21 cm diameter globe of dense opal glass encloses a lamp emitting 1000 lumens and has uniform brightness of 4e+3 lumen/m^2\n",
    "when viewed in any direction. What would be the luminous intensity of the globe in any direction? Find what percentage of the\n",
    "flux emitted by the lamp is absorbed by the globe.'''\n",
    "\n",
    "d = 21.0           #cm      (diameter)\n",
    "flux = 1000.0      #lumens  (luminous flux) \n",
    "B = 4e+3           #lm/m^2  (uniform Brightness)\n",
    "\n",
    "#Surface Area of the globe\n",
    "sa = 3.14*(d*d)*10e-5       #m^2\n",
    "#Flux emitted by globe is\n",
    "fluxe = sa*B       #lm\n",
    "\n",
    "#luminous intensity of globe is\n",
    "lint = fluxe/(4*3.14)      #Cd\n",
    "print \"luminous intensity of globe is =\",round(lint),\"Cd.\"\n",
    "#Flux absorbed by globe is\n",
    "fluxab = flux - fluxe        #lm\n",
    "\n",
    "#% absorption is\n",
    "absrp = fluxab/flux*100      #% absorption\n",
    "print \"percentage absorption = \",round(absrp,2),\"%.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.15 , PAGE NO :- 1904"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Luminous intensity is = 1005440.0 Cd\n",
      "The beam spread is = 14.25 degrees\n"
     ]
    }
   ],
   "source": [
    "'''A 2.5 cm diameter disc source of luminance 1000 cd/cm2 is placed at the focus of a specular parabolic reflector\n",
    "normal to the axis. The focal length of the reflector is 10 cm, diameter 40 cm and reflectance 0.8. Calculate the axial\n",
    "intensity and beam-spread. Also show diagrammatically what will happen if the source were moved away from the reflector\n",
    "along the axis in either direction.'''\n",
    "\n",
    "import math as m\n",
    "\n",
    "dia = 0.025         #m         (diameter of disc)\n",
    "d = 0.4           #m         (diameter of relector) \n",
    "L = 1000.0e+4     #Cd/m^2    (luminance)\n",
    "\n",
    "#Surface area is\n",
    "A = 3.142*d*d/4    #m^2       (Area)\n",
    "\n",
    "#Luminous intensity is\n",
    "I = 0.8*A*L      #Cd\n",
    "print \"Luminous intensity is =\",round(I,2),\"Cd\"\n",
    "\n",
    "#Let us assume 'theta' as the beam-spread .Then\n",
    "r = dia/2           #m    (radius)\n",
    "f = 0.1           #m    (focal length) \n",
    "theta = 2*m.degrees(m.atan((r/f)))\n",
    "\n",
    "print \"The beam spread is =\",round(theta,2),\"degrees\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.16 , PAGE NO :- 1905"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Flux emmited by source is = 6942.15 lm/m^2 .\n",
      "C.P of globe is =  84.0 Cd.\n"
     ]
    }
   ],
   "source": [
    "'''A 22cm diameter globe of opal glass encloses a lamp of uniform luminous intensity 120 C.P. Thirty per cent of light emitted \n",
    "by the lamp is absorbed by globe. Determine (a) luminance of globe (b) C.P. of globe in any direction.'''\n",
    "\n",
    "\n",
    "d = 0.22       #m     (diameter)\n",
    "I = 120.0      #Cd    (luminous intensity)\n",
    "\n",
    "#surface area is\n",
    "sa = 3.14*d*d      #m^2\n",
    "\n",
    "#Flux emmited by source is\n",
    "flux = I*(4*3.14)       #lm\n",
    "#Flux emmited by globe is\n",
    "reflux = 0.7*flux       #lm\n",
    "\n",
    "#(a)Luminance of globe is\n",
    "L = reflux/sa           #lm/m^2\n",
    "print \"Flux emmited by source is =\",round(L,2),\"lm/m^2 .\"\n",
    "#(b) C.P of globe is\n",
    "cp = reflux/(4*3.14)     #Cd\n",
    "print \"C.P of globe is = \",round(cp,2),\"Cd.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.17 , PAGE NO :- 1905"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Average luminance = 7722.93 lm/m^2 .\n"
     ]
    }
   ],
   "source": [
    "'''A 0.4 m diameter diffusing sphere of opal glass (20 percent absorption) encloses an incandescent lamp with a luminous flux of\n",
    "4850 lumens. Calculate the average luminance of the sphere.'''\n",
    "\n",
    "\n",
    "d = 0.4              #m       (diameter)\n",
    "lflux = 4850.0       #lm      (luminous flux)\n",
    "reflux = 0.8*lflux   #lm      (flux emmited by globe)\n",
    "\n",
    "sa = 3.14*d*d        #m^2     (surface area)\n",
    "\n",
    "#Brightness B = flux emmited/surface area . i.e\n",
    "B = reflux/sa        #lm/m^2  (brightness)\n",
    "\n",
    "print \"Average luminance =\",round(B,2),\"lm/m^2 .\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.18 , PAGE NO :- 1907"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Illumination produced is = 122.55 lm/m^2.\n"
     ]
    }
   ],
   "source": [
    "'''A show case is lighted by 4 metre of architectural tubular lamps arranged in a continuous line and placed along the top of the\n",
    "case.Determine the illumination produced on a horizontal surface 2 metres below the lamps in a position directly underneath the\n",
    "centre of the 4 m length of the lamps on the assumption that in tubular lamps emit 1,880 lm per metre run.\n",
    "Neglect the effect of any reflectors which may be used.'''\n",
    "\n",
    "import math as m\n",
    "\n",
    "L = 4.0       #m        (length of source of light)\n",
    "d = 2.0       #m        (height)\n",
    "flux = 1880.0 #lumens      (flux) \n",
    "#Now\n",
    "theta = m.atan(L/(2*d))\n",
    "\n",
    "#As I = flux/(3.14*3.14*L)\n",
    "I = 4*flux/(3.14*3.14*L)     #cd/m\n",
    "\n",
    "#Illumination produced is\n",
    "E = I/(2*d)*(m.sin(2*theta) + 2*theta)    #lm/m^2\n",
    "\n",
    "print \"Illumination produced is =\",round(E,2),\"lm/m^2.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## EXAMPLE 49.19 , PAGE NO :- 1913"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Luminous flux yield of the source = 1109.2 lm.\n"
     ]
    }
   ],
   "source": [
    "'''If an integrating sphere 0.6 m in diameter whose inner surface has a reflection coefficient of 0.8 contains a lamp producing\n",
    "on the portion of the sphere, screened from direct radiation,a luminance of 1000 cd/m2, what is the luminous flux yield of\n",
    "the source ?'''\n",
    "\n",
    "from sympy import Eq,solve,Symbol\n",
    "\n",
    "coef = 0.8      #          (reflection coefficient)\n",
    "L = 1000.0      #cd/m^2    (luminance)\n",
    "d = 0.6         #m         (diameter)\n",
    "\n",
    "Fl = Symbol('Fl')\n",
    "E = coef*Fl/(3.14*d*d*(1-coef))     #lm/m^2\n",
    "L1 = coef*E/3.14           #cd/m^2\n",
    "#As L is equal to L1\n",
    "eq = Eq(L,L1)\n",
    "Fl = solve(eq)\n",
    "Fl1 = Fl[0]     #lumens\n",
    "\n",
    "print \"Luminous flux yield of the source =\",round(Fl1,2),\"lm.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## EXAMPLE 49.20 , PAGE NO :- 1919 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Utilization coefficient =  0.4\n"
     ]
    }
   ],
   "source": [
    "'''A room 8 m * 12 m is lighted by 15 lamps to a fairly uniform illumination of 100 lm/m^2. Calculate the utilization coefficient\n",
    "of the room given that the output of each lamp is 1600 lumens.'''\n",
    "\n",
    "Area = 8*12      #m^2      (area of room)\n",
    "num = 15.0       #         (number of lamps)\n",
    "I = 1600.0       #lumens   (output of each lamp)\n",
    "E = 100.0        #lm/m^2   (illumination)\n",
    "\n",
    "#Lumens emmited by lamp\n",
    "I_tot = num*I    #lumens\n",
    "\n",
    "#Lumens recieved by working plane\n",
    "I1 = Area*E      #lumens\n",
    "\n",
    "#Utilization coefficient is\n",
    "coef = I1/I_tot\n",
    "\n",
    "print \"Utilization coefficient = \",round(coef,2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.21 , PAGE NO :- 1919"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of lamps required = 50.0\n"
     ]
    }
   ],
   "source": [
    "'''The illumination in a drawing office 30 m*10 m is to have a value of 250 lux and is to be provided by a number of 300 W\n",
    "filament lamps. If the coefficient of utilization is 0.4 and the depreciation factor 0.9, determine the number of lamps\n",
    "required. The luminous efficiency of each lamp is 14 lm/W.'''\n",
    "\n",
    "A = 30*10.0     #m^2     (area)\n",
    "E = 250.0       #lm/m^2  (illumination)\n",
    "coef = 0.4      #        (coefficient of utilization)\n",
    "p = 0.9         #        (depriciation factor)\n",
    "eff = 14.0      #lm/W    (luminous efficiency)\n",
    "watt = 300.0    #W       (wattage of eacch lamp)\n",
    "#Now, flux = E*A/coef*p\n",
    "flux = E*A/(coef*p)   #lm     (output in lumens)\n",
    "\n",
    "#Flux emmited per lamp is\n",
    "Fl2 = watt*eff      #lm\n",
    "\n",
    "#No. of lamps required are\n",
    "num = flux/Fl2\n",
    "\n",
    "print \"Number of lamps required =\",round(num)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.22 , PAGE NO :- 1919"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Net saving in load = 600.0 W.\n",
      "Increase in illumination =  42.22 %\n"
     ]
    }
   ],
   "source": [
    "'''Find the total saving in electrical load and percentage increase in illumination if instead of using twelve 150 W tungsten-\n",
    "filament lamps,we use twelve 80 W fluorescent tubes. It may be assumed that (i) there is a choke loss of 25 per cent of rated\n",
    "lamp wattage (ii) average luminous efficiency throughout life for each lamp is 15 lm/W and for each tube 40 lm/W and \n",
    "(iii) coefficient of utilization remains the same in both cases.'''\n",
    "\n",
    "#Luminous efficiency\n",
    "eff1 = 15.0      #lm/W\n",
    "eff2 = 40.0      #lm/W\n",
    "\n",
    "#Total load in filament-lamps\n",
    "flamp = 12*150.0      #W\n",
    "#Total load in fluoroscent tubes\n",
    "tube = 12*(80 + 0.25*80) #W\n",
    "#Net saving\n",
    "load = flamp - tube     #W\n",
    "print \"Net saving in load =\",round(load,2),\"W.\"\n",
    "\n",
    "#Let us assume that\n",
    "#E1 -> illumination with lamps\n",
    "#E2 -> illumination with tubes\n",
    "#Now E1/E2 = (O/P in lumens 1)/(O/P in lumens 2)\n",
    "\n",
    "tube2 = 12*80.0         #W\n",
    "\n",
    "E1_E2 = flamp*eff1/(tube2*eff2)\n",
    "\n",
    "#Increase in illumination is given by  %increase = (E2/E1 - 1)*100\n",
    "increase = (1/E1_E2 - 1)*100.0\n",
    "\n",
    "print \"Increase in illumination = \",round(increase,2),\"%\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.23 , PAGE NO :- 1919"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of lamps on each tower is = 50.0\n"
     ]
    }
   ],
   "source": [
    "'''A football pitch 120 m * 60 m is to be illuminated for night play by similar banks of equal 1000 W lamps supported on twelve \n",
    "towers which are distributed around the ground to provide approximately uniform illumination of the pitch.Assuming that 40% of\n",
    "the total light emitted reaches the playing pitch and that an illumination of 1000 lm/m2 is necessary for television purposes,\n",
    "calculate the number of lamps on each tower. The overall efficiency of the lamp is to be taken as 30 lm/W.'''\n",
    " \n",
    "Area = 120.0*60.0       #m^2         (Area of pitch)\n",
    "E = 1000.0              #lm/m^2      (Illumination of pitch)\n",
    "\n",
    "#Flux required is\n",
    "flux = Area*E           #lm         \n",
    "\n",
    "#Since only 40% reaches the ground.Total flux required is\n",
    "lflux = flux/0.4        #lm\n",
    "\n",
    "#There are 12 tower banks . Therefore flux by each tower bank is\n",
    "flux_each = lflux/12    #lm\n",
    "\n",
    "#Output of each 1000 W lamp is\n",
    "I = 30.0*1000           #lm\n",
    "\n",
    "#Therefore, number of each lamps is\n",
    "num = flux_each/I\n",
    "\n",
    "print \"Number of lamps on each tower is =\",round(num)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.24 , PAGE NO :- 1920"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "number of flouroscent tubes = 384.0\n",
      "number of twin fittings = 192.0\n",
      "These can be arranged in 8 rows and 24 columns with space/height ratio = 1.\n"
     ]
    }
   ],
   "source": [
    "'''Design a suitable lighting scheme for a factory 120 m * 40 m with a height of 7 m. Illumination required is 60 lux.\n",
    "State the number, location and mounting height of 40 W fluorescent tubes giving 45 lm/W. Depreciation factor = 1.2;\n",
    "utilization factor = 0.5 .'''\n",
    "\n",
    "A = 120.0*40.0        #m^2     (Area)\n",
    "h = 7.0               #m       (Height)\n",
    "E = 60.0              #lm/m^2  (Illumination)\n",
    "watt = 40.0           #W       (Wattage of bulb)\n",
    "eff = 45.0            #lm/W    (Luminous efficiency)\n",
    "dep = 1.2             #        (Depriciation factor)\n",
    "uti = 0.5             #        (Utilization factor)\n",
    "\n",
    "#Total output flux is\n",
    "flux = E*A/(uti*1/dep)     #lm\n",
    "#Flux per tube is\n",
    "flux_tube = eff*watt       #lm\n",
    "\n",
    "#Therefore,number of flouroscent tubes required\n",
    "num = flux/flux_tube\n",
    "print \"number of flouroscent tubes =\",round(num)\n",
    "#For twin fittings\n",
    "num = num/2\n",
    "print \"number of twin fittings =\",round(num)\n",
    "print \"These can be arranged in 8 rows and 24 columns with space/height ratio = 1.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.25 , PAGE NO :- 1920"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of 500-W lamps required = 24.0\n",
      "Number of 300-W lamps required = 49.0\n"
     ]
    }
   ],
   "source": [
    "'''A drawing hall in an engineering college is to be provided with a lighting installation. The hall is 30 m * 20 m * 8 m (high).\n",
    "The mounting height is 5 m and the required level of illumination is 144 lm/m^2. Using metal filament lamps, estimate\n",
    "the size and number of single lamp luminaries and also draw their spacing layout. Assume :\n",
    "Utilization coefficient = 0.6; maintenance factor = 0.75; space/height ratio=1 lumens/watt for 300-W lamp = 13,\n",
    "lumens/watt for 500-W lamp = 16.'''\n",
    "\n",
    "\n",
    "A = 30.0*20      #m^2      (Area)\n",
    "E = 144.0        #lm/m^2   (Illumination)\n",
    "coef = 0.6       #         (Utilization coefficient)\n",
    "mfac = 0.75      #         (maintenance factor)\n",
    "\n",
    "\n",
    "#The flux is given by\n",
    "flux = E*A/(coef*mfac)       #lm\n",
    "\n",
    "#Lumen output for 500-W lamp\n",
    "I5 = 500.0*16        #lm\n",
    "\n",
    "#Lumen output for 500-W lamp\n",
    "I3 = 300.0*13        #lm\n",
    "\n",
    "#No. of 500 W lamps required is\n",
    "num5 = flux/I5\n",
    "print \"Number of 500-W lamps required =\",round(num5)\n",
    "\n",
    "#No. of 300 W lamps required is\n",
    "num3 = flux/I3\n",
    "print \"Number of 300-W lamps required =\",round(num3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.26 , PAGE NO :- 1920"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of lamps = 36.0\n",
      "Wattage of each lamp is = 500.0 W.\n"
     ]
    }
   ],
   "source": [
    "'''Estimate the number and wattage of lamps which would be required to illuminate a workshop space 60 * 15 metres by means of\n",
    "lamps mounted 5 metres above the working plane. The average illumination required is about 100 lux.Coefficient of\n",
    "utilization=0.4 ; Luminous efficiency=16 lm/W.Assume a spacing/height ratio of unity and a candle power depreciation of 20%.'''\n",
    "\n",
    "A = 60.0*15.0        #m^2\n",
    "E = 100.0            #lm/m^2\n",
    "coef = 0.4           #            (coefficient of utilization)\n",
    "lum = 16.0           #lm/W        (luminous efficiency)\n",
    "dep = 1+0.2          #            (depriciation factor)\n",
    "\n",
    "#Total flux is given by\n",
    "flux = E*A/(coef*1/dep)    #lm\n",
    "\n",
    "#Total wattage required is\n",
    "watt = flux/lum            #W\n",
    "\n",
    "#Now,space/height ratio is 1.\n",
    "h = 5.0                #m\n",
    "\n",
    "#Therefore along breadth , lamps are\n",
    "num_b = 15.0/h\n",
    "\n",
    "#Therefore along length , lamps are\n",
    "num_l = 60.0/h\n",
    "\n",
    "#Total number of lamps are\n",
    "num_tot = num_b*num_l\n",
    "\n",
    "#Wattage of each lamp is\n",
    "watt_each = watt/num_tot\n",
    "\n",
    "print \"Total number of lamps =\",num_tot\n",
    "print \"Wattage of each lamp is =\",round(watt_each,-2),\"W.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## EXAMPLE 49.27 , PAGE NO :- 1921"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of 200-W lamps required are = 68.0\n",
      "Number of 300-W lamps required are = 40.0\n",
      "Number of 500-W lamps required are = 22.0\n"
     ]
    }
   ],
   "source": [
    "'''A drawing hall 40 m * 25 m * 6 high is to be illuminated with metal-filament gas-filled lamps to an average illumination of\n",
    "90 lm/m^2 on a working plane 1 metre above the floor.Estimate suitable number, size and mounting height of lamps. Sketch the\n",
    "spacing layout.Assume coefficient of utilization of 0.5, depreciation factor of 1.2 and spacing/height ratio of 1.2\n",
    "\n",
    "Size of lamps                 :     200 W        300 W         500 W\n",
    "Luminous efficiency (in lm/W) :      16           18            20                                '''\n",
    "\n",
    "A = 40.0*25.0       #m^2        (Area)\n",
    "E = 90.0            #lm/m^2     (Illumination)\n",
    "coef = 0.5          #           (Coefficient of utilization)\n",
    "dep = 1.2           #           (Depreciation factor)\n",
    "\n",
    "#Total flux required is\n",
    "flux = E*A/(coef*1/1.2)          #lumens\n",
    "\n",
    "#Lumen output of each 200-W lamp is\n",
    "flux_200 = 200.0*16              #lumens\n",
    "\n",
    "#Lumen output of each 200-W lamp is\n",
    "flux_300 = 300.0*18             #lumens\n",
    "\n",
    "#Lumen output of each 200-W lamp is\n",
    "flux_500 = 500.0*20              #lumens\n",
    "\n",
    "#Number of 200-W lamps required is\n",
    "num_200 = flux/flux_200\n",
    "#Number of 200-W lamps required is\n",
    "num_300 = flux/flux_300\n",
    "#Number of 200-W lamps required is\n",
    "num_500 = flux/flux_500\n",
    "\n",
    "print \"Number of 200-W lamps required are =\",round(num_200)\n",
    "print \"Number of 300-W lamps required are =\",round(num_300)\n",
    "print \"Number of 500-W lamps required are =\",round(num_500)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.28 , PAGE NO :- 1922"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total wattage required is = 2019.23 W.\n"
     ]
    }
   ],
   "source": [
    "'''A school classroom, 7 m * 10 m * 4 m high is to be illuminated to 135 lm/m^2 on the working plane. If the coefficient of\n",
    "utilization is 0.45 and the sources give 13 lumens per watt,work out the total wattage required, assuming a depreciation factor\n",
    "of 0.8 .Sketch roughly the plan of the room, showing suitable positions for fittings, giving reasons for the positions chosen.'''\n",
    "\n",
    "A = 7.0*10.0       #m^2     (Area)\n",
    "E = 135.0          #lm/m^2  (Illumination)\n",
    "coef = 0.45        #        (Coefficient of utilization)\n",
    "dep = 0.8          #        (Depreciation factor)\n",
    "eff = 13.0         #lm/W        (luminous efficiency) \n",
    "\n",
    "#Total flux is\n",
    "flux = E*A/(coef*dep)      #lumens\n",
    "\n",
    "#Therefore,total wattage required is\n",
    "watt = flux/eff              #W\n",
    "\n",
    "print \"Total wattage required is =\",round(watt,2),\"W.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.29 , PAGE NO :- 1922"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of 100-W lamps required = 29.0\n",
      "Number of 200-W lamps required = 13.0\n",
      "Number of 300-W lamps required = 10.0\n",
      "Number of 500-W lamps required = 5.0\n",
      "Number of 1000-W lamps required = 2.0\n",
      "If we take the mounting height of 5 m, then 300 W lamps would be suitable.\n",
      "The No.of lamps required would be 10, arranged in two rows, each row having 5 lamps thus giving space/height ratio of 6/5\n"
     ]
    }
   ],
   "source": [
    "'''A hall 30 m long and 12 m wide is to be illuminated and the illumination required is 50 lm/m2. Calculate the number,\n",
    "the wattage of each unit and the location and mounting height of the units, taking a depreciation factor of 1.3 and\n",
    "utilization factor of 0.5, given that the outputs of the different types of lamp are as under :\n",
    "Watts  : 100       200       300       500        1000\n",
    "Lumens : 1615      3650      4700      9950       21500                                              '''\n",
    "\n",
    "A = 30.0*12.0       #m^2         (Area)\n",
    "E = 50.0            #lm/m^2      (Illumination)\n",
    "coef = 0.5          #            (coefficient of utilization)\n",
    "dep = 1/1.3         #            (depreciation factor)\n",
    "\n",
    "#Total flux required is\n",
    "flux = E*A/(coef*dep)       #lumens\n",
    "\n",
    "#For 100-W lamps are used ,Number required\n",
    "num_100 = flux/1615.0\n",
    "#For 200-W lamps are used ,Number required\n",
    "num_200 = flux/3650.0\n",
    "#For 300-W lamps are used ,Number required\n",
    "num_300 = flux/4700.0\n",
    "#For 500-W lamps are used ,Number required\n",
    "num_500 = flux/9950.0\n",
    "#For 1000-W lamps are used ,Number required\n",
    "num_1000 = flux/21500.0\n",
    "\n",
    "print \"Number of 100-W lamps required =\",round(num_100)\n",
    "print \"Number of 200-W lamps required =\",round(num_200)\n",
    "print \"Number of 300-W lamps required =\",round(num_300)\n",
    "print \"Number of 500-W lamps required =\",round(num_500)\n",
    "print \"Number of 1000-W lamps required =\",round(num_1000)\n",
    "print \"If we take the mounting height of 5 m, then 300 W lamps would be suitable.\"\n",
    "print \"The No.of lamps required would be 10, arranged in two rows, each row having 5 lamps thus giving space/height ratio of 6/5\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.30 , PAGE NO :- 1924"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of lamps required are = 10.0\n"
     ]
    }
   ],
   "source": [
    "'''It is desired to floodlight the front of a building 42 m wide and 16 m high.Projectors of 30° beam spread and 1000-W lamps\n",
    "giving 20 lumen/watt are available. If the desired level of illumination is 75 lm/m2 and if the projectors are to be located\n",
    "at ground level 17 m away,design and show a suitable scheme. Assume the following :\n",
    "Coefficient of utilization = 0.4     ;      Depreciation factor = 1.3    ;   Waste-light factor = 1.2.   '''\n",
    "\n",
    "A = 42.0*16.0           #m^2          (Area)\n",
    "E = 75.0                #lm/m^2       (Illumination)\n",
    "W = 1.2                 #             (Waste-light factor)\n",
    "coef = 0.4              #             (Coefficient of utilization)\n",
    "dep = 1/1.3             #             (Depreciation factor)\n",
    "eff = 20.0              #lm/W         (luminous efficiency)\n",
    "\n",
    "#Total flux is\n",
    "flux = E*A*W/(coef*dep)       #lm/m^2\n",
    "\n",
    "#Lumen output of each 1000-W lamp is\n",
    "flux_each = 1000.0*eff\n",
    "\n",
    "#Number of lamps required are\n",
    "num = flux/flux_each\n",
    "\n",
    "print \"Number of lamps required are =\",round(num)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.31 , PAGE NO :- 1925"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The number of floodlight projectors required = 24.0\n"
     ]
    }
   ],
   "source": [
    "'''Estimate the number of 1000-W floodlight projectors required to illuminate the up per 75 m of one face of a 96 m tower of \n",
    "width 13 m if approximate initial average luminance is to be 6.85 cd/m2. The projectors are mounted at ground level 51m from base\n",
    "of the tower.Utilization factor is = 0.2; reflection factor of wall = 25% and efficiency of each lamp = 18 lm/W.'''\n",
    "\n",
    "\n",
    "A = 13.0*75.0      #m^2      (Area to be flood-lighted)\n",
    "B = 6.85           #cd/m^2   (Average luminance)\n",
    "watt = 1000.0      #W        (Wattage floodlight projectors)\n",
    "coef = 0.2         #         (Utilization factor)\n",
    "ref = 0.25         #         (Reflection factor)\n",
    "\n",
    "#Illumination E = pi*B/reflection factor\n",
    "E = 3.14*B/ref     #lm/m^2\n",
    "\n",
    "#Therefore, total flux required is\n",
    "flux = E*A         #lm\n",
    "\n",
    "#Flux to be emmited by lamp is\n",
    "lflux = flux/coef  #lm\n",
    "\n",
    "#Flux from each lamp is\n",
    "flux_each = 18.0*watt   #lm\n",
    "\n",
    "#The number of floodlight projectors required are\n",
    "num = lflux/flux_each\n",
    "\n",
    "print \"The number of floodlight projectors required =\",round(num)+1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.32 , PAGE NO :- 1928"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Diameter d2 =  0.4 *d1.\n",
      "Length l2 =  1.26 *l1.\n"
     ]
    }
   ],
   "source": [
    "'''If the filament of a 32 candela, 100-V lamp has a length l and diameter d,calculate the length and diameter of the filament\n",
    "of a 16 candela 200-V lamp,assuming that the two lamps run at the same intrinsic brilliance.'''\n",
    "\n",
    "\n",
    "#As l*d is directly propotional luminous intensity .\n",
    "#Let a = l1*d1 & b = l2*d2 . Then, l1*d1/l2*d2 = 32/16\n",
    "\n",
    "a_b = 32.0/16         # (= a/b = l1*d1/l2*d2)\n",
    "\n",
    "#As luminous intensity is directly propotional to power output\n",
    "# 32 o< 100*I1    & 16 o< 200*I2\n",
    "\n",
    "I1_I2 = 32*200.0/(16*100.0)     #( = I1/I2)\n",
    "\n",
    "\n",
    "#Also , I o< d^3/2 \n",
    "d1_d2 = (I1_I2)**(2.0/3)         #( = d1/d2)\n",
    "\n",
    "print \"Diameter d2 = \",round(1/d1_d2,2),\"*d1.\"\n",
    "\n",
    "#As , d1_d2 = d1/d2\n",
    "l1_l2 = a_b/d1_d2               #( = l1/l2)\n",
    "print \"Length l2 = \",round(1/l1_l2,2),\"*l1.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.33 , PAGE NO :- 1928"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Diameter d2 =  0.00198 cm.\n",
      "Length l2 =  126.0 cm.\n"
     ]
    }
   ],
   "source": [
    "'''An incandescent lamp has a filament of 0.005 cm diameter and one metre length. It is required to construct another lamp of\n",
    "similar type to work at double the supply voltage and give half the candle power. Assuming that the new lamp operates at the same\n",
    "brilliancy,determine suitable dimensions for its filament.'''\n",
    "\n",
    "d1 = 0.005       #cm    (diameter)\n",
    "l1 = 100.0       #cm    (length) \n",
    "#As l*d is directly propotional luminous intensity .\n",
    "#Let a = l1*d1 & b = l2*d2 . Then, l1*d1/l2*d2 = 2.0/1.0\n",
    "\n",
    "a_b = 2.0/1        # (= a/b = l1*d1/l2*d2)\n",
    "\n",
    "#As luminous intensity is directly propotional to power output\n",
    "# I1 o< V1*i1    & I2 o< V2*i2\n",
    "\n",
    "I1_I2 = (2.0/1)*(2.0/1)     #( = I1/I2)\n",
    "\n",
    "\n",
    "#Also , I o< d^3/2 \n",
    "d1_d2 = (I1_I2)**(2.0/3)         #( = d1/d2)\n",
    "d2 = d1/d1_d2                    #cm\n",
    "print \"Diameter d2 = \",round(d2,5),\"cm.\"\n",
    "\n",
    "#As , d1_d2 = d1/d2\n",
    "l1_l2 = a_b/d1_d2               #( = l1/l2)\n",
    "l2 = l1/l1_l2                   #cm \n",
    "print \"Length l2 = \",round(l2),\"cm.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 49.34 , PAGE NO :- 1928"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hence expression for candle power is C = 1.155816e-09 *V^ 4.47\n",
      "Change of candle power per volt =  268.1 cd/m.\n",
      "% change in candle power for increase = 19.16\n",
      "% change in candle power for decrease = -16.67\n"
     ]
    }
   ],
   "source": [
    "'''A 60 candle power, 250-V metal filament lamp has a measured candle power of 71.5 candela at 260 V and 50 candela at 240 V.\n",
    "(a) Find the constant for the lamp in the expression C = aV^b where C = candle power and V = voltage.\n",
    "(b) Calculate the change of candle power per volt at 250 V. Determine the percentage variation of candle power due to a voltage\n",
    "variation of æ 4% from the normal value.   '''\n",
    "\n",
    "from sympy import Symbol,solve,Eq\n",
    "\n",
    "#Given expression is C = a*V^b\n",
    "b = Symbol('b')\n",
    "# 71.5/50 = (260/240)^b\n",
    "lhs = 71.5/50.0\n",
    "rhs = (260.0/240)**b\n",
    "eq = Eq(lhs,rhs)\n",
    "b = solve(eq)\n",
    "b1 = b[0]          #constant\n",
    "\n",
    "a = 71.5/(260.0)**b1\n",
    "print \"Hence expression for candle power is C = %e\" %a,\"*V^\",round(b1,2)\n",
    "\n",
    "#Change of candle power per volt\n",
    "# dC/dV = b*a*V^b\n",
    "change = b1*a*((250.0)**(b1))    #cd/V\n",
    "print \"Change of candle power per volt = \",round(change,1),\"cd/m.\"\n",
    "\n",
    "#When voltage is increases by 4% C2/C1 = (1.04)^b\n",
    "per_change = ( (1.04)**b1  - 1 ) * 100\n",
    "\n",
    "print \"% change in candle power for increase =\",round(per_change,2)\n",
    "\n",
    "#When voltage is decreases by 4% C2/C1 = (0.96)^b\n",
    "per_change = ( (0.96)**b1 - 1)* 100\n",
    "\n",
    "print \"% change in candle power for decrease =\",round(per_change,2)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "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
}