전체 프로그램이 옳습니다 (여러 단계에서 확인했습니다). 그러나이 모듈에서 강조 표시된 행은 다음과 같은 오류를 반환합니다.scipy.optimize.newton이 제공하는 TypeError : 터플 ("int"가 아님)을 튜플에 연결할 수 있습니다.
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
당신이 전체 오류 추적을 제공 할 수 있을까요? 'T' 란 무엇입니까? – jonrsharpe