Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ENH: add methods and tests for a explicit IV curve calculation of single-diode model #409

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

Merged
merged 76 commits into from
Jul 10, 2018
Merged
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
22d2e5c
add methods and tests for a faster way to calculate single-diode model
mikofski Jan 27, 2018
bb7c49a
log estimate of speedup in test
mikofski Jan 27, 2018
36d4f78
use ordered dict for output, match inputs and outputs, add iv-curve
mikofski Jan 27, 2018
817a303
add "slow" but reliable ways to calculate i_from_v and vv
mikofski Jan 28, 2018
b17a8cd
add check for numerical errors
mikofski Jan 30, 2018
0666d29
use float64, output symbols for fun, make executable
mikofski Jan 30, 2018
595e254
add tests for slower_way using fminbound
mikofski Jan 30, 2018
5ade588
change voc to v_oc
mikofski Jan 30, 2018
7179096
add numeric type to args in docstrings
mikofski Jan 30, 2018
4b66f87
replace custom newton method with scipy.optimize.newton
mikofski Jan 31, 2018
664d7d8
get lambdas working in fast_i_from_v
mikofski Jan 31, 2018
09a9e14
add fast_v_from_i using newton
mikofski Jan 31, 2018
06be522
add fast_mppt
mikofski Jan 31, 2018
1aba56a
calculate i_x and i_xx too for both fast and slow
mikofski Jan 31, 2018
f09be91
test i_x and i_xx too
mikofski Jan 31, 2018
4905363
use brentq instead of fminbound
mikofski Jan 31, 2018
a3d2bb4
change test for numerical errors to use data file
mikofski Jan 31, 2018
8ee1b94
working on #410
mikofski Jan 31, 2018
c9a893a
helping test_singlediode pass tests
mikofski Jan 31, 2018
c5248bb
add the requires scipy decorator
mikofski Jan 31, 2018
68c65c3
fixes #410
mikofski Jan 31, 2018
41e0c83
add i, v, and p to out
mikofski Jan 31, 2018
d7b6e62
need to calculate i-v curve points to compare
mikofski Jan 31, 2018
aa3d29a
add mppt method, update docs
mikofski Jan 31, 2018
9fc350d
fix latex and other sphinx formatting issue sand typos
mikofski Jan 31, 2018
54e8d18
fix circular import issues?
mikofski Feb 1, 2018
16ad9b4
try something remove redundant package imports
mikofski Feb 1, 2018
7aca302
don't raise import error at module level if no scipy
mikofski Feb 1, 2018
086e73f
okay I think I fixed it, now return pvlib module objects
mikofski Feb 1, 2018
9f2b157
try to modify i_from_v
mikofski Feb 1, 2018
555e946
implement v_from_i wrapper
mikofski Feb 1, 2018
52a8e88
respond to @thunderfish24 review items:
mikofski Feb 1, 2018
c0e18a5
change default argument for method to "gold"
mikofski Feb 1, 2018
09c6a75
update test_singlediode_methods to use lambertw in comparison
mikofski Feb 1, 2018
ff8cc0b
change name from mppt -> mpp
mikofski Feb 1, 2018
446fa9e
add test to check for verbose yet graceful failure of v_from_i
mikofski Feb 1, 2018
f976f61
fix pytest.raise context, add test_v_from_i
mikofski Feb 1, 2018
db88022
change mppt->mpp in api.rst docs
mikofski Feb 1, 2018
a509dd3
fix what's new to point to mpp in docs, also add links to bishop88 an…
mikofski Feb 1, 2018
62010c2
Merge branch 'master' into faster_way
mikofski Jun 20, 2018
5c939b8
TST: fix precision test to use new calcparams* API
mikofski Jun 20, 2018
66a801d
TST: update singlediode test for updated atol in #415
mikofski Jun 20, 2018
df1423b
DOC: update what's new for 0.6 with proposed explicit SDM solution
mikofski Jun 20, 2018
eb20cf4
DOC: update docstring to conform to numpydoc style in sdm methods
mikofski Jun 20, 2018
e3805ef
Merge branch 'master' into faster_way
mikofski Jun 26, 2018
5f89578
ENH: refactor est_voc -> estimate_voc
mikofski Jun 26, 2018
ba84fcf
ENH refactor pvsystem.estimate_voc too, also update docs to numpy style
mikofski Jun 26, 2018
0f3893c
ENH refactor vd->diode_voltage in bishop88
mikofski Jun 26, 2018
d6023b1
ENH: TST: refactor reshaping conditions for _array_newton
mikofski Jun 27, 2018
80b3352
ENH: TST: make brentq vectorized always
mikofski Jun 27, 2018
ef20676
ENH: TST: can't vectorize brentq because it treats args as array
mikofski Jun 27, 2018
98d1c01
BUG: TST: use "brentq" instead of "gold"
mikofski Jun 27, 2018
4ecd913
TST: change test fixtures with nonsensical values in quadrant four
mikofski Jun 27, 2018
bf05d2d
TST: fix mpp tests
mikofski Jun 28, 2018
edc445d
ENH: clean up last little bit
mikofski Jun 28, 2018
f542d15
ENH: BUG: TST: DOC: remove all traces for "fast" or "slow"
mikofski Jun 28, 2018
cc6c976
TST: BUG: fix the boolean mask numpy<1.14 bug in tests
mikofski Jun 28, 2018
22c53fc
ENH: TST: ignore .pytest_cache/ folder
mikofski Jun 29, 2018
442a3d4
DOC: MAINT: respond to review by @cwhanse , clean up docstrings
mikofski Jun 29, 2018
6bcffe8
MAINT: update comment about mpp search algorithm
mikofski Jun 29, 2018
e6b60c6
MAINT: update what's new for v0.6
mikofski Jun 29, 2018
0fc9c83
DOC: make sure docs render well
mikofski Jun 29, 2018
fc6cee1
DOC: MAINT: rewording what's new with @cwhanse comments to make it clear
mikofski Jun 29, 2018
28c8ffb
API: change bishop88 and estimate_voc to be used from singlediode_met…
mikofski Jun 29, 2018
58361c1
DOC: link to new singlediode_methods subfunctions in what's new
mikofski Jun 29, 2018
5f9ed41
API: DOC: ENH: change pvsystem.mpp() -> max_power_point()
mikofski Jun 29, 2018
43475cc
MAINT: address comments by @wholmgren
mikofski Jun 30, 2018
c79ab97
Merge branch 'master' into faster_way
mikofski Jul 10, 2018
1ad6031
MAINT: add comment to explain why we import brentq in try-except
mikofski Jul 10, 2018
f14ba04
MAINT: move lambertw methods to singlediode_methods.py
mikofski Jul 10, 2018
8d86560
MAINT: add docstring elaborating the numerical precision test
mikofski Jul 10, 2018
337d7b4
MAINT: use np.expm1(x) for exp(x) - 1 in bishop88 single diode method
mikofski Jul 10, 2018
ce5b0f5
MAINT: replace boilerplate code for broadcasting newton array args
mikofski Jul 10, 2018
3e009f8
MAINT: TEST: parametrize i_from_v and v_from_i for methods, atol
mikofski Jul 10, 2018
082dfd5
MAINT: remove import of functools.partial in pvsystem.py
mikofski Jul 10, 2018
ceb69cd
MAINT: wrap lines longer than 79 characters
mikofski Jul 10, 2018
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
add fast_v_from_i using newton
  • Loading branch information
mikofski committed Jan 31, 2018
commit 09a9e147564ae9bd520a26b860b6fc2dd3a6799f
15 changes: 15 additions & 0 deletions 15 pvlib/way_faster.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ def slow_v_from_i(i, photocurrent, saturation_current, resistance_series,
return bishop88(vd, *args)[1]


def fast_v_from_i(i, photocurrent, saturation_current, resistance_series,
resistance_shunt, nNsVth):
"""
This is a fast but unreliable way to find voltage given any current.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if "unreliable" is the best choice of words here. It's more of an "unchecked" result.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

"""
# collect args
args = (photocurrent, saturation_current, resistance_series,
resistance_shunt, nNsVth)
# first bound the search using voc
voc_est = est_voc(photocurrent, saturation_current, nNsVth)
vd = newton(func=lambda x, *a: bishop88(x, *a)[0] - i, x0=voc_est,
fprime=lambda x, *a: bishop88(x, *a)[2], args=args)
return bishop88(vd, *args)[1]


def slow_mppt(photocurrent, saturation_current, resistance_series,
resistance_shunt, nNsVth):
"""
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.