On the optimal operation of a small solar plant and a battery

64 Views Asked by At

You operate a small solar plant and a battery. Each day, you can decide how much energy (in kWh) to buy from the grid, sell to the grid, or generate from the solar plant. On day $i$, the price of energy you sell is $s_i$, the cost of energy you buy is $c_i$, and the cost of generating electricity is $g_i$, all denominated in pence per kWh. You can generate at most $15$ kWh per day. The battery has a maximum storage capacity of C = 100 kWh. According to your contract with the grid, you can sell at most 110 kWh per day. If you generate energy you can sell it immediately; it does not need to be stored in the battery first. The same thing applies to energy that you buy, but to eliminate obvious arbitrage possibilities, we expect that the grid sets $c_i > s_i$ for every $i$. At the start of day 1, the battery has Y1 kWh of energy stored in it. Your aim is to maximise your profit from buying, selling and generating energy.

(a) Assume that $Y_1$, $s_1$, $c_1$, $g_1$ are given. Formulate the problem of how much energy to buy, sell and generate on day 1 as a linear programming problem. Define all of your notation and explain your constraints and objective function. In terms of your control variables, how much energy does the battery have stored at the start of day 2?


Let:

  • $x_1$ be the amount of energy (in kWh) to buy from the grid on day 1.​

  • $y_1$ be the amount of energy (in kWh) to sell to the grid on day 1.

  • $z_1$ be the amount of energy (in kWh) to generate from the solar plant on day 1.

and

$$ \begin{array}{ll} \underset {} {\text{maximize}} & z = s_1 y_1 - c_1 x_1 - g_1 z_1 \\ \text{subject to} & Y_1 + z_1 + x_1 - y_1 \leq 100 \\ & z_1 \leq 15 \\ & y_1 \leq 110 \\ & z_1, x_1, y_1 \geq 0 \end{array} $$

At the start of day 2, the energy stored is

$$Y_2 = \min \left( z_1 + x_1 - y_1, 100 \right)$$

Can you please review my answer for formulating the linear program above? I feel like I missed on some constraints but I am not quite sure.