'''model a cell'''
def __init__(self):
self.a = [ 1, 1 ]
- self.cell_scale = opts.cells_per_subpanel * opts.num_subpanels
- self.Vmp = cell_Vmp/self.cell_scale
- self.Voc = cell_Voc/self.cell_scale
+ cell_scale = opts.cells_per_subpanel * opts.num_subpanels
+ self.Vmp = cell_Vmp/cell_scale
+ self.Voc = cell_Voc/cell_scale
self.Isc = cell_Isc
self.Imp = cell_Imp
self._recalc()
I = self.I(V)
return I * V
+
class subpanel:
'''model a subpanel'''
def __init__(self):
def Perr(x):
p = self.P(x)
if p <= 0:
- return 1e50
+ return 1e100
return 1.0/p
return find_best2(Perr, 0, inverter_range[1])
def MPPP(self):
return self.P(self.MPPV())
+
def plotit(fn, low, high, label=''):
'''convenience plotting function'''
def array_func(fn, a):
pylab.plot(xrange, y, label=label)
pylab.draw()
+
def shaded_1mpp(a):
'''plot shading effects with 1 MPPT'''
maxv = round(inverter_range[1], 200)
(opts, args) = parser.parse_args()
if len(args) != 1:
- print("Functions are:")
+ print("Available functions are:")
k = functions.keys()
k.sort()
for f in k: