shading fraction makes sense need to fix optimiser
This commit is contained in:
		
							parent
							
								
									5792640d30
								
							
						
					
					
						commit
						2cae51ccbf
					
				| @ -27,7 +27,7 @@ def optimise_vertical_panel_pitch(c): | ||||
|     # perform minimization | ||||
|     initial_pitch = c["array"]["spacing"] | ||||
|     result = minimize( | ||||
|         objective, initial_pitch, bounds=[(0, 5)], tol=1e-8, options={"eps": 0.5} | ||||
|         objective, initial_pitch, bounds=[(0, 20)], tol=1e-8, options={"eps": 1} | ||||
|     ) | ||||
|     optimal_pitch = result.x[0] | ||||
|     c["array"]["spacing"] = optimal_pitch | ||||
|  | ||||
| @ -128,9 +128,9 @@ def get_solar_data(c): | ||||
| def sanity_check_minimum_pitch(c): | ||||
|     solar_positions, _ = get_solar_data(c) | ||||
|     zenith = solar_positions["zenith"].values | ||||
|     solar_positions["shadow_length"] = ( | ||||
|         c["panel"]["dimensions"]["length"] + c["environment"]["height"] | ||||
|     ) * np.tan(zenith / 180 * np.pi) | ||||
|     solar_positions["shadow_length"] = (c["panel"]["dimensions"]["length"]) * np.tan( | ||||
|         zenith / 180 * np.pi | ||||
|     ) | ||||
|     return solar_positions | ||||
| 
 | ||||
| 
 | ||||
| @ -150,10 +150,17 @@ def calculate_energy_production_vertical(c): | ||||
|     shaded_row_rotation = 90 | ||||
|     shading_row_rotation = 90 | ||||
|     axis_tilt = 0 | ||||
|     axis_azimuth = 90 | ||||
|     axis_azimuth = 180 | ||||
| 
 | ||||
|     morning_projected_solar_zenith = pvlib.shading.projected_solar_zenith_angle( | ||||
|         solar_zenith=solar_positions["apparent_zenith"], | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         axis_azimuth=axis_azimuth, | ||||
|         axis_tilt=axis_tilt, | ||||
|     ) | ||||
| 
 | ||||
|     morning_shaded_fraction = pvlib.shading.shaded_fraction1d( | ||||
|         solar_zenith=solar_positions["zenith"], | ||||
|         solar_zenith=morning_projected_solar_zenith, | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         axis_azimuth=axis_azimuth, | ||||
|         shaded_row_rotation=shaded_row_rotation, | ||||
| @ -165,8 +172,14 @@ def calculate_energy_production_vertical(c): | ||||
|     ) | ||||
|     morning_shaded_fraction = morning_shaded_fraction * no_of_shaded_rows / no_of_rows | ||||
| 
 | ||||
|     afternoon_projected_solar_zenith = pvlib.shading.projected_solar_zenith_angle( | ||||
|         solar_zenith=solar_positions["apparent_zenith"], | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         axis_azimuth=axis_azimuth + 180, | ||||
|         axis_tilt=axis_tilt, | ||||
|     ) | ||||
|     afternoon_shaded_fraction = pvlib.shading.shaded_fraction1d( | ||||
|         solar_zenith=solar_positions["zenith"], | ||||
|         solar_zenith=afternoon_projected_solar_zenith, | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         axis_azimuth=axis_azimuth + 180, | ||||
|         shaded_row_rotation=shaded_row_rotation, | ||||
| @ -185,8 +198,8 @@ def calculate_energy_production_vertical(c): | ||||
|     # calculate irradiance on plane of array | ||||
|     poa_front = pvlib.irradiance.get_total_irradiance( | ||||
|         surface_tilt=90, | ||||
|         surface_azimuth=axis_azimuth, | ||||
|         solar_zenith=solar_positions["zenith"], | ||||
|         surface_azimuth=90, | ||||
|         solar_zenith=morning_projected_solar_zenith, | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         dni=clearsky_data["dni"], | ||||
|         ghi=clearsky_data["ghi"], | ||||
| @ -198,8 +211,8 @@ def calculate_energy_production_vertical(c): | ||||
| 
 | ||||
|     poa_rear = pvlib.irradiance.get_total_irradiance( | ||||
|         surface_tilt=180 - 90, | ||||
|         surface_azimuth=axis_azimuth + 180, | ||||
|         solar_zenith=solar_positions["zenith"], | ||||
|         surface_azimuth=90 + 180, | ||||
|         solar_zenith=afternoon_projected_solar_zenith, | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         dni=clearsky_data["dni"], | ||||
|         ghi=clearsky_data["ghi"], | ||||
| @ -254,10 +267,17 @@ def calculate_energy_production_horizontal(c): | ||||
|     shaded_row_rotation = 0 | ||||
|     shading_row_rotation = 0 | ||||
|     axis_tilt = 0 | ||||
|     axis_azimuth = 180  # south facing | ||||
|     axis_azimuth = 90  # south facing | ||||
| 
 | ||||
|     projected_solar_zenith = pvlib.shading.projected_solar_zenith_angle( | ||||
|         solar_zenith=solar_positions["apparent_zenith"], | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         axis_azimuth=axis_azimuth, | ||||
|         axis_tilt=axis_tilt, | ||||
|     ) | ||||
| 
 | ||||
|     shaded_fraction = pvlib.shading.shaded_fraction1d( | ||||
|         solar_zenith=solar_positions["zenith"], | ||||
|         solar_zenith=projected_solar_zenith, | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         axis_azimuth=axis_azimuth, | ||||
|         shaded_row_rotation=shaded_row_rotation, | ||||
| @ -271,8 +291,8 @@ def calculate_energy_production_horizontal(c): | ||||
| 
 | ||||
|     poa = pvlib.irradiance.get_total_irradiance( | ||||
|         surface_tilt=0, | ||||
|         surface_azimuth=axis_azimuth, | ||||
|         solar_zenith=solar_positions["zenith"], | ||||
|         surface_azimuth=180, | ||||
|         solar_zenith=projected_solar_zenith, | ||||
|         solar_azimuth=solar_positions["azimuth"], | ||||
|         dni=clearsky_data["dni"], | ||||
|         ghi=clearsky_data["ghi"], | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| array: | ||||
|   peak_power_demand: 900 # in kWac | ||||
|   DC_AC_ratio: 1.2 # ratio of DC to AC power | ||||
|   spacing: 0.4 # spacing between adjacent panel rows in m | ||||
|   spacing: 3 # spacing between adjacent panel rows in m | ||||
|   edge_setback: 1.8 # distance from the edge of the roof to the array | ||||
|   roof_slope: 0 | ||||
|   slope: 0 # degrees from horizontal (+ve means shaded row is higher than the row in front) | ||||
| @ -16,7 +16,7 @@ environment: | ||||
|   roof: | ||||
|     dimensions: | ||||
|       # dimensions all in m | ||||
|       length: 50 | ||||
|       length: 100 | ||||
|       width: 40 | ||||
|     albedo: 0.2 # % of light reflected from the surface | ||||
|     tilt: 0 # degrees from horizontal | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user