Skip to content

Commit cd699da

Browse files
committed
add series and parallel multipliers, aoi modifier
1 parent 77c6217 commit cd699da

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

pvlib/modelchain.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,12 @@ def run_model(self, times, irradiance=None, weather=None):
386386
self.airmass['airmass_absolute'],
387387
self.aoi)
388388

389+
voltages = ['v_mp', 'v_oc']
390+
self.dc[voltages] *= self.system.series_modules
391+
currents = ['i_mp', 'i_sc', 'i_x', 'i_xx']
392+
self.dc[currents] *= self.system.parallel_modules
393+
self.dc['p_mp'] = self.dc['v_mp'] * self.dc['i_mp']
394+
389395
self.ac = self.system.snlinverter(self.dc['v_mp'], self.dc['p_mp'])
390396

391397
return self
@@ -425,13 +431,19 @@ def run_model(self, times, irradiance=None, weather=None):
425431

426432
self.prepare_inputs(times, irradiance, weather)
427433

428-
self.temps = self.system.sapm_celltemp(self.total_irrad['poa_global'],
429-
self.weather['wind_speed'],
430-
self.weather['temp_air'])
434+
self.aoi_mod = self.system.ashraeiam(self.aoi).fillna(0)
435+
self.total_irrad['poa_global_aoi'] = (
436+
self.total_irrad['poa_direct'] * self.aoi_mod +
437+
self.total_irrad['poa_diffuse'])
438+
439+
self.temps = self.system.sapm_celltemp(
440+
self.total_irrad['poa_global_aoi'],
441+
self.weather['wind_speed'],
442+
self.weather['temp_air'])
431443

432444
(photocurrent, saturation_current, resistance_series,
433445
resistance_shunt, nNsVth) = (
434-
self.system.calcparams_desoto(self.total_irrad['poa_global'],
446+
self.system.calcparams_desoto(self.total_irrad['poa_global_aoi'],
435447
self.temps['temp_cell']))
436448

437449
self.desoto = (photocurrent, saturation_current, resistance_series,
@@ -441,6 +453,14 @@ def run_model(self, times, irradiance=None, weather=None):
441453
photocurrent, saturation_current, resistance_series,
442454
resistance_shunt, nNsVth)
443455

456+
self.dc = self.dc.fillna(0)
457+
458+
voltages = ['v_mp', 'v_oc']
459+
self.dc[voltages] *= self.system.series_modules
460+
currents = ['i_mp', 'i_sc', 'i_x', 'i_xx']
461+
self.dc[currents] *= self.system.parallel_modules
462+
self.dc['p_mp'] = self.dc['v_mp'] * self.dc['i_mp']
463+
444464
self.ac = self.system.snlinverter(self.dc['v_mp'], self.dc['p_mp'])
445465

446466
return self

0 commit comments

Comments
 (0)