You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pvsystem.sapm expected effective_irradiance in units of suns (1 sun = 1000 W/m2). pvsystem.calcparams_desoto expects effective_irradiance in W/m2. I want to change to consistent units for effective irradiance.
Also, calling this "effective irradiance" might be confused with the G_{eff} appearing in the DeSoto's master's thesis, which appears to have a different definition.
It appears above that I misunderstood the definition of the parameter S (it is "absorbed", and thus includes some losses). My underlying concern stands though, as it seems that we are struggling with making a consistent function API out of different models that construct "analogous" parameters somewhat differently. Because I am not an everyday user of some/all of DeSoto vs. CEC vs. PVsyst, I don't think I should comment on what is better: consistent API or fidelity to the original model formulation.
I will also point out that my difficulties wrapping my head around these various irradiance definitions is what lead me to yet another formulation of "effective irradiance". This formulation does not eliminate all the various issues either, but in some measurement setups it is significantly easier to reason about.
@thunderfish24 we are resolving the conflict about the irradiance input to calcparams_desoto as part of #462 - see my comment on this topic late in the discussion.
As it is now, calcparams_desoto accepts irradiance in W/m2, sapm expects irradiance in suns. If we agree, the change will be to sapm to accept irradiance in W/m2. The suns unit in sapm is likely a holdover from transcribing PVLib for matlab to python.
That's an idea. If we want to retain the units published for each model, I could see implementing a private helper function to convert units based on model. Not sure where it would plug into the model chain workflow, though.
Here another thought out of the left corner. Perhaps these functions should have just irradiance as a parameter, without further details. There is a similar situation with inverters, where it is clear there are some losses between the array and the power electronics, but the input to the inverter is just called p_dc, not p_dc_after_wiring_loss.
@adriesse I think that would be a step back for pvlib in terms of our objective to clarify the component models and their usage. For the inverter example you cite, I'd be inclined to add clarity to the p_dc input.
For this issue, my plan is to implement effective_irradiance in units of W/m2 for SAPM. I believe these changes will make the use of effective irradiance consistent throughout pvlib:
change pvsystem.sapm to expect effective_irradiance in units of W/m2
no change needed to pvsystem.sapm_celltemp
clarify signature of pvsystem.samp_effective_irradiance to add units to input parameter descriptions.
Activity
markcampanelli commentedon Jun 2, 2018
It seems like the Desoto quantity is an actual broadband total irradiance, possibly normalized but not "effective"---poa_global with irrad_ref in pvlib or S or S/Sref here, while the unitless SAPM quantity seems more properly called an "effective" irradiance as a ratio of currents.
markcampanelli commentedon Jun 3, 2018
Also, calling this "effective irradiance" might be confused with the G_{eff} appearing in the DeSoto's master's thesis, which appears to have a different definition.
markcampanelli commentedon Jun 3, 2018
It appears above that I misunderstood the definition of the parameter
S(it is "absorbed", and thus includes some losses). My underlying concern stands though, as it seems that we are struggling with making a consistent function API out of different models that construct "analogous" parameters somewhat differently. Because I am not an everyday user of some/all of DeSoto vs. CEC vs. PVsyst, I don't think I should comment on what is better: consistent API or fidelity to the original model formulation.I will also point out that my difficulties wrapping my head around these various irradiance definitions is what lead me to yet another formulation of "effective irradiance". This formulation does not eliminate all the various issues either, but in some measurement setups it is significantly easier to reason about.
adriesse commentedon Jun 3, 2018
I would prefer things called "irradiance" to have units of W/m2.
cwhanse commentedon Jun 4, 2018
@thunderfish24 we are resolving the conflict about the irradiance input to
calcparams_desotoas part of #462 - see my comment on this topic late in the discussion.cwhanse commentedon Jun 4, 2018
As it is now, calcparams_desoto accepts irradiance in W/m2, sapm expects irradiance in suns. If we agree, the change will be to sapm to accept irradiance in W/m2. The suns unit in sapm is likely a holdover from transcribing PVLib for matlab to python.
adriesse commentedon Jun 4, 2018
The original sapm report uses suns too. Maybe there is a role for an
effective_irradiance_factorto link the two.cwhanse commentedon Jun 4, 2018
That's an idea. If we want to retain the units published for each model, I could see implementing a private helper function to convert units based on model. Not sure where it would plug into the model chain workflow, though.
wholmgren commentedon Jun 4, 2018
I prefer
effective_irradiancein units of W/m^2. I prefer prepending or appending "normalized" for unitless quantities.adriesse commentedon Jun 6, 2018
Here another thought out of the left corner. Perhaps these functions should have just
irradianceas a parameter, without further details. There is a similar situation with inverters, where it is clear there are some losses between the array and the power electronics, but the input to the inverter is just calledp_dc, notp_dc_after_wiring_loss.cwhanse commentedon Jun 6, 2018
@adriesse I think that would be a step back for pvlib in terms of our objective to clarify the component models and their usage. For the inverter example you cite, I'd be inclined to add clarity to the
p_dcinput.adriesse commentedon Jun 6, 2018
I admit I didn't have that objective foremost in mind.
cwhanse commentedon Jun 11, 2018
For this issue, my plan is to implement
effective_irradiancein units of W/m2 for SAPM. I believe these changes will make the use of effective irradiance consistent throughout pvlib:pvsystem.sapmto expecteffective_irradiancein units of W/m2pvsystem.sapm_celltemppvsystem.samp_effective_irradianceto add units to input parameter descriptions.