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$]')
And obtain the value at midday.
poa_fixed_tmy_irradiance.loc[poa_fixed_tmy_irradiance.index[12]]
poa_global 1012.632016
poa_direct 759.224942
poa_diffuse 253.407075
poa_sky_diffuse 245.371117
poa_ground_diffuse 8.035958
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 | 189.640070 | 20.431896 | 169.208174 | 167.783412 | 1.424762 |
2022-05-12 08:00:00+03:00 | 566.935107 | 318.432935 | 248.502172 | 244.401270 | 4.100902 |
2022-05-12 09:00:00+03:00 | 794.877004 | 548.407304 | 246.469700 | 240.521885 | 5.947815 |
2022-05-12 10:00:00+03:00 | 943.291771 | 694.540539 | 248.751232 | 241.491731 | 7.259501 |
2022-05-12 11:00:00+03:00 | 1014.898647 | 762.536803 | 252.361844 | 244.401270 | 7.960574 |
2022-05-12 12:00:00+03:00 | 1012.632016 | 759.224942 | 253.407075 | 245.371117 | 8.035958 |
2022-05-12 13:00:00+03:00 | 942.827059 | 695.751674 | 247.075384 | 239.552039 | 7.523346 |
2022-05-12 14:00:00+03:00 | 803.094325 | 563.931090 | 239.163235 | 232.763114 | 6.400121 |
2022-05-12 15:00:00+03:00 | 632.953091 | 430.098931 | 202.854160 | 197.848647 | 5.005512 |
2022-05-12 16:00:00+03:00 | 412.459845 | 249.238913 | 163.220932 | 160.024641 | 3.196291 |
2022-05-12 17:00:00+03:00 | 182.034432 | 85.632577 | 96.401854 | 95.044938 | 1.356916 |
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 |