8000 Add mismatch.py and function to combine curves by ajonesr · Pull Request #1781 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Add mismatch.py and function to combine curves #1781

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

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
06abfaa
Added mismatch.py
ajonesr Jun 20, 2023
3159bc1
Make method in bishop functions explicit
ajonesr Jun 21, 2023
76efbac
Move clipping to prepare_curves
ajonesr Jun 21, 2023
586de8f
Change assert to ValueError
ajonesr Jun 21, 2023
3038f86
Added docstrings
ajonesr Jun 22, 2023
c0e57da
Fixed missing parenthesis
ajonesr Jun 22, 2023
0670a6f
Updated comments, fixed typo
ajonesr Jun 22, 2023
a3a135b
Updated imports
ajonesr Jun 22, 2023
c27f558
Updated .rst file
ajonesr Jun 22, 2023
5dfda15
Updated docstrings
ajonesr Jun 22, 2023
2f11a16
Update docstring of prepare_curves
ajonesr Jun 23, 2023
3effafe
Update docstring of combine_curves
ajonesr Jun 23, 2023
b969581
Fixed spacing and clipped_voltage typo
ajonesr Jun 23, 2023
7ab461c
Reverse order of currents array
ajonesr Jun 23, 2023
d87f9df
Add tests
ajonesr Jun 23, 2023
cf955a3
Fixed types, updated tests
ajonesr Jun 23, 2023
a014b2a
Updated whatsnew
ajonesr Jun 23, 2023
1f5914a
Added contributor
ajonesr Jun 23, 2023
94e923c
Update prepare_curves docstring
ajonesr Jun 26, 2023
31d1188
Update prepare_curves docstring
ajonesr Jun 26, 2023
0880f24
Update prepare_curves docstring
ajonesr Jun 26, 2023
e87b4aa
Update spacing
ajonesr Jun 26, 2023
057cada
Update spacing
ajonesr Jun 26, 2023
606de91
Add tests for ValueErrors
ajonesr Jun 26, 2023
baeac3f
Merge branch 'main' into mismatch
ajonesr Jun 26, 2023
ded4548
Update init
ajonesr Jun 26, 2023
52b7455
Added example
ajonesr Jul 10, 2023
2ca0cb0
Merge remote-tracking branch 'upstream/main' into mismatch
ajonesr Jul 13, 2023
8cca7b7
Update whatsnew, example
ajonesr Jul 14, 2023
17d738c
Merge branch 'main' of https://github.com/pvlib/pvlib-python into mis…
cwhanse Aug 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated comments, fixed typo
  • Loading branch information
ajonesr committed Jun 22, 2023
commit 0670a6f3f03ed07e0bb5e80c88e84903443ad6b7
14 changes: 2 additions & 12 deletions pvlib/ivtools/mismatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,7 @@ def prepare_curves(params, num_pts, breakdown_voltage=-0.5):
`breakdown_voltage` are replaced by `breakdown_voltage`, yielding a
vertical asymptote at `breakdown_voltage`.


"""
# params is an n x 5 array where each row corresponds to one of
# the n curves' five defining parameters (photocurrent, saturation
# current, series resistance, shunt resistance, nNsVth)
# num_pts is the number of points you want calculated for each curve
# (this will also be the number of points in the aggregate curve)
# breakdown_voltage is the asymptote we use left of the y-axis

# in case params is a list containing scalars, add a dimension
if len(np.shape(params)) == 1:
Expand All @@ -90,6 +83,8 @@ def prepare_curves(params, num_pts, breakdown_voltage=-0.5):
# there is a row for each current value

# get voltages for each curve
# (note: expecting to vectorize for both the inputted currents and
# the inputted curve parameters)
# transpose result so each row contains voltages for a single curve
voltages = pvlib.singlediode.bishop88_v_from_i(bishop_inputs, *params.T,
method='newton').T
Expand Down Expand Up @@ -152,10 +147,6 @@ def combine_curves(currents, voltages):
in.

"""
# currents is a 1D array that contains a range from 0 to max_isc
# voltages is a 2D array where each row corresponds to the
# associated voltages of a single curve (should be n by
# len(currents), where n is the number of curves we're summing over)

currents = np.asarray(currents)
voltages = np.asarray(voltages)
Expand All @@ -180,7 +171,6 @@ def combine_curves(currents, voltages):
# should also be decreasing
if not np.all(np.diff(combined_voltages) < 0):
raise ValueError("Each row of voltages array must be decreasing.")

# get isc
# np.interp requires second argument is increasing, so flip
# combined_voltages and currents
Expand Down
0