Skip to content

Commit 6858250

Browse files
committed
add series and parallel multipliers, aoi modifier
1 parent d5852c5 commit 6858250

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

pvlib/modelchain.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def basic_chain(times, latitude, longitude,
4444
Use decimal degrees notation.
4545
4646
module_parameters : None, dict or Series
47-
Module parameters as defined by the SAPM.
47+
Module parameters as defined by the SAPM, CEC, or other.
4848
4949
inverter_parameters : None, dict or Series
5050
Inverter parameters as defined by the CEC.
@@ -213,10 +213,7 @@ class ModelChain(object):
213213
"""
214214
An experimental base class that represents all of the modeling steps
215215
necessary for calculating power or energy for a PV system at a given
216-
location using the SAPM.
217-
218-
CEC module specifications and the single diode model are not yet
219-
supported.
216+
location.
220217
221218
Parameters
222219
----------
@@ -456,13 +453,19 @@ def run_model(self, times, irradiance=None, weather=None):
456453

457454
self.prepare_inputs(times, irradiance, weather)
458455

459-
self.temps = self.system.sapm_celltemp(self.total_irrad['poa_global'],
460-
self.weather['wind_speed'],
461-
self.weather['temp_air'])
456+
self.aoi_mod = self.system.ashraeiam(self.aoi).fillna(0)
457+
self.total_irrad['poa_global_aoi'] = (
458+
self.total_irrad['poa_direct'] * self.aoi_mod +
459+
self.total_irrad['poa_diffuse'])
460+
461+
self.temps = self.system.sapm_celltemp(
462+
self.total_irrad['poa_global_aoi'],
463+
self.weather['wind_speed'],
464+
self.weather['temp_air'])
462465

463466
(photocurrent, saturation_current, resistance_series,
464467
resistance_shunt, nNsVth) = (
465-
self.system.calcparams_desoto(self.total_irrad['poa_global'],
468+
self.system.calcparams_desoto(self.total_irrad['poa_global_aoi'],
466469
self.temps['temp_cell']))
467470

468471
self.desoto = (photocurrent, saturation_current, resistance_series,
@@ -472,6 +475,14 @@ def run_model(self, times, irradiance=None, weather=None):
472475
photocurrent, saturation_current, resistance_series,
473476
resistance_shunt, nNsVth)
474477

478+
self.dc = self.dc.fillna(0)
479+
480+
voltages = ['v_mp', 'v_oc']
481+
self.dc[voltages] *= self.system.series_modules
482+
currents = ['i_mp', 'i_sc', 'i_x', 'i_xx']
483+
self.dc[currents] *= self.system.parallel_modules
484+
self.dc['p_mp'] = self.dc['v_mp'] * self.dc['i_mp']
485+
475486
self.ac = self.system.snlinverter(self.dc['v_mp'], self.dc['p_mp'])
476487

477488
return self

0 commit comments

Comments
 (0)