Skip to content

Commit 4739621

Browse files
Update pvlib/transformer.py
Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
1 parent f8b12ff commit 4739621

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pvlib/transformer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ def simple_efficiency(
111111
b = 1
112112
c = no_load_loss - input_power_normalized
113113

114+
# alternative form of the quadratic equation to avoid
115+
# divide-by-zero when a == 0
114116
disc = (b*b - 4*a*c)**0.5
115117
output_power_normalized = 2*c / (-b - disc)
116118

0 commit comments

Comments
 (0)