tidyup
authorAndrew Tridgell <tridge@samba.org>
Tue, 31 Aug 2010 07:45:27 +0000 (17:45 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 31 Aug 2010 07:45:27 +0000 (17:45 +1000)
pv_model

index 77ae96ecff8bfc1ec25ca3e2c94cd16194d724bb..ede96b9e588b1f9337c2fa545885c886c176d1d8 100755 (executable)
--- a/pv_model
+++ b/pv_model
@@ -177,9 +177,9 @@ class cell:
     '''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()
@@ -211,6 +211,7 @@ class cell:
         I = self.I(V)
         return I * V
 
+
 class subpanel:
     '''model a subpanel'''
     def __init__(self):
@@ -425,13 +426,14 @@ class pvarray:
         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):
@@ -445,6 +447,7 @@ def plotit(fn, low, high, label=''):
     pylab.plot(xrange, y, label=label)
     pylab.draw()
 
+
 def shaded_1mpp(a):
     '''plot shading effects with 1 MPPT'''
     maxv = round(inverter_range[1], 200)
@@ -787,7 +790,7 @@ if __name__ == "__main__":
 
     (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: