Apr-10-2019, 03:18 AM
write a python functionn GOS_erlang(chanels,capacity) that computes the grade of service for a give number of (interger) channels and (floating point) capacity using the Erlang B formula. write a second function E_erlang(GOS,chanels) that computes the capacity in erlangs for a give grade of service and number of chanels. this function should use GOS_erlang and perform a binary search for the capacity. (e.g. start with a=0E and b=channels as guesses for the umber of erlangs, compute the average c of a and b. computer the gos for a,b,ad c and then replace either a with c or b with c depending on whether the desired GOS is greater or less than that computed for c. repeat the process and terminate when abs(a-b)<.001.. write a pytho script which uses E-erlag to compute a table for 7,15,22,30,37,45,52,60 channels and a GOS of 0.01 and GOS0 of 0.05
def Gos_Erlang(A,C): term=1 sum=1 fact=1 num=1 for k in range (1,C+1): fact=fact*k num=A term=num/fact sum +=term Gos= term/sum def (gos, C): a=0 b=c d=(a+b)/2 gos d= Gos_Erlang(a)