Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.2 kB
2
Indexable
Never
def Tempc(precisao,M):
    A=0
    aa=200
    c = 0
    b= 0
    step = 100
    while A==0:
            if all(k>=0  for k in V(aa,M))==True:
                if all(p>=precisao for p in V(aa,M))== True:
                    b = aa
                    aa = (c+aa)/2
                    print('vamos descer')
                else:  
                    for i in range(60,299):
                        if 0<V(aa,M)[i]<precisao:
                            print('achei')
                            A= V(aa,M)[i]
                            print('V = %f'% A)
                            print('Valor de phi = %f' % dd[i+1])
                            print('Tc = %f' %aa)
                            print(i)
                            ksi = (dd[i+1])/aa
                            print('Valor de ksi é = % f ' %ksi)
                            return ksi
                            break
                        if precisao<V(aa,M)[i]:
                            aa = aa

            else:
                c = aa
                print('Subir')
                aa = (b+aa)/2
                if aa<c:
                    aa = aa+step
                else:
                    aa = aa