0

This is my code. I am very new to pvlib and copy-pasted, and I switched the API references from the website. I am trying to create a device that can track the sun throughout the day that is a dual axis. This is the code I have. I wonder how to have it to this segmented dual-axis tracker and print out the solar zenith and azimuth angles throughout the day for a specific amount of time. Sorry if the code is formatted weirdly it was weird to input.

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

class DualAxisTrackerMount(pvsystem.AbstractMount):
    def get_orientation(self, solar_zenith, solar_azimuth):
        zenith_subset = solar_zenith.resample('15min').first()
        azimuth_subset = solar_azimuth.resample('15min').first()
        return {'surface_tilt': zenith_subset, 'surface_azimuth': azimuth_subset}

loc = location.Location(40, -80)
array = pvsystem.Array(
    mount=DualAxisTrackerMount(),
    module_parameters=dict(pdc0=1, gamma_pdc=-0.004, b=0.05),
    temperature_model_parameters=dict(a=-3.56, b=-0.075, deltaT=3))
system = pvsystem.PVSystem(arrays=[array], inverter_parameters=dict(pdc0=3))
mc = modelchain.ModelChain(system, loc, spectral_model='no_loss')

times = pd.date_range('2019-01-01 06:00', '2019-01-01 18:00', freq='15min',
                      tz='Etc/GMT+5')
weather = loc.get_clearsky(times)
mc.run_model(weather)
Mark Mikofski
  • 19,398
  • 2
  • 57
  • 90
BEn
  • 5
  • 4

0 Answers0