Skip to content

Commit

Permalink
Merge pull request #28 from nzweibaum/master
Browse files Browse the repository at this point in the history
add quadratic term to breakdown and add new contrib folder
  • Loading branch information
mikofski committed Sep 24, 2015
2 parents 971d3e7 + a3ef6c9 commit 333b1bb
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 8 deletions.
56 changes: 56 additions & 0 deletions pvmismatch/contrib/tetris_reference_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""
This script uses default Tetris module configuration and cell parameters to
calculate performance and generate IV and PV curves.
"""

from pvmismatch import *
import numpy as np
from matplotlib import pyplot as plt

if __name__ == "__main__":

# Model parameters
NPTS=5000 # Because of the high cell breakdown voltage, NPTS must be >1000

# Cell parameters
RS = 0.0181123 # [ohm] series resistance
RSH = 58.082 # [ohm] shunt resistance
ISAT1_T0 = 2.9885E-11 # [A] diode one saturation current
ISAT2 = 1.6622E-07 # [A] diode two saturation current
ISC0_T0 = 1.437 # [A] reference short circuit current
ARBD = 9.0E-4 # reverse breakdown coefficient 1
BRBD = -0.056 # reverse breakdown coefficient 2
VRBD_ = -25.1 # [V] reverse breakdown voltage
NRBD = 4.0 # reverse breakdown exponent
EG = 1.166 # [eV] band gap of cSi
ALPHA_ISC = 0.0003551 # [1/K] short circuit current temperature coefficient
TCELL = 298.15 # [K] cell temperature
CELLAREA = np.float64(38.064) # [cm^2] cell area used for efficiency calculation

# Module parameters
VBYPASS = np.float64(-0.885) # [V] trigger voltage of bypass diode
NUMBERCOLS = 6 # number of hypercells per module

# System parameters
NUMBERMODS = 1 # number of modules per string
NUMBERSTRS = 1 # number of strings in parallel

# System definition
tetrisCell = pvcell.PVcell(Rs=RS, Rsh=RSH, Isat1_T0=ISAT1_T0, Isat2=ISAT2,
Isc0_T0=ISC0_T0, aRBD=ARBD, VRBD=VRBD_, bRBD=BRBD,
nRBD=NRBD, Eg=EG, alpha_Isc=ALPHA_ISC,
Tcell=TCELL)
tetrisModule = pvmodule.PVmodule(cell_pos=pvmodule.PCT492, pvcells=tetrisCell,
Vbypass=VBYPASS, cellArea=CELLAREA) # Tetris module with no cross-tiling
tetrisSystem = pvsystem.PVsystem(pvconst=pvconstants.PVconstants(npts=NPTS),
pvmods=tetrisModule, numberStrs=NUMBERSTRS, numberMods=NUMBERMODS)

print 'Imp = ' + str(tetrisSystem.Imp) + ' A'
print 'Vmp = ' + str(tetrisSystem.Vmp) + ' V'
print 'Pmp = ' + str(tetrisSystem.Pmp) + ' W'
print 'Isc = ' + str(tetrisSystem.Isc) + ' A'
print 'Voc = ' + str(tetrisSystem.Voc) + ' V'
print 'FF = ' + str(100*tetrisSystem.FF) + ' %'
print 'Efficiency = ' + str(100*tetrisSystem.eff) + ' %'
figure = tetrisSystem.plotSys()
plt.show()
17 changes: 11 additions & 6 deletions pvmismatch/pvmismatch_lib/pvcell.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
ISAT2 = 1.117455042372326E-6 # [A] diode two saturation current
ISC0_T0 = 6.3056 # [A] reference short circuit current
TCELL = 298.15 # [K] cell temperature
ARBD = 1.036748445065697E-4 # reverse breakdown coefficient
ARBD = 1.036748445065697E-4 # reverse breakdown coefficient 1
BRBD = 0. # reverse breakdown coefficient 2
VRBD_ = -5.527260068445654 # [V] reverse breakdown voltage
NRBD = 3.284628553041425 # reverse breakdown exponent
EG = 1.1 # [eV] band gap of cSi
Expand All @@ -33,7 +34,8 @@ class PVcell(object):
:param Isat1_T0: first saturation diode current at ref temp [A]
:param Isat2: second saturation diode current [A]
:param Isc0_T0: short circuit current at ref temp [A]
:param aRBD: reverse breakdown coefficient
:param aRBD: reverse breakdown coefficient 1
:param bRBD: reverse breakdown coefficient 2
:param VRBD: reverse breakdown voltage [V]
:param nRBD: reverse breakdown exponent
:param Eg: band gap [eV]
Expand All @@ -44,7 +46,7 @@ class PVcell(object):
:type pvconst: :class:`~pvmismatch.pvmismatch_lib.pvconstants.PVconstants`
"""
def __init__(self, Rs=RS, Rsh=RSH, Isat1_T0=ISAT1_T0, Isat2=ISAT2,
Isc0_T0=ISC0_T0, aRBD=ARBD, VRBD=VRBD_,
Isc0_T0=ISC0_T0, aRBD=ARBD, bRBD=BRBD, VRBD=VRBD_,
nRBD=NRBD, Eg=EG, alpha_Isc=ALPHA_ISC,
Tcell=TCELL, Ee=1., pvconst=PVconstants()):
# user inputs
Expand All @@ -53,7 +55,8 @@ def __init__(self, Rs=RS, Rsh=RSH, Isat1_T0=ISAT1_T0, Isat2=ISAT2,
self.Isat1_T0 = Isat1_T0 #: [A] diode one sat. current at T0
self.Isat2 = Isat2 #: [A] diode two saturation current
self.Isc0_T0 = Isc0_T0 #: [A] short circuit current at T0
self.aRBD = aRBD #: reverse breakdown coefficient
self.aRBD = aRBD #: reverse breakdown coefficient 1
self.bRBD = bRBD #: reverse breakdown coefficient 2
self.VRBD = VRBD #: [V] reverse breakdown voltage
self.nRBD = nRBD #: reverse breakdown exponent
self.Eg = Eg #: [eV] band gap of cSi
Expand Down Expand Up @@ -166,8 +169,10 @@ def calcCell(self):
fRBD = 1. - Vdiode / self.VRBD
# use epsilon = 2.2204460492503131e-16 to avoid "divide by zero"
fRBD[fRBD == 0] = np.finfo(np.float64).eps
fRBD = self.aRBD * fRBD ** (-self.nRBD)
Icell = Igen - Idiode1 - Idiode2 - Ishunt * (1. + fRBD)
Vdiode_norm = Vdiode / self.Rsh / self.Isc0_T0
fRBD = self.Isc0_T0 * fRBD ** (-self.nRBD)
IRBD = (self.aRBD * Vdiode_norm + self.bRBD * Vdiode_norm ** 2) * fRBD
Icell = Igen - Idiode1 - Idiode2 - Ishunt - IRBD
Vcell = Vdiode - Icell * self.Rs
Pcell = Icell * Vcell
return Icell, Vcell, Pcell
Expand Down
11 changes: 9 additions & 2 deletions pvmismatch/tests/test_pvcell.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,18 @@ def test_calc_series():
i, v = pvconst.calcSeries(icells, vcells, isc.mean(), i_at_vrbd.max())
iv = np.loadtxt(os.path.join(BASE_DIR, 'calc_series_test_iv.dat'))
# noinspection PyTypeChecker
ok_(np.all(i == iv[0]))
ok_(np.allclose(i, iv[0]))
# noinspection PyTypeChecker
ok_(np.all(v == iv[1]))
ok_(np.allclose(v, iv[1]))
return i, v


def test_pvcell_calc_rbd():
pvc1 = PVcell(bRBD=0.)
ok_(isinstance(pvc1, PVcell))
pvc2 = PVcell(bRBD=-0.056)
ok_(isinstance(pvc2, PVcell))


if __name__ == "__main__":
test_calc_series()

0 comments on commit 333b1bb

Please sign in to comment.