v-pvmismatch 0.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- v_PVMismatch-0.0.8/LICENSE +21 -0
- v_PVMismatch-0.0.8/PKG-INFO +33 -0
- v_PVMismatch-0.0.8/README.md +17 -0
- v_PVMismatch-0.0.8/pyproject.toml +29 -0
- v_PVMismatch-0.0.8/setup.cfg +4 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/__init__.py +21 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/circuit_comb.py +272 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/pvmismatch/__init__.py +12 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/pvmismatch/pvcell.py +339 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/pvmismatch/pvconstants.py +268 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/pvmismatch/pvexceptions.py +22 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/pvmismatch/pvmodule.py +635 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/pvmismatch/pvstring.py +231 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/pvmismatch/pvsystem.py +237 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/utils.py +361 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/vpvcell.py +162 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/vpvmodule.py +322 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/vpvstring.py +104 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch/vpvsystem.py +365 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch.egg-info/PKG-INFO +33 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch.egg-info/SOURCES.txt +27 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch.egg-info/dependency_links.txt +1 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch.egg-info/requires.txt +1 -0
- v_PVMismatch-0.0.8/src/v_PVMismatch.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Kiran Balasubramanian
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: v_PVMismatch
|
|
3
|
+
Version: 0.0.8
|
|
4
|
+
Summary: Vectorized PVMismatch (v_PVMismatch) Package.
|
|
5
|
+
Author-email: Kiran Balasubramanian <kiran.balasubramanian@maxeon.com>
|
|
6
|
+
Maintainer-email: Kiran Balasubramanian <kiran.balasubramanian@maxeon.com>
|
|
7
|
+
Project-URL: Homepage, https://github.com/Maxeon-RnD/v_pvmismatch
|
|
8
|
+
Project-URL: Issues, https://github.com/Maxeon-RnD/v_pvmismatch/issues
|
|
9
|
+
Keywords: pvmismatch,PV,shading,mismatch,IV
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Python: ==3.10.12
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
|
|
17
|
+
# v_PVMismatch
|
|
18
|
+
Vectorized version of SunPower's PVMismatch using dynamic programming. PVMismatch is an explicit IV & PV curve trace calculator for PV system circuits.
|
|
19
|
+
|
|
20
|
+
## Install & Setup
|
|
21
|
+
In a fresh Python virtual environment, simply run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
$ pip install -i https://test.pypi.org/simple/ v-PVMismatch
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
v_PVMismatch requires NumPy, and SciPy.
|
|
30
|
+
|
|
31
|
+
## Current Maintainer at Maxeon Solar
|
|
32
|
+
|
|
33
|
+
@k-bsub
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# v_PVMismatch
|
|
2
|
+
Vectorized version of SunPower's PVMismatch using dynamic programming. PVMismatch is an explicit IV & PV curve trace calculator for PV system circuits.
|
|
3
|
+
|
|
4
|
+
## Install & Setup
|
|
5
|
+
In a fresh Python virtual environment, simply run:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
$ pip install -i https://test.pypi.org/simple/ v-PVMismatch
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
v_PVMismatch requires NumPy, and SciPy.
|
|
14
|
+
|
|
15
|
+
## Current Maintainer at Maxeon Solar
|
|
16
|
+
|
|
17
|
+
@k-bsub
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools < 65.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "v_PVMismatch"
|
|
7
|
+
version = "0.0.8"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Kiran Balasubramanian", email="kiran.balasubramanian@maxeon.com" },
|
|
10
|
+
]
|
|
11
|
+
maintainers = [
|
|
12
|
+
{name = "Kiran Balasubramanian", email = "kiran.balasubramanian@maxeon.com"},
|
|
13
|
+
]
|
|
14
|
+
description = "Vectorized PVMismatch (v_PVMismatch) Package."
|
|
15
|
+
readme = "README.md"
|
|
16
|
+
requires-python = "==3.10.12"
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"scipy >= 1.9.3",
|
|
24
|
+
]
|
|
25
|
+
keywords = ["pvmismatch", "PV", "shading", "mismatch", "IV"]
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Homepage = "https://github.com/Maxeon-RnD/v_pvmismatch"
|
|
29
|
+
Issues = "https://github.com/Maxeon-RnD/v_pvmismatch/issues"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
Initialization file for the vectorized PVMismatch (v_PVMismatch) Package.
|
|
4
|
+
|
|
5
|
+
This package contains the basic library modules, methods, classes and
|
|
6
|
+
attributes to model PV system mismatch.
|
|
7
|
+
>>> from v_pvmismatch import pvcell # imports the PVcell methods
|
|
8
|
+
>>> # import pvcell, pvmodule, pvstring and pvsystem
|
|
9
|
+
>>> from v_pvmismatch import *
|
|
10
|
+
"""
|
|
11
|
+
# from v_pvmismatch.version import __version__
|
|
12
|
+
|
|
13
|
+
from v_PVMismatch import (
|
|
14
|
+
utils,
|
|
15
|
+
circuit_comb,
|
|
16
|
+
vpvcell,
|
|
17
|
+
vpvmodule,
|
|
18
|
+
vpvstring,
|
|
19
|
+
vpvsystem,
|
|
20
|
+
pvmismatch
|
|
21
|
+
)
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""Circuit combination and bypass diode configuration functions that are vectorized."""
|
|
3
|
+
|
|
4
|
+
import numpy as np
|
|
5
|
+
from scipy.interpolate import interp1d
|
|
6
|
+
from pvmismatch import pvconstants
|
|
7
|
+
|
|
8
|
+
# ------------------------------------------------------------------------------
|
|
9
|
+
# CIRCUIT COMBINATION FUNCTIONS-------------------------------------------------
|
|
10
|
+
|
|
11
|
+
DEFAULT_BYPASS = 0
|
|
12
|
+
MODULE_BYPASS = 1
|
|
13
|
+
CUSTOM_SUBSTR_BYPASS = 2
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def calcSeries(Curr, V, meanIsc, Imax, Imod_pts, Imod_negpts, npts):
|
|
17
|
+
"""
|
|
18
|
+
Calculate IV curve for cells and substrings in series.
|
|
19
|
+
|
|
20
|
+
Given current and voltage in increasing order by voltage,
|
|
21
|
+
the average short circuit current and the max current at the breakdown voltage.
|
|
22
|
+
|
|
23
|
+
:param Curr: cell or substring currents [A]
|
|
24
|
+
:param V: cell or substring voltages [V]
|
|
25
|
+
:param meanIsc: average short circuit current [A]
|
|
26
|
+
:param Imax: maximum current [A]
|
|
27
|
+
:return: current [A] and voltage [V] of series
|
|
28
|
+
|
|
29
|
+
"""
|
|
30
|
+
# make sure all inputs are numpy arrays, but don't make extra copies
|
|
31
|
+
Curr = np.asarray(Curr) # currents [A]
|
|
32
|
+
V = np.asarray(V) # voltages [V]
|
|
33
|
+
meanIsc = np.asarray(meanIsc) # mean Isc [A]
|
|
34
|
+
Imax = np.asarray(Imax) # max current [A]
|
|
35
|
+
# create array of currents optimally spaced from mean Isc to max VRBD
|
|
36
|
+
Ireverse = (Imax - meanIsc) * Imod_pts + meanIsc
|
|
37
|
+
Imin = np.minimum(Curr.min(), 0.) # minimum cell current, at most zero
|
|
38
|
+
# range of currents in forward bias from min current to mean Isc
|
|
39
|
+
Iforward = (Imin - meanIsc) * Imod_negpts + meanIsc
|
|
40
|
+
# create range for interpolation from forward to reverse bias
|
|
41
|
+
Itot = np.concatenate((Iforward, Ireverse), axis=0).flatten()
|
|
42
|
+
Vtot = np.zeros((2 * npts,))
|
|
43
|
+
# add up all series cell voltages
|
|
44
|
+
# t0 = time.time()
|
|
45
|
+
for i, v in zip(Curr, V):
|
|
46
|
+
# interp requires x, y to be sorted by x in increasing order
|
|
47
|
+
Vtot += pvconstants.npinterpx(Itot, np.flipud(i), np.flipud(v))
|
|
48
|
+
# print('Time elapsed to run loopy interp: ' + str(time.time() - t0) + ' s')
|
|
49
|
+
# Itot = np.repeat(Itot[:,np.newaxis], Curr.shape[0], axis=1).T
|
|
50
|
+
# t0 = time.time()
|
|
51
|
+
# Vtot = interp2d_wrap(np.flip(Curr, axis = 1), Itot, np.flip(V, axis = 1))
|
|
52
|
+
# Vtot = Vtot.sum(axis=1)
|
|
53
|
+
# print('Time elapsed to run vectorized interp: ' + str(time.time() - t0) + ' s')
|
|
54
|
+
return np.flipud(Itot), np.flipud(Vtot)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def calcSeries_with_bypass(Curr, V, meanIsc, Imax, Imod_pts, Imod_negpts, npts, substr_bypass, run_bpact=True):
|
|
58
|
+
"""
|
|
59
|
+
Calculate IV curve for cells and substrings in series.
|
|
60
|
+
|
|
61
|
+
Given current and voltage in increasing order by voltage,
|
|
62
|
+
the average short circuit current and the max current at
|
|
63
|
+
the breakdown voltage.
|
|
64
|
+
|
|
65
|
+
:param Curr: cell or substring currents [A]
|
|
66
|
+
:param V: cell or substring voltages [V]
|
|
67
|
+
:param meanIsc: average short circuit current [A]
|
|
68
|
+
:param Imax: maximum current [A]
|
|
69
|
+
:return: current [A] and voltage [V] of series
|
|
70
|
+
"""
|
|
71
|
+
# make sure all inputs are numpy arrays, but don't make extra copies
|
|
72
|
+
Curr = np.asarray(Curr) # currents [A]
|
|
73
|
+
V = np.asarray(V) # voltages [V]
|
|
74
|
+
meanIsc = np.asarray(meanIsc) # mean Isc [A]
|
|
75
|
+
Imax = np.asarray(Imax) # max current [A]
|
|
76
|
+
|
|
77
|
+
# create array of currents optimally spaced from mean Isc to max VRBD
|
|
78
|
+
Ireverse = (Imax - meanIsc) * Imod_pts + meanIsc
|
|
79
|
+
Imin = np.minimum(Curr.min(), 0.) # minimum cell current, at most zero
|
|
80
|
+
# range of currents in forward bias from min current to mean Isc
|
|
81
|
+
Iforward = (Imin - meanIsc) * Imod_negpts + meanIsc
|
|
82
|
+
# create range for interpolation from forward to reverse bias
|
|
83
|
+
Itot = np.concatenate((Iforward, Ireverse), axis=0).flatten()
|
|
84
|
+
Vtot = np.zeros((2 * npts,))
|
|
85
|
+
|
|
86
|
+
# t0 = time.time()
|
|
87
|
+
# add up all series cell voltages
|
|
88
|
+
for i, v in zip(Curr, V):
|
|
89
|
+
# interp requires x, y to be sorted by x in increasing order
|
|
90
|
+
Vtot += pvconstants.npinterpx(Itot, np.flipud(i), np.flipud(v))
|
|
91
|
+
|
|
92
|
+
# Logic to check the shape of substr_bypass and ensure interpolations is done correctly
|
|
93
|
+
# Case 1 (Module): I, V, sb have same shape (n x npt)
|
|
94
|
+
# Case 2 (String): I, & V and sb have different dimensions (n x npt and m x n x npt)
|
|
95
|
+
if run_bpact:
|
|
96
|
+
if len(Curr.shape) == len(substr_bypass.shape):
|
|
97
|
+
bypassed_mod = []
|
|
98
|
+
for i, v, bypassed in zip(Curr, V, substr_bypass):
|
|
99
|
+
if ~bypassed.all():
|
|
100
|
+
bp_interp = bypassed[0]*np.ones(Itot.shape)
|
|
101
|
+
else:
|
|
102
|
+
interpolator = interp1d(np.flipud(i), np.flipud(bypassed),
|
|
103
|
+
kind='previous', fill_value='extrapolate')
|
|
104
|
+
bp_interp = interpolator(Itot)
|
|
105
|
+
bp_interp = bp_interp.astype(bool)
|
|
106
|
+
bypassed_mod.append(np.flipud(bp_interp))
|
|
107
|
+
bypassed_mod = np.asarray(bypassed_mod)
|
|
108
|
+
else:
|
|
109
|
+
bypassed_mod = np.zeros((Curr.shape[0], substr_bypass.shape[1], 2 * npts))
|
|
110
|
+
idx_mod = 0
|
|
111
|
+
for i, v, bypassed_strs in zip(Curr, V, substr_bypass):
|
|
112
|
+
for idx_substr in range(bypassed_strs.shape[0]):
|
|
113
|
+
bypassed = bypassed_strs[idx_substr, :]
|
|
114
|
+
if ~bypassed.all() or bypassed.all():
|
|
115
|
+
bp_interp = bypassed[0]*np.ones(Itot.shape)
|
|
116
|
+
else:
|
|
117
|
+
interpolator = interp1d(np.flipud(i), np.flipud(bypassed),
|
|
118
|
+
kind='previous', fill_value='extrapolate')
|
|
119
|
+
bp_interp = interpolator(Itot)
|
|
120
|
+
bp_interp = bp_interp.astype(bool)
|
|
121
|
+
bypassed_mod[idx_mod, idx_substr, :] = np.flipud(bp_interp)
|
|
122
|
+
idx_mod += 1
|
|
123
|
+
else:
|
|
124
|
+
bypassed_mod = np.nan
|
|
125
|
+
return np.flipud(Itot), np.flipud(Vtot), bypassed_mod
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def calcParallel(Curr, V, Vmax, Vmin, negpts, pts, npts):
|
|
129
|
+
"""
|
|
130
|
+
Calculate IV curve for cells and substrings in parallel.
|
|
131
|
+
|
|
132
|
+
:param Curr: currents [A]
|
|
133
|
+
:type: Curr: list, :class:`numpy.ndarray`
|
|
134
|
+
:param V: voltages [V]
|
|
135
|
+
:type: V: list, :class:`numpy.ndarray`
|
|
136
|
+
:param Vmax: max voltage limit, should be max Voc [V]
|
|
137
|
+
:param Vmin: min voltage limit, could be zero or Vrbd [V]
|
|
138
|
+
"""
|
|
139
|
+
Curr, V = np.asarray(Curr), np.asarray(V)
|
|
140
|
+
Vmax = np.asarray(Vmax)
|
|
141
|
+
Vmin = np.asarray(Vmin)
|
|
142
|
+
Vreverse = Vmin * negpts
|
|
143
|
+
Vforward = Vmax * pts
|
|
144
|
+
Vtot = np.concatenate((Vreverse, Vforward), axis=0).flatten()
|
|
145
|
+
Itot = np.zeros((2 * npts,))
|
|
146
|
+
for i, v in zip(Curr, V):
|
|
147
|
+
Itot += pvconstants.npinterpx(Vtot, v, i)
|
|
148
|
+
return Itot, Vtot
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def calcParallel_with_bypass(Curr, V, Vmax, Vmin, negpts, pts, npts, substr_bypass, run_bpact=True):
|
|
152
|
+
"""
|
|
153
|
+
Calculate IV curve for cells and substrings in parallel.
|
|
154
|
+
|
|
155
|
+
:param Curr: currents [A]
|
|
156
|
+
:type: Curr: list, :class:`numpy.ndarray`
|
|
157
|
+
:param V: voltages [V]
|
|
158
|
+
:type: V: list, :class:`numpy.ndarray`
|
|
159
|
+
:param Vmax: max voltage limit, should be max Voc [V]
|
|
160
|
+
:param Vmin: min voltage limit, could be zero or Vrbd [V]
|
|
161
|
+
"""
|
|
162
|
+
Curr, V = np.asarray(Curr), np.asarray(V)
|
|
163
|
+
Vmax = np.asarray(Vmax)
|
|
164
|
+
Vmin = np.asarray(Vmin)
|
|
165
|
+
Vreverse = Vmin * negpts
|
|
166
|
+
Vforward = Vmax * pts
|
|
167
|
+
Vtot = np.concatenate((Vreverse, Vforward), axis=0).flatten()
|
|
168
|
+
Itot = np.zeros((2 * npts,))
|
|
169
|
+
for i, v in zip(Curr, V):
|
|
170
|
+
Itot += pvconstants.npinterpx(Vtot, v, i)
|
|
171
|
+
|
|
172
|
+
if run_bpact:
|
|
173
|
+
if len(Curr.shape) == len(substr_bypass.shape):
|
|
174
|
+
bypassed_mod = []
|
|
175
|
+
for i, v, bypassed in zip(Curr, V, substr_bypass):
|
|
176
|
+
if ~bypassed.all():
|
|
177
|
+
bp_interp = bypassed[0]*np.ones(Vtot.shape)
|
|
178
|
+
else:
|
|
179
|
+
interpolator = interp1d(v, bypassed, kind='previous',
|
|
180
|
+
fill_value='extrapolate')
|
|
181
|
+
bp_interp = interpolator(Vtot)
|
|
182
|
+
bp_interp = bp_interp.astype(bool)
|
|
183
|
+
bypassed_mod.append(bp_interp)
|
|
184
|
+
bypassed_mod = np.asarray(bypassed_mod)
|
|
185
|
+
# bypassed_mod = interp2d_wrap(V, Vtot1, substr_bypass.astype(float), kind='previous')
|
|
186
|
+
# bypassed_mod = np.round(bypassed_mod).astype(bool)
|
|
187
|
+
else:
|
|
188
|
+
bypassed_mod = np.zeros((Curr.shape[0], substr_bypass.shape[1],
|
|
189
|
+
substr_bypass.shape[2], 2 * npts), dtype=bool)
|
|
190
|
+
idx_str = 0
|
|
191
|
+
for i, v, bypassed_strs in zip(Curr, V, substr_bypass):
|
|
192
|
+
idx_mod = 0
|
|
193
|
+
for idx_mod in range(bypassed_strs.shape[0]):
|
|
194
|
+
for idx_substr in range(bypassed_strs.shape[1]):
|
|
195
|
+
bypassed = bypassed_strs[idx_mod, idx_substr, :]
|
|
196
|
+
if ~bypassed.all() or bypassed.all():
|
|
197
|
+
bp_interp = bypassed[0]*np.ones(Vtot.shape)
|
|
198
|
+
else:
|
|
199
|
+
interpolator = interp1d(v, bypassed, kind='previous',
|
|
200
|
+
fill_value='extrapolate')
|
|
201
|
+
bp_interp = interpolator(Vtot)
|
|
202
|
+
bp_interp = bp_interp.astype(bool)
|
|
203
|
+
bypassed_mod[idx_str, idx_mod, idx_substr, :] = bp_interp
|
|
204
|
+
idx_mod += 1
|
|
205
|
+
idx_str += 1
|
|
206
|
+
else:
|
|
207
|
+
bypassed_mod = np.nan
|
|
208
|
+
|
|
209
|
+
return Itot, Vtot, bypassed_mod
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def combine_parallel_circuits(IVprev_cols, pvconst,
|
|
213
|
+
negpts, pts, Imod_pts, Imod_negpts, npts):
|
|
214
|
+
"""
|
|
215
|
+
Combine crosstied circuits in a substring.
|
|
216
|
+
|
|
217
|
+
:param IVprev_cols: lists of IV curves of crosstied and series circuits
|
|
218
|
+
:return:
|
|
219
|
+
"""
|
|
220
|
+
# combine crosstied circuits
|
|
221
|
+
Irows, Vrows = [], []
|
|
222
|
+
Isc_rows, Imax_rows = [], []
|
|
223
|
+
for IVcols in zip(*IVprev_cols):
|
|
224
|
+
Iparallel, Vparallel = zip(*IVcols)
|
|
225
|
+
Iparallel = np.asarray(Iparallel)
|
|
226
|
+
Vparallel = np.asarray(Vparallel)
|
|
227
|
+
Irow, Vrow = calcParallel(
|
|
228
|
+
Iparallel, Vparallel, Vparallel.max(),
|
|
229
|
+
Vparallel.min(), negpts, pts, npts
|
|
230
|
+
)
|
|
231
|
+
Irows.append(Irow)
|
|
232
|
+
Vrows.append(Vrow)
|
|
233
|
+
Isc_rows.append(np.interp(np.float64(0), Vrow, Irow))
|
|
234
|
+
Imax_rows.append(Irow.max())
|
|
235
|
+
Irows, Vrows = np.asarray(Irows), np.asarray(Vrows)
|
|
236
|
+
Isc_rows = np.asarray(Isc_rows)
|
|
237
|
+
Imax_rows = np.asarray(Imax_rows)
|
|
238
|
+
return calcSeries(
|
|
239
|
+
Irows, Vrows, Isc_rows.mean(), Imax_rows.max(),
|
|
240
|
+
Imod_pts, Imod_negpts, npts
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def parse_diode_config(Vbypass, cell_pos):
|
|
245
|
+
"""
|
|
246
|
+
Parse diode configuration from the Vbypass argument.
|
|
247
|
+
|
|
248
|
+
:param Vbypass: Vbypass config
|
|
249
|
+
:type Vbypass: float|list|tuple
|
|
250
|
+
:param cell_pos:
|
|
251
|
+
:type cell_pos:
|
|
252
|
+
:return: bypass config
|
|
253
|
+
:rtype: str
|
|
254
|
+
"""
|
|
255
|
+
try:
|
|
256
|
+
# check if float or list/tuple
|
|
257
|
+
num_bypass = len(Vbypass)
|
|
258
|
+
except TypeError:
|
|
259
|
+
# float passed - default case - Vbypass across every cell string
|
|
260
|
+
return DEFAULT_BYPASS
|
|
261
|
+
else:
|
|
262
|
+
# if only one value is passed in the list- assume only one
|
|
263
|
+
# bypass diode across the PV module
|
|
264
|
+
if len(Vbypass) == 1:
|
|
265
|
+
return MODULE_BYPASS
|
|
266
|
+
# if more than 1 values are passed, apply them across
|
|
267
|
+
# the cell strings in ascending order
|
|
268
|
+
elif len(cell_pos) == num_bypass:
|
|
269
|
+
return CUSTOM_SUBSTR_BYPASS
|
|
270
|
+
else:
|
|
271
|
+
print("wrong number of bypass diode values passed : %d" %
|
|
272
|
+
(len(Vbypass)))
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
This is the PVMismatch Library. Configuration constants and classes like
|
|
4
|
+
:class:`~pvmismatch.pvmismatch_lib.pvconstants.PVconstants`,
|
|
5
|
+
:class:`~pvmismatch.pvmismatch_lib.pvcell.PVcell`,
|
|
6
|
+
:class:`~pvmismatch.pvmismatch_lib.pvmodule.PVmodule`,
|
|
7
|
+
:class:`~pvmismatch.pvmismatch_lib.pvstring.PVstring` and
|
|
8
|
+
:class:`~pvmismatch.pvmismatch_lib.pvsystem.PVsystem`, objects are all defined
|
|
9
|
+
here.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from v_PVMismatch.pvmismatch import pvconstants, pvexceptions, pvcell, pvmodule, pvstring, pvsystem
|