Python Forum
In need help to put this code in order
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
In need help to put this code in order
#1
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)
Reply


Messages In This Thread
In need help to put this code in order - by lekuru01 - Apr-10-2019, 03:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help!! Order form and receipt code beginner1996 2 3,417 Mar-07-2019, 03:22 PM
Last Post: beginner1996
  Write a code to output in alphabetical order AbdelaliPython 1 4,748 Jan-19-2018, 09:03 PM
Last Post: j.crater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020