@@ -32,6 +32,9 @@ configuration at a handful of sites listed below.
32
32
.. ipython :: python
33
33
34
34
import pandas as pd
35
+ import matplotlib.pyplot as plt
36
+ import seaborn as sns
37
+ sns.set_color_codes()
35
38
36
39
times = pd.DatetimeIndex(start = ' 2015' , end = ' 2016' , freq = ' 1h' )
37
40
@@ -68,19 +71,34 @@ to accomplish our system modeling goal:
68
71
system[' surface_tilt' ] = latitude
69
72
cs = pvlib.clearsky.ineichen(times, latitude, longitude)
70
73
solpos = pvlib.solarposition.get_solarposition(times, latitude, longitude)
74
+ dni_extra = pvlib.irradiance.extraradiation(times)
75
+ dni_extra = pd.Series(dni_extra, index = times)
71
76
airmass = pvlib.atmosphere.relativeairmass(solpos[' apparent_zenith' ])
72
- aoi = pvlib.irradiance.aoi(system[' surface_tilt' ], system[' surface_azimuth' ], solpos[' apparent_zenith' ], solpos[' azimuth' ])
73
- total_irrad = pvlib.irradiance.total_irrad(** solpos, ** cs, ** system)
77
+ aoi = pvlib.irradiance.aoi(system[' surface_tilt' ], system[' surface_azimuth' ],
78
+ solpos[' apparent_zenith' ], solpos[' azimuth' ])
79
+ total_irrad = pvlib.irradiance.total_irrad(system[' surface_tilt' ],
80
+ system[' surface_azimuth' ],
81
+ solpos[' apparent_zenith' ],
82
+ solpos[' azimuth' ],
83
+ cs[' dni' ], cs[' ghi' ], cs[' dhi' ],
84
+ dni_extra = dni_extra,
85
+ model = ' haydavies' )
74
86
temps = pvlib.pvsystem.sapm_celltemp(total_irrad[' poa_global' ], 0 , 20 )
75
- dc = pvlib.pvsystem.sapm(module, total_irrad[' poa_direct' ], total_irrad[' poa_diffuse' ], temps[' temp_cell' ], airmass, aoi)
87
+ dc = pvlib.pvsystem.sapm(module, total_irrad[' poa_direct' ],
88
+ total_irrad[' poa_diffuse' ], temps[' temp_cell' ],
89
+ airmass, aoi)
76
90
ac = pvlib.pvsystem.snlinverter(inverter, dc[' v_mp' ], dc[' p_mp' ])
77
91
annual_energy = ac.sum()
78
92
energies[name] = annual_energy
93
+
94
+ energies = pd.Series(energies)
79
95
80
- print (energies)
96
+ # based on the parameters specified above, these are in W*hrs
97
+ print (energies.round(0 ))
81
98
82
- # energies = pd.DataFrame(energies)
83
- # energies.plot()
99
+ energies.plot(kind = ' bar' , rot = 0 )
100
+ @savefig proc -energies.png width=6in
101
+ plt.ylabel(' Yearly energy yield (W hr)' )
84
102
85
103
86
104
Object oriented (Location, PVSystem, ModelChain)
0 commit comments