#page no. 315
n1=17.#
n2=16.#
n3=14.#
n4=12.#
n5=11.#
n6=10.#
n7=7.#
n8=5.#
n9=3.#
n10=2.
t1=51.#
t2=47.#
t3=43.#
t4=39.#
t5=34.#
t6=28.#
t7=22.#
t8=15.#
t9=9.#
t10=6.
tncphr=n1+n2+n3+n4+n5+n6+n7+n8+n9+n10#no. of calls/hr.
Y=tncphr/60.#rate of calls/min.
toct=t1+t2+t3+t4+t5+t6+t7+t8+t9+t10#total system occupied time in min.
H=toct/tncphr#avg. holding time/call in min
Aav=Y*H
print '%s %.1f %s' %('average traffic intensity Aav is =',Aav,'Erlangs')
#page no. 316
Y=2.#avg. no of calls/hr/user
Hmin=3.
H=Hmin/60.#avg. duration of a call
Aav=Y*H#average traffic intensity
print '%s %.1f %s' %('average traffic intensity per user Aav is =',Aav,' Erlangs')
#page no. 316
n1=2200.#
n2=1900.#
n3=4000.#
n4=1100.#
n5=1000.#
n6=1200.#
n7=1800.#
n8=2100.#
n9=2000.#
n10=1580.#
n11=1800.#
n12=900.
TBW=30.*10.**6.#total allocated bandwidth
SBW=25000.#simplex channel bandwidth
NS=TBW/SBW#no.of simplex channels
DS=NS/2.#no.of duplex channels
NCPC=10.
NCPCL=12.
TNCC=NCPC*NCPCL##no. of control channels
TNTC=DS-TNCC#no. of traffic channels
NTCPC=TNTC/NCPCL
NUPC=8.
NMCPC=8.
TNCPC=NMCPC*NTCPC#total no. of calls/cell
print '%s %d %s' %('total no. of calls/cell =',TNCPC,'calls/cell')
H=5./100.*3600.
Y=60./3600.
Aav=H*Y#traffic intensity case(b)
print '%s %d %s' %('average offered traffic load Aav for (case(b)) is =',Aav,'Erlangs')
tc=n1+n2+n3+n4+n5+n6+n7+n8+n9+n10+n11+n12
pbms=75./100.
nbms=pbms*tc
print '%s %.3f %s' %('number of mobile subscribers/cluster = ',nbms*10**(-3),'users')
y=tc/NCPCL
Y1=y/3600.
H1=60.
Aav1=Y1*H1#traffic intensity case(c)
print '%s %d %s' %('average offered traffic load Aav for (case(c)) is =',round(Aav1),'Erlangs')
#page no. 319
Y=3000./3600.
H=1.76*60.
Aav=Y*H
print '%s %.2f %s' %('offered traffic load Aav is =',Aav,'Erlangs')
Pb=2./100.
N=100.
Y1=28000./3600.
H1=105.6
Aav1=Y1*H1
N1=820.
print '%s %d %s' %('max. no of channels/cell =',N,'channels/cell')
print '%s %d %s' %('max. no of channels/cell wrt increased lambda =',N1,'channels/cell')
#answer in the textbook is less accurate due to approximations.
#page no.320
N=50.#no. of channels in cell
Pb=0.02#blocking probability
Aav=40.3#offered traffic load
H=100./3600.#average call-holding time
Y=Aav/H##no. of calls handled
print'%s %d %s' %('no. of calls handled =',Y,'calls/hr')
#page no. 320
At=0.1
Pb=0.005
N=10.
Aav=3.96
Nt=Aav/At
N1=100.
Aav1=80.9
Nt1=Aav1/At
print '%s %d %s' %('total no. of mobile users =',Nt,'users')
print '%s %d %s' %('total no. of mobile users for increased N =',Nt1,'users')
#page no.321
N=40.#no. of channels in cell
Pb=0.02#blocking probability
Aav=31.#offered traffic load
H=3./60.#holding time
Z=Aav/(H*3.)#users per cell
NC=20.#no. of cells in the system
nms=NC*Z
print'%s %d %s' %('number of mobile subscribers in the system =',nms,'users')
#page no.322
N1=24.#no. of trunked channels
N=10.#10 channels trunked together
Pb=0.01#blocking probability
Aav=4.46#offered traffic load
N2=5.#2 groups of 5 trunked channels each
Aav1=1.36
Aav2=2.*Aav1
Ex=Aav2/Aav#extent
if Aav>Aav2:
print('10 channels trunked together can support more traffic at a specific GOS(say 0.01) than two 5-channel trunk individually do')
else:
print('10 channels trunked together can support less traffic at a specific GOS(say 0.01) than two 5-channel trunk individually do')
#end
print'%s %d %s' %('\nextent of more traffic supported by N=10 system as compared to two 5-channel trunked systems=',Ex*100,'%')
#page no. 323
Nch=395.
ncpcl=7.
Pb=.01
N=Nch/ncpcl
H=3./60.
Aav=44.2
Y=Aav/H
print '%s %d %s' %('average number of calls/hr. i.e(omnidirectional case) Y is =',Y,'calls per hour')
nspc=3.
Nchps=N/nspc
Aav1=11.2
avnc=Aav1/H
Y1=avnc*nspc
print '%s %d %s' %('average number of calls/hr. ie.(3-sector case) Y is =',Y1+1,'calls per hour')
DTRef=(Y-Y1)/Y
print '%s %.2f %s %d %s' %('decrease in trunking efficiency =',DTRef,'or',(DTRef+0.01)*100,'%')
nspc1=6.
Nchps1=N/nspc1
Aav2=4.1
avnc1=Aav2/H
Y2=avnc1*nspc1
print '%s %d %s' %('average number of calls/hr. ie.(6-sector case) Y is =',Y2+1,'calls per hour')
DTRef1=(Y-Y2)/Y
print '%s %.2f %s %d %s' %('decrement in trunking efficiency =',DTRef1,'or',DTRef1*100,'%')
#page no. 325
Rkm=1.4#radius of the cell
Acell=2.6*Rkm*Rkm#area (hexagonal cell)
K=4.#no.of cells/cluster
ntotal=60.
ncell=ntotal/K
avgtlpu=0.029
Aav=9.
Pb=0.05
tnu=Aav/avgtlpu#total no. of users supported in a cell
NupA=tnu/Acell
print '%s %d %s' %('number of users per kmsqr area =',NupA,'users/(km^2) (approx.)')
#page no.327
Bt=12.5*10.**6.
BtMHz=12.5
Bc=30.*10.**3.
Bg=10.**3.
Nt=(Bt-2*Bg)/Bc#total number of channels/cluster
Nc=21.
Nd=Nt-Nc#number of user data transmission/cluster
K=7.#frequency reuse factor
Ndpcell=Nd/K
Acell=6
n1=Ndpcell/(BtMHz*Acell)
print '%s %d %s' %('total number of channels/cluster (Nt) =',Nt,'channels')
print '%s %d %s' %('number of user data transmission/cluster (Nd) =',Nd,'data channels per cluster')
print '%s %d %s' %('total number of transmission/cell (Nd/cell) if K= 7 is =',Ndpcell,'data channels per cell')
print '%s %.3f %s' %('overall spectral efficiency n1 in channels/MHz/kmsqr for cell area 6kmsqr is =',n1,'channels/MHz/Km^2')
#page no.327
Acell=6.
Acellular=3024.
Ncells=Acellular/Acell#number of cells in the system
Bt=12.5*10.**6.
BtMHz=12.5
Bc=30.*10.**3.
Bg=10.*10.**3.
Nc=21.
Nd=((Bt-2.*Bg)/Bc)-Nc#no. of data channels/cluster
K=7.
Ndpcell=Nd/K
H=1./20
ntr=0.95
Ncallphr=1./H
Ncallphrpcell=Ndpcell*ntr*Ncallphr#number of calls per hour per cell
Ncallpuserphr=1.5
Nusers=Ncallphrpcell/Ncallpuserphr
n1=Ndpcell/(BtMHz*Acell)
n=ntr*n1
print '%s %d %s' %('number of cells in the system =',Ncells,'cells')
print '%s %d %s' %('number of calls per hour per cell =',Ncallphrpcell,'calls/hour/cell')
print '%s %d %s' %('average number of users per hour per cell =',Nusers,'users/hour/cell')
print '%s %.3f %s' %('system spectral efficiency in the units of Erlangs/MHz/kmsqr =',n,'Erlangs/MHz/km^2')
#answers in texbook are wrong due to approximations.
#page no.330
Bt=25.*10.**6.#system bandwidth
Bc=30.*10.**3.#channel bandwidth
Bg=20.*10.**3.#guard spacing
Nu=((Bt-2.*Bg)/Bc)
Tf=40.*10.**-3.#frame time
Tp=0.*10.**-3.#preamble time
Tt=0.*10.**-3.#trailer time
Ld=260.
Ls=324.
ntframe=((Tf-Tp-Tt)/Tf)*(Ld/Ls)
ntsys=ntframe*(Nu*Bc*(1./Bt))
Rs=7.95*10.**3.
ntmod=Rs/Bc
K=7.
nt=ntsys*ntmod/K
print '%s %d %s' %('number of simultaneous users that can be accomodated in each cell =',Nu,'users/cluster')
print '%s %.1f' %('spectral efficiency per frame of a TDMA system =',ntframe)
print '%s %.1f' %('spectral efficiency of the TDMA system =',ntsys)
print '%s %.3f %s' %('overall spectral efficiency in bps/Hz/cell =',nt*10,'bps/Hz/cell')
#page no. 332
import math
Bc1=30.*10.**3.#
cimin1=18.
Bc2=25.*10.**3.#
cimin2=14.
Bc3=12.5*10.**3.#
cimin3=12.
Bc4=6.25*10.**3.#
cimin4=9.
Y=4.#path propogation constant
BcI=6.25*10.**3.
cieq1=cimin1+20.*math.log10(Bc1/BcI)
cieq2=cimin2+20.*math.log10(Bc2/BcI)
cieq3=cimin3+20.*math.log10(Bc3/BcI)
cieq4=cimin4+20.*math.log10(Bc4/BcI)
print'%s %.2f %s' %('(C/I)eq in dB for system I =',cieq1,'dB')
print'%s %d %s' %('(C/I)eq in dB for system II =',cieq2,'dB')
print'%s %d %s' %('(C/I)eq in dB for system III =',cieq3,'dB')
print'%s %d %s' %('(C/I)eq in dB for system IV =',cieq4,'dB')
if cieq1<cieq2:
if cieq1<cieq3:
if cieq1<cieq4:
print('System I offers the best capacity')
#end
#end
elif cieq2<cieq3:
if cieq2<cieq4:
if cieq2<cieq1:
print('System II offers the best capacity')
#end
#end
elif cieq3<cieq4:
if cieq3<cieq1:
if cieq3<cieq2:
print('System II offers the best capacity')
#end
#end
elif cieq4<cieq3 :
if cieq4<cieq1:
if cieq4<cieq2:
print('System IV offers the best capacity')
#end
#end
#end
#page no. 333
Bt=12.5*10.**6.
Bc=200.*10.**3.
Ns=8.
N=Bt/Bc
Ns=8.
Nu=N*Ns
K=4.#frequency reuse factor
SysC=Nu/K#system capacity
M=(Bt/Bc)*Ns*(1./K)#system capacity using alternate method
print '%s %d %s' %('System capacity per cell is =',SysC,'users/cell')
print '%s %d %s' %('System capacity per cell,M,by using alternate method is =',M,'users/cell')