Tsup=[]
Te=0
dt=1
t=range(0,3600*2,dt)
r=len(t)
for i in range(0,r):
Tsup.append(20)
....
Tsup.append( (((Pj[i]+Ps-Pc[i]-Pr[i])*(dt))/((m_al*c_al[i])+(m_a*c_a[i])))+Tsup[i] )
if i==r:
Te=(((Pj[i]+Ps-Pc[i]-Pr[i])*(dt))/((m_al*c_al[i])+(m_a*c_a[i])))+Tsup[i]
variacao=[]
T_est=0
for i in range(0,l+1):
variacao.append(abs(Te-Tsup[i]))
if variacao[i] < 0.1 and variacao[i-1] > 0.1:
T_est=Tsup[i]
The "list index out of range" error appears on the line varacao.append (abs (Te-Tsup [i])).