4343# ModelChain, particularly they are used by the methods
4444# ModelChain.with_pvwatts, ModelChain.with_sapm, etc.
4545
46+
47+
4648# pvwatts documentation states that it uses the following reference for
4749# a temperature model: Fuentes, M. K. (1987). A Simplified Thermal Model
4850# for Flat-Plate Photovoltaic Arrays. SAND85-0330. Albuquerque, NM:
@@ -1713,6 +1715,48 @@ def run_model_from_poa(self, data):
17131715 of Arrays in the PVSystem.
17141716 ValueError
17151717 If the DataFrames in `data` have different indexes.
1718+ Examples
1719+ --------
1720+ Single-array system:
1721+ >>> import pandas as pd
1722+ >>> from pvlib.pvsystem import PVSystem
1723+ >>> from pvlib.location import Location
1724+ >>> from pvlib.modelchain import ModelChain
1725+ >>>
1726+ >>> system = PVSystem(module_parameters={'pdc0': 300})
1727+ >>> location = Location(35, -110)
1728+ >>> mc = ModelChain(system, location)
1729+ >>>
1730+ >>> poa = pd.DataFrame({
1731+ ... 'poa_global': [900, 850],
1732+ ... 'poa_direct': [600, 560],
1733+ ... 'poa_diffuse': [300, 290],
1734+ ... },
1735+ ... index=pd.date_range("2021-06-01", periods=2, freq="H"))
1736+ >>>
1737+ >>> mc.run_model_from_poa(poa)
1738+ <pvlib.modelchain.ModelChain ...>
1739+
1740+ Multi-array system:
1741+ >>> array1 = Array(tilt=30, azimuth=180)
1742+ >>> array2 = Array(tilt=10, azimuth=90)
1743+ >>> system = PVSystem(arrays=[array1, array2],
1744+ ... module_parameters={'pdc0': 300})
1745+ >>> mc = ModelChain(system, location)
1746+ >>> poa1 = pd.DataFrame({
1747+ ... 'poa_global': [900, 880],
1748+ ... 'poa_direct': [600, 580],
1749+ ... 'poa_diffuse': [300, 300],
1750+ ... },
1751+ ... index=pd.date_range("2021-06-01", periods=2, freq="H"))
1752+ >>> poa2 = pd.DataFrame({
1753+ ... 'poa_global': [700, 720],
1754+ ... 'poa_direct': [400, 420],
1755+ ... 'poa_diffuse': [300, 300],
1756+ ... },
1757+ ... index=poa1.index)
1758+ >>> mc.run_model_from_poa([poa1, poa2])
1759+ <pvlib.modelchain.ModelChain ...>
17161760
17171761 Notes
17181762 -----
@@ -1738,7 +1782,6 @@ def run_model_from_poa(self, data):
17381782 self ._run_from_effective_irrad (data )
17391783
17401784 return self
1741-
17421785 def _run_from_effective_irrad (self , data ):
17431786 """
17441787 Executes the temperature, DC, losses and AC models.
@@ -1757,7 +1800,7 @@ def _run_from_effective_irrad(self, data):
17571800
17581801 Notes
17591802 -----
1760- Assigns attributes:``cell_temperature``, ``dc`` , ``ac`` , ``losses``,
1803+ Assigns attributes:``cell_temperature, 'dc' , ``ac' , ``losses``,
17611804 ``diode_params`` (if dc_model is a single diode model).
17621805 """
17631806 self ._prepare_temperature (data )
@@ -1798,7 +1841,6 @@ def run_model_from_effective_irradiance(self, data):
17981841 of Arrays in the PVSystem.
17991842 ValueError
18001843 If the DataFrames in `data` have different indexes.
1801-
18021844 Notes
18031845 -----
18041846 Optional ``data`` columns ``'cell_temperature'``,
@@ -1836,6 +1878,7 @@ def run_model_from_effective_irradiance(self, data):
18361878 return self
18371879
18381880
1881+
18391882def _irrad_for_celltemp (total_irrad , effective_irradiance ):
18401883 """
18411884 Determine irradiance to use for cell temperature models, in order
0 commit comments