question archive We want to optimize the production of green electrical power from 3 kinds of power generators (hydro-based, solar-based and wind-based)
Subject:Computer SciencePrice: Bought3
We want to optimize the production of green electrical power from 3 kinds of power generators (hydro-based, solar-based and wind-based). The maximum power production of solar and wind generators depends on their primary energy source, on the contrary to hydro generators which have constant maximum power of 5kW per generator. We have predictions for available solar and wind power for the next day:
# Global parameters
n = 25 # number of hours (from 0 to n both included)
# Input generators data
hours = np.linspace(0,n-1,n) # 1 data point per hour starting from 0 to n, both included
wind = np.array([7.5,8.3,9.2,8.6,8.63,6.6,7.23,5.21,6.9,4.4,4.3,5.5,5.11,4.33,8.56,8.62,8.43,6.2,6.6,5.81,9.89,8.7,8.8,8.11,8.56]) # in kW
solar = np.array([0,0,0,0,0,0,0.66,2.12,4.23,5.24,6.11,7.09,7.5,8.01,7.98,7.26,6.67,4.12,3.24,2.78,1.27,0,0,0,0])
hydro = np.array([5 for i in range(n)])
# Input data plot
plt.figure()
plt.plot(hours,wind,label="Wind power")
plt.plot(hours,solar,label="Solar power")
plt.plot(hours,hydro,label="Hydro power")
plt.title("Available power (in kW) per generator for next 24 hours")
plt.legend()
plt.show()
Our current power generation grid is based on 12 hydro generators, 10 solar generators and 8 wind generators.
Each kind of generator has specific costs (in euros) and operational constraints (in kW) when used. Some simplified assumptions were done for cost to obtain the following characteristics:
Type |
max | powercost/kWh |
Hydro | 5 | 2 |
Solar | 8 | 1.5 |
Wind | 10 | 1.1 |
In fact, we want to define, per hour, which of the available generators we want to use.
We have to satisfy the following demand:
n_h = 12 # Number of hydro generators
n_s = 10 # Number of solar generators
n_w = 8 # Number of wind generators
demand = np.array([78.45,80.23,83.34,84.45,85.01,86.98,92.78,93.01,98.23,100.34,106.48,113.52,115.02,111.21,116.82,119.89,118.38,116.63,109.04,102.94,100.02,106.29,102.45,95.93,91.26])
plt.figure()
plt.plot(hours,demand,label='demand')
plt.plot(hours,wind*n_w+solar*n_s+hydro*n_h,label='available')
plt.title("Power demand and total available power (in kW) for next 24 hours")
plt.legend()
plt.show()
We want to study the possibility to buy a battery system to store some power when possible. This will allow to satisfy power demand when solar and wind are not enough available and hydro power alone is not enough. Moreover, it reduces the risk to not satisfy the demand in case of a generator failure. Batteries can have various capacities. From a market study, we consider that 2500 euros per kWh is a relevant average price. The battery technology have a lifetime of about 18 months, considering hourly charge and discharge cycles. The electric components used to store the power (between the generators and the battery system and from the battery and the power delivery sink) have a global efficiency of 88%.
This new battery within the grid may allow to shutdown the most expensive generators when enough power has been stored. Nevertheless, we want to keep at least 25kWh in the battery at the end of the 24 hours. With historical data about wind and solar conditions, we have globally excellent production conditions about 22% of the time (ie. >75% of maximum power) and bad conditions about 15% of the time (ie <30% of maximum power). The demand given for 24h can be considered of an average demand over the year. Season effects are neglected in this analysis.
We want to minimize the production cost for the demand of next 24 hours using Python. using scipy optimize only.
Define the mathematical problem allowing to size battery storage and solve it using python (scipy optimize)
Update your model to optimize the energy production taking into account this new battery using Python