Skip to content
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

use np.expm1 in singlediode model for exp(x) - 1 #500

Closed
mikofski opened this issue Jun 30, 2018 · 0 comments
Closed

use np.expm1 in singlediode model for exp(x) - 1 #500

mikofski opened this issue Jun 30, 2018 · 0 comments

Comments

@mikofski
Copy link
Member

Problem
it is possible that at extremely small voltages there may be machine precision error of less than 1 part per million because the single diode model has the term exp(x) - 1 which has an increasing error as x → 0 because exp(x) → 1, so 1 - 1 is a very, very small number close to zero.

Solution
Use np.expm1(x) instead of np.exp(x) - 1 as suggested in this comment

Additional context
#409

mikofski added a commit to mikofski/pvlib-python that referenced this issue Jul 10, 2018
* closes pvlib#500
* also add a comment that we are creating some temporary values to make
calculations simpler
* also use more descriptive names instead of a, b, c, use v_star, g_sh,
and g_diode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants