# Tilt Correlation Art¶

A rough look at the correlation between power generation from arrays on east- and west-facing roof planes as tilt increases.

```from pvlib import pvsystem, modelchain, location
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

array_kwargs = dict(
module_parameters=dict(pdc0=1, gamma_pdc=-0.004),
temperature_model_parameters=dict(a=-3.56, b=-0.075, deltaT=3)
)

loc = location.Location(40, -80)
times = pd.date_range('2019-01-01 06:00', '2019-01-01 18:00', freq='1min',
tz='Etc/GMT+5')
weather = loc.get_clearsky(times)

def run_sim(tilt):
arrays = [
pvsystem.Array(pvsystem.FixedMount(tilt, 270), name='West-Facing Array',
**array_kwargs),
pvsystem.Array(pvsystem.FixedMount(tilt, 90), name='East-Facing Array',
**array_kwargs),
]
system = pvsystem.PVSystem(arrays=arrays, inverter_parameters=dict(pdc0=3))
mc = modelchain.ModelChain(system, loc, aoi_model='physical',
spectral_model='no_loss')

mc.run_model(weather)
return mc.results.dc

tilts = np.arange(0, 90, 5)
powers = map(run_sim, tilts)
corrs = [p1.corr(p2) for p1, p2 in powers]

plt.plot(tilts, corrs)
plt.ylabel('Pearson Correlation')
plt.xlabel('Tilt [degrees]')
```

Out:

```Text(0.5, 23.52222222222222, 'Tilt [degrees]')
```

It’s also good for making art:

```fig, ax = plt.subplots(figsize=(4, 4))

for tilt in [0, 10, 20, 30]:
p1, p2 = run_sim(tilt)
ax.scatter(p1, p2, label=tilt)
```
```# sphinx_gallery_thumbnail_number = 2
```

Total running time of the script: ( 0 minutes 2.654 seconds)

Gallery generated by Sphinx-Gallery