Skip to content

Commit ccfee19

Browse files
authored
Add loss input to example in modelchain.with_pvwatts docs (#1863)
* Add loss input to modelchain.with_pvwatts docs * Update warning * Update warning description * Create two with_pvwatts examples * Fix doc rendering * Update docs
1 parent 7608eda commit ccfee19

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

pvlib/modelchain.py

+29-7
Original file line numberDiff line numberDiff line change
@@ -582,17 +582,39 @@ def with_pvwatts(cls, system, location,
582582
constructor and take precedence over the default
583583
configuration.
584584
585+
Warning
586+
-------
587+
The PVWatts model defaults to 14 % total system losses. The PVWatts
588+
losses are fractions of DC power and can be modified, as shown in the
589+
example below.
590+
585591
Examples
586592
--------
593+
>>> from pvlib import temperature, pvsystem, location, modelchain
587594
>>> module_parameters = dict(gamma_pdc=-0.003, pdc0=4500)
588595
>>> inverter_parameters = dict(pdc0=4000)
589-
>>> tparams = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
590-
>>> system = PVSystem(surface_tilt=30, surface_azimuth=180,
591-
... module_parameters=module_parameters,
592-
... inverter_parameters=inverter_parameters,
593-
... temperature_model_parameters=tparams)
594-
>>> location = Location(32.2, -110.9)
595-
>>> ModelChain.with_pvwatts(system, location)
596+
>>> tparams = temperature.TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
597+
>>> system = pvsystem.PVSystem(
598+
>>> surface_tilt=30, surface_azimuth=180,
599+
>>> module_parameters=module_parameters,
600+
>>> inverter_parameters=inverter_parameters,
601+
>>> temperature_model_parameters=tparams)
602+
>>> loc = location.Location(32.2, -110.9)
603+
>>> modelchain.ModelChain.with_pvwatts(system, loc)
604+
605+
The following example is a modification of the example above but where
606+
custom losses have been specified.
607+
608+
>>> pvwatts_losses = {'soiling': 2, 'shading': 3, 'snow': 0, 'mismatch': 2,
609+
>>> 'wiring': 2, 'connections': 0.5, 'lid': 1.5,
610+
>>> 'nameplate_rating': 1, 'age': 0, 'availability': 30}
611+
>>> system_with_custom_losses = pvsystem.PVSystem(
612+
>>> surface_tilt=30, surface_azimuth=180,
613+
>>> module_parameters=module_parameters,
614+
>>> inverter_parameters=inverter_parameters,
615+
>>> temperature_model_parameters=tparams,
616+
>>> losses_parameters=pvwatts_losses)
617+
>>> modelchain.ModelChain.with_pvwatts(system_with_custom_losses, loc)
596618
ModelChain:
597619
name: None
598620
clearsky_model: ineichen

0 commit comments

Comments
 (0)