SunPower / PVMismatch

An explicit Python PV system IV & PV curve trace calculator which can also calculate mismatch.
http://sunpower.github.io/PVMismatch/
BSD 3-Clause "New" or "Revised" License
79 stars 30 forks source link

should it be possible to create standard module using crossties #23

Open mikofski opened 9 years ago

mikofski commented 9 years ago

If you make a cell position pattern that mimics a standard serpentine module the simulation fails.

>>> std72 = [
 [[{'circuit': 'series', 'idx': 0},
   {'circuit': 'series', 'idx': 1},
   {'circuit': 'series', 'idx': 2},
   {'circuit': 'series', 'idx': 3},
   {'circuit': 'series', 'idx': 4},
   {'circuit': 'series', 'idx': 5},
   {'circuit': 'series', 'idx': 6},
   {'circuit': 'series', 'idx': 7},
   {'circuit': 'series', 'idx': 8},
   {'circuit': 'series', 'idx': 9},
   {'circuit': 'series', 'idx': 10},
   {'circuit': 'parallel', 'idx': 11}],
  [{'circuit': 'parallel', 'idx': 23},
   {'circuit': 'series', 'idx': 22},
   {'circuit': 'series', 'idx': 21},
   {'circuit': 'series', 'idx': 20},
   {'circuit': 'series', 'idx': 19},
   {'circuit': 'series', 'idx': 18},
   {'circuit': 'series', 'idx': 17},
   {'circuit': 'series', 'idx': 16},
   {'circuit': 'series', 'idx': 15},
   {'circuit': 'series', 'idx': 14},
   {'circuit': 'series', 'idx': 13},
   {'circuit': 'series', 'idx': 12}]],
 [[{'circuit': 'series', 'idx': 24},
   {'circuit': 'series', 'idx': 25},
   {'circuit': 'series', 'idx': 26},
   {'circuit': 'series', 'idx': 27},
   {'circuit': 'series', 'idx': 28},
   {'circuit': 'series', 'idx': 29},
   {'circuit': 'series', 'idx': 30},
   {'circuit': 'series', 'idx': 31},
   {'circuit': 'series', 'idx': 32},
   {'circuit': 'series', 'idx': 33},
   {'circuit': 'series', 'idx': 34},
   {'circuit': 'parallel', 'idx': 35}],
  [{'circuit': 'parallel', 'idx': 47},
   {'circuit': 'series', 'idx': 46},
   {'circuit': 'series', 'idx': 45},
   {'circuit': 'series', 'idx': 44},
   {'circuit': 'series', 'idx': 43},
   {'circuit': 'series', 'idx': 42},
   {'circuit': 'series', 'idx': 41},
   {'circuit': 'series', 'idx': 40},
   {'circuit': 'series', 'idx': 39},
   {'circuit': 'series', 'idx': 38},
   {'circuit': 'series', 'idx': 37},
   {'circuit': 'series', 'idx': 36}]],
 [[{'circuit': 'series', 'idx': 48},
   {'circuit': 'series', 'idx': 49},
   {'circuit': 'series', 'idx': 50},
   {'circuit': 'series', 'idx': 51},
   {'circuit': 'series', 'idx': 52},
   {'circuit': 'series', 'idx': 53},
   {'circuit': 'series', 'idx': 54},
   {'circuit': 'series', 'idx': 55},
   {'circuit': 'series', 'idx': 56},
   {'circuit': 'series', 'idx': 57},
   {'circuit': 'series', 'idx': 58},
   {'circuit': 'parallel', 'idx': 59}],
  [{'circuit': 'parallel', 'idx': 71},
   {'circuit': 'series', 'idx': 70},
   {'circuit': 'series', 'idx': 69},
   {'circuit': 'series', 'idx': 68},
   {'circuit': 'series', 'idx': 67},
   {'circuit': 'series', 'idx': 66},
   {'circuit': 'series', 'idx': 65},
   {'circuit': 'series', 'idx': 64},
   {'circuit': 'series', 'idx': 63},
   {'circuit': 'series', 'idx': 62},
   {'circuit': 'series', 'idx': 61},
   {'circuit': 'series', 'idx': 60}]]
]
>>> pvsys = pvsystem.PVsystem(numberMods=8, numberStrs=2, pvmods=pvmodule.PVmodule(std72))
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-29-5843f6d31c33> in <module>()
----> 1 pvsys2 = pvsystem.PVsystem(numberMods=8, numberStrs=2, pvmods=pvmodule.PVmodule(std72a))

C:\Users\mmikofski\Documents\Projects\PVMismatch\pvmismatch\pvmismatch_lib\pvmodule.pyc in __init__(self, cell_pos, pvcells, pvconst, Vbypass, cellArea)
    131         self.subStrCells = [len(_) for _ in self.cell_pos]  #: cells per substr
    132         # initialize members so PyLint doesn't get upset
--> 133         self.Imod, self.Vmod, self.Pmod, self.Vsubstr = self.calcMod()
    134
    135     # TODO: use __getattr__ to check for updates to pvcells

C:\Users\mmikofski\Documents\Projects\PVMismatch\pvmismatch\pvmismatch_lib\pvmodule.pyc in calcMod(self)
    257                             # TODO: use pvmismatch exceptions
    258                             raise Exception(
--> 259                                 "First row and last rows must be crosstied."
    260                             )
    261                         elif len(idxs) > 1:

Exception: First row and last rows must be crosstied.