← All projects

Energy

Water value

A small stochastic hydrothermal model that shows how a power price can come out of an optimization.

In a hydro system, water can be used today or saved, so the system needs a value for it. That value is an opportunity cost, and it depends on what the water would replace in a future nobody knows. Brazil runs this logic at a large scale to reach its spot price.

I wanted to see the mechanism work, so I built the smallest version that still behaves like the real thing: one reservoir, three thermal units, twelve monthly stages and three inflow scenarios per month. Try making the outlook drier without touching the reservoir.

Loading the model…

How it works

The model solves a dynamic program backward in time. For each month and each reservoir level it finds the cheapest way of serving demand once the inflow is known, counting the future cost of whatever water it uses. The slope of that future cost curve is the water value. A forward simulation then runs the resulting policy over 12 months.

Each monthly problem has a convex, piecewise-linear cost, so the solver only needs to check the breakpoints, and it gets the exact optimum for the grid. The price is the cost of serving one more unit of demand.

What I found

Starting in May with the reservoir half full, the water value is about R$ 233/MWh under the long-run hydrology. Raising the chance of a dry month from 30% to 50% for the next three months moves it to about R$ 273, which is 17% higher with exactly the same water in the reservoir.

The curve is very steep at the low end. The same water is worth about R$ 143 with the reservoir at 90% and about R$ 667 at 20%.

Model settings matter as much as the weather. With risk aversion at 0.6 instead of 0, the water value goes from R$ 233 to about R$ 387, with no change in the physical system. That is why a revision of a modelling parameter can be a market event.

The tests found a real bug on the way. The first version let hydro generate more than demand, which is a free way of throwing water away, and an energy balance test caught it.

What it leaves out

The real chain has thousands of plants and uses stochastic dual dynamic programming, since a grid over many reservoirs would be impossible. This version has no transmission, no correlated inflows and no regulated price limits, and every number in it is synthetic.

Personal project built with synthetic data. It uses nothing from any employer, and it is not investment advice.