I am trying to find out the maximum value of a function (here it is T(n)) through this code:
for i in range(2, imax-1):
Q=q(i-1)-q(i)
Tn=T(i)+(Dt/(rho*cp*0.1))*Q
y=max(Tn)
But I am getting an error "float' object is not iterable". Any suggestion on this would be helpful to me.
Please note that, "q" and "T(i)" have been defined as functions of "i", and all the other terms are constants.