Monte Carlo Loop: Electricity Generation Costs
Random feasible outputs from five power plants, compared with the exact $28,000 cost of meeting 1,000 MWh demand.
Five power plants, one demand target
This illustrative dispatch problem minimizes the cost of generating exactly 1,000 MWh. The coefficients are example values, not measured data from a utility.
| Source | Cost ($/MWh) | Capacity (MWh) |
|---|---|---|
| Nuclear | 20 | 300 |
| Natural gas | 45 | 250 |
| Oil | 60 | 200 |
| Coal | 25 | 350 |
| Hydroelectric | 35 | 250 |
A feasible Monte Carlo loop
Independent continuous random draws almost never sum to exactly 1,000. Instead, shuffle the plant order and sample each output within bounds that leave enough capacity for the remaining plants. Assign the final plant the remaining demand. Every dot represents one feasible draw and its cost; the horizontal axis is the sample index.
These sequential feasible draws are not uniform over the entire feasible polytope. They demonstrate stochastic search, not an unbiased probability model or a guaranteed optimizer. The plot repeats after 200 samples.
The exact reference result
For this linear deterministic model, use the cheapest available capacity first:
The supplied 6,000 + 8,750 + 28,000.
The allocation is infeasible: hydroelectric generation exceeds its 250 MWh capacity. The corrected allocation uses 100 MWh of natural gas.
Monte Carlo can approach this reference cost, but linear programming is the efficient exact method here. This illustration does not model ramp limits, losses, emissions, or uncertain demand.
Reference: Economic Dispatch as a Linear Optimisation Problem.
Kunigunda@organicwolf477
Sampling feasible dispatches avoids almost every random five-plant draw failing the exact demand constraint.