← TAIMOOR ALI Case study
TRADING & DISPATCH DECISIONS · MSc DISSERTATION

Turning volatility into profit: electricity arbitrage for UK wind farms

The UK's shift to renewables made electricity prices volatile — and made wind farms hostage to the weather that powers them. My MSc dissertation builds the system that flips that volatility into revenue: deep-learning forecasts of wind output and power prices feeding a battery optimiser that buys low, sells high, and knows when to do neither.

+7.13%avg revenue uplift
161%peak uplift
4 × 2architectures × tasks
60 MWhBESS · 10 MW · MILP

01 · THE PROBLEMRenewables made power cheap — and prices wild

The UK has a legally binding net-zero target for 2050, and the generation mix shows it: clean power has displaced coal and is now overtaking gas. But the transition rewired how electricity is priced. Unlike a gas plant, a wind farm can't choose when to generate — output follows the weather, on every timescale at once. In a liberalised market where each trading period clears at the marginal cost of meeting demand, that intermittency has consequences: an abundance of wind can push prices toward zero or even negative, while scarcity events send them spiking.

For a wind producer this is a double bind. Your asset earns the least exactly when it produces the most (everyone's turbines are spinning), and you can't capture the spikes (the wind doesn't take orders). Worse, the UK's imbalance-settlement regime penalises forecast errors in either direction — so being wrong about your own output costs money twice. Volatility, for a passive generator, is pure downside.

The UK generation mix has flipped
Approximate share of UK electricity generation by source · Ember / DUKES annual data
Coal collapsed from ~28% to effectively zero (the last plant closed in 2024); renewables grew from ~7% to the largest source. The price-setting plant changed — and so did price behaviour: the weather now writes the order book.

A co-located battery changes the game. Store energy when prices are low, sell when they're high, and the volatility that punished you becomes the spread you trade. But the battery is only as smart as its view of the next few hours — which makes this, at its core, a forecasting problem welded to an optimisation problem. That's the system this dissertation builds, end to end, on UK data.

02 · THE SYSTEMTwo forecasts, one optimiser, one decision per hour

Every hour, the producer faces four options: sell the generation now, store it, discharge what's stored, or sit idle. The framework feeds two six-hour-ahead forecasts — wind power and electricity price — into a mixed-integer optimiser that makes that call, subject to the physics and economics of a real battery.

The integrated framework
Two forecasting models feed one optimiser; the optimiser makes the hourly call
ERA5 weather wind · temp · u* ENTSO-E prices UK day-ahead, hourly Wind forecast (MLP) next 6 hours, kW Price forecast (CNN-LSTM) next 6 hours, £/MWh MILP optimiser PuLP · CBC solver Decision store / sell
Six hours is a deliberate horizon: long enough to plan a charge–discharge cycle, short enough that forecasts stay useful — accuracy degrades fast beyond it.

03 · THE PHYSICSFrom wind speed to watts: Betz's law in the feature set

The wind data is ERA5 reanalysis from the ECMWF — hourly atmospheric variables on a ~31 km grid: wind components at 10 m and 100 m, air temperature, surface friction velocity (u*, which captures how terrain roughness drags on the wind). Raw ERA5 doesn't give you wind speed directly; it gives the zonal (east–west) and meridional (north–south) components, u and v, which combine by simple vector magnitude:

WS = √(u² + v²)evaluated at 100 m — close to turbine hub height

Speed alone isn't power. The target variable — theoretical turbine output — comes from the fundamental wind-power equation rooted in Betz's analysis of how much kinetic energy a rotor can extract from moving air (Betz, 1926):

P = ½ · ρ · A · Cp · v³ρ air density · A swept rotor area · Cp = 0.5 power coefficient · v wind speed

where ρ is air density, A the swept rotor area, v the wind speed, and Cp the power coefficient — fixed at 0.5 here, typical of modern turbines (Betz proved no rotor can ever exceed ~0.593). Two things follow from that little equation. First, power scales with the cube of wind speed: a 10% change in wind is a ~33% change in output, which is exactly why wind revenue is so volatile. Second, embedding the equation grounds the deep-learning models in physics — they learn to predict an output anchored to real turbine behaviour rather than a free-floating curve.

04 · EXPLOREWhat correlates with power — and what got dropped

Before modelling, the candidate features faced a correlation audit against power output. The verdict was clean:

Correlation of wind variables with each other and with power
Pearson correlations from the ERA5 feature audit (dissertation Figure 5)
u10v10u100v100gusttempradiationu* (friction)wind speedpower
u101.000.440.990.380.430.03-0.100.430.470.47
v100.441.000.470.990.360.20-0.040.350.390.47
u1000.990.471.000.410.410.02-0.120.420.470.46
v1000.380.990.411.000.350.22-0.030.340.380.45
gust0.430.360.410.351.000.150.240.980.890.84
temp0.030.200.020.220.151.000.510.12-0.07-0.03
radiation-0.10-0.04-0.12-0.030.240.511.000.21-0.14-0.09
u* (friction)0.430.350.420.340.980.120.211.000.910.83
wind speed0.470.390.470.380.89-0.07-0.140.911.000.89
power0.470.470.460.450.84-0.03-0.090.830.891.00
Blue = positive, red = negative, intensity = strength. Wind speed (r = 0.89), gusts (0.84) and friction velocity (0.83) carry the signal; temperature (−0.03) and solar radiation (−0.09) carry none.

The exploratory pass also surfaced a diurnal rhythm — average output peaks in the early afternoon around 13:00 — and the raw series shows what the models are up against: spikes past 14,000 kW next to long becalmed stretches. Intermittency isn't a footnote in this data; it is the data.

05 · SETUPHow the models were trained

Four deep-learning architectures were built for each forecasting task — a feed-forward MLP, a 1D-CNN, an LSTM, and a CNN-LSTM hybrid — chosen to span the design space: pure function approximation, local pattern extraction, long-range memory, and the combination. The discipline was identical across all eight model instances:

ComponentChoiceRationale
Input window18-hour lookbackCaptures strong hourly autocorrelation and the daily demand cycle
OutputDirect 6-step predictionOne shot for all six hours — beat recursive one-step forecasting on stability
SplitChronological 80/20 + validationNo future data leaks backwards; scaling statistics fitted on train only
LossHuberRobust to the price spikes that would dominate a pure MSE objective
TuningOptuna, up to 100 trials/modelBayesian search (TPE) over layers, units, learning rate, dropout, batch size
RegularisationDropout + early stopping + weight decayTraining and validation losses converge — verified per model, not assumed
Price featuresLagged prices onlyCalendar features were engineered, then dropped: the recurrent models learned the daily and weekly cycles from the sequence itself

06 · FORECASTING PRICESThe hybrid wins the market

Price signals mix sharp local spikes with longer daily and weekly rhythms, and the CNN-LSTM's structure mirrors that split: convolutional layers catch the spikes, the recurrent layers carry the rhythm. The benchmark agreed — the hybrid leads every headline metric.

ModelRMSE (€)MAE (€)Pearson R
CNN-LSTM21.7516.170.72550.852
MLP22.0016.370.71910.8612
LSTM23.0317.020.69210.8414
1D-CNN23.5017.330.67950.8408
Tracking the market: actual vs predicted prices
Best price model (CNN-LSTM) on unseen test data · illustrative reconstruction calibrated to the reported metrics (R² = 0.7255, RMSE = €21.75)
Actual vs predicted electricity price on the test set
The model rides the daily cycles faithfully and follows spikes directionally while undershooting their peaks — the classic, honest signature of a well-regularised forecaster on volatile data. Original figure in the dissertation.
Price model — learning curves
Training vs validation loss · redrawn from the dissertation's training plots (approximate values)
Price model training versus validation loss
Both losses fall together and flatten at the same level — learning structure, not memorising noise. Early stopping ended training when the validation curve stopped improving.
Price forecast accuracy decays with horizon
Per-horizon R² on the electricity price task, t+1 to t+6 hours ahead
At t+1 the hybrid is exceptional (R² 0.94); by t+5 the models converge as uncertainty compounds. The first two hours — where dispatch decisions bite hardest — are where the hybrid earns its keep.

07 · FORECASTING WINDThe plot twist: the simplest model wins

Same four architectures, same protocol, different winner. On wind power, the humble MLP beat every sequence model — lowest RMSE and MAE at all six horizons, highest R² at five of six. With a rich, physics-grounded ERA5 feature set, wind prediction behaves less like a sequence problem and more like nonlinear regression, and a well-tuned MLP is exactly that. Meanwhile the LSTM scored the highest Pearson correlation (0.862): it tracks the shape of the series best even where its magnitudes miss — a genuinely different skill, and which one matters depends on what the downstream decision consumes.

Wind power forecasting — overall test performance
Holdout RMSE in kW, lower is better · R² in tooltip
MLP: RMSE 1,285 kW, R² 0.7016. The CNN-LSTM that won on prices finishes last on wind — architecture fit is task-specific, not universal.
Tracking the wind: actual vs predicted power output
Best wind model (MLP) on unseen test data · illustrative reconstruction calibrated to the reported metrics (R² ≈ 0.70, RMSE ≈ 1,285 kW)
Actual vs predicted wind power on the test set
Calm stretches are predicted almost perfectly; the bursts are caught in timing but trimmed in magnitude — remember the cubic law: small wind-speed errors become large power errors at the top end. Original figure in the dissertation.
Wind model — learning curves
MLP training vs validation loss · redrawn from dissertation Figure 14 (approximate values)
Wind MLP training versus validation loss
The steep early descent and joint convergence near zero held across all eight model instances — dropout, weight decay and early stopping doing their jobs.
Accuracy decays with horizon — differently per model
Per-horizon R² on the wind power task, t+1 to t+6 hours ahead
The MLP holds its lead across the window; the CNN-LSTM degrades fastest (R² 0.78 → 0.37). Stability over the horizon is a model property in its own right.
The call

No single architecture dominated both tasks — and that's the finding, not a failure. The price task rewarded the hybrid; the wind task rewarded a flexible function approximator; the "best" model even changes with the metric (point accuracy vs shape tracking). A production system should run a portfolio of specialised models per data stream, not crown one architecture and force it everywhere.

08 · THE OPTIMISERProfit, with physics attached

Forecasts feed a mixed-integer linear programme (PuLP, CBC solver) that maximises revenue over each six-hour window. Each hour it sets three non-negative decision variables — energy sold directly, charging power, discharging power — with a binary variable forbidding simultaneous charge and discharge. The objective is total revenue: direct sales plus discharged energy at market price, minus charged energy and minus degradation cost. The constraints are how batteries actually work:

ConstraintValueWhy it matters
Usable capacity60 MWhYou can't arbitrage what you can't store
Charge / discharge power10 MWCaps how fast the battery can act on a price spike
Round-trip efficiency86%Every stored MWh comes back smaller — spreads must beat the loss
State of charge5–95%Protects battery life at the extremes
Degradation cost€0.01 / kWhCycling isn't free; the optimiser won't trade thin spreads
Energy balanceSoCt+1 = SoCt + ηcPc − PddCharge and discharge losses applied where they physically occur

The degradation term is the quiet hero: it makes the optimiser conservative in flat markets and aggressive in volatile ones — exactly the behaviour a real asset manager wants, emerging from the economics rather than a hand-coded rule.

09 · RESULTSWhat the arbitrage earned

Against a baseline that sells all generation immediately, the forecast-driven optimiser averaged £858.85 per six-hour window vs £801.72 — a +7.13% uplift across the dataset. The average hides the texture, which three windows illustrate:

Optimiser vs sell-everything baseline
Average revenue per 6-hour window (left axis) · uplift by market condition (right axis)
Most windows deliver modest 5–7% gains; rare high-volatility events deliver far more. Volatility is the profit engine — forecasts are the key that unlocks it.

The single best window in the dataset shows the ceiling. Prices started near zero and climbed to roughly £150/MWh across six hours; the optimiser charged through the cheap hours at up to 10 MW and emptied the battery into the final two:

Anatomy of the best window: +161.8%
Hourly dispatch against price · reconstructed from the dissertation appendix figure (approximate values)
Total revenue: £1,224 baseline vs £3,204 optimised — +£1,980 from the same wind, the same battery and the same market, differing only in when energy was released.

10 · HONESTYThe limitations, stated plainly

The framework treats point forecasts as if they were certain, so the reported uplift is an upper bound under that assumption — realised gains would be reduced by forecast error. The six-hour horizon can't hold charge for tomorrow's bigger spike. Degradation is modelled as a flat linear cost when real degradation is nonlinear in temperature, depth of discharge and C-rate. Round-trip efficiency is held constant when it varies with operating conditions. And one year of training data meets a market that policy and the generation mix keep reshaping — the models need rolling retraining to stay calibrated.

The call

I reported the 7.13% explicitly as an idealised ceiling rather than a promised return. An analysis that hides its assumptions gets one good meeting; an analysis that prices them in gets trusted with the next decision. The fix list is concrete: probabilistic forecasts feeding risk-aware (stochastic or robust) optimisation, longer or nested horizons, richer degradation models, rolling retraining on updated market and weather data.

11 · NEXTWhere this goes

The most interesting extension is economically-driven forecast training: stop optimising RMSE and start optimising the profit the downstream decision actually realises. The forecast exists only to serve the decision, so train it on the decision's objective. Beyond that: multi-market participation — day-ahead, continuous intraday, the balancing mechanism and ancillary services, where prior studies show material gains from joint bidding — and reinforcement-learning dispatch policies that learn the market directly instead of through a forecasting intermediary.

Stack: TensorFlow / Keras · MLP · 1D-CNN · LSTM · CNN-LSTM · Optuna (TPE) · PuLP (MILP, CBC) · ERA5 (ECMWF) · ENTSO-E · pandas · University of Surrey, supervised by Dr. Xun Zhou