from sscapi import PySSC import matplotlib.pyplot as plot # setup data structures ssc = PySSC() dat = ssc.data_create() # required inputs ssc.data_set_string(dat, "file_name", "daggett.tm2") ssc.data_set_number(dat, "system_size", 4) ssc.data_set_number(dat, "derate", 0.77) ssc.data_set_number(dat, "track_mode", 2) ssc.data_set_number(dat, "azimuth", 180) ssc.data_set_number(dat, "tilt_eq_lat", 1) # default inputs exposed ssc.data_set_number(dat, 'rotlim', 45.0) ssc.data_set_number(dat, 't_noct', 45.0) ssc.data_set_number(dat, 't_ref', 25.0) ssc.data_set_number(dat, 'gamma', -0.5) ssc.data_set_number(dat, 'inv_eff', 0.92) ssc.data_set_number(dat, 'fd', 1.0) ssc.data_set_number(dat, 'i_ref', 1000) ssc.data_set_number(dat, 'poa_cutin', 0) ssc.data_set_number(dat, 'w_stow', 0) # complicated optional inputs # ssc.data_set_array(dat, 'shading_hourly', ...) Hourly beam shading factors # ssc.data_set_matrix(dat, 'shading_mxh', ...) Month x Hour beam shading factors # ssc.data_set_matrix(dat, 'shading_azal', ...) Azimuth x altitude beam shading factors # ssc.data_set_number(dat, 'shading_diff', ...) Diffuse shading factor # ssc.data_set_number(dat, 'enable_user_poa', ...) Enable user-defined POA irradiance input = 0 or 1 # ssc.data_set_array(dat, 'user_poa', ...) User-defined POA irradiance in W/m2
from sscapi import PySSC # setup inputs ssc = PySSC() dat = ssc.data_create() ssc.data_set_string(dat, "file_name", "daggett.tm2") ssc.data_set_number(dat, "system_size", 4) ssc.data_set_number(dat, "derate", 0.77) ssc.data_set_number(dat, "track_mode", 0) ssc.data_set_number(dat, "azimuth", 180) ssc.data_set_number(dat, "tilt_eq_lat", 1) ssc.data_set_matrix(dat, "shading_mxh", [[ 0, 0, 0, 0, 0, 0, 0, 0, 0.475, 0.95, 1, 1, 0.7875, 0.2375, 0.25, 0.3625, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0.4875, 1, 1, 1, 0.925, 0.6375, 0.6625, 0.225, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0.15, 0.925, 1, 1, 1, 1, 1, 0.75, 0.2, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0.45, 0.9125, 1, 1, 1, 1, 1, 0.625, 0.375, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0.075, 0.05, 0.7875, 1, 1, 1, 1, 1, 1, 0.625, 0.4875, 0.025, 0, 0, 0, 0, 0, 0, 0
from sscapi import PySSC ''' This does not work because of API failures as of 3/22/2013 ''' ssc = PySSC() data = ssc.data_create() # Test windwatts with skystream 2.4/3.7 hybrid ssc.data_set_string(data, 'file_name', 'WY Southern-Flat Lands.srw') ssc.data_set_number(data, 'ctl_mode', 2) ssc.data_set_number(data, 'cutin', 4) ssc.data_set_number(data, 'hub_ht', 50) ssc.data_set_number(data, 'lossc', 0) ssc.data_set_number(data, 'lossp', 0) pc_wind = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ] ssc.data_set_array(data, 'pc_wind', pc_wind) pc_power = [ 0, 0, 0, 0, 0.08, 0.02, 0.35, 0.6, 1, 1.6, 2, 2.25, 2.35, 2.4, 2.4, 2.37, 2.3, 2.09, 2, 2, 2, 2, 2, 1.98, 1.95, 1.8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ssc.data_set_array(data, 'pc_power', pc_power) ssc.data_set_number(data, 'rotor_di', 3.7) ssc.data_set_number(data, 'shear', 0.14) ssc.data_set_number(data, 'turbul', 0.1) ssc.data_set_array(data, 'wt_x', [0]) ssc.data_set_array(data, 'wt_y', [0]) ssc.data_set_number(data, 'wake_model', 0) ssc.data_set_number(data, 'model_choice', 0)
print num_parallel print num_series print num_inverters # set the weather file. the web service should take a # lat-long and use the perez satellite data or tmy2/3 data # in the same way that the PVWatts service specifies the weather data # --> essentially, this service and PVWatts should use exactly the same # method to get weather data for a location request ssc = PySSC() data = ssc.data_create() ssc.data_set_string(data, 'weather_file', 'daggett.tm2' ) ssc.data_set_number(data, 'ac_derate', ac_derate ) ssc.data_set_number(data, 'modules_per_string', num_series ) ssc.data_set_number(data, 'strings_in_parallel', num_parallel ) ssc.data_set_number(data, 'inverter_count', num_inverters ) ssc.data_set_number(data, 'subarray1_tilt', tilt ) ssc.data_set_number(data, 'subarray1_azimuth', azimuth ) ssc.data_set_number(data, 'subarray1_track_mode', track_mode ) ssc.data_set_matrix(data, 'subarray1_shading_mxh', shading_mxh ) ssc.data_set_array(data, 'subarray1_soiling', [soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling ] ) ssc.data_set_number(data, 'subarray1_derate', dc_derate ) # set up values for other sub arrays - not used (currently) ssc.data_set_number(data, 'subarray2_tilt', 0 ) ssc.data_set_number(data, 'subarray3_tilt', 0 ) ssc.data_set_number(data, 'subarray4_tilt', 0 )
num_inverters = 1 num_parallel = int(num_parallel) num_inverters = int(num_inverters) print 'num_parallel: ' + str(num_parallel) print 'num_series: ' + str(num_series) print 'num_inverters: ' + str(num_inverters) #Shoehorn the variables into the SAM data container. ssc = PySSC() dat = ssc.data_create() ssc.data_set_string(dat, 'weather_file', 'C:/Users/dwp0/Dropbox/OMF/omf/scratch/SAM/daggett.tm2') ssc.data_set_number(dat, 'ac_derate', ac_derate) ssc.data_set_number(dat, 'modules_per_string', num_series) ssc.data_set_number(dat, 'strings_in_parallel', num_parallel) ssc.data_set_number(dat, 'inverter_count', num_inverters) ssc.data_set_number(dat, 'subarray1_tilt', tilt) ssc.data_set_number(dat, 'subarray1_azimuth', azimuth) ssc.data_set_number(dat, 'subarray1_track_mode', track_mode) ssc.data_set_matrix(dat, 'subarray1_shading_mxh', shading_mxh) ssc.data_set_array(dat, 'subarray1_soiling', [soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling ]) ssc.data_set_number(dat, 'subarray1_derate', dc_derate) # set up values for other sub arrays - not used (currently) ssc.data_set_number(dat, 'subarray2_tilt', 0) ssc.data_set_number(dat, 'subarray3_tilt', 0)
num_inverters = int(num_inverters) print num_parallel print num_series print num_inverters # set the weather file. the web service should take a # lat-long and use the perez satellite data or tmy2/3 data # in the same way that the PVWatts service specifies the weather data # --> essentially, this service and PVWatts should use exactly the same # method to get weather data for a location request ssc = PySSC() data = ssc.data_create() ssc.data_set_string(data, 'weather_file', 'daggett.tm2') ssc.data_set_number(data, 'ac_derate', ac_derate) ssc.data_set_number(data, 'modules_per_string', num_series) ssc.data_set_number(data, 'strings_in_parallel', num_parallel) ssc.data_set_number(data, 'inverter_count', num_inverters) ssc.data_set_number(data, 'subarray1_tilt', tilt) ssc.data_set_number(data, 'subarray1_azimuth', azimuth) ssc.data_set_number(data, 'subarray1_track_mode', track_mode) ssc.data_set_matrix(data, 'subarray1_shading_mxh', shading_mxh) ssc.data_set_array(data, 'subarray1_soiling', [ soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling ]) ssc.data_set_number(data, 'subarray1_derate', dc_derate) # set up values for other sub arrays - not used (currently)
from sscapi import PySSC ''' Runs but returns nonsense data. ''' # setup inputs ssc = PySSC() dat = ssc.data_create() ssc.data_set_string(dat, "file_name", "daggett.tm2") ssc.data_set_number(dat, "resource_potential", 910) #Resource Potential MW ssc.data_set_number(dat, "resource_type", 0) #Type of Resource INTEGER ssc.data_set_number(dat, "resource_temp", 200) #Resource Temperature C ssc.data_set_number(dat, "resource_depth", 2000) #Resource Depth m ssc.data_set_number(dat, "analysis_period", 25) #Analysis Lifetime years INTEGER ssc.data_set_number(dat, "model_choice", 0) #Which model to run (0,1,2) INTEGER ssc.data_set_number(dat, "nameplate", 15000) #Desired plant output kW ssc.data_set_number(dat, "analysis_type", 0) #Analysis Type INTEGER ssc.data_set_number(dat, "num_wells", 3) #Number of Wells ssc.data_set_number(dat, "num_wells_getem", 3) #Number of Wells GETEM calc'd ssc.data_set_number(dat, "conversion_type", 0) #Conversion Type INTEGER ssc.data_set_number(dat, "plant_efficiency_input", 11.28) #Plant efficiency ssc.data_set_number(dat, "conversion_subtype", 0) #Conversion Subtype INTEGER ssc.data_set_number(dat, "decline_type", 0) #Temp decline Type INTEGER ssc.data_set_number(dat, "temp_decline_rate", 0.03) #Temperature decline rate %/yr ssc.data_set_number(dat, "temp_decline_max", 30) #Maximum temperature decline C ssc.data_set_number(dat, "wet_bulb_temp", 15) #Wet Bulb Temperature C ssc.data_set_number(dat, "ambient_pressure", 14.7) #Ambient pressure psi ssc.data_set_number(dat, "well_flow_rate", 70) #Production flow rate per well kg/s ssc.data_set_number(dat, "pump_efficiency", 0.60) #Pump efficiency % ssc.data_set_number(dat, "delta_pressure_equip", 25) #Delta pressure across surface equipment psi ssc.data_set_number(dat, "excess_pressure_pump", 50.76) #Excess pressure @ pump suction psi ssc.data_set_number(dat, "well_diameter", 10) #Production well diameter in
if num_inverters < 1: num_inverters = 1 num_parallel = int(num_parallel) num_inverters = int(num_inverters) print 'num_parallel: ' + str(num_parallel) print 'num_series: ' + str(num_series) print 'num_inverters: ' + str(num_inverters) #Shoehorn the variables into the SAM data container. ssc = PySSC() dat = ssc.data_create() ssc.data_set_string(dat, 'weather_file', 'C:/Users/dwp0/Dropbox/OMF/omf/scratch/SAM/daggett.tm2') ssc.data_set_number(dat, 'ac_derate', ac_derate) ssc.data_set_number(dat, 'modules_per_string', num_series) ssc.data_set_number(dat, 'strings_in_parallel', num_parallel) ssc.data_set_number(dat, 'inverter_count', num_inverters) ssc.data_set_number(dat, 'subarray1_tilt', tilt) ssc.data_set_number(dat, 'subarray1_azimuth', azimuth) ssc.data_set_number(dat, 'subarray1_track_mode', track_mode) ssc.data_set_matrix(dat, 'subarray1_shading_mxh', shading_mxh) ssc.data_set_array(dat, 'subarray1_soiling', [ soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling, soiling ]) ssc.data_set_number(dat, 'subarray1_derate', dc_derate)
from sscapi import PySSC ''' Runs but returns nonsense data. ''' # setup inputs ssc = PySSC() dat = ssc.data_create() ssc.data_set_string(dat, "file_name", "daggett.tm2") ssc.data_set_number(dat, "resource_potential", 910) #Resource Potential MW ssc.data_set_number(dat, "resource_type", 0) #Type of Resource INTEGER ssc.data_set_number(dat, "resource_temp", 200) #Resource Temperature C ssc.data_set_number(dat, "resource_depth", 2000) #Resource Depth m ssc.data_set_number(dat, "analysis_period", 25) #Analysis Lifetime years INTEGER ssc.data_set_number(dat, "model_choice", 0) #Which model to run (0,1,2) INTEGER ssc.data_set_number(dat, "nameplate", 15000) #Desired plant output kW ssc.data_set_number(dat, "analysis_type", 0) #Analysis Type INTEGER ssc.data_set_number(dat, "num_wells", 3) #Number of Wells ssc.data_set_number(dat, "num_wells_getem", 3) #Number of Wells GETEM calc'd ssc.data_set_number(dat, "conversion_type", 0) #Conversion Type INTEGER ssc.data_set_number(dat, "plant_efficiency_input", 11.28) #Plant efficiency ssc.data_set_number(dat, "conversion_subtype", 0) #Conversion Subtype INTEGER ssc.data_set_number(dat, "decline_type", 0) #Temp decline Type INTEGER ssc.data_set_number(dat, "temp_decline_rate", 0.03) #Temperature decline rate %/yr ssc.data_set_number(dat, "temp_decline_max", 30) #Maximum temperature decline C ssc.data_set_number(dat, "wet_bulb_temp", 15) #Wet Bulb Temperature C ssc.data_set_number(dat, "ambient_pressure", 14.7) #Ambient pressure psi ssc.data_set_number(dat, "well_flow_rate",