There is a vector $\boldsymbol{P_{el}}$ with the power values of a power plant, where every 15 minutes a power value is measured. Now I want to create a vector $\boldsymbol{W_{el}}$ which contains the amount of energy produced for each hour, i.e. the hourly integrated power. Considering one day, $|\boldsymbol{P_{el}}| = 96$ and $|\boldsymbol{W_{el}}| = 24$.
How can I define the creation of $\boldsymbol{W_{el}}$ mathematically?
This definition is programming-like; $X[n]$ is the $(n+1)\text{-th}$ element of array (index $n$ starts at $0$). Convensions:
Then,
$$W_{el}[n] = \frac{1}{4}\sum_{m=0}^{4-1}{(P_{el}[4n+m])}$$
Explanation: We approximate the energy in each hour using summation of rectangles in right-end point (see figure).
Source: https://mathequality.files.wordpress.com/2013/01/left-right-midpoints.png
Now, for each 15 min. interval, the area of rectangle is length x width, or $$P[i]\ \text{Watts} \times 15 \text{min.} \times \bigg(\frac{1 \text{hr.}}{60\text{min.}}\bigg) = (P[i] \times \frac{1}{4})\ \text{Wh}.$$ The $4n+m$ inside $P_{el}$ is just the indices of 15 min., 30 min., 45 min., and 60 min. rectangles for $(n+1)$-th hour. The sum of areas of these four rectangles is the $W_{el}[n]$, the energy in Watt-hour.