## 3 Methodology to Develop and Execute a Redispatch Model in Real-Time Operation
### Mathematical Methodology to Implement the Modeling of a Redispatch
#### 3.2.7. Mathematical Formulation Defining Maximum Dispatch Power for System Security
However, plant dispatches favor coal-gas thermal generation with 100% fuel availability and hours of autonomy without the need to resort to diesel fuel in large amounts of generation to meet demand, as shown in Figure 11.  
In this situation the redispatch model for real-time extreme scenario 4 is a conservative scenario due to the availability of gas-fired thermal generation. However, the shortfall in hydro and wind generation allows the redispatch model to make use of diesel-fired thermal generation to a lesser extent. Figure 11 indicates, on the primary axis, the increases in gas-fired thermal generation, ranging from 270 to 1110 MW, while diesel thermal generation shows a slight increase of around 230 MW and coal-fired generation increases from 400 to 600 MW in low and high demand hours. The worst consequence in this scenario is assumed by hydroelectric generation, with a decrease in power ranging from 95 to 770 MW. The secondary axis of Figure 11 shows the marginal costs obtained in the redispatch, ranging from 89 to 133 USD/MWh. 2.5 Real-Time Extreme Scenario 5: Regrettable Consolidation of Thermal Generation due to Extreme Energy Emergency That Leaves Hydro and Wind Generation without Dispatch Possibility  
This real scenario considers low availability of wind power generation resources of around 10%, and hydroelectric generation from reservoirs is in a depleted state, i.e., with an availability of less than 5%. Gas-fired thermal generation is limited to 50%. However, this is one of the most complex scenarios due to the fact that 100% coal-fired thermal generation and more than 50% diesel generation must be used to supply demand, as shown in Figure 12.  
Figure 11: Redispatch of total hourly generation indicating marginal costs for real-time extreme scenario 4. In this situation the redispatch model for real-time extreme scenario 5 is a critical scenario due to the unavailability of gas-fired thermal generation. In addition, the shortfall of hydro and wind generation allows the redispatch model to make use of diesel thermal generation to a greater extent. Figure 12 indicates, on the primary axis, the increases in diesel thermal generation, ranging from 1320 to 1850 MW, while coal-fired thermal generation remains between 400 to 600 MW during low and high demand hours. The worst consequence in this scenario is assumed by gas-fired thermal generation, with a decrease in power ranging from 500 to 1200 MW. The economic effects on marginal costs are unfavorably noted for this scenario, since the secondary axis of Figure 12 shows the marginal costs obtained in the redispatch, ranging from 148 to 188 USD/MWh. 2.6 Real-Time Extreme Scenario 6: Decarbonization Stalls with the use of Coal-Fired Generation due to Crisis in Resources Destined for Hydro, Wind and Gas Generation  
This is the most extreme real-time scenario, since demand supply is 100% dependent on coal-diesel thermal generation, and emissions and the overall cost of operation increase in the face of zero water, gas, and wind generation forecasts, as shown in Figure 13.  
In this situation, the redispatch model for real-time extreme scenario 6 is the most critical scenario compared to the other five scenarios, due to the total unavailability of gas-fired  
Figure 8:0 Redispatch of total hourly generation indicating marginal costs for real-time extreme scenario 5. Figure 8:1 Redispatch of total hourly generation indicating marginal costs for real-time extreme scenario 6.  
thermal generation, hydro generation at the limit of drought, and wind generation with forecast errors. Consequently, the redispatch model will be based on a total use of diesel thermal generation with high marginal costs to supply demand. That is, Figure 13 indicates, on the primary axis, increases in diesel thermal generation ranging from 3175 to 4250 MW, while the worst consequence in this scenario is assumed by gas-fired thermal generation, with a decrease in power ranging from 3200 to 3900 MW.