简体   繁体   中英

PVLIB UFuncTypeError while using run_model

I have defined my model, and I am looking to get the generation results when I come upon the following error: UFuncTypeError: ufunc 'multiply' did not contain a loop with signature matching types (dtype('float64'), dtype('<U5')) -> None

A simple version of my model is shown below:

temperature_model_parameters = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
sandia_modules = pvlib.pvsystem.retrieve_sam('SandiaMod')
cec_inverters = pvlib.pvsystem.retrieve_sam('cecinverter')
sandia_module = sandia_modules['Canadian_Solar_CS6X_300M__2013_']
cec_inverter = cec_inverters['ABB__PVI_3_0_OUTD_S_US__240V_'] 

pvlib_location = Location(latitude=self.latitude, longitude=self.longitude,
                            name=name, altitude=self.altitude, tz=self.tz)

system = PVSystem(surface_tilt=20, surface_azimuth=210,
                        module_parameters=sandia_module,
                        inverter_parameters=cec_inverter,
                        temperature_model_parameters=temperature_model_parameters,
                        modules_per_string=5, strings_per_inverter=3,
                        albedo='urban', module_type='glass_polymer',
                        racking_model='insulated_back', name='Inverter1')

mc = ModelChain(system, self.pvlib_location)

weather = pvlib.iotools.get_psm3(self.latitude, self.longitude, self.nrel_key,
                                 self.nrel_email, names=name,interval=60, 
                                 attributes=('air_temperature', 'dew_point', 'dhi', 'dni', 
                                             'ghi', 'surface_albedo', 'surface_pressure', 
                                             'wind_direction', 'wind_speed'),
                                 leap_day=False, full_name='pvlib python', 
                                 affiliation='pvlib python', map_variables=True, timeout=30)[0]

weather.index.name = "utc_time"

result = mc.run_model(weather)

The problem is the albedo parameter for PVSystem . The parameter albedo requires a float. The parameter surface_type on the other hand, accepts a string from one of the possible surface types.
PVSystem documentation
Surface types
The correct PVSystem call should be:

system = PVSystem(surface_tilt=20, surface_azimuth=210,
                        module_parameters=sandia_module,
                        inverter_parameters=cec_inverter,
                        temperature_model_parameters=temperature_model_parameters,
                        modules_per_string=5, strings_per_inverter=3,
                        surface_type='urban', module_type='glass_polymer',
                        racking_model='insulated_back', name='Inverter1')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM