In [9]:

```
from __future__ import division
from math import sqrt
# To determine the distance of a 25 cp lamp for various illumination
#Candle power of the lamp
I=25
# Various illumination levels
E1=5 #Case1
E2=15 #Case2
E3=8 #Case3
# According to the law of illumination E = I/(r**2)
# Using the above equation we find the distances for the above three illuminations
r1= sqrt(I/E1)
r2= sqrt(I/E2)
r3= sqrt(I/E3)
print 'a) The distance for %g flux illumination from the normally placed screen is %0.2f m'%(E1,r1)
print 'b) The distance for %g flux illumination from the normally placed screen is %0.2f m'%(E2,r2)
print 'c) The distance for %g f.c illumination from the normally placed screen is %0.2f ft'%(E3,r3)
```

In [10]:

```
from math import pi
#To determine the total radiation sent vertically downward from a lamp of 1500 cp
#Candle power of the lamp
P=1500
#Since the flux required corresponds to the one that lies in a plane passing through the lamp vertically downwards the angle is given by
Angle= pi # Angle in radians
Flux=P*Angle
print 'The total radiation sent vertically downward is %g lumens '%Flux
# Answer in the textbook are not accurate.
```

In [11]:

```
from math import sin
#To calculate Spherical Candle Power and intensity of illumination
Tf= 1500 #Total flux
D=3 #Distance from the source
CP=200 #Candle power of the Uniform Source
E=CP/(D**2) #Maximum Illumination Intensity
IntIllumi = lambda x : E*sin(x*pi/180) #Function to determine the intensity of iluumination for various conditions
MSCP=Tf/(4*pi) #The Mean spherical candle power
#Various Angles at which the rays falls on the surface
t1=90
t2=60
t3=0
#Illumination Intensities at various angles
E1=IntIllumi(t1)
E2=IntIllumi(t2)
E3=IntIllumi(t3)
print 'a)The Mean Spherical Candle Power is %0.2f c.p'%(MSCP)
print 'b The illumination intensities for the following cases are: '
print 'i) Normal : %0.2f lux'%E1
print 'ii) Inclined at 60 degrees : %0.2f lux '%E2
print 'iii) Parallel : %g lux'%E3
```

In [12]:

```
from __future__ import division
from math import acos, degrees, cos
#To determine average illumination and illumination at various points on the area
CP=200 #Candle power of the lamp
D=4 #Vertical Distance from the centre of the area to the lamp
R=5/2 #Radius of the given area
De=sqrt((D**2)+((R)**2)) #Distance from the edge of the area
Reff=80/100 #Reflector Efficiency
Ec= CP/(D**2) #Illumination at the centre of the area
cos_theta = (D/De) #Angle made between perpendicular and edge distances
w=2*pi*(1-cos_theta) #Solid angle subtended by the area
#Assuming uniform intensity in all directions
#Illumination at the edge is
Eue=(CP/(De**2))*cos_theta
#Flux is given by Iw
flux=CP*w
#Average illumination
Euavg= flux/(pi*(R**2))
#Average illumination with reflector efficiency
Euavgr= Euavg*Reff
#When candle power is only vertically downwards
Eve=Eue*cos_theta #Illumination at the edge of the area
#Total flux equation for non uniform intensity is derived and given by 2*pi*I*(sec(theta)-1)
fluxn=2*pi*CP*(1/cos_theta-1)
#Average illumination
Enuavg= fluxn/(pi*(R**2))
#Average illumination with reflector efficiency
Enuavgr= Enuavg*Reff
print 'The illumination at the'
print 'i) Centre of area = %g lux'%Ec
print 'ii)Periphery of the area '
print 'a) Uniform illumination = %0.3f lux'%Eue
print 'b) Candle power is vertically downward = %0.2f lux '%Eve
print 'iii) Average illumination and Average illumination with reflector efficiency'
print 'a) Uniform intensity = %0.2f lux and %0.2f lux respectively.'%(Euavg,Euavgr)
print 'b) Non Uniform intensity = %0.2f lux and %0.3f lux respectively. '%(Enuavg,Enuavgr)
```

In [13]:

```
from math import atan
#To determine illumination at a point when a mirror is used
CP=500 #Candle power of the lamp
Vd=5 #Vertical distance from the point to the source
Hd=5 #Horizontal distance fron the point to the source
D=sqrt((Vd**2)+(Hd**2)) #Distance between the source and the point
Md=2 #Distance of the source from the mirror
theta=degrees(atan(Hd/Vd)) #Angle made between the source to point and the horizontal
#Lets consider the mirror reflection
R=80/100 #Reflected rays ratio
Vdm=Vd+(2*Md) #Vertical Distance from the point to the source reflection
Hdm=Hd #Horizontal distance from the point to the source reflection
Dm=sqrt((Vdm**2)+(Hdm**2)) #Distance between the source reflection and the point
thetam=degrees(atan(Hdm/Vdm)) #Angle made between the source reflection to point and the horizontal
#Illumination at A due to source
Es=(CP/(D**2))*cos(theta*pi/180)
#Illumination at A due to source refelction
Er=(R*CP/(Dm**2))*cos(thetam*pi/180)
print "Illumination at point A due to O' is %0.1f lux."%Er
#Total Illumination at point A
E=Er+Es
print "The total illumination at point A is %0.2f lux."%E
```

In [14]:

```
#To determine the illumination over a disc
MSCP=300 #Uniform intensity of the lamp or Mean Spherical candle power
Vd=6 #Vertical distance of the lamp from the disc
R=6/2 #Radius of the disc
Reff=60/100 #Reflector efficiency
D=sqrt((Vd**2)+(R**2)) #Distance from the source to the edge of the disc
theta=degrees(atan(R/Vd)) #Angle made between D and Vd
Ecwr=MSCP/(Vd**2) #Illumination at the centre without reflector
Eewr=(MSCP/(D**2))*cos(theta*pi/180) #Illumination at the edge without reflector
#Illumination at the centre is equal to the illumination at the egde with a reflector
Eer=MSCP*Reff*(4*pi/(pi*(R**2)))
Ecr=Eer
w=2*pi*(1-cos(theta*pi/180)) #Solid angle made by the surface
flux=MSCP*w #Total flux produced by the source
Eavg=flux/(pi*(R**2)) #Average illumination
print 'The illumination at: '
print 'a) At the centre: '
print 'i) With reflector : %g lux'%Ecr
print 'ii)Without reflector : %0.2f lux '%Ecwr
print 'b) At the edge of the surface:'
print 'i) With reflector : %g lux'%Eer
print 'ii)Without reflector : %0.2f lux '%Eewr
print 'c) Average illumination over the disc without the reflector : %0.2f lux'%Eavg
```

In [15]:

```
from math import ceil
#To estimate the number rating and disposition of the lamps
E=32 #Illumination required for the working plane
A=80*15 #Area of the work bench
UF=0.5 #Utilization Factor
MF=0.8 #Maintenance Factor
SHR=1.5 #Maximum permissible value of spacing to height ratio
h=4.5 #Required height for the lamps to be hung above the work bench
Leff=14 #Lamp efficacy
Tlumen=E*A #Total lumens required
Llumen=Tlumen/(UF*MF) #Lamp lumens required
l=(A/15) #Length of the workspace
Nc=ceil(l/(1.5*4.5)) #Minimum number of lamps in a single row (Number of columns)
W=200 #Assumed wattage of the bulb
NoL=Llumen/(W*Leff) #Number of bulbs required, Calculated value
Nr=ceil(NoL/12) #Number of rows calculated for the required criteria
N=Nc*Nr #Number of lamps necessary.
Sp=l/Nc #Length wise spacing between the lamps
print '''Assuming 200W bulbs,
in a rectangular workspace of 80m*15m, we require %g bulbs arranged in %g rows
& %g columns having a spacing of %0.2fm between them.'''%(N,Nr,Nc,Sp)
```

In [16]:

```
#To determine the number of lamps required
A=30*20 #Area of the building
B=25 #Brightness in lumen/sq. metre
CoR=0.25 #Co - efficient of reflection
Lwatt=500 #Lamp Wattage
Ll=8000 #Lamp lumens output
E=B/CoR #Illumination required
BF=0.6 #Beam factor
WF=1.2 #Waste light factor
MF=0.75 #Mainteanance factor
Tlumen= E*A*WF/MF #Total lumens required
Llumen=Ll*BF #Lumens provided by one lamp
NoL=Tlumen/Llumen #Number of lamps
print 'The number of lamps required are %g. '%(round(NoL))
```

In [17]:

```
from math import cos, degrees, sqrt, atan, pi
#To determine the illumination on the ground
CP=300 #Uniform luminous intensity of a lamp
Vd=6 #Vertical distance from the ground to the lamp
Hd=6 #Horizontal distance from the ground to the lamp
D=sqrt((Vd**2)+(Hd**2)) #Distance from the lamp to point 6 metres away from the vertical line
theta=degrees(atan(Hd/Vd)) #Angle made between D and Vd.
# Illumination
Ec=CP/(Vd**2) #Vertically beneath the lamp
E6=CP*cos(theta*pi/180)/(D**2) #**=6 metres away from the centre
print 'The illumination on the ground :'
print 'a)Vertically beneath the lamp : %0.2f lux.'%Ec
print 'b)6 metres away from condition a) : %0.2f lux.'%E6
```

In [18]:

```
#Determine the output voltage
Area=(5.08*3.75)*(10**-4) #Area projected by the cathode
Is=12*(10**-6) #Sensitivity
Rl=1.5*(10**6) # Load of operation
#Function to calculate the output voltage for each case
volt = lambda a,b:Area*a*Is*Rl/(b**2)
#Case 1
CP=60 #Lamp intensity
D=1.8 #Vertical distance of the lamp from the cell
V1=volt(CP,D)
#Case 2
CP=6 #Lamp intensity
D=0.5 #Vertical distance of the lamp from the cell
V2=volt(CP,D)
#Case 3
W=100 #Wattage of the lamp
eff=20 #eficacy of the lamp
CP=W*eff/(4*pi) #Lamp intensity
D=2 #Vertical distance of the lamp from the cell
V3=volt(CP,D)
print 'The voltage output of the cells are :'
print 'a) 60 CP lamp at 1.8m : %g V'%V1
print 'b) 6 CP lamp at 0.5m : %0.3f V'%V2
print 'c) A 100W lamp having a efficacy of 20 lumens/watt at 2m : %0.3f V'%V3
```