ME590 Report (2013 winter)

Size: px
Start display at page:

Download "ME590 Report (2013 winter)"

Transcription

1 ME590 Report (2013 winter) Renewable Energy (Solar/Wind Power) Supply Model An Application of SAM Simulation Core (SSC) Software Development Kit (SDK) Yuqing Zhou Algorithmic Synthesis Laboratory (ASL) Department of Mechanical Engineering University of Michigan April 2013

2 Contents Abstract Introduction to SAM Simulation Core (SSC) Software Development Kit (SDK) Introduction to Solar/Wind Power System Solar Power Supply System Wind Power Supply System Module Database Solar PV Module Solar Inverter Module Wind Turbine Module Model Function PV/Inverter/Turbine Module Reader Function ( pvrader, invreader, tbreader ) Solar/Wind Energy Supply Function ( solarpwr, windpwr ) System Main Function ( mainsolar, mainwind ) Result Analysis Solar Energy Model Test Result Wind Energy Model Test Result Conclusion Reference

3 Abstract By using NREL recently released SAM Simulation Core (SSC) Software Development Kit (SDK) in MATLAB environment, we made the analytical and mathematical models of the energy supply capacity of distributed renewable energy sources including solar and wind power. The module database for PV, inverter and wind turbine is also established in order to reduce the module spec inputs to the main function. Compared with System Advisor Model (SAM) software, there is less than 1.0% error between our model and SAM. 1. Introduction to SAM Simulation Core (SSC) Software Development Kit (SDK) The SSC (SAM Simulation Core) software library implements the underlying renewable energy system modeling calculation engine utilized by the popular desktop System Advisor Model (SAM) tool. SSC provides a simple and programmer-friendly application programming interface (API) that allows developers to directly integrate SAM calculations into other tools. The API includes mechanisms to set input variable values, run simulations, and retrieve calculated outputs. The library is provided to users as pre-compiled binary dynamic libraries for Windows, Mac OSX, and Linux, with the bare minimum system library dependencies. While the native API language is ISO-standard C, language bindings for MATLAB and Python are included. To serve our purpose, we used MATLAB in Linux system environment. The Figure 1 shows how to call SSC SDK functions in MATLAB. Figure 1 SAM SSC SDK and MATLAB development environment 2. Introduction to Solar/Wind Power System 2.1 Solar Power Supply System Solar energy technologies include solar heating, solar photovoltaic, solar thermal 2

4 electricity, solar architecture and artificial photosynthesis. The technology we are interested in is the solar photovoltaic which converts sunlight into electric current using the photoelectric effect. A typical photovoltaic system (PV system) is made up of photovoltaic (PV) panels and DC/AC power inverters. The photovoltaic (PV) is a method of generating electrical power by converting solar radiation into direct current electricity using semiconductors that exhibit the photovoltaic effect. The solar inverter converts the variable direct current (DC) output of a photovoltaic (PV) solar panel into a utility frequency alternating current (AC) that can be fed into a commercial electrical grid or used by a local, off-grid electrical network. The solar photovoltaic system inputs can be summarized as local weather data, PV and inverter module specs and system layout information. An outline of the solar photovoltaic system is shown in Figure 2. Figure 2 Solar energy system overview 2.2 Wind Power Supply System Wind power is the conversion of wind energy into a useful form of energy, such as using wind turbines to make electrical power. Large wind systems consist of hundreds of wind turbines which are connected to the electric power transmission network. The wind power system inputs can be summarized as local weather data, wind turbine module specs, hub height installation information and system layout information. An overview of the wind power system is shown in Figure 3. 3

5 Figure 3 Wind energy system overview 3. Module Database In order to reduce the direct inputs to the main function of our models, or the design variables of the future optimization problem and enhance the flexibility of our model, a database of PV/inverter/turbine modules is established. 3.1 Solar PV Module We used SAM Sandia PV Array Performance model data for our PV database. It consists of a set of equations that provide values for five points on a module s I-V curve and a database of coefficients for the equations whose values are stored in the Sandia Modules library. The coefficients have been empirically determined based on a set of manufacturer specifications and measurements taken from modules installed outdoors in real, operating photovoltaic systems. The parameters in solar PV database are listed below. Table 1 Parameters in solar PV module database Title ID_pv pv_area pv_parallel Description Solar PV ID number Module area Module and mounting structure configuration 4

6 pv_a Temperature coefficient a pv_b Temperature coefficient b pv_dtc Temperature coefficient dt pv_fd Diffuse fraction pv_a0 Air mass polynomial coeff 0 pv_a1 Air mass polynomial coeff 1 pv_a2 Air mass polynomial coeff 2 pv_a3 Air mass polynomial coeff 3 pv_a4 Air mass polynomial coeff 4 pv_aimp Max power point current temperature coefficient pv_aisc Short circuit current temperature coefficient pv_b0 Incidence angle modifier polynomial coeff 0 pv_b1 Incidence angle modifier polynomial coeff 1 pv_b2 Incidence angle modifier polynomial coeff 2 pv_b3 Incidence angle modifier polynomial coeff 3 pv_b4 Incidence angle modifier polynomial coeff 4 pv_b5 Incidence angle modifier polynomial coeff 5 pv_bvmpo Max power point voltage temperature coefficient pv_bvoco Open circuit voltage temperature coefficient pv_c0 C0 pv_c1 C1 pv_c2 C2 pv_c3 C3 pv_c4 C4 pv_c5 C5 pv_c6 C6 pv_c7 C7 pv_impo Max power point current pv_isco Short circuit current pv_ixo Ix midpoint current pv_ixxo Ixx midpoint current pv_mbvmp Irradiance dependence of Vmp temperature coefficient pv_mbvoc Irradiance dependence of Voc temperature coefficient pv_n Diode factor pv_series Number of cells in series pv_vmpo Max power point voltage pv_voco Open circuit voltage 3.2 Solar Inverter Module We used the Sandia Performance Model for Grid-Connected PV Inverters from a database of commercially available inverters maintained by Sandia National Laboratory as our inverter spec data. The Sandia model consists of a set of equations that SAM uses to calculate the 5

7 inverter's hourly AC output based on the DC input and a set of empirically-determined coefficients that describe the inverter's performance characteristics. The equations involve a set of coefficients that have been empirically determined based on data from manufacturer specification sheets and either field measurements from inverters installed in operating systems, or laboratory measurements using the California Energy Commission (CEC) test protocol. The parameters in inverter database are listed below. Table 2 Parameters in inverter module database Title ID_inv inv_c0 inv_c1 inv_c2 inv_c3 inv_paco inv_pdco inv_pnt inv_pso inv_vdco inv_vdcmax Description Inverter ID number Curvature between ac-power and dc-power at ref Coefficient of Pdco variation with dc input voltage Coefficient of Pso variation with dc input voltage Coefficient of Co variation with dc input voltage AC maximum power rating DC input power at which ac-power rating is achieved AC power consumed by inverter at night DC power required to enable the inversion process DC input voltage for the rated ac-power rating Maximum dc input operating voltage 3.3 Wind Turbine Module We used SAM turbine spec data to establish the wind turbine database. According to the database, it can automatically populate the power curve, rated output and rotor diameter values. The parameters in wind turbine database are listed below. Table 3 Parameters in wind turbine module database Title ID_tb hub_efficiency pc_wind pc_power rotor_di cut_in Description Wind turbine ID number Turbulence coefficient Power curve wind speed array Power curve turbine output array Rotor diameter Cut-in wind speed 4. Model Function 4.1 PV/Inverter/Turbine Module Reader Function ( pvrader, invreader, tbreader ) With the input of PV/inverter/turbine module ID number, the certain reader function will return the PV/inverter/turbine module spec parameters listed in Table1 to 3 to the workspace for later usage of solar/wind energy performance function. 6

8 The function content for invreader is listed below. In addition, the pvreader and tbreader functions have the similar function contents as the one listed. function [inv_paco, inv_pdco, inv_vdco, inv_pso, inv_c0, inv_c1, inv_c2, inv_c3, inv_pnt, inv_vdcmax] = invreader(id_inv) % load inverter database invdata = xlsread('invexcel'); % inverter spec inv_paco = invdata(id_inv,1); inv_pdco = invdata(id_inv,2); inv_vdco = invdata(id_inv,3); inv_pso = invdata(id_inv,4); inv_c0 = invdata(id_inv,5); inv_c1 = invdata(id_inv,6); inv_c2 = invdata(id_inv,7); inv_c3 = invdata(id_inv,8); inv_pnt = invdata(id_inv,9); inv_vdcmax = invdata(id_inv,10); end 4.2 Solar/Wind Energy Supply Function ( solarpwr, windpwr ) After introducing the module database to the system model, the simplified system function descriptions of Figure1 and 2 can be summarized as following. Figure 4 Simplified solar energy system description For solarpwr function, the inputs of the function have been reduced to six which are local weather information: weather_file; module spec information: 7

9 ID_pv, ID_inv; system layout information: modules_per_string, strings_in_parrallel, inverter_count. Running the function, the output of hourly AC or DC solar energy profile can be obtained. Figure 5 Simplified wind energy system description For windpwr function, the inputs of the function are local weather information: file_name; module spec information: ID_tb, hub_ht; system layout information: wt_x, wt_y. Running the function, the output of hourly wind energy profile can be obtained. The function content for windpwr is listed below. In addition, the solarpwr function also has the similar function format as the one listed. function [farmpwr] = windpwr(file_name, pc_wind, pc_power, rotor_di, cutin, hub_ht, hub_efficiency, wt_x, wt_y) // the function headline which includes the function inputs and outputs 8

10 % load the API file ssccall('load'); % create a data container to store all the variables data = ssccall('data_create'); // load the SSC API file and create a data container to store function inputs %% setup weather data % ***hourly or Weibull model (0/1) % 0_hourly, 1_Weibull ssccall('data_set_number', data, 'model_choice', 0); % ***local SWRF file path ssccall('data_set_string', data, 'file_name', file_name); % ***Weibull K factor for wind resource ssccall('data_set_number', data, 'weibullk', 2.1); % ***wind recource class ssccall('data_set_number', data, 'resource_class', 7.6); // choose the weather data input mode and read the existing weather data file %% setup turbine % wind turbine performance curve % ***power curve wind speed array ssccall('data_set_array', data, 'pc_wind', pc_wind); % ***power curve turbine output array ssccall('data_set_array', data, 'pc_power', pc_power); % ***rotor diameter ssccall('data_set_number', data, 'rotor_di', rotor_di); % ***max cp (!!!not used, no effects to the result!!!) ssccall('data_set_number', data, 'max_cp', 0.37); % ***cut-in wind speed ssccall('data_set_number', data, 'cutin', cutin); % ***hub height ssccall('data_set_number', data, 'hub_ht', hub_ht); % ***array of hub efficiencies ssccall('data_set_array', data, 'hub_efficiency', hub_efficiency); % ***shear exponent ssccall('data_set_number', data, 'shear', 0.14); // read the outputs from tbreader function and setup other parameters for wind turbine spec 9

11 %% setup wind farm % ***turbine X coordinates ssccall('data_set_array', data, 'wt_x', wt_x); % ***turbine Y coordinates ssccall('data_set_array', data, 'wt_y', wt_y); % ***wake model (0/1/2) ssccall('data_set_number', data, 'wake_model', 1); % ***percentage losses ssccall('data_set_number', data, 'lossp', 0); % ***turbulence coefficient ssccall('data_set_number', data, 'turbul', 0.1); // setup the system layout information %% run % create the WindPower module module = ssccall('module_create', 'windpower'); % run the module ok = ssccall('module_exec', module, data); if ok, % if successful, retrieve the hourly AC generation data and print farmpwr = ssccall('data_get_array', data, 'farmpwr'); disp(sprintf('windpower: %.2f kwh',sum(farmpwr))); else % if it failed, print all the errors disp('windpower ver.2 errors:'); ii=0; while 1, err = ssccall('module_log', module, ii); if strcmp(err,''), break; end disp( err ); ii=ii+1; end end // run the model and report errors as necessary 10

12 % free the PVWatts module that we created ssccall('module_free', module); % release the data container and all of its variables ssccall('data_free', data); % unload the library ssccall('unload'); end // free the model, release the data container and unload the SAM library 4.3 System Main Function ( mainsolar, mainwind ) The main script for running the solar (wind) energy system model including pvreader, invreader and solarpwr ( tbreader and windpwr ) has been coded. The format of the main script follows the flowchart in Figure 4 and 5. The content of mainsolar has been listed below which is similar to that of mainwind. %% setup input % define weather location: Nagoya, Japan weather_file = '/afs/umich.edu/user/y/u/yuqingz/software/weatherdata/solar_nagoya.csv'; // read the weather file % define PV spec (input: ID_pv) ID_pv = 48; [pv_area, pv_series, pv_parallel, pv_isco, pv_voco, pv_impo, pv_vmpo, pv_aisc, pv_aimp, pv_c0, pv_c1, pv_bvoco, pv_mbvoc, pv_bvmpo, pv_mbvmp, pv_n, pv_c2, pv_c3, pv_a0, pv_a1, pv_a2, pv_a3, pv_a4, pv_b0, pv_b1, pv_b2, pv_b3, pv_b4, pv_b5, pv_dtc, pv_fd, pv_a, pv_b, pv_c4, pv_c5, pv_ixo, pv_ixxo, pv_c6, pv_c7] = pvreader(id_pv); // define the PV module ID and run pvreader function which will return PV spec information to the main script % define inverter spec (input: ID_inv) ID_inv = 285; [inv_paco, inv_pdco, inv_vdco, inv_pso, inv_c0, inv_c1, inv_c2, inv_c3, inv_pnt, inv_vdcmax] = invreader(id_inv); // define the inverter module ID and run invreader function which will return inverter spec information to the main script 11

13 % define system layout % ***number of modules per string modules_per_string = 10; % ***number of strings in parallel strings_in_parallel = 20; % ***number of inverters inverter_count = 8; // define the solar system layout information %% run the solar model [ac, dc] = solarpwr(weather_file, pv_area, pv_series, pv_parallel, pv_isco, pv_voco, pv_impo, pv_vmpo, pv_aisc, pv_aimp, pv_c0, pv_c1, pv_bvoco, pv_mbvoc, pv_bvmpo, pv_mbvmp, pv_n,pv_c2, pv_c3, pv_a0, pv_a1, pv_a2, pv_a3, pv_a4, pv_b0, pv_b1, pv_b2, pv_b3, pv_b4, pv_b5, pv_dtc, pv_fd, pv_a, pv_b, pv_c4, pv_c5, pv_ixo, pv_ixxo, pv_c6, pv_c7, inv_paco, inv_pdco, inv_vdco, inv_pso, inv_c0, inv_c1, inv_c2, inv_c3, inv_pnt, inv_vdcmax, modules_per_string, strings_in_parallel, inverter_count); // run the solarpwr function and obtain the system hourly energy supply result 5. Result Analysis In order to test the accuracy and reliability of our model, we ran both solar and wind models with constant inputs and compared the results with SAM. 5.1 Solar Energy Model Test Result I. Solar system test model description Location: Nagoya, Japan PV module: BP Solar BP3110 [2006 (E)] Inverter module: GE Energy: GEPVe-2000-NA V [CEC 2009] System layout: #PV: 10*20 #Inverter: 8 II. III. Annual result Annual ac energy: Error: % Hourly result SAM: 22620kWh MODEL: kWh 12

14 Figure 6 Solar system hourly AC power output Figure 6 above shows the solar system hourly AC output during one year period. In order to analyze the error with SAM software results, we listed the first 24 hours energy output from both our model and SAM in the following Table 4 and calculated the error for each hour. Time (h) PV_dc (SAM) (kwh) Table 4 First 24 hours' solar system dc/ac power output PV_dc (MODEL) (kwh) Error (%) 13 Time (h) PV_ac (SAM) (kwh) PV_ac (MODEL) (kwh) Error (%)

15 Wind Energy Model Test Result I. Wind system test model description Location: Eastern-Flat Lands, MI, USA Turbine module: Mitsubishi MWT 1000 System layout: (0, 0) (200, 700) (500, 0) (700, 700) I. Annual result Annual ac energy: Error: % SAM: Wh MODEL: kWh II. Hourly result Figure 7 Wind system hourly power output Figure 7 shows the hourly energy output of the wind farm throughout a year. In order to analyze the error with the SAM result, we also listed the first 24 hours energy output in the following Table 5 and calculated the error for each hour. 14

16 Table 5 First 24 hours' wind system power output Time (h) Wind (SAM) (kwh) Wind (MODEL) (kwh) Error (%) E E E-06 The result shown above proves that our model is quit accuracy and reliable with less than 0.5% error compared with SAM software result and flexible features, e.g. thousands of modules in database and hundreds of local weather data around the world. 6. Conclusion This report presented a renewable energy (solar/wind) supply model which is developed with SAM Simulation Core (SSC) Software Development Kit (SDK) in MATLAB environment. In addition, the module database for solar PV, inverters and wind turbines has also been established. The process of calling the database, initializing the inputs, implementing the code and running the model has been discussed in detail. The results of the model are then compared with SAM software results and turn out to be accurate, flexible and efficient. The error is less than 1.0% compared with the SAM result. Thousands of PV, inverter and turbine modules can be used by searching their ID number in the database. The speed of our code is about 3 to 5 seconds per iteration. 15

17 Reference [1] System Advisor Model Version (SAM ) National Renewable Energy Laboratory. Golden, CO. [2] System Advisor Model Version (SAM ) User Documentation. National Renewable Energy Laboratory. Golden, CO. 16