Solar Cell Parameter Extraction from Data
This example shows optimization of the Solar Cell block's parameters to fit data defined over a range of different temperatures. It uses the MATLAB® optimization function fminsearch
. Other products available for performing this type of parameter fitting with Simscape™ Electrical™ models are the Optimization Toolbox™ and Simulink® Design Optimization™. These products provide predefined functions to manipulate and analyze blocks using GUIs or a command line approach.
Strategy
Fit I-V output curves for an 8 Parameter Solar Cell to data using a 2 step procedure:
Optimize parameters in the Solar Cell Main dialog tab to match output curves to data at room temperature.
Optimize parameters in the Solar Cell Temperature dialog tab to match output curves to data at non-room temperatures.
Data and Block Setup
The MATLAB data file, SolarCellFromDatasheetData.mat, stores Solar Cell data as an array of structures. Each structure contains 3 fields: temperature , i (current) and v (voltage). The Solar Cell block references a data structure to set the device operating temperature, the VPulse block's Pulse value, V2, and to generate simulation output currents at prescribed voltages. The prescribed voltages are set by outputting simulation results at prescribed output times. To set the output times, on the Modeling tab, click Model Settings; in the Configuration Parameters, in the Data Import/Export category, click Additional parameters and specify the Output times. Scopes save the output voltage and current responses as structure data, Io.signal.values and Vo.signal.values.
Initial Parameter Specification
Starting values for fminsearch
can be estimated using a combination of Solar Cell block defaults, data sheet values and the following equations:
List of parameters and initial values prior to optimization
Since fminsearch
is an unconstrained nonlinear optimizer that locates a local minimum of a function, varying the initial estimate will result in a different solution set.
Plot Data Versus Solar Cell Output Using Initial Parameters
Load 8 parameter Solar Cell model and set parameters
Sum of Squares of Error Calculation
SolarCellFromDatasheetCostFunction
is the function to be minimized by fminsearch
. This function returns a sum of squares of error for the difference between the solar cell output current and the data. If an invalid parameter value is supplied by fminsearch
, the catch
statement returns a large value for the error.
Optimize Main Tab Dialog Parameters at Room Temperature (Step 1)
Optimized parameters for the solar cell main dialog tab are: Is = 3.14978e-07 Iph = 3.80137 ec = 1.39989 Rs = 0.00415132 Rp = 10.1093
Optimize Parameters Controlling Temperature Dependence (Step 2)
Optimized parameters for the solar cell temperature dialog tab are: TIPH1 = 0.00080492 EG = 1.1384 TXIS1 = 3.3842