Exemplo n.º 1
0
    def _init_PVWatts(self):
        """Configure PV system using simplified PVWatts model"""

        try:
            pvwatts_module = {
                'pdc0': self.config[self._cfg].getfloat('SystemPower'),
                'gamma_pdc':
                self.config[self._cfg].getfloat('TemperatureCoeff')
            }
            pvwatts_inverter = {
                'pdc0': self.config[self._cfg].getfloat('InverterPower'),
                'eta_inv_nom':
                self.config[self._cfg].getfloat('NominalEfficiency')
            }
            pvwatts_losses = {
                'soiling': 0,
                'shading': 0,
                'snow': 0,
                'mismatch': 0,
                'wiring': 2,
                'connections': 0.5,
                'lid': 0,
                'nameplate_rating': 0,
                'age': 0,
                'availability': 0
            }
            tempModel = self.config.get(self._cfg, 'TemperatureModel')
            self._pvsystem = PVSystem(
                surface_tilt=self.config[self._cfg].getfloat('Tilt'),
                surface_azimuth=self.config[self._cfg].getfloat('Azimuth'),
                module_parameters=pvwatts_module,
                inverter_parameters=pvwatts_inverter,
                losses_parameters=pvwatts_losses,
                temperature_model_parameters=TEMPERATURE_MODEL_PARAMETERS[
                    'sapm'][tempModel])
            self._mc = ModelChain.with_pvwatts(self._pvsystem,
                                               self._location,
                                               dc_model='pvwatts',
                                               ac_model='pvwatts',
                                               aoi_model='physical',
                                               spectral_model='no_loss')
            self.pv_model = 'PVWatts'
        except Exception as e:
            print("init_PVWatts: " + str(e))
            sys.exit(1)
Exemplo n.º 2
0
def test_with_pvwatts(pvwatts_dc_pvwatts_ac_system, location, weather):
    mc = ModelChain.with_pvwatts(pvwatts_dc_pvwatts_ac_system, location)
    assert mc.dc_model == mc.pvwatts_dc
    assert mc.temperature_model == mc.sapm_temp
    mc.run_model(weather)