Skip to content

Commit

Permalink
Create two with_pvwatts examples
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamRJensen authored Sep 18, 2023
1 parent 0900524 commit 6cc1a11
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,17 +593,26 @@ def with_pvwatts(cls, system, location,
>>> module_parameters = dict(gamma_pdc=-0.003, pdc0=4500)
>>> inverter_parameters = dict(pdc0=4000)
>>> tparams = temperature.TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
>>> system = pvsystem.PVSystem(
>>> surface_tilt=30, surface_azimuth=180,
>>> module_parameters=module_parameters,
>>> inverter_parameters=inverter_parameters,
>>> temperature_model_parameters=tparams)
>>> loc = location.Location(32.2, -110.9)
>>> modelchain.ModelChain.with_pvwatts(system, loc)
The following example is a modification of the example above but where
custom losses have been specified.
>>> 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}
>>> system = pvsystem.PVSystem(
>>> system_with_custom_losses = 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.ModelChain.with_pvwatts(system_with_custom_losses, loc)
ModelChain:
name: None
clearsky_model: ineichen
Expand Down

0 comments on commit 6cc1a11

Please sign in to comment.