@@ -33,23 +33,31 @@ configuration at a handful of sites listed below.
33
33
34
34
import pandas as pd
35
35
import matplotlib.pyplot as plt
36
+
37
+ # seaborn makes the plots look nicer
36
38
import seaborn as sns
37
39
sns.set_color_codes()
38
40
39
41
times = pd.DatetimeIndex(start = ' 2015' , end = ' 2016' , freq = ' 1h' )
40
42
41
43
# very approximate
44
+ # latitude, longitude, name, altitude
42
45
coordinates = [(30 , - 110 , ' Tucson' , 700 ),
43
46
(35 , - 105 , ' Albuquerque' , 1500 ),
44
47
(40 , - 120 , ' San Francisco' , 10 ),
45
48
(50 , 10 , ' Berlin' , 34 )]
46
49
47
50
import pvlib
48
51
52
+ # get the module and inverter specifications from SAM
49
53
sandia_modules = pvlib.pvsystem.retrieve_sam(' SandiaMod' )
50
54
sapm_inverters = pvlib.pvsystem.retrieve_sam(' sandiainverter' )
51
55
module = sandia_modules[' Canadian_Solar_CS5P_220M___2009_' ]
52
56
inverter = sapm_inverters[' ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_' ]
57
+
58
+ # specify constant ambient air temp and wind
59
+ temp_air = 20
60
+ wind_speed = 0
53
61
54
62
55
63
Procedural
@@ -85,7 +93,8 @@ to accomplish our system modeling goal:
85
93
cs[' dni' ], cs[' ghi' ], cs[' dhi' ],
86
94
dni_extra = dni_extra,
87
95
model = ' haydavies' )
88
- temps = pvlib.pvsystem.sapm_celltemp(total_irrad[' poa_global' ], 0 , 20 )
96
+ temps = pvlib.pvsystem.sapm_celltemp(total_irrad[' poa_global' ],
97
+ wind_speed, temp_air)
89
98
dc = pvlib.pvsystem.sapm(module, total_irrad[' poa_direct' ],
90
99
total_irrad[' poa_diffuse' ], temps[' temp_cell' ],
91
100
am_abs, aoi)
@@ -140,6 +149,7 @@ objects to accomplish our system modeling goal:
140
149
# very experimental
141
150
mc = ModelChain(system, location,
142
151
orientation_strategy = ' south_at_latitude_tilt' )
152
+ # optional parameters for irradiance and weather data
143
153
dc, ac = mc.run_model(times)
144
154
annual_energy = ac.sum()
145
155
energies[name] = annual_energy
@@ -188,7 +198,8 @@ object to accomplish our modeling goal:
188
198
clearsky[' dni' ],
189
199
clearsky[' ghi' ],
190
200
clearsky[' dhi' ])
191
- temps = localized_system.sapm_celltemp(total_irrad[' poa_global' ], 0 , 20 )
201
+ temps = localized_system.sapm_celltemp(total_irrad[' poa_global' ],
202
+ wind_speed, temp_air)
192
203
aoi = localized_system.get_aoi(solar_position[' apparent_zenith' ],
193
204
solar_position[' azimuth' ])
194
205
am_rel = pvlib.atmosphere.relativeairmass(solar_position[' apparent_zenith' ])
0 commit comments