# 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  
In this case study, the unit commitment problem is implemented using the GAMS platform for a system comprising 10 thermal generating units, whose operational datasets  
Figure 3: Electricity prices for 24 h taken for study. Figure 2: Electrical demand for 24 h taken for study. are provided in Table 1. The system is operated over a 24 h period under a dynamic load profile, as depicted in Figure 4. The primary objective is to minimize the total operating cost, which includes the fuel cost, start-up cost, and shut-down cost, as represented by the cost function in Equation (1). To solve the problem, a Mixed Integer Programming (MIP) formulation is employed. Several operational constraints are incorporated into the model, including  
* Ramp rate limits
* Minimum up/down time requirements
* Power balance between supply and demand
* Start-up and shut-down cost constraints  
The binary decision variables used in the model are  
* \(u(i,t)\): Indicates the ON/OFF status of generator \(i\) at time \(t\)
* \(y(i,t)\): Indicates the start-up status of generator \(i\) at time \(t\)
* \(z(i,t)\): Indicates the shutdown status of generator \(i\) at time \(t\)
* In addition to binary variables, positive continuous variables are defined:
* \(p(i,t)\): Power output of generator \(i\) at time \(t\)
* StC(\(i,t\)): Start-up cost of generator \(i\) at time \(t\)
* SdC(\(i,t\)): Shutdown cost of generator \(i\) at time \(t\)  
Once the model is fully defined, GAMS solves the optimization problem using one of its MIP-compatible solvers. After simulation, the resulting **generator schedules**--including the operational status and output of each generator over the 24 h period--are obtained and presented as follows. One of the primary advantages of solving the unit commitment problem is the ability to operate the power system economically by selecting an optimal subset of available generating units, rather than running all units simultaneously. This strategic selection ensures that demand is met at the lowest possible operating cost, while still adhering to system constraints. As illustrated in Figure 4, at time step t1, the system demand of 883 MW is met without utilizing generators g1, g2, g6, and g8. Instead, the load is supplied by an optimal combination of units: g3, g4, g5, g7, g9, and g10. This selection highlights the efficiency of unit commitment in minimizing operational costs by prioritizing generators with lower cost coefficients, favorable ramp rates, or more suitable startup conditions at that hour. Figure 4: Power schedules of 10 generating units for dynamic load for 24 h.  
Case 2: Unit Commitment of 10 Thermal Power Plants for Given Dynamic Load with Spinning Reserve Constraints  
In the previous case, a basic unit commitment problem was formulated and solved. However, real-world power systems are subject to uncertainties and unforeseen events, such as generator outages or sudden load changes. To enhance the reliability and robustness of unit commitment solutions, an additional constraint--namely the spinning reserve constraint--must be introduced. Spinning reserve (SR) refers to the immediately available extra capacity from online units that can be dispatched on short notice to respond to system disturbances. It is defined as the difference between a generator's maximum available capacity and its current output. Spinning reserves are critical for improving the security, flexibility, and dependability of the power system. In this case study, the objective function remains unchanged: minimizing the total operating cost, which includes fuel, start-up, and shut-down costs. The only modification is the inclusion of the spinning reserve constraint in addition to the existing constraints such as ramp rate limits, minimum up/down times, and power balance.