Skip to content

Add loss input to example in modelchain.with_pvwatts docs #1863

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

Merged
merged 6 commits into from
Sep 21, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,17 +582,28 @@ def with_pvwatts(cls, system, location,
constructor and take precedence over the default
configuration.

Warning
-------
The PVWatts model defaults to 14 % total system losses. The loss
assumptions can be modified as shown in the example below.
Copy link
Member Author

@AdamRJensen AdamRJensen Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The PVWatts model defaults to 14 % total system losses. The loss
assumptions can be modified as shown in the example below.
The PVWatts model defaults to 14 % total system losses. The loss
assumptions represent annual averages and can be modified as
shown in the example below.
The model is not recommended for high-accuracy applications.

Thoughts on this edit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two thoughts, neither of which I feel too strongly about:

  • I think "annual averages" is true but not as specific as it could be. How about "...represent constant DC-side loss fractions and can be modified..."? As an aside, constant losses means all simulation timesteps are affected equally (on a relative basis), so the "snow loss" applies to July just as much as it does to December...
  • Re "not recommended": I certainly don't disagree with the sentiment, but this struck me as too subjective a statement to be appropriate for pvlib's documentation. If we want to make novice users aware that PVWatts v5 isn't a very detailed model, I think it would be better to describe what the model does (or doesn't) do, and let the user judge suitability for themselves.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bikeshedding: "The PVWatts losses are fractions of DC power and can be modified..."


Examples
--------
>>> from pvlib import temperature, pvsystem, location, modelchain
>>> module_parameters = dict(gamma_pdc=-0.003, pdc0=4500)
>>> inverter_parameters = dict(pdc0=4000)
>>> tparams = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
>>> system = PVSystem(surface_tilt=30, surface_azimuth=180,
... module_parameters=module_parameters,
... inverter_parameters=inverter_parameters,
... temperature_model_parameters=tparams)
>>> location = Location(32.2, -110.9)
>>> ModelChain.with_pvwatts(system, location)
>>> tparams = temperature.TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
>>> pvwatts_losses = {'soiling': 2, 'shading': 3, 'snow': 0, 'mismatch': 2,
>>> 'wiring': 2, 'connections': 0.5, 'lid': 1.5,
>>> 'nameplate_rating': 1, 'age': 0, 'availability': 30}
Comment on lines +608 to +610
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have two examples here, one that keeps things as simple as possible, and one that gets more into the weeds (like specifying losses)? with_pvwatts is an easy point of entry for ModelChain, and PVWatts isn't really the model to use if you care a lot about the details, so I'm hesitant to make the only usage example more complicated.

IMHO there is also an argument to be made that PVWatts losses aren't really legitimate on their own and are better regarded as a single combined fudge factor, but maybe that's just my editorializing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think users should ever run a model without any considerations for what losses are specified or at least be aware that losses are accounted for by the model? Acknowledging and accepting the default values is perfectly resonable, but awareness of what they are seems pertinent.

Copy link
Member Author

@AdamRJensen AdamRJensen Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created two examples, one simple and one that builds upon the simple one where the losses are modified.

Let me know if it warrants a whatsnew entry (I don't think it does).

>>> system = pvsystem.PVSystem(
>>> surface_tilt=30, surface_azimuth=180,
>>> module_parameters=module_parameters,
>>> inverter_parameters=inverter_parameters,
>>> temperature_model_parameters=tparams,
>>> losses_parameters=pvwatts_losses)
>>> loc = location.Location(32.2, -110.9)
>>> modelchain.ModelChain.with_pvwatts(system, loc)
ModelChain:
name: None
clearsky_model: ineichen
Expand Down