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
{{ message }}
Repository navigation
pvwatts loss model implementation with user defined input values #484
I am trying to use pvwatts loss model with ModelChain with user defined loss values instead of the default ones.
I understand that for default values I just have to pass "pvwatts" string as the losses_model but I am not sure how can I link the loss model with user-specified values in the ModelChain function. I have tried all the possible ways that I can think of but still not sure how this will be implemented.
You can use keyword arguments with pvsystem.pvwatts_losses . It's not clear that these arguments are accessible through a ModelChain object - @wholmgren can you confirm or correct? If they are not accessible we need a new Issue opened.
There is currently no easy way to combine ModelChain and user-defined losses for the pvwatts model. Implementing this in the standard pvlib pattern would require adding an attribute to the PVSystem object that defines the losses, then looking up that data during a call to PVSystem.pvwatts_losses. For example,
system = PVSystem(module_parameters={'pvwatts_losses' = {'soiling': 3, 'wiring': 1}}
system.pvwatts_losses() # uses tools._build_kwargs to extract keys, if available.
One problem is that most of the losses parameters are poorly described by the existing PVSystem attributes (module_parameters, inverter_parameters, etc), so we might want to define a new generic attribute such as losses_parameters.
In the meantime, you can use the approach outlined here to define your own function that calls the existing pvsystem.pvwatts_losses with your parameters.
One problem is that most of the losses parameters are poorly described by the existing PVSystem attributes (module_parameters, inverter_parameters, etc), so we might want to define a new generic attribute such as losses_parameters.
I'm in favor of this approach. Thinking further, perhaps losses_parameters could be a dict with entries for the different categories of loss. We could start with the PVWatts list, or the PVsyst waterfall. Either way, it would be an enhancement and merits its own Issue.
On Mon, Jun 18, 2018 at 9:41 AM Cliff Hansen ***@***.***> wrote:
One problem is that most of the losses parameters are poorly described by
the existing PVSystem attributes (module_parameters, inverter_parameters,
etc), so we might want to define a new generic attribute such as
losses_parameters.
I'm in favor of this approach. Thinking further, perhaps losses_parameters
could be a dict with entries for the different categories of loss. We could
start with the PVWatts list, or the PVsyst waterfall. Either way, it would
be an enhancement and merits its own Issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#484 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AELiR5mhsO9Jh8_R1ilGUjoMjiIrxuURks5t99grgaJpZM4UraX4>
.
@wholmgren I tried linking my function with the ModelChain.
If I include "pvwatts" as output to my function. ModelChain is accepting it but otherwise on linking when the output is an integer value (from the pvwatts loss function), there appears an error (the first argument must be callable)
Activity
cwhanse commentedon Jun 18, 2018
You can use keyword arguments with
pvsystem.pvwatts_losses. It's not clear that these arguments are accessible through aModelChainobject - @wholmgren can you confirm or correct? If they are not accessible we need a new Issue opened.wholmgren commentedon Jun 18, 2018
There is currently no easy way to combine
ModelChainand user-defined losses for the pvwatts model. Implementing this in the standard pvlib pattern would require adding an attribute to thePVSystemobject that defines the losses, then looking up that data during a call toPVSystem.pvwatts_losses. For example,One problem is that most of the losses parameters are poorly described by the existing
PVSystemattributes (module_parameters, inverter_parameters, etc), so we might want to define a new generic attribute such aslosses_parameters.In the meantime, you can use the approach outlined here to define your own function that calls the existing
pvsystem.pvwatts_losseswith your parameters.cwhanse commentedon Jun 18, 2018
I'm in favor of this approach. Thinking further, perhaps
losses_parameterscould be a dict with entries for the different categories of loss. We could start with the PVWatts list, or the PVsyst waterfall. Either way, it would be an enhancement and merits its own Issue.wholmgren commentedon Jun 18, 2018
Jawairia123 commentedon Jun 19, 2018
@wholmgren I tried linking my function with the
ModelChain.If I include
"pvwatts"as output to my function.ModelChainis accepting it but otherwise on linking when the output is an integer value (from the pvwatts loss function), there appears an error (the first argument must be callable)Jawairia123 commentedon Jun 19, 2018
I have been suggested the following by one of the members of pvlib google group.
a = mc.ac * (1 - pvlib.pvsystem.pvwatts_losses(soiling=2, shading=3, snow=0, mismatch=2, wiring=2, connections=0.5, lid=1.5, nameplate_rating=1, age=0, availability=3)/100)i.e. to deduce the loss directly from the output. And since pvwatts applies losses only at final stage, this is working.
It would be very helpful to see PVsyst system model and the loss calculation approach in pvlib-python.