-
Notifications
You must be signed in to change notification settings - Fork 992
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
Revise dc_ohmic_loss and dc_ohms_from_percent docstrings #2229
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ac2755b
revise dc_ohmic_loss and dc_ohms_from_percent docstrings
cwhanse c90422b
Merge branch 'main' of https://github.com/cwhanse/pvlib-python into p…
cwhanse 8592fab
edits
cwhanse b1c6cf9
Apply suggestions from code review
cwhanse 4779c44
raw docstring
cwhanse c5ac6d0
whatsnew
cwhanse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2871,46 +2871,49 @@ def pvwatts_losses(soiling=2, shading=3, snow=0, mismatch=2, wiring=2, | |
def dc_ohms_from_percent(vmp_ref, imp_ref, dc_ohmic_percent, | ||
modules_per_string=1, | ||
strings=1): | ||
""" | ||
Calculates the equivalent resistance of the wires from a percent | ||
ohmic loss at STC. | ||
|
||
Equivalent resistance is calculated with the function: | ||
|
||
.. math:: | ||
Rw = (L_{stc} / 100) * (Varray / Iarray) | ||
|
||
:math:`Rw` is the equivalent resistance in ohms | ||
:math:`Varray` is the Vmp of the modules times modules per string | ||
:math:`Iarray` is the Imp of the modules times strings per array | ||
:math:`L_{stc}` is the input dc loss percent | ||
r""" | ||
Calculate the equivalent resistance of the conductors from the percent | ||
ohmic loss of an array at reference conditions. | ||
|
||
Parameters | ||
---------- | ||
vmp_ref: numeric | ||
Voltage at maximum power in reference conditions [V] | ||
Maximum power voltage of one module at reference conditions. [V] | ||
imp_ref: numeric | ||
Current at maximum power in reference conditions [V] | ||
dc_ohmic_percent: numeric, default 0 | ||
input dc loss as a percent, e.g. 1.5% loss is input as 1.5 | ||
Maximum power current of one module at reference conditions. [A] | ||
dc_ohmic_percent: numeric | ||
Array DC power loss as a percent of DC power loss at reference | ||
conditions. In percent, e.g. 1.5% loss is input as 1.5. | ||
modules_per_string: int, default 1 | ||
Number of modules per string in the array. | ||
Number of series-connected modules per string in the array. | ||
strings: int, default 1 | ||
Number of parallel strings in the array. | ||
|
||
Returns | ||
---------- | ||
Rw: numeric | ||
Equivalent resistance [ohm] | ||
Equivalent resistance. [ohm] | ||
|
||
See Also | ||
-------- | ||
pvlib.pvsystem.dc_ohmic_losses | ||
|
||
References | ||
---------- | ||
.. [1] PVsyst 7 Help. "Array ohmic wiring loss". | ||
https://www.pvsyst.com/help/ohmic_loss.htm | ||
Notes | ||
----- | ||
Equivalent resistance is calculated as: | ||
|
||
.. math:: | ||
|
||
R_w = \left(\frac{L_{stc}}{100}\right) \times \left(\frac{ | ||
V_{array}}{I_{array}}\right) | ||
|
||
:math:`R_w` is the equivalent resistance in ohms. | ||
:math:`V_{array}` is the array voltage, equal to ``vmp_ref`` times | ||
``modules_per_string``. | ||
:math:`I_{array}` is the array current, equal to ``imp_ref`` times | ||
``strings``. | ||
:math:`L_{stc}` is the input DC loss percent at reference conditions. | ||
|
||
""" | ||
vmp = modules_per_string * vmp_ref | ||
|
||
|
@@ -2922,30 +2925,37 @@ def dc_ohms_from_percent(vmp_ref, imp_ref, dc_ohmic_percent, | |
|
||
|
||
def dc_ohmic_losses(resistance, current): | ||
""" | ||
r""" | ||
Returns ohmic losses in units of power from the equivalent | ||
resistance of the wires and the operating current. | ||
|
||
Parameters | ||
---------- | ||
resistance: numeric | ||
Equivalent resistance of wires [ohm] | ||
Equivalent resistance of wires. [ohm] | ||
current: numeric, float or array-like | ||
Operating current [A] | ||
Operating current. [A] | ||
|
||
Returns | ||
---------- | ||
loss: numeric | ||
Power Loss [W] | ||
Power loss. [W] | ||
|
||
See Also | ||
-------- | ||
pvlib.pvsystem.dc_ohms_from_percent | ||
|
||
References | ||
---------- | ||
.. [1] PVsyst 7 Help. "Array ohmic wiring loss". | ||
https://www.pvsyst.com/help/ohmic_loss.htm | ||
Notes | ||
----- | ||
Ohmic (also termed joule or heat) loss is the power lost due to current | ||
flowing through a conductor. Ohmic loss, :math:`L`, is computed as | ||
|
||
.. math:: | ||
|
||
L = I \times R^2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be L = I^2 R |
||
|
||
where :math:`I` is the current (A) and :math:`R` is the resistance of the | ||
conductor (ohms). | ||
""" | ||
return resistance * current * current | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be
dc_ohmic_losses
, notdc_ohmic_loss