私のプログラム全体は正しいです(さまざまな段階でチェックしました)。ただし、このモジュールで強調表示されている行は、次のエラーを返します。
TypeError: can only concatenate tuple (not "int") to tuple
なぜこれが起こっているのかわかりません。funcPsat
float 値を返します。有益なアドバイスをいただければ幸いです。
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