Skip to content

Commit a5731da

Browse files
authored
Update pvlib/transformer.py
1 parent 0b96e24 commit a5731da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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)