我试图弄清楚如何在另一个函数中调用该函数,但是我无法在“ t_calc = calc_temp(d_curr,volt,tbase)”行上解决此无效的语法错误。您不能在另一个函数中调用一个函数吗?
def calc_temp(current,voltage,tbase):
power_diss = current * voltage
thermal_resistance = THICK/(K*AREA)
temp = tbase + (power_diss * thermal_resistance)
return(temp)
def diode_i_terr(volt,tguess,tbase):
d_curr = I0(np.exp((Q*volt)/(IDE*KB*tguess))
t_calc = calc_temp(d_curr,volt,tbase)
t_err = t_calc - tguess
return(d_curr, t_err)
t_calc = calc_temp(d_curr,volt,tbase)
^
SyntaxError: invalid syntax