G = [100,200,300]
I_cel = [[0.1, 0.2,0.3,0.4],[1,2,3,4],[11, 22,33,44]]
for i in list(range(len(G))):
V_cel.append([])
Iph_g = Iph_cal[i]
Icel_g = I_cel[i]
for j in Icel_g:
a = math.log((Iph_g - j - I_sat)/I_sat,10) - j*R_se
V_cel[i].append(a)
print(V_cel[0])
**输出为:ValueError: math domain error
输出中的箭头指向a = math.log((Iph_g - j - I_sat)/I_sat,10) - j*R_se
。看起来这是一些数学错误的根源。一些帮助。当我设置a = i*j
(检查整个程序)并成功执行代码时,其他的一切都是循环
我想你漏掉了一个逗号
您得到一个数学域错误,因为在
math.log(j,10)
上求值时j
等于0
。 也许你想用数组值而不是它的索引做些什么而且,我不知道
G
的值是什么。它们是否用于设置V_cel
的长度相关问题 更多 >
编程相关推荐