# Cost Analysis and Optimization of Modern Power System Operations
## 3 Implementation and Case Studies
### Case 1: Unit Commitment of 10 Thermal Power Plants for Dynamic Load
The spinning reserve constraint can be mathematically expressed and implemented in GAMS as follows:  
\[\mathbf{Ri,t\leq P^{max}i,t-Pi,t} \tag{29}\]  
\[\sum_{i=1}^{n}Ri,t\geq\gamma\mathbf{Lt} \tag{30}\]  
where \(R_{i,t}\) is the reserve provision by the \(i\)th unit at time \(t\) and \(P^{max}i,t\) maximum amount of power that can be supplied by a unit, and \(P_{i,t}\) is the power supplied by the \(i\)th unit at time \(t\). In a power system, the reserve requirement is fixed as a percentage of demand, and that is defined by Equation (30), where \(\gamma\) is the % of load demand that specifies the reserve requirement and \(L_{t}\) is load demand at time \(t\). For this study, \(\gamma=\mathbf{40\%}\), and the load is decreased by 55% of the load taken in case 1. It is important to note that while the spinning reserve does not reduce total system load in the conventional sense, it reduces load-carrying and commitment requirements within the power system, resulting in reduced overall load needs. A study of adding the potential effect of adding spinning reserves in the case of Spanish islands found system cost reductions of up to 30% of overall system cost, in extreme cases resulting in more than 50% of thermal generation reduction. While significantly reducing operational costs, spinning reserves will result in higher overall system investments and related costs [32]. After simulation and optimization on GAMS using the mixed integer programming technique, the generator schedule and reserve provision are as Figure 5.  
Figure 5: Power schedules of 10 generating units for given dynamic load for 24 h considering reserve provision. As illustrated in Figure 5, an optimal combination of thermal generators is dispatched to meet the 24 h load demand while ensuring system reliability. The inclusion of spinning reserve, visualized in Figure 6, provides additional operational flexibility and security. For instance, at time step t2, generators g4, g5, and g7 contribute spinning reserves of 99.1 MW, 38.6 MW, and 27 MW, respectively--after meeting their allocated portion of the load demand. This unused generation capacity represents reserve power that is immediately available to the system. Such spinning reserves play a crucial role in enhancing the dependability of the power system. They can be deployed to  
* Cover sudden increases in load,
* Compensate for unexpected drops in renewable generation, or
* Respond to generator outages or other unforeseen contingencies. The integration of spinning reserves into the unit commitment strategy thus ensures not only economic operation but also operational resilience in dynamic power system environments. Case 3: Unit Commitment of Thermal Units with Energy Storage System and Wind Energy for 24 h Dynamic Load  
In this case, a modern power system is studied that supplies electricity to consumers using a hybrid mix of thermal power plants, renewable energy resources, and energy storage systems (ESS). For this analysis, only four thermal generating units are considered, in addition to wind energy and battery storage systems. The decision to include only four thermal units reflects current trends in the energy sector, where the global push to reduce greenhouse gas emissions and combat climate change is driving a transition away from fossil fuels--particularly coal-fired power plants--and toward clean energy alternatives. As such, this model represents a more sustainable and environmentally responsible approach to power system planning. The inclusion of renewables and ESS significantly enhances the flexibility of the power system. Energy storage allows for demand-side flexibility, supporting a shift to the supply-driven demand paradigm. This means that instead of adjusting generation to match demand, demand can now be managed or shifted to align with available supply--especially from intermittent sources like wind. However, this increased flexibility also introduces greater system complexity, particularly in balancing variability and ensuring reliability.