Skip to content

Implement CEC module performance model in place of desoto #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cwhanse opened this issue May 16, 2018 · 21 comments
Closed

Implement CEC module performance model in place of desoto #463

cwhanse opened this issue May 16, 2018 · 21 comments
Assignees
Milestone

Comments

@cwhanse
Copy link
Member

cwhanse commented May 16, 2018

The Desoto module performance model and the CEC model differ in that the CEC model has one additional parameter (an adjustment to temperature coefficients for Isc and Voc). pvlib-python implements only the Desoto model, but supplies parameters that are fit for the CEC model. Replacing the Desoto model with the CEC model would remove this inconsistency. The differences between the two model's results are quite minor.

@adriesse
Copy link
Member

Are you talking about the so-called "adjust" parameter, whose origins I had trouble tracing a year or more back?

@cwhanse
Copy link
Member Author

cwhanse commented May 16, 2018

Yes

@adriesse
Copy link
Member

adriesse commented May 16, 2018

I retained the impression that it was used to influence the fitting process rather than being a model parameter.

@cwhanse
Copy link
Member Author

cwhanse commented May 16, 2018

Adjust enters the IV curve calculation via the equation for light current: IL = G * ( IL0 + alphaprime (Tc - T0)), and alphaprime = alpha ( 1 - Adjust/100). As far as I know this is only detailed in A. Dobos paper describing the 6 parameter model coefficient calculator. The procedure to determine the value for Adjust is still obscure to me despite Aron's paper.

@adriesse
Copy link
Member

adriesse commented May 16, 2018

The way I view this is that your diode model parameters may end up with a new, adjusted alpha (compared to the datasheet value) but that doesn't really constitute an additional model parameter.

There are a number of things that worry me about that paper, including the sanity check that allows alpha and beta to be adjusted by +/- 100%.

@wholmgren
Copy link
Member

Can we add a CEC model while keeping desoto? Perhaps replace was in reference to the ModelChain logic?

I think I'd also want to add a corresponding model option in the ModelChain initialization. The model option could be automatically determined based on the presence or absence of the "Adjust" parameter in the supplied PVSystem.module_parameters.

@cwhanse
Copy link
Member Author

cwhanse commented May 17, 2018

We can (and I agree that we should) add the CEC model and keep the Desoto functions. However, strictly speaking we have CEC model parameters, rather than Desoto parameters. The values in SAM are determined simultaneously with the Adjust parameter (in the CEC bot not the Desoto model) and thus there is some (certainly minor) influence of the Adjust value on the other parameters.

@markcampanelli
Copy link
Contributor

FWIW there is https://www.nrel.gov/docs/fy18osti/67399.pdf, esp. section 10.4. There are many reasons why “the” reported Isc temperature coefficient could be need adjustment, such as its spectral dependence during measurement. Why the same adjustment would be used simultaneously on Isc and Voc (presumably in data fitting) I cannot say. I too would be suspect if the adjustment were large, and is it true then that an IV curve’s Voc could be very different from the “adjusted” value? If yes, then what Voc value would pvlib report?

@cwhanse
Copy link
Member Author

cwhanse commented May 17, 2018

The Adjust parameter acts to bring the model's temperature coefficients for power and Voc into line with the datasheet values. The temperature coefficients of power and Voc are model outputs rather than model parameter. The CEC model implements Adjust to provide this matching, PVSyst uses a temperature coefficient for the diode factor. In either case, the effect is to add a model parameter for fitting purposes.

@wholmgren wholmgren added this to the 0.6.0 milestone May 17, 2018
@wholmgren
Copy link
Member

Are we in agreement that:

  1. CEC model should be added to pvsystem.py as a function with a corresponding PVSystem wrapper method.
  2. ModelChain should use CEC model if it detects that PVSystem.module_parameters comes from the NREL database (possibly via the presence/absence of an Adjust parameter).
  3. Documentation should recommend using CEC model if module parameters come from the NREL database. Perhaps will be needed in a few places.
  4. Documentation examples that currently use desoto should be modified to use CEC (they all come from the NREL database)

@cwhanse
Copy link
Member Author

cwhanse commented May 17, 2018

#1 - 4 : I agree.

@adriesse
Copy link
Member

I'm not sure. I think part of my unease comes from the frequent use of the word model in this discussion without knowing exactly what it refers to in each instance. I think there are three separate "calculation steps" (for lack of a better word): the one-diode I-V curve equation (which hasn't changed in a long time and isn't associated with any particular name); the process of determining its 5 parameters at reference conditions from various measured quantities; and the translation of its parameters to represent different operating conditions. The third step is governed by additional measured quantities, such as alpha, or additional parameters produced in the second step, such as alphaprime/adjust.

Is there an easy way to keep these distinctions clear in the code structure etc?

@cwhanse
Copy link
Member Author

cwhanse commented May 17, 2018

I try to be consistent with my own terms, and hope that others adopt them, but time will tell. The single diode equation is a model (in a general sense) for an IV curve but it is not a model for a photovoltaic device. The single diode equation has 5 coefficients (I prefer not to call them parameters, although I've sort of given up on making that distinction). When I write 'single diode model' I mean the diode equation together with the other equations describing how the 5 coefficients change with irradiance, temperature, etc. The constants appearing in this larger set of equations are the single diode model parameters, e.g., light current at STC, alpha, diode factor, etc. For example, the Desoto model actually has 8 parameters: IL, Io, n, Rsh and Rs at STC (5), alpha_Isc, Eg at STC and dEgdT at STC. (3 more parameters).

In this nomenclature, Desoto is a photovoltaic performance model, PVsyst includes a photovoltaic performance model, but the single diode (or n-diode) equation is not a PV performance model.

To comment on what @adriesse writes, the 3 steps are separate and each is important. The '5 parameters at reference conditions'. Those 5 values are some, but not all, of the parameters for the Desoto, CEC or PVsyst performance models. To summarize what is in pvlib-python for each of the 3 steps mentioned by @adriesse :

  1. determine model parameters from measurements, No capability currently in pvlib-python but there's a stale, unfinished pull request for a method to estimate PVsyst model parameters.
  2. given parameters that determine a single diode performance model, calculate the 5 coefficients for the single diode equation at the desired irradiance etc. conditions. Here pvlib-python has calcparams_desoto, we could add calcparams_PVsyst, calcparams_CEC, etc.
  3. calculate an IV curve given a set of 5 coefficients. This is the current singlediode function.

@adriesse
Copy link
Member

Good, I don't think we disagree on anything important.

If in the proposed action 1 above, 'CEC model should be added' means making a calcparams_CEC function (or perhaps calc_1d_params_CEC) then I fully support it.

The rest sounds sensible too. Maybe the above discussion will turn out to be helpful when choosing words for the documentation updates.

@markcampanelli
Copy link
Contributor

With due consideration of a consistent API, I have no issue adding various model implementations. Personally, and following this terminology, section 2.1 with terms "calibration parameters" (e.g., dark current or shunt resistance at reference conditions) and "control variables" (e.g., temperature or irradiance). It seems that the term "coefficients" are indeed useful to distinguish values in the 5-parameter single diode equation that are computed as some function of calibration parameters and control variables in a PV performance model.

Am I correct that the adjust parameter only appears in the CEC's PV performance model in "the" short-circuit temperature coefficient, even although it might itself be calibrated using other "measured output values" such as various datasheet temperature coefficients?

Furthermore, when computing, say, a Voc value at a temperature different from reference conditions, can one expect that using an datasheet (or adjusted?) Voc temperature coefficient to be better/worse than computing the "same" value from the corresponding I-V curve from the PV performance model?

@cwhanse
Copy link
Member Author

cwhanse commented May 21, 2018

Am I correct that the adjust parameter only appears in the CEC's PV performance model in "the" short-circuit temperature coefficient, even although it might itself be calibrated using other "measured output values" such as various datasheet temperature coefficients?

Yes, Adjust is a calibration parameter in the CEC performance model, appearing in both the equation for the short circuit current temperature coefficient and the equation for the open circuit voltage temperature coefficient betaVoc. However, betaVoc is a model output and is not used in the calculation of the IV curve.

Furthermore, when computing, say, a Voc value at a temperature different from reference conditions, can one expect that using an datasheet (or adjusted?) Voc temperature coefficient to be better/worse than computing the "same" value from the corresponding I-V curve from the PV performance model?

I read your question as: how does Voc (from the single diode equation) compare to Voc computed with the linear expression involving betaVoc? That's a good question. I'll respond unhelpfully and say that the equation defining Voc as a model output is the single diode equation, so from the point of view of faithfully implementing a model in software, your question is moot.

@adriesse
Copy link
Member

I wondered about the second question too, and only have a theory, not an answer.

The median value for the adjust parameter in the CEC database is about 10%. This would seem to imply that the target beta for the CEC parameter optimization/search was 10% above the datasheet value, and consequently I would expect that when using this model I would see a higher beta value than the spec sheet.

If this is theory correct, then I would worry a little bit about modules with large adjust values. Voc is important for system sizing.

@markcampanelli
Copy link
Contributor

While the implementation details of how CEC parameters are calibrated using adjust are not entirely clear to me (and this approach seems fraught with likely issues), I agree that large adjust values appear worrisome with respect to goodness of fit.

It also appears that the only difference between the CEC and Desoto models' calculations is use of the short-circuit temperature coefficient vs. the "adjusted" short-circuit temperature coefficient. Is that correct?

I suppose that a related question here is whether pvlib should compute various temperature coefficients (i.e., various derivatives w.r.t. temperature) at reference/arbitrary conditions.

@cwhanse
Copy link
Member Author

cwhanse commented May 23, 2018

@thunderfish24 agree with you about the calibration. I suspect one reason for non-zero values of Adjust is that the calibration is matching the derivative at STC to an average rate of change over a range of temperature. You are correct, the only difference between CEC and Desoto that I know is the use of Adjust in the equation for the short-circuit current temperature coefficient.

We can certainly write functions to calculate derivatives for a specific single diode model, but I question whether there is widespread interest in them.

@markcampanelli
Copy link
Contributor

@cwhanse Do you know where the original CEC model is actually documented, esp. the "auxiliary equations"? I've been relying on this SAM documentation, but I'm not sure what changes may have been made here.

I have seen a significant difference in model calibration quality between the Desoto-style (no use) and PVsyst-style (use) implementation of the ideality factor in the auxiliary equation for the reverse saturation current (i.e., the reverse saturation current as a function of temperature).

@cwhanse
Copy link
Member Author

cwhanse commented Jun 5, 2018

As far as I know, the original documentation of the CEC model is here: https://www.researchgate.net/publication/254998479_An_Improved_Coefficient_Calculator_for_the_California_Energy_Commission_6_Parameter_Photovoltaic_Module_Model

Aron Dobos documented the model in the course of explaining how the SAM coefficient database was being determined. The SAM documentation for the CEC model looks to be consistent. The coefficient calculation is different, in that the diode factor (constant) is determined from fitting a line to Voc vs. log(irradiance), which is possible when IEC-61853 IV curve data are available.

@cwhanse cwhanse self-assigned this Jun 11, 2018
@cwhanse cwhanse mentioned this issue Sep 5, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants