Problem 2.16

Problem 2.16#

Fundamentals of Solar Cells and Photovoltaic Systems Engineering

Solutions Manual - Chapter 2

Problem 2.16

Estimate the global irradiance G(α,β) reaching the plane of array (POA) of a north-facing, 20° tilted generator over grass (reflectivity \(ρ_{alb}\) =0.2) located at a PV plant in Antananarivo, Madagascar (18° 56′ 0″ S, 47° 31′ 0″ E) at midday (true solar time) on May 12, 2022.

Solve the problem using pvlib-python and selecting the same day from the typical meteorological year (TMY) obtained from PVGIS.

We will use the packages pvlib, pandas and matplotlib.pyplot to plot the results.

import pvlib
import pandas as pd
import matplotlib.pyplot as plt

We start by defining the location, date and time. We will implement the calculation for every hour on May 12, 2022.

# Antananarivo, Madagascar
lat, lon = 18.93, 47.52
tz = 'Indian/Antananarivo' #existing timezones can be checked using pytz.all_timezones[::20]

date = '2022-05-12'

# surface angles beta, alpha
tilt, orientation = 20, 0 # pvlib sets orientation origin at North -> North=0

# location
location = pvlib.location.Location(lat, lon, tz=tz)

# albedo
albedo = 0.20 # grass reflectivity

# datetimes
times = pd.date_range(start=date, freq='h', periods=24, tz=tz)

Retrieve typical meteorological year (TMY) data from PVGIS.

tmy, _, _, _ = pvlib.iotools.get_pvgis_tmy(latitude=lat, longitude=lon, map_variables=True)
tmy.index = [ts.replace(year=2022) for ts in tmy.index] # homogenizes year to 2022

tmy.index = tmy.index.tz_convert(tz) # use local time

# select the hourly values corresponding to the day=May 12
tmy_day = tmy.loc[date]

We calculate the Sun’s coordinates and calculate the irradiance on the plane of array (POA)

# calculates Sun's coordinates
solar_position_tmy = location.get_solarposition(times=tmy_day.index)

poa_fixed_tmy_irradiance = pvlib.irradiance.get_total_irradiance(
    surface_tilt=tilt,
    surface_azimuth=orientation,
    dni=tmy_day['dni'],
    ghi=tmy_day['ghi'],
    dhi=tmy_day['dhi'],
    solar_zenith=solar_position_tmy['apparent_zenith'],
    solar_azimuth=solar_position_tmy['azimuth'])

We can plot the daily evolution of direct, diffuse, and global irradiance

poa_fixed_tmy_irradiance.plot()
plt.ylabel('Irradiance [$W/m^2$]')
Text(0, 0.5, 'Irradiance [$W/m^2$]')
../../_images/3e36eae0c6bfd8ee81d83a4b90d12f9ad189eca2a56579d136d97dbeba4e58f1.png

And obtain the value at midday.

poa_fixed_tmy_irradiance.loc[poa_fixed_tmy_irradiance.index[12]]
poa_global            967.400908
poa_direct            690.117058
poa_diffuse           277.283850
poa_sky_diffuse       269.617274
poa_ground_diffuse      7.666576
Name: 2022-05-12 12:00:00+03:00, dtype: float64

We can also obtain the values at any other time step.

poa_fixed_tmy_irradiance
poa_global poa_direct poa_diffuse poa_sky_diffuse poa_ground_diffuse
2022-05-12 00:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 01:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 02:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 03:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 04:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 05:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 06:00:00+03:00 10.751232 0.000000 10.751232 10.668309 0.082923
2022-05-12 07:00:00+03:00 206.758018 30.647844 176.110174 174.572336 1.537838
2022-05-12 08:00:00+03:00 426.573387 127.589048 298.984339 295.803125 3.181214
2022-05-12 09:00:00+03:00 740.955832 454.137046 286.818786 281.255430 5.563356
2022-05-12 10:00:00+03:00 899.108129 627.419815 271.688315 264.768043 6.920272
2022-05-12 11:00:00+03:00 973.182885 705.635191 267.547695 259.918811 7.628883
2022-05-12 12:00:00+03:00 967.400908 690.117058 277.283850 269.617274 7.666576
2022-05-12 13:00:00+03:00 910.400388 657.769770 252.630617 245.371117 7.259501
2022-05-12 14:00:00+03:00 780.907612 537.076067 243.831545 237.612346 6.219198
2022-05-12 15:00:00+03:00 610.576463 401.114302 209.462162 204.637571 4.824590
2022-05-12 16:00:00+03:00 402.771171 238.655777 164.115394 160.994488 3.120907
2022-05-12 17:00:00+03:00 184.360920 90.853528 93.507392 92.135399 1.371993
2022-05-12 18:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 19:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 20:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 21:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 22:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000
2022-05-12 23:00:00+03:00 0.000000 0.000000 0.000000 0.000000 0.000000