In a power grid that still has only a small share of renewable energy, conventional power plants (nuclear, gas-fired) can be used to balance generation and consumption in real time. When the share of renewable energy is larger, this energy must be stored and released as required. And this must be done efficiently, because what nature accomplished for free over millions of years must now be done in real time using expensive resources (batteries or pumped-storage power plants).
Planning how to combine the two types of energy -------------------------------------------------
Optimization comes into play here. It lets us plan the operation of the power grid. When all the generating resources are known and we have a good estimate of the next day’s electricity demand, we can formulate a (large!) optimization problem. Its decision variables are the amounts of electricity generated P*r*, *t by each plant (resource r) in each period t of the day (the day may be divided into twenty-four one-hour periods or into shorter periods). Each resource has a generation cost that increases with the quantity generated, fr*, *t (Pr*, *t*).