-
Notifications
You must be signed in to change notification settings - Fork 1.1k
implement multi-MPPT inverter model #1085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
6477d7b
1abbcbb
6f16ff3
7fbbb46
e301c57
99019c9
3d4b988
a471629
4d487aa
2080adb
e89719d
7e4a80b
a0abc5a
9bf5f1a
613e287
7fae826
699853a
7bf9218
dd01b74
377e179
b68b3ad
38cfcea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,39 @@ | |
| from numpy.polynomial.polynomial import polyfit # different than np.polyfit | ||
|
|
||
|
|
||
| def _sandia_eff(v_dc, p_dc, inverter): | ||
| r''' | ||
| Calculate the inverter AC power without clipping | ||
| ''' | ||
| Paco = inverter['Paco'] | ||
| Pdco = inverter['Pdco'] | ||
| Vdco = inverter['Vdco'] | ||
| C0 = inverter['C0'] | ||
| C1 = inverter['C1'] | ||
| C2 = inverter['C2'] | ||
| C3 = inverter['C3'] | ||
| Pso = inverter['Pso'] | ||
|
|
||
| A = Pdco * (1 + C1 * (v_dc - Vdco)) | ||
| B = Pso * (1 + C2 * (v_dc - Vdco)) | ||
| C = C0 * (1 + C3 * (v_dc - Vdco)) | ||
|
|
||
| return (Paco / (A - B) - C * (A - B)) * (p_dc - B) + C * (p_dc - B)**2 | ||
|
|
||
|
|
||
| def _sandia_limits(power_ac, p_dc, Paco, Pnt, Pso): | ||
| r''' | ||
| Applies minimum and maximum power limits to `power_ac` | ||
| ''' | ||
| power_ac = np.minimum(Paco, power_ac) | ||
| try: | ||
| power_ac[p_dc < Pso] = -1.0 * abs(Pnt) | ||
| except TypeError: # float | ||
| if power_ac < Pso: | ||
| power_ac = -1.0 * abs(Pnt) | ||
| return power_ac | ||
|
|
||
|
|
||
| def sandia(v_dc, p_dc, inverter): | ||
| r''' | ||
| Convert DC power and voltage to AC power using Sandia's | ||
|
|
@@ -54,10 +87,10 @@ def sandia(v_dc, p_dc, inverter): | |
| Column Description | ||
| ====== ============================================================ | ||
| Paco AC power rating of the inverter. [W] | ||
| Pdco DC power input to inverter, typically assumed to be equal | ||
| to the PV array maximum power. [W] | ||
| Pdco DC power input that results in Paco output at reference | ||
| voltage Vdoc0. [W] | ||
kandersolar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Vdco DC voltage at which the AC power rating is achieved | ||
| at the reference operating condition. [V] | ||
| with Pdco power input. [V] | ||
| Pso DC power required to start the inversion process, or | ||
| self-consumption by inverter, strongly influences inverter | ||
| efficiency at low power levels. [W] | ||
|
|
@@ -91,29 +124,80 @@ def sandia(v_dc, p_dc, inverter): | |
| ''' | ||
|
|
||
| Paco = inverter['Paco'] | ||
| Pdco = inverter['Pdco'] | ||
| Vdco = inverter['Vdco'] | ||
| Pso = inverter['Pso'] | ||
| C0 = inverter['C0'] | ||
| C1 = inverter['C1'] | ||
| C2 = inverter['C2'] | ||
| C3 = inverter['C3'] | ||
| Pnt = inverter['Pnt'] | ||
| Pso = inverter['Pso'] | ||
|
|
||
| A = Pdco * (1 + C1 * (v_dc - Vdco)) | ||
| B = Pso * (1 + C2 * (v_dc - Vdco)) | ||
| C = C0 * (1 + C3 * (v_dc - Vdco)) | ||
|
|
||
| power_ac = (Paco / (A - B) - C * (A - B)) * (p_dc - B) + C * (p_dc - B)**2 | ||
| power_ac = np.minimum(Paco, power_ac) | ||
| power_ac = np.where(p_dc < Pso, -1.0 * abs(Pnt), power_ac) | ||
| power_ac = _sandia_eff(v_dc, p_dc, inverter) | ||
| power_ac = _sandia_limits(power_ac, p_dc, Paco, Pnt, Pso) | ||
|
|
||
| if isinstance(p_dc, pd.Series): | ||
| power_ac = pd.Series(power_ac, index=p_dc.index) | ||
|
|
||
| return power_ac | ||
|
|
||
|
|
||
| def sandia_multi(v_dc, p_dc, inverter): | ||
| r''' | ||
| Convert DC power and voltage to AC power for an inverter with multiple | ||
| MPPT inputs. | ||
|
|
||
| Uses Sandia's Grid-Connected PV Inverter model [1]_. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| v_dc : numeric or tuple of numeric | ||
| DC voltage on each MPPT input of the inverter. [V] | ||
|
|
||
| p_dc : numeric or tuple of numeric | ||
| DC power on each MPPT input of the inverter. [W] | ||
cwhanse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| inverter : dict-like | ||
| Defines parameters for the inverter model in [1]_. | ||
|
|
||
| Returns | ||
| ------- | ||
| power_ac : numeric | ||
| AC power output for the inverter. [W] | ||
|
|
||
| Raises | ||
| ------ | ||
| ValueError if v_dc and p_dc have different lengths. | ||
kandersolar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Notes | ||
| ----- | ||
| See :py:func:`pvlib.inverter.sandia` for definition of the parameters in | ||
| `inverter`. | ||
|
|
||
| References | ||
| ---------- | ||
| .. [1] D. King, S. Gonzalez, G. Galbraith, W. Boyson, "Performance Model | ||
| for Grid-Connected Photovoltaic Inverters", SAND2007-5036, Sandia | ||
| National Laboratories. | ||
|
|
||
| See also | ||
| -------- | ||
| pvlib.inverter.sandia | ||
| ''' | ||
|
|
||
| if isinstance(p_dc, tuple): | ||
cwhanse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if isinstance(v_dc, tuple) and not len(p_dc) == len(v_dc): | ||
| raise ValueError('p_dc and v_dc have different lengths') | ||
| power_dc = sum(p_dc) | ||
| else: | ||
| power_dc = sum((p_dc,)) # handle Series, array or float | ||
|
|
||
| power_ac = 0. * power_dc | ||
|
|
||
| if isinstance(p_dc, tuple): | ||
| for vdc, pdc in zip(v_dc, p_dc): | ||
| power_ac += pdc / power_dc * _sandia_eff(vdc, power_dc, inverter) | ||
| else: | ||
| power_ac = _sandia_eff(v_dc, power_dc, inverter) | ||
|
||
|
|
||
| return _sandia_limits(power_ac, power_dc, inverter['Paco'], | ||
| inverter['Pnt'], inverter['Pso']) | ||
|
|
||
|
|
||
| def adr(v_dc, p_dc, inverter, vtol=0.10): | ||
| r''' | ||
| Converts DC power and voltage to AC power using Anton Driesse's | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.