## 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
2.2 Real-Time Extreme Scenario 2: Lower Gas-Fired Thermal Generation with Partial Gas Volume Stock Causes Dispatch of Diesel Generation at High Marginal Costs  
In this real scenario, variability and uncertainty conditions are maintained at 40% for wind generation, hydroelectric generation from reservoirs and run-of-river is at 30% deviation with respect to its programmed inflow, and coal-fired generation has 100% fuel availability and hours of autonomy. However, gas-fired thermal generation presents \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Plants** & **RTES1** & **RTES2** & **RTES3** & **RTES4** & **RTES5** & **RTES6** \\ \hline Solar & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ Wind & 40\% & 40\% & 40\% & 10\% & 10\% & 10\% \\ Geothermal & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ Cogeneration & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ Coal & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ Gas & 100\% & 50\% & 0\% & 100\% & 50\% & 0\% \\ Oil & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ Hydraulic-S & 30\% & 30\% & 30\% & 5\% & 5\% & 5\% \\ Hydraulic-R & 30\% & 30\% & 30\% & 30\% & 30\% & 30\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Critical scenario (%) of gas, hydro, and wind generation. Figure 8: Redispatch of total hourly generation indicating marginal costs for real-time extreme scenario 1.  
variability in the storage volume stock by 50%. This consequence immediately causes the appearance of diesel generation to cover the demand, as shown in Figure 9.  
In this situation, the redispatch model for real-time extreme scenario 2 is complex due to the deficit of economic and cleaner generation. However, Figure 9, on the primary axis, negatively shows the effects of redispatch with increases in diesel thermal generation ranging from 800 to 1120 MW and increases in coal thermal generation ranging from 340 to 580 MW, negatively causing a decrease in gas thermal generation ranging from 1500 to 1800 MW. Finally, the economic consequence can be seen in the secondary axis of Figure 9, which shows the marginal cost increases obtained in the redispatch, ranging from 109 to 123 USD/MWh. 2.3 Real-Time Extreme Scenario 3: Non-Supply of Gas Volumes in Stock Causes Forced Withdrawal of Gas-Fired Thermal Generation Complicating Frequency Regulation and Power Reserves  
This is a critical real scenario, since it contemplates the null resource of gas volumes for thermal generation, a situation that induces gas-fired thermal generation to change fuel in combined cycles and open cycle gas turbines to generate with diesel. Meanwhile, wind variability remains at 40%, hydro variability remains at 30%, and coal remains operating at 100%, as shown in Figure 10.  
Figure 10: Redispatch of total hourly generation indicating marginal costs for real-time extreme scenario 3. Figure 9: Redispatch of total hourly generation indicating marginal costs for real-time extreme scenario 2. In this situation, the redispatch model for real-time extreme scenario 3 is also complex due to the major shortfall of less-polluting and economical generation. On the primary axis of Figure 10, the increases in generation with higher costs and higher pollution allow us to negatively visualize the effects of redispatch with increases in diesel-fired thermal generation ranging from 2050 to 2800 MW and increases in coal-fired thermal generation ranging from 480 to 950 MW, negatively causing a decrease in gas-fired thermal generation ranging from 3200 to 3900 MW. Finally, the economic consequence is more severe, since in the secondary axis of Figure 10, the marginal cost increases obtained in the redispatch range from 123 to 127 USD/MWh. 2.4 Real-Time Extreme Scenario 4: Depleted Hydroelectric Reservoirs and Scarce Wind Resource Transform a Thermal Generation Predominant Dispatch with High Emissions  
This is a very severe real-world scenario that often occurs due to drought weather conditions and inaccurate wind forecasts.