pvlib.iam.convert#
- pvlib.iam.convert(source_name, source_params, target_name, weight=<function _sin_weight>, fix_n=True, xtol=None)[source]#
Convert a source IAM model to a target IAM model.
- Parameters:
source_name (str) – Name of the source model. Must be
'ashrae'
,'martin_ruiz'
, or'physical'
.source_params (dict) –
A dictionary of parameters for the source model.
If source model is
'ashrae'
, the dictionary must contain the key'b'
.If source model is
'martin_ruiz'
, the dictionary must contain the key'a_r'
.If source model is
'physical'
, the dictionary must contain the keys'n'
,'K'
, and'L'
.target_name (str) – Name of the target model. Must be
'ashrae'
,'martin_ruiz'
, or'physical'
.weight (function, optional) – A single-argument function of AOI (degrees) that calculates weights for the residuals between models. Must return a float or an array-like object. The default weight function is \(f(aoi) = 1 - sin(aoi)\).
fix_n (bool, default True) –
A flag to determine which method is used when converting from the ASHRAE model to the physical model.
When
source_name
is'ashrae'
andtarget_name
is'physical'
, if fix_n isTrue
,iam.convert()
will fixn
so that the returned physical model has the same x-intercept as the inputted ASHRAE model. Fixingn
like this improves the fit of the conversion, but often returns unrealistic values for the parameters of the physical model. If more physically meaningful parameters are wanted, set fix_n to False.xtol (float, optional) – Passed to scipy.optimize.minimize.
- Returns:
dict – Parameters for the target model.
If target model is
'ashrae'
, the dictionary will contain the key'b'
.If target model is
'martin_ruiz'
, the dictionary will contain the key'a_r'
.If target model is
'physical'
, the dictionary will contain the keys'n'
,'K'
, and'L'
.
Note
Target model parameters are determined by minimizing
\[\sum_{\theta=0}^{90} weight \left(\theta \right) \times \| source \left(\theta \right) - target \left(\theta \right) \|\]The sum is over \(\theta = 0, 1, 2, ..., 90\).
References