From ef21f28d2b14a1af1881c8ea8ff0f4f2d9524164 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Sat, 16 Sep 2023 15:17:59 +0200 Subject: [PATCH 1/6] Add loss input to modelchain.with_pvwatts docs --- pvlib/modelchain.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index a4d2a19317..58ddd52b93 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -582,17 +582,27 @@ def with_pvwatts(cls, system, location, constructor and take precedence over the default configuration. + .. warning:: + The PVWatts model assumes 14% total system losses. The loss assumptions + can be modified as shown in the example below. + 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} + >>> 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 From 1cdcb185e8c8ce14b3f41d324df409f06f8ad732 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Sat, 16 Sep 2023 15:37:57 +0200 Subject: [PATCH 2/6] Update warning --- pvlib/modelchain.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 58ddd52b93..340c7d8598 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -582,9 +582,10 @@ def with_pvwatts(cls, system, location, constructor and take precedence over the default configuration. - .. warning:: - The PVWatts model assumes 14% total system losses. The loss assumptions - can be modified as shown in the example below. + Warning + ------- + The PVWatts model assumes 14% total system losses. The loss assumptions + can be modified as shown in the example below. Examples -------- From 090052446ebaf154f3eb79f972d31ea14661aebe Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Sat, 16 Sep 2023 16:32:06 +0200 Subject: [PATCH 3/6] Update warning description --- pvlib/modelchain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 340c7d8598..b975c7b7e2 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -584,8 +584,8 @@ def with_pvwatts(cls, system, location, Warning ------- - The PVWatts model assumes 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 can be modified as shown in the example below. Examples -------- From 6cc1a11cc4d6f700c41c2b65e6157f18e056cf1b Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Mon, 18 Sep 2023 21:01:44 +0200 Subject: [PATCH 4/6] Create two with_pvwatts examples --- pvlib/modelchain.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index b975c7b7e2..89fd36dc40 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -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 From ede88259d0d9eebd63b98d1c7875a084df6ddbeb Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Mon, 18 Sep 2023 21:10:25 +0200 Subject: [PATCH 5/6] Fix doc rendering --- pvlib/modelchain.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 89fd36dc40..468f7d07b6 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -603,6 +603,7 @@ def with_pvwatts(cls, system, location, 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} From 6653aa4fd780332032b5e46901722b545262e909 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Thu, 21 Sep 2023 15:33:18 +0200 Subject: [PATCH 6/6] Update docs --- pvlib/modelchain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 468f7d07b6..c1ea50e1b2 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -584,8 +584,9 @@ def with_pvwatts(cls, system, location, Warning ------- - 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 PVWatts + losses are fractions of DC power and can be modified, as shown in the + example below. Examples --------