My whole program is right (I've checked at various stages). The highlighted line in this module, however, returns the error:
TypeError: can only concatenate tuple (not "int") to tuple
I don't know why this is happening. funcPsat
returns float value. I would appreciate any useful advice!
import scipy.optimize.newton as newton
def Psat(self, T):
pop= self.getPborder(T)
boolean=int(pop[0])
P1=pop[1]
P2=pop[2]
if boolean:
Pmin = min([P1, P2])
Pmax = max([P1, P2])
if Pmin > 0.0:
Pguess = 0.5*(Pmin+Pmax)
else:
Pguess=0.5*Pmax
solution = newton(self.funcPsat, Pguess, args=(T)) #error in this line
return solution
else:
return None