Skip to content

Commit 66c9fe5

Browse files
Adjust dx passed to trapz if last slice has fewer timesteps in heat kWh integration (WIP)
1 parent 3b741cb commit 66c9fe5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/geophires_x/SurfacePlant.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ def annual_electricity_pumping_power(self, plant_lifetime: int, enduse_option: E
177177
HeatkWhProduced = np.zeros(plant_lifetime)
178178

179179
for i in range(0, plant_lifetime):
180-
HeatkWhExtracted[i] = np.trapz(HeatExtracted[(0 + i * timestepsperyear):((i + 1) * timestepsperyear) + 1],
181-
dx = 1. / timestepsperyear * 365. * 24.) * 1000. * utilization_factor
180+
heat_extracted_slice = HeatExtracted[(0 + i * timestepsperyear):((i + 1) * timestepsperyear) + 1]
181+
HeatkWhExtracted[i] = np.trapz(heat_extracted_slice,
182+
dx = 1. / (len(heat_extracted_slice)-1) * 365. * 24.) * 1000. * utilization_factor
182183
PumpingkWh[i] = np.trapz(PumpingPower[(0 + i * timestepsperyear):((i + 1) * timestepsperyear) + 1],
183184
dx = 1. / timestepsperyear * 365. * 24.) * 1000. * utilization_factor
184185

0 commit comments

Comments
 (0)