1

I'm new to PVLib and to PV simulation in general so sorry if the question is too naive :)

I'm using procedural code provided here: https://pvlib-python.readthedocs.io/en/stable/introtutorial.html to estimate DC/AC output for a given technology set (module, inverter) and a given (lat,long,altitude). My region of interest is Georgia (country).

The calculation of annual energy for a given location (lat,long,alt) uses ac.sum() like it's show below (see original code in https://pvlib-python.readthedocs.io/en/stable/introtutorial.html):

...
dc = pvlib.pvsystem.sapm(effective_irradiance, cell_temperature, module)
ac = pvlib.inverter.sandia(dc['v_mp'], dc['p_mp'], inverter)
annual_energy = ac.sum()
energies[name] = annual_energy
...

1) Is this really annual energy production? The weather set has data from 2009-2015 so wouldn't sum() yield the total energy for all these years?

2) Is there any TMY dataset that provides more than 10 years? Currently, PVGIS is returning 7 years (2009-1015)?

3) Is the AC output for a single module and single inverter? If so, how can I add more modules and inverters to the system using procedural code (OO code provides Arrays and Mounts)? I tried setting parameters modules_per_string and strings_per_inverter for the system but it did not affect the output.

Example:

    system = {
        'module': [my-module-name],
        'inverter': [my-inverter-name],
        'surface_azimuth': 180,
        'modules_per_string': 5, 
        'strings_per_inverter': 2,
        'albedo': 0.3
    }

Thank you!

Marcilio
  • 11
  • 1

1 Answers1

0
  1. Is this really annual energy production? The weather set has data from 2009-2015 so wouldn't sum() yield the total energy for all these years?

A TMY dataset contains a single year (365 days, or 8760 hours) of weather data. Yes, the TMY index may contain timestamps from several years, but if you take a closer look you'll find that it's only a subset of each year (January 2015, February 2010, etc) for only 12 months in total. So taking the sum of a TMY-based energy simulation will indeed yield an annual energy estimate.

  1. Is there any TMY dataset that provides more than 10 years? Currently, PVGIS is returning 7 years (2009-1015)?

Again, a TMY dataset is by definition is just 1 year of data sampled from many years. Also I think PVGIS actually samples from 10 years by default when creating a TMY, and it just so happens that it only pulled from fewer years this time. A TMY for a different location would sample from different years.

If you're interested in continuous (non-TMY) data, see other iotools functions like pvlib.iotools.get_pvgis_hourly and pvlib.iotools.get_psm3 which let you fetch weather data for specific calendar years, and you can iterate across however many years you want to use.

  1. Is the AC output for a single module and single inverter? If so, how can I add more modules and inverters to the system using procedural code (OO code provides Arrays and Mounts)? I tried setting parameters modules_per_string and strings_per_inverter for the system but it did not affect the output.

If you want to stick with the non-OO interface, that means you can't use the PVSystem class, since it's part of the OO interface alongside Array and the Mounts :) Note that pvlib.pvsystem is a python module while pvlib.pvsystem.PVSystem is a class. Setting attributes the attributes of an instance of the PVSystem class will only change the behavior of the methods of that instance. It won't change the behavior of the functions in the pvlib.pvsystem module not directly associated with that instance.

Anyway, check out pvlib.pvsystem.scale_voltage_current_power for the modules_per_string and strings_per_inverter. For multiple inverters you will need to have some kind of iterative loop and repeat the simulation process for each inverter. In the special case where all arrays and inverters are identical, you can just multiply the AC power output by the number of inverters.

kevinsa5
  • 3,301
  • 2
  • 25
  • 28
  • Thank you! Appreciate the insights. Makes total sense the TMY explanation. I was confused. It's a single year. – Marcilio Mar 10 '22 at 22:49
  • If I wanted to position a module so it's facing straight up what would the `surface_tilt` value be (0? latitude?). In this case, would the value of `surface_azimuth` matter at all? – Marcilio Mar 10 '22 at 22:59
  • @Marcilio in pvlib `surface_tilt` is relative to the "local horizontal", so a module facing straight up has `surface_tilt=0` no matter where it is on the planet. And yes, `surface_azimuth` shouldn't make any difference in that case. Note that, for a horizontal module, POA irradiance is the same as GHI, so you might as well just set `poa_global = ghi` instead of using a transposition model. – kevinsa5 Mar 11 '22 at 12:52
  • Thank you again! Is there a way to read/parse TMY data completely offline for a list of lat/long pairs instead of having to call an API to fetch individual PVGIS data for a single lat/long pair? I need to calculate TMY data for a large number of lat/long pairs and it's inefficient to make individual API calls. I was able to find a 46.6MB file in the PVGIS website (https://joint-research-centre.ec.europa.eu/pvgis-photovoltaic-geographical-information-system/pvgis-data-download/nsrdb-solar-radiation_en) but was unable to use PVLib to read and parse that file. Any hint? – Marcilio Mar 14 '22 at 20:24
  • @Marcilio Looks like that specific file only contains long-term averages (not the underlying hourly data), so probably that's not what you want anyway. pvlib doesn't have a way to pull bulk PVGIS data, and I don't use PVGIS much so I don't know if there's some other way to do it. But this sounds like it should be a new stackoverflow question :) – kevinsa5 Mar 15 '22 at 13:33
  • I'm using model chain to calculate DC. My input parameters include module, inverter, number of strings, number of modules, number of inverters, albedo, etc. I do simple math to calculate number of modules per string and number of strings per inverter. I then create a PVArray per inverter and run the model. I now want to contrast DC vs. AC. AC output is W (yearly: `mc.results.ac.sum()`). However, the model's DC result is a Dataframe w/ columns: 'i_sc', 'i_mp', 'v_oc', 'v_mp', 'p_mp', 'i_x', 'i_xx'. I am not sure how to calculate annual DC in W to then compare w/ AC (ratio). Any hint? – Marcilio Mar 29 '22 at 13:00
  • @Marcilio, DC power is "p_mp" (power at the maximum power point). – kevinsa5 Mar 29 '22 at 20:34