Skip to content

pvwatts loss model implementation with user defined input values  #484

Closed

Description

@Jawairia123

Hi,

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.

Will appreciate if anyone can guide me to it!

Thanks in advance!

Regards

Activity

  1. cwhanse commented on Jun 18, 2018

    @cwhanse
    Member

    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.

  2. wholmgren commented on Jun 18, 2018

    @wholmgren
    Member

    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.

  3. cwhanse commented on Jun 18, 2018

    @cwhanse
    Member

    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.

  4. wholmgren commented on Jun 18, 2018

    @wholmgren
    Member
  5. Jawairia123 commented on Jun 19, 2018

    @Jawairia123
    Author

    @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)

  6. Jawairia123 commented on Jun 19, 2018

    @Jawairia123
    Author

    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.

  7. added this to the Someday milestone on Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions