-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
I'd like to consider adding a function to pvsystem.py
that would multiply the voltages and currents returned by pvsystem.sapm
and pvsystem.singlediode
. Of course, the motivation for this is to make it easier to calculate array parameters.
def multiply_voltage_current(data, voltage_multiplier=1, current_multiplier=1):
# as written, only works with a DataFrame
# could make it work with a dict, but it would be more verbose
data = data.copy()
voltages = ['v_mp', 'v_oc']
currents = ['i_mp' ,'i_x', 'i_xx', 'i_sc']
data[voltages] *= voltage_multiplier
data[currents] *= current_multiplier
data['p_mp'] *= voltage_multiplier * current_multiplier
return data
# within the PVSystem class...
def multiply_voltage_current(self, data):
return multiply_voltage_current(
data, voltage_multiplier=self.series_modules,
current_multiplier=self.parallel_modules)
Maybe the function can also be reused for some system losses.