A part of my Python program is:
dt=1
maxt=3600*2
t=range(0,maxt,dt)
r=len(t)
Tsup_i=20
for i in range(1,r):
Tsup[0]=Tsup_i
P[i]=((I_dc)**2) * R20 * (1 + a * (Tsup[i] - (20+K)))
And the error is appearing
"IndexError: list assignment index out of range"
In the line corresponding to Tsup[0]=Tsup_i
and I do not know how to solve ...
The Tsup
I put before the cycle for
as an empty list Tsup=[]
, and what I want is that the 1st element of the list is equal to Tsup_i
, that gives to determine P[i]
e later in the code you can determine Tsup[i+1]
using P[i]
.