Pump energy from sliced arrays

A data logger records a pump's average power over four consecutive intervals. An engineer computes energy with this code:


Python
import numpy as np
P = np.array([1.2, 1.5, 0.9, 2.1])     # average power, kW
t = np.array([0.5, 0.25, 1.0, 0.75])   # interval duration, h
E = np.sum(P[1:] * t[1:])


What value does E hold? Give your answer in kWh to two decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Python Programming Questions: