MissAuditore 0 Newbie Poster

Hi guys,

I'm pretty new to Python and having some issues. I have some data points in first and second column. First column is elapsed time. I am trying to implement a differential interval condition which goes as following:

ln(t_i+j)-ln(t_i) >= exp(0.2)
ln(t_i)-ln(t_i-k) >= exp(0.2)

My code so far:P So what I want it to do, as soon as the above condition is not satisfied that it updates for k value or j value.

ki = 0
ji = 0

for i in range(2,10):
    k = 1-ki
    j = 1+ji
    ti_mk = t_elapsed[i-k]
    ti = t_elapsed[i]
    ti_pj = t_elapsed[i+j]
    print 't(i-k) = ' +str(t_elapsed[i-k])
    print 'ti = '+str(t_elapsed[i])
    print 't(i+j) = ' +str(t_elapsed[i+j])
    Ai = np.divide(ti, ti_mk)
    Aii = np.divide(ti_pj, ti)
    if (Ai >= exp(0.2) and Aii >= exp(0.2)):
        print 'ti/t(i-k) = '+str(Ai)
        print 't(i+j)/ti = '+str(Aii)
        print 'k = ' +str(k)
        print 'j = ' +str(j)
    elif (Ai < exp(0.2)):
        ki= k - 1
        print 'ki= ' +str(ki)
    elif (Aii < exp(0.2)):
        ji= j + 1
        print 'ji= ' +str(ji)