@@ -279,16 +279,16 @@ def physicaliam(self, aoi):
279279
280280 return physicaliam (aoi , ** kwargs )
281281
282- def calcparams_desoto (self , poa_global , temp_cell , ** kwargs ):
282+ def calcparams_desoto (self , effective_irradiance , temp_cell , ** kwargs ):
283283 """
284284 Use the :py:func:`calcparams_desoto` function, the input
285285 parameters and ``self.module_parameters`` to calculate the
286286 module currents and resistances.
287287
288288 Parameters
289289 ----------
290- poa_global : float or Series
291- The irradiance (in W/m^2) absorbed by the module .
290+ effective_irradiance : numeric
291+ The irradiance (W/m2) that is converted to photocurrent .
292292
293293 temp_cell : float or Series
294294 The average cell temperature of cells within a module in C.
@@ -300,11 +300,12 @@ def calcparams_desoto(self, poa_global, temp_cell, **kwargs):
300300 -------
301301 See pvsystem.calcparams_desoto for details
302302 """
303- return calcparams_desoto (poa_global , temp_cell ,
304- self .module_parameters ['alpha_sc' ],
305- self .module_parameters ,
306- self .module_parameters ['EgRef' ],
307- self .module_parameters ['dEgdT' ], ** kwargs )
303+
304+ kwargs = _build_kwargs (['a_ref' , 'I_L_ref' , 'I_o_ref' , 'R_sh_ref' ,
305+ 'R_s' , 'alpha_sc' , 'EgRef' , 'dEgdT' ],
306+ self .module_parameters )
307+
308+ return calcparams_desoto (effective_irradiance , temp_cell , ** kwargs )
308309
309310 def sapm (self , effective_irradiance , temp_cell , ** kwargs ):
310311 """
@@ -944,75 +945,60 @@ def physicaliam(aoi, n=1.526, K=4., L=0.002):
944945 return iam
945946
946947
947- def calcparams_desoto (poa_global , temp_cell , alpha_isc , module_parameters ,
948- EgRef , dEgdT , M = 1 , irrad_ref = 1000 , temp_ref = 25 ):
948+ def calcparams_desoto (effective_irradiance , temp_cell ,
949+ alpha_sc , a_ref , I_L_ref , I_o_ref , R_sh_ref , R_s ,
950+ EgRef = 1.121 , dEgdT = - 0.0002677 ,
951+ irrad_ref = 1000 , temp_ref = 25 ):
949952 '''
950- Applies the temperature and irradiance corrections to inputs for
951- singlediode.
952-
953- Applies the temperature and irradiance corrections to the IL, I0,
954- Rs, Rsh, and a parameters at reference conditions (IL_ref, I0_ref,
955- etc.) according to the De Soto et. al description given in [1]. The
956- results of this correction procedure may be used in a single diode
957- model to determine IV curves at irradiance = S, cell temperature =
958- Tcell.
953+ Calculates five parameter values for the single diode equation at
954+ effective irradiance and cell temperature using the De Soto et al.
955+ model described in [1]. The five values returned by calcparams_desoto
956+ can be used by singlediode to calculate an IV curve.
959957
960958 Parameters
961959 ----------
962- poa_global : numeric
963- The irradiance (in W/m^2) absorbed by the module .
960+ effective_irradiance : numeric
961+ The irradiance (W/m2) that is converted to photocurrent .
964962
965963 temp_cell : numeric
966964 The average cell temperature of cells within a module in C.
967965
968- alpha_isc : float
966+ alpha_sc : float
969967 The short-circuit current temperature coefficient of the
970- module in units of 1/C.
971-
972- module_parameters : dict
973- Parameters describing PV module performance at reference
974- conditions according to DeSoto's paper. Parameters may be
975- generated or found by lookup. For ease of use,
976- retrieve_sam can automatically generate a dict based on the
977- most recent SAM CEC module
978- database. The module_parameters dict must contain the
979- following 5 fields:
980-
981- * a_ref - modified diode ideality factor parameter at
982- reference conditions (units of eV), a_ref can be calculated
983- from the usual diode ideality factor (n),
984- number of cells in series (Ns),
985- and cell temperature (Tcell) per equation (2) in [1].
986- * I_L_ref - Light-generated current (or photocurrent)
987- in amperes at reference conditions. This value is referred to
988- as Iph in some literature.
989- * I_o_ref - diode reverse saturation current in amperes,
990- under reference conditions.
991- * R_sh_ref - shunt resistance under reference conditions (ohms).
992- * R_s - series resistance under reference conditions (ohms).
968+ module in units of A/C.
969+
970+ a_ref : float
971+ The product of the usual diode ideality factor (n, unitless),
972+ number of cells in series (Ns), and cell thermal voltage at reference
973+ conditions, in units of V.
974+
975+ I_L_ref : float
976+ The light-generated current (or photocurrent) at reference conditions,
977+ in amperes.
978+
979+ I_o_ref : float
980+ The dark or diode reverse saturation current at reference conditions,
981+ in amperes.
982+
983+ R_sh_ref : float
984+ The shunt resistance at reference conditions, in ohms.
985+
986+ R_s : float
987+ The series resistance at reference conditions, in ohms.
993988
994989 EgRef : float
995- The energy bandgap at reference temperature (in eV).
996- 1.121 eV for silicon. EgRef must be >0.
990+ The energy bandgap at reference temperature in units of eV.
991+ 1.121 eV for crystalline silicon. EgRef must be >0. For parameters
992+ from the SAM CEC module database, EgRef=1.121 is implicit for all
993+ cell types in the parameter estimation algorithm used by NREL.
997994
998995 dEgdT : float
999- The temperature dependence of the energy bandgap at SRC (in
1000- 1/C). May be either a scalar value (e.g. -0.0002677 as in [1])
1001- or a DataFrame of dEgdT values corresponding to each input
1002- condition (this may be useful if dEgdT is a function of
1003- temperature).
1004-
1005- M : numeric (optional, default=1)
1006- An optional airmass modifier, if omitted, M is given a value of
1007- 1, which assumes absolute (pressure corrected) airmass = 1.5. In
1008- this code, M is equal to M/Mref as described in [1] (i.e. Mref
1009- is assumed to be 1). Source [1] suggests that an appropriate
1010- value for M as a function absolute airmass (AMa) may be:
1011-
1012- >>> M = np.polyval([-0.000126, 0.002816, -0.024459, 0.086257, 0.918093],
1013- ... AMa) # doctest: +SKIP
1014-
1015- M may be a Series.
996+ The temperature dependence of the energy bandgap at reference
997+ conditions in units of 1/K. May be either a scalar value
998+ (e.g. -0.0002677 as in [1]) or a DataFrame (this may be useful if
999+ dEgdT is a modeled as a function of temperature). For parameters from
1000+ the SAM CEC module database, dEgdT=-0.0002677 is implicit for all cell
1001+ types in the parameter estimation algorithm used by NREL.
10161002
10171003 irrad_ref : float (optional, default=1000)
10181004 Reference irradiance in W/m^2.
@@ -1090,7 +1076,7 @@ def calcparams_desoto(poa_global, temp_cell, alpha_isc, module_parameters,
10901076 and modifying the reference parameters (for irradiance, temperature,
10911077 and airmass) per DeSoto's equations.
10921078
1093- Silicon (Si):
1079+ Crystalline Silicon (Si):
10941080 * EgRef = 1.121
10951081 * dEgdT = -0.0002677
10961082
@@ -1134,26 +1120,54 @@ def calcparams_desoto(poa_global, temp_cell, alpha_isc, module_parameters,
11341120 Source: [4]
11351121 '''
11361122
1137- M = np .maximum (M , 0 )
1138- a_ref = module_parameters ['a_ref' ]
1139- IL_ref = module_parameters ['I_L_ref' ]
1140- I0_ref = module_parameters ['I_o_ref' ]
1141- Rsh_ref = module_parameters ['R_sh_ref' ]
1142- Rs_ref = module_parameters ['R_s' ]
1143-
1123+ # test for use of function pre-v0.6.0 API change
1124+ if isinstance (a_ref , dict ) or \
1125+ (isinstance (a_ref , pd .Series ) and ('a_ref' in a_ref .keys ())):
1126+ import warnings
1127+ warnings .warn ('module_parameters detected as fourth positional'
1128+ + ' argument of calcparams_desoto. calcparams_desoto'
1129+ + ' will require one argument for each module model'
1130+ + ' parameter in v0.7.0 and later' , DeprecationWarning )
1131+ try :
1132+ module_parameters = a_ref
1133+ a_ref = module_parameters ['a_ref' ]
1134+ I_L_ref = module_parameters ['I_L_ref' ]
1135+ I_o_ref = module_parameters ['I_o_ref' ]
1136+ R_sh_ref = module_parameters ['R_sh_ref' ]
1137+ R_s = module_parameters ['R_s' ]
1138+ except Exception as e :
1139+ raise e ('Module parameters could not be extracted from fourth'
1140+ + ' positional argument of calcparams_desoto. Check that'
1141+ + ' parameters are from the CEC database and/or update'
1142+ + ' your code for the new API for calcparams_desoto' )
1143+
1144+ # Boltzmann constant in eV/K
11441145 k = 8.617332478e-05
1146+
1147+ # reference temperature
11451148 Tref_K = temp_ref + 273.15
11461149 Tcell_K = temp_cell + 273.15
11471150
11481151 E_g = EgRef * (1 + dEgdT * (Tcell_K - Tref_K ))
11491152
11501153 nNsVth = a_ref * (Tcell_K / Tref_K )
11511154
1152- IL = (poa_global / irrad_ref ) * M * (IL_ref + alpha_isc * (Tcell_K - Tref_K ))
1153- I0 = (I0_ref * ((Tcell_K / Tref_K ) ** 3 ) *
1155+ # In the equation for IL, the single factor effective_irradiance is
1156+ # used, in place of the product S*M in [1]. effective_irradiance is
1157+ # equivalent to the product of S (irradiance reaching a module's cells) *
1158+ # M (spectral adjustment factor) as described in [1].
1159+ IL = effective_irradiance / irrad_ref * \
1160+ (I_L_ref + alpha_sc * (Tcell_K - Tref_K ))
1161+ I0 = (I_o_ref * ((Tcell_K / Tref_K ) ** 3 ) *
11541162 (np .exp (EgRef / (k * (Tref_K )) - (E_g / (k * (Tcell_K ))))))
1155- Rsh = Rsh_ref * (irrad_ref / poa_global )
1156- Rs = Rs_ref
1163+ # Note that the equation for Rsh differs from [1]. In [1] Rsh is given as
1164+ # Rsh = Rsh_ref * (S_ref / S) where S is broadband irradiance reaching
1165+ # the module's cells. If desired this model behavior can be duplicated
1166+ # by applying reflection and soiling losses to broadband plane of array
1167+ # irradiance and not applying a spectral loss modifier, i.e.,
1168+ # spectral_modifier = 1.0.
1169+ Rsh = R_sh_ref * (irrad_ref / effective_irradiance )
1170+ Rs = R_s
11571171
11581172 return IL , I0 , Rs , Rsh , nNsVth
11591173
0 commit comments