EP Commodities × FEI TUKE EPIC
EPIC — EP Innovation Centre × FEI TUKE · Guest lecture

Power Markets Lab: from megawatts to euros

How electricity markets really work, how we model them and how energy companies turn models into decisions — and money. Every section has an interactive part (play with it), a guide (what to try) and an explanation (what it means in the real world).

⚡ Power plants & optimisation 📈 Day-ahead market & merit order 🧮 Modelling (PyPSA, grids, PTDF) 💶 Trading & hedging 🎓 Thesis & project ideas
The big picture — one value chain
PhysicsPlants, weather, grid — supply must equal demand every second
MarketsForward, day-ahead, intraday, balancing, capacity
ModelsMerit order, PyPSA, ML forecasts, optimisation
DecisionsDispatch, bid, hedge, buy, build
P&LWas the model actionable? Did it make money?
The message of todayA model is only worth something if it changes a decision. “The price will be 92 €/MWh” is trivia — “sell 50 MW of Q1 now, keep 30 MW of the gas plant for balancing, charge the battery at 13:00” is a business.

How energy companies make money

🏭 Asset optimisation

Run plants, hydro and batteries in the most valuable hours and markets. Every MW sold once, at the best place.

dispatchancillarywater value

📉 Hedging & risk

Lock in margins with forwards years ahead so the company survives price crashes. Less upside, much less downside.

forwardsVaRclean spreads

🔮 Trading (spec)

Take positions when your fundamental view differs from the market: weather, outages, gas, policy.

fundamentalsweathernews

🤝 Origination

Structured deals for clients: PPAs for wind/solar, shaped supply for industry, tolling, flexibility contracts.

PPAshape riskpricing

🏗️ Investments & M&A

Value plants over 20–40 years: buy, build, retire. Long-term price scenarios decide billion-euro questions.

NPVscenarioscapture price

🧠 Analytics & data

Forecasts, fundamental models, automation — the engine behind all of the above. This is where engineers start.

PythonoptimisationML
Today's route (≈ 90 min)
Power plants — how each technology earns money, and splitting capacity across markets · 20 min
Day-ahead market — merit order, price setting, coupling, why gas matters · 20 min
Modelling — PyPSA, calibration, scenarios, grid & PTDF · 20 min
Trading — horizons, hedging, valuation + trader quiz · 20 min
About EPIC

EPIC — EP Innovation Centre is the university cooperation programme of EP Commodities (EPC), the energy trading arm of the EPH group.

  • Master & PhD thesis topics with real market data
  • Mentoring by traders, analysts and quants
  • Internships and student projects → junior roles
  • Joint research: modelling, optimisation, grids, ML
epcommodities.cz
?

How to use this lab

  1. Yellow boxes = your task list. Steps tick ✓ as you do them.
  2. Move sliders, press buttons — every chart recalculates live.
  3. Read the explanation below each tool: what it means in practice.
  4. Red dashed boxes = how this makes money.
The question we answer today

Why did electricity cost 30 €/MWh in 2020, over 450 €/MWh in summer 2022, and sometimes below zero today?

Section 1 · Asset optimisation

Power plants: what they cost, how they run, where they sell

Every plant is a machine that turns fuel, water, wind or stored energy into megawatt-hours — but each MW can be sold only once. The trader's job: decide when a plant runs and in which market each MW earns the most. Nuclear, gas, hydro, batteries and renewables solve very different optimisation problems.

10 interactive tools Marginal cost · spreads · dispatch Optimisers: DP, water value, storage All prices illustrative, CEE 2025/26
!

Your task

  1. Click a market on the timeline below to see who buys, what is traded and which plants can take part.
  2. Open at least 4 different markets — watch which slice of the 400 MW gas plant each one uses.
  3. Answer the three quick-check questions on the right.
Timeline of power markets — from years ahead to real time (click a bar)
Years ahead
Months → days
Day before (D-1)
Delivery day (D)
Real time & after

← Click any market bar above to open its fact sheet.

Quick check
One 400 MW gas plant — how its capacity is typically split for tomorrow (illustrative)
Sold forward
160 MW
Day-ahead
120 MW
aFRR reserve
60 MW
FCR
20
Open for intraday
40 MW
Capacity mechanism (where it exists): paid for the whole 400 MW being available — on top of energy sales

The bars add up to 400 MW: once a MW is promised to one buyer it cannot be sold again. Real-time balancing energy is delivered from the reserved slices when the TSO activates them.

What is going on?

Electricity is traded many times before it is produced. Forwards fix prices months or years ahead (hedging). The day-ahead auction at 12:00 the day before sets the hourly — since 1 Oct 2025 15-minute — schedule for all of Europe in one optimisation (SDAC, algorithm Euphemia). Intraday trading fixes forecast errors until shortly before delivery. Whatever is still out of balance is solved by the TSO (ČEPS, SEPS…) in real time with balancing reserves it bought in advance.

Key concept — opportunity costA MW reserved for aFRR cannot be sold day-ahead. So the reserve price must pay at least the margin you give up in the energy market. Every allocation decision compares the value of the next best use of the same MW.
Gate closureEach market has a deadline. Decisions are sequential: forwards → reserves (D-1 morning) → day-ahead (12:00) → intraday → real time. What you sold earlier constrains what you can do later.
A flexible plant earns from several markets: a baseline energy margin from forwards/day-ahead, a capacity fee for reserves, and extra money in intraday and balancing when prices spike. Stacking these revenues (“revenue stacking”) is what makes gas plants and batteries profitable today.
Every morning a trading desk re-optimises the whole fleet: which MW go to the TSO reserve auctions, what is bid into day-ahead at 12:00, and what stays open for intraday. Bids are generated by optimisation models and checked by traders — the same logic you will play with in the next tabs.
!

Your task

  1. Move the gas price — watch the gas plants move along the cost ladder.
  2. Change gas or CO₂ until hard coal and the new CCGT swap places (the fuel switch).
  3. Click any bar in the chart to open that plant's fact card.
  4. Lower the power price until the clean spark spread of the new CCGT turns negative — the plant would stay off.
Commodity prices (illustrative)
+2 €/MWhth transport to the plant
1 EUA = right to emit 1 t CO₂
1 t coal ≈ 6.98 MWhth
Own mine next to the plant — cheap fuel, lots of CO₂
Old CCGT fixed at 49 %

e.g. a baseload day-ahead price
SRMC new CCGT
–
€/MWh electricity
Clean spark spread
–
power − gas − CO₂ (new CCGT)
Clean dark spread
–
power − coal − CO₂
Fuel-switch CO₂ price
–
above it gas beats coal
solid = fuellight = CO₂ costgrey = variable O&Mhatched = opportunity cost (water value)dashed line = power price

Click a bar to open a plant fact card.

What is going on?

The short-run marginal cost (SRMC) is what it costs to produce one more MWh: fuel + CO₂ + variable maintenance. Fixed costs (staff, capital) do not count — they are paid whether the plant runs or not. A plant runs when the power price is above its SRMC.

SRMC = fuel/η + CO₂ · EF/η + VOM

η = efficiency (MWhel per MWh of fuel), EF = emission factor (t CO₂ per MWh fuel: gas 0.20, hard coal 0.34, lignite 0.37). A 57 % CCGT emits ≈ 0.35 t/MWh, lignite ≈ 1 t/MWh — so CO₂ hurts lignite three times more.

Key concept — spreadsClean spark spread = power − gas/η − CO₂·EF/η. Clean dark spread = same for coal. Positive spread → the plant earns money for every MWh. Traders hedge plants by selling power and buying gas + CO₂ forward at the same time — they lock in the spread, not the price.
Hydro, wind and solarWind and solar have almost zero SRMC → they always run if they can. Reservoir hydro has zero fuel cost but limited water: it bids its opportunity cost (“water value”, see the Hydro tab), not zero.
The plant owner earns price − SRMC in every hour it runs (the “infra-marginal rent”). Nuclear and wind earn a lot per MWh because the price is usually set by a more expensive gas or coal plant. The marginal plant earns almost nothing — it must make money from flexibility, reserves and scarcity hours.
Spreads are monitored live: a desk computes spark/dark spreads for every plant and every forward product (month, quarter, year) and sells forward when the spread is attractive — buying gas and EUAs at the same moment. Fuel-switch levels tell analysts which plants will be in the money next winter.
Flexibility at a glance (typical values)
!

Your task

  1. Open at least three market cards below: what is sold, when, how is it priced?
  2. Pick tomorrow's day type and read the forecast. The real prices are still hidden.
  3. Split the 400 MW between aFRR reserve, day-ahead and intraday, then press Run tomorrow.
  4. Find a run where the second chance in intraday earns money (MW not selected day-ahead, sold later).
  5. Beat “all-in day-ahead” on two different day types.
Where can a power plant sell its MW? Six markets, from years ahead to real time (click to open)
Forwards & futures years → days ahead
  • What: base/peak blocks for a week, month, quarter, year (e.g. “CZ Cal-27 base”).
  • When: continuous trading on EEX/PXE or OTC via brokers, until shortly before delivery.
  • Price: each deal at its own fixed price (pay-as-traded). Used for hedging: lock the spark spread early.
  • Who: generators, suppliers, industry, traders.
Capacity mechanism 1–4 years ahead
  • What: being available in scarcity (€/kW/year), not energy.
  • When: state/TSO auctions years before delivery.
  • Price: auction clearing price; penalties if unavailable. Stacks on top of energy sales.
  • Who: prequalified, de-rated plants, storage, demand response. PL, IT, BE, GB… not CZ/SK today.
Balancing capacity FCR · aFRR · mFRR D-1 morning
  • What: MW kept ready for the TSO. Paid a reserve price in €/MW/h even if never activated.
  • When: TSO auctions, mostly on D-1 before day-ahead, in 4-hour blocks.
  • Catch: a gas plant must be running (≥ min load) and keep headroom: for aFRR up, output ≤ 400 − reserve.
  • Who: prequalified units: gas, hydro, batteries, demand response.
Day-ahead auction (SDAC) 12:00 on D-1
  • What: energy for each 15-minute period of tomorrow (15-min MTU since 1 Oct 2025, hourly before).
  • When: gate closure 12:00 CET, results ≈ 13:00.
  • Price: one uniform clearing price per zone and period (pay-as-cleared), Euphemia couples Europe.
  • Who: everyone with a balance group. Deepest liquidity, reference price for most contracts.
Intraday (IDA + continuous) D-1 15:00 → ~1 h before
  • What: 15-min, hourly and block products to correct positions.
  • When: three auctions (15:00, 22:00 D-1, 10:00 D) plus continuous trading (SIDC) until shortly before delivery.
  • Price: auctions uniform, continuous pay-as-bid. Moves with forecast errors, thinner liquidity.
  • Who: same players. Flexible plants sell more when ID spikes, buy back when it drops.
Balancing energy & imbalance real time
  • What: energy from activated reserves (aFRR via PICASSO, mFRR via MARI); settlement of every deviation.
  • When: real time, settled per 15-min period afterwards.
  • Price: marginal activation price; imbalance price for each balance responsible party. Very volatile.
  • Who: reserve providers earn on activation; everyone pays or receives imbalance.
Your decision for tomorrow · CCGT 400 MW
SRMC = …
whole day · max 150 MW (5-min ramp) · plant must stay online ≥ 180 MW
0 or ≥ 180 MW (minimum stable load)
sold later if the intraday price beats SRMC
Your P&L
?
press Run tomorrow
Reserve income
?
MW × €/MW/h × 24 h
Day-ahead margin
?
selected hours
Intraday margin
?
of which second chance

Before the run you only see the forecast band (illustrative). After the run: real day-ahead prices, intraday prices and what your plant sold in each hour.

P&L by market: you vs alternatives
Decide first, then press Run tomorrow.

What is going on?

The markets close one after another: reserve auctions (morning D-1) → day-ahead (12:00) → intraday (until about an hour before delivery). You must split the plant before you know the prices of the later markets.

Your day-ahead offer is priced at SRMC, so you are only selected in hours where the clearing price covers fuel and CO₂. MW that were not selected, plus the MW you kept back, can still be sold in intraday wherever the ID price beats SRMC.

Model (illustrative): hourly instead of 15-min; reserve is held all day, so the plant runs at least 180 MW in every hour (that min-load block is sold day-ahead as a must-run). Selling intraday moves the price against you by 2 €/MWh per 100 MW (thin liquidity). Starting the plant costs €12k. Ramp and min up/down times are ignored here: they are the topic of the next tab.

Key concept: the second chanceIf you are not selected on day-ahead, you still have a second chance in intraday. But ID prices are uncertain and liquidity is thinner. A windy surprise pushes ID below DA; a calm surprise pushes it above.
Reserve: safe money with a catchThe reserve fee is earned whatever the prices do. But the plant must run at least 180 MW all day, even in hours below SRMC, and the reserved MW cannot be sold as energy.
Optionality has value. A MW sold day-ahead earns one known price. A MW kept flexible can earn the intraday price if it is higher, or stay idle if it is lower. Traders call this an option. The skill is to sell enough early to lock in the spread, and keep enough flexible for the surprises. On a stable day all-in day-ahead is fine. On a day with a big forecast error, the flexible MW earn the most.
The desk forecasts tomorrow's DA, ID and reserve prices together, with scenarios. Reserve volumes go to the TSO auction first, then DA bids at 12:00. The remaining flexibility is traded intraday by a 24/7 desk and by algorithms, every 15 minutes, until gate closure.
!

Your task

  1. Choose a day type and read the weather indication. Exact prices stay hidden until you submit.
  2. Enter a price and quantity for each block (or use a helper), then press Submit to day-ahead.
  3. Read the feasibility check. Change your bids until the accepted schedule has 0 violations.
  4. Reach a score of at least 90 % of the optimal feasible schedule.
  5. Tick Step 2: already online and compare the cold plant with the online plant.
Your plant · CCGT 400 MW (illustrative)
SRMC = …
Your day-ahead bids · price (€/MWh) and quantity (MW: 0 or 180–400)
Your P&L
?
after fixing violations
Violations
?
technical constraints
Optimal schedule
?
perfect foresight
Score ?
?
Feasibility check of the accepted schedule

Submit your bids to see which hours were selected and whether the plant can actually run that schedule.

P&L: you vs naive SRMC bidding vs optimal feasible schedule
Your bids are not submitted yet.

What is going on?

The day-ahead auction treats every hour (since Oct 2025 every 15 minutes) as a separate price. Each simple bid is accepted when the clearing price is at or above the bid price. A gas plant, however, has inter-temporal constraints: it needs a start (and a start cost), it must stay on at least 4 h and off at least 3 h, it cannot run below 180 MW, and it ramps only 150 MW per hour.

So a set of hourly bids can be accepted but impossible to run: “selected 07–09 only”. The plant then repairs the schedule: it buys back in intraday (at a worse price) or runs loss-making hours.

Model (illustrative): hourly, price-taker (our bids do not move prices), start-up goes 0 → 180 MW in the first hour, shut-down only from 180 MW, runs that reach midnight continue tomorrow. Intraday fixes cost the DA price ± 12 €/MWh. The optimal schedule is a dynamic program (as in the Gas plant tab) extended with ramps and min up/down times.

Key concept: block and smart orders in EuphemiaBlock order: “sell 300 MW in 06–22 at an average of at least 105 €/MWh”, all or nothing. Its minimum acceptance ratio (e.g. 60 %) allows partial acceptance, never below that share. Linked blocks: a child block (extra MW in the evening) is accepted only if its parent (the min-load block) is. Exclusive groups: at most one of several alternative profiles is accepted. These orders exist exactly so plants can bid their start cost and min load.
Being online changes the bidA cold plant must earn its start and no-load costs, so it bids above SRMC. A plant already online (for aFRR, or because of an earlier sale) has paid those already. It bids its remaining MW at pure SRMC and is selected in more hours.
The money is in the difference between accepted and feasible. Good bids recover start costs without being priced out, respect ramps and run lengths, and avoid expensive intraday fixes. On a volatile day the gap between naive SRMC bidding and an optimised bid is tens of thousands of euros, for one plant and one day.
Trading desks run a unit-commitment optimiser (MILP) on price scenarios every morning. It translates the optimal schedule into block, linked and simple orders for Euphemia. After the auction the same model checks the accepted result and re-optimises intraday: it repairs infeasible hours, sells spare MW and buys back when ID is cheaper than running.
!

Your task

  1. Switch to the sunny spring day: the optimiser stops the plant over the midday price dip (or keeps it at minimum load).
  2. Reserve ≥ 50 MW for aFRR: the output is capped and the blue headroom appears.
  3. Press Find optimal split — how many MW should go to reserves?
  4. Try the dunkelflaute day: is reserve still worth it when energy margins are huge?
CCGT 400 MW · min. stable load 180 MW
fuel to heat up + wear and tear per start

Max 150 MW: what the plant can ramp in 5 minutes
paid per MW per hour just for standing ready
SRMC = …
Day-ahead margin
–
(price − SRMC) × MWh
Reserve income
–
MW × €/MW/h × hours
Start costs
–
Profit of the day
–
optimised dispatch

Reserve is offered in 4-hour blocks (00–04, 04–08, …). In a block with reserve the plant must be online and keep the reserved MW free. The optimiser (dynamic programming over 24 h × on/off × reserve block) chooses when to start, stop and offer reserve.

Compare strategies

What is going on?

A gas plant (CCGT) is the classic flexible plant: it starts in 1–3 hours and can move between minimum load (here 180 MW) and full load (400 MW) quickly. But each start costs money (fuel to heat up, wear of the turbine), and below 180 MW it cannot run stably.

So the question is not “is the price above SRMC this hour?” but “is the whole run worth it?” — sometimes it is cheaper to stay at minimum load through a few loss-making hours than to stop and pay another start.

Key concept — reserve vs energyEach MW reserved for aFRR earns the capacity price, but cannot be sold day-ahead. If the plant would anyway run at minimum load (price < SRMC), the headroom up to full load is almost free to offer as reserve. When the spark spread is high, reserve costs you the lost energy margin.
“Naive” dispatchruns at full load whenever price > SRMC and ignores start costs and minimum load. On a spiky day it starts several times and loses the start-up costs.
The CCGT earns from the shape of prices (running in the expensive hours), from reserve payments and from extra balancing activations. On low-spread days, reserves can be the main income — which is why owners of gas plants care so much about TSO auctions.
Real optimisation models use the same structure as this toy DP, only bigger: mixed-integer programs (MILP) with part-load efficiency curves, ramp rates, minimum up/down times, hot/warm/cold start costs, gas nominations and all reserve products — solved every day before the TSO auctions and again before day-ahead gate closure.
!

Your task

  1. Drag the outage start slider through the year and watch the lost margin change.
  2. Find the cheapest window (within 1 % of the best).
  3. Switch on the TSO winter rule and the one-crew rule — where is the best window now?
  4. Move the spot price scenario and the hedge ratio: why does nuclear sell its power years ahead?
1 000 MW nuclear unit · SRMC ≈ 10 €/MWh
Lost margin (your window)
–
Best allowed window
–
Cost of your choice
–
vs. best window
Annual margin
–
at forward prices, 97 % availability outside the outage
Why nuclear sells forward — next year's revenue (≈ 8 TWh)
Revenue with hedge
–
Fully unhedged
–
Context: nuclear in Slovakia and Czechia
  • Slovakia: Mochovce 1–3 (≈ 470 MW each, unit 3 since 2023, unit 4 under construction) and Bohunice V2 (2 × ≈ 500 MW) — nuclear covers well over half of Slovak generation.
  • Czechia: Dukovany (4 × ≈ 510 MW) and Temelín (2 × ≈ 1 080 MW) — about 40 % of Czech generation.
  • Units refuel every 12–18 months; outages take ~3–6 weeks and are planned years ahead with the TSO.
  • SRMC is tiny (fuel ≈ 5–7 €/MWh) but fixed costs are huge — the plant must run as close to 100 % as possible.
Can nuclear be flexible?Technically partly (France modulates daily). Economically it only reduces output when prices fall below its SRMC, i.e. at negative prices — this happens more often with more solar.

What is going on?

Nuclear is a baseload plant: it runs flat out almost all year. Its optimisation problem is not hourly dispatch but when to stop for refuelling and maintenance. Forward prices are seasonal — winter months are much more expensive (heating, low solar) than late spring/summer. Every day offline costs 24 GWh × (price − SRMC).

Constraints make it realistic: the TSO needs enough capacity in winter, and a site has one specialised outage team, so units at the same site cannot all stop at once.

Key concept — planning against the forward curveOutages are planned against the forward curve (today's prices for future months), not against a guess. Because the plant sells forward, a day of outage means buying back power that was already sold — at today's forward price.
Two levers: (1) timing outages in cheap months saves millions every year; (2) selling forward 1–3 years ahead locks in revenue — it removes the risk that a price crash ruins the plant's year. Look at the hedge chart: with 80 % hedged, a crash to 40 €/MWh costs only a fraction of what it costs unhedged.
The generation owner and the trading desk agree a hedging strategy (e.g. ~60–80 % of expected output sold one year ahead, rising towards delivery). The desk executes it gradually on exchanges (EEX/PXE) and OTC, and adjusts positions when outage plans change.
!

Your task

  1. Lower the water budget (a dry week) — watch the water value go up.
  2. Compare the optimal plan with “uniform” dispatch: how much does smart timing add?
  3. Switch on pumped storage and change the round-trip efficiency.
  4. Try another week type (e.g. the mixed-weather week with a dunkelflaute Friday).
Reservoir hydro plant · one week (168 h)
stored water + inflow, expressed as MWh it can produce
pump power = turbine power; reservoir has room for 6 extra full-load hours
Water value
–
price of the last (cheapest) hour used
Revenue (optimal)
–
Revenue (uniform)
–
same water, flat output
Value of timing
–
optimal vs uniform

What is going on?

Water in a reservoir costs nothing — but it is limited. Every MWh used now cannot be used later. So the optimal plan sorts the hours by price and uses the water in the most expensive ones until it runs out.

The price of the last (cheapest) hour that still gets water is the water value: the opportunity cost of one more MWh of water. Hydro therefore bids into the market at its water value, not at zero.

Simplification: water left at the end of the week is worth zero; real models give it a value from the expected future (seasonal water values).

Key concept — water valueDry week → less water → only the very best hours get it → higher water value → hydro bids higher → market prices rise. This is why dry years in Norway, the Alps or the Balkans push up prices all over Europe.
Pumped storagepumps water up at cheap hours and produces at expensive ones. It only pays when the price spread beats the losses: buy at plow, sell at phigh only if phigh × η > plow. Solar-driven midday dips made this much more valuable.
Same water, different timing: the optimal plan typically earns 20–50 % more than flat output. On top, hydro is ideal for reserves (starts in minutes, ramps in seconds) — every MW not producing can sell aFRR/mFRR.
Slovakia: the Váh cascade (reservoir + run-of-river), Gabčíkovo on the Danube (≈ 720 MW, mostly run-of-river — it must use the river flow) and Čierny Váh pumped storage (≈ 735 MW). Desks compute water values with stochastic optimisation (inflow scenarios, seasonal reservoir targets) and update bids daily.
!

Your task

  1. Pick the sunny spring day: the battery charges in the midday dip and discharges in the evening.
  2. Lower the efficiency or raise the degradation cost — which cycles are no longer worth it?
  3. Move MW into FCR/aFRR, then press Find best split.
  4. Increase the number of batteries already in the reserve market — what happens to the reserve price and to your best split?
Battery 20 MW / 40 MWh (2-hour)
warranty limit — 1 cycle = 40 MWh discharged
wear of the cells per MWh discharged

symmetric: must deliver ±R MW for 30 min → SOC kept between R/2 and 40 − R/2 MWh
reserve need ≈ 400 MW (illustrative country) → sets the price above
Arbitrage margin
–
sell − buy
Reserve income
–
24 h × MW × price
Degradation
–
Profit of the day
–
Profit vs MW given to reserve (same day, same settings)

What is going on?

A battery buys energy when it is cheap and sells it when it is expensive (arbitrage). But it loses 8–20 % in each round trip, it wears out with every cycle, and its state of charge (SOC) must stay between empty and full. The optimiser here is a dynamic program over 24 hours and 81 SOC levels — it never discharges more than is stored.

profit/MWh ≈ psell − pbuy/η − degradation
Key concept — split between marketsEvery MW held for FCR/aFRR earns a fixed fee for 24 h, but reduces the power available for arbitrage and forces the SOC to stay in the middle (so the battery can react both ways). On flat days reserve wins; on very spiky days arbitrage wins.
CannibalisationThe reserve market is small (a few hundred MW per country). Once batteries exceed the need, they compete each other down to their opportunity cost — FCR/aFRR prices in Germany and elsewhere dropped sharply as battery fleets grew. Business plans built on 2022 reserve prices did not survive.
Revenue stacking: reserve fee (stable) + day-ahead arbitrage (shape) + intraday and imbalance (volatility). Investors look at € per MW per year across all of them; the optimiser decides every day which stack pays most.
Battery optimisation runs daily (and intraday, re-optimised every few minutes): a MILP/DP chooses reserve volumes for the TSO auctions in the morning, day-ahead bids at 12:00 and intraday trades, keeping SOC limits, cycle budgets and warranty rules. Many owners hand this to a trading company under an “optimisation” or “tolling” contract.
!

Your task

  1. On the sunny spring day, compare the capture price of the solar park with the baseload price.
  2. Increase the installed solar in the market — watch midday prices and the capture rate fall.
  3. Turn on curtailment at negative prices: how much money does it save?
  4. Raise the forecast error — imbalance costs eat into revenue.
Your renewable asset
today ≈ 100 GW (DE + CEE neighbours, illustrative)
0 = merchant plant; >0 = feed-in premium (paid even at negative prices here)
deviation settled at imbalance: ≈ 25 €/MWh penalty
Baseload price
–
average of 24 h
Capture price
–
Net revenue
–
Imbalance cost
–
Capture rate vs installed solar (this day, no curtailment)
From market value to money in the bank

What is going on?

Wind and solar cannot choose when to produce — nature decides. Their marginal cost is ~0, so they always run… and when many of them produce at the same time, they push the price down exactly in their own hours. That is cannibalisation.

capture price = Σ(price × MWh) / Σ MWh

Capture rate = capture price / baseload price. Solar in CEE fell from ~100 % to well below 70 % in sunny months of 2024–25 (illustrative).

Key concept — the optimisation is differentA thermal plant decides whether to run. A renewable asset can only (1) forecast well, (2) curtail when the price is below its (negative) marginal cost, (3) sell intraday to fix forecast errors, and (4) pair with storage or sign a PPA to stabilise revenue.
Negative pricesappear when inflexible plants and subsidised RES produce more than the demand + export. A plant paid a premium per MWh keeps producing down to −premium. Since 2025 many support schemes pay nothing in negative hours — so new plants curtail at 0.
RES value = volume × capture price − imbalance costs − curtailment losses. Buyers of a PPA price the shape (capture discount) and profile/imbalance risk — that is exactly what a trading desk calculates and charges for.
Desks run their own wind and solar forecasts (weather ensembles + machine learning), trade the forecast changes intraday every 15 minutes, and send automatic curtailment signals to parks when prices go negative. Batteries next to solar parks (“co-location”) shift midday MWh into the evening peak.
!

Your task

  1. Pick a day type — this is tomorrow's price forecast.
  2. Split your assets between reserves and energy (move at least two sliders) and choose the negative-price rules.
  3. Reach a score of at least 95 % of the optimised benchmark.
  4. Press Show the optimiser's answer and compare with your plan.
Tomorrow's market
€/MW/h · gas, hydro
€/MW/h · battery
Your decisions

Nuclear 500 MWSRMC 10

CCGT 400 MWSRMC –

Hydro 150 MW900 MWh water / day

Battery 50 MW / 100 MWhη 88 %

Solar 200 MW + Wind 150 MW

Your P&L
–
one day, all assets
Optimised benchmark
–
per-asset optimisers
From reserves
–
Your score ?
–
P&L by asset and market — you (solid) vs optimiser (light)

What is going on?

This is a mini version of what an asset-optimisation desk does every morning: take tomorrow's price forecast, decide how much of each plant goes to reserves and how much to energy, then let each plant's optimiser produce a schedule. The benchmark uses the same models as the gas, hydro and battery tabs (DP for the gas plant and battery, water value for hydro) and tries every split.

Score = your value ÷ the optimiser's value, counted only on what you control (gas, hydro, battery and the negative-price rules) — the flat output of nuclear, wind and solar is the same for everyone.

Simplifications: perfect price forecast, price-taker (our bids do not move prices), one reserve price per day, no intraday re-optimisation, no forward hedges.

Key concept — portfolio effectsAssets complement each other. Hydro and batteries can cover the forecast errors of wind and solar inside the same balance group, so the portfolio pays less imbalance. Reserves can be provided by whichever asset has the cheapest headroom that day — the gas plant at night, the battery at noon.
UncertaintyReal prices are not known in advance. Real optimisers are stochastic: they optimise over many price/wind scenarios and keep options open for intraday.
The difference between a naive plan and an optimised one is pure profit — often 5–15 % of a portfolio's gross margin. On a fleet worth hundreds of millions per year that pays for a whole analytics team many times over.
Trading companies run portfolio optimisers (commercial tools like PLEXOS or in-house Python models with Pyomo + solvers such as HiGHS/Gurobi) every day before the reserve auctions and day-ahead gate closure, then re-run intraday as forecasts change. Engineers who can build, calibrate and explain such models are exactly the people EPIC is looking for.
Section 2 · Day-ahead market

The day-ahead auction and the merit order

Every day at noon, buyers and sellers from almost all of Europe send their bids for tomorrow. One algorithm finds the prices for every quarter-hour and every country. The key idea is the merit order: plants are sorted from cheapest to most expensive, and the last plant needed to cover demand sets the price for everybody.

Pay-as-clear auction Merit order & SRMC Scarcity & negative prices Market coupling Gas → power pass-through
!

Your task (≈ 8 min)

  1. Click a supply block in the chart, or pick a plant in the list. Hover to see its numbers.
  2. Be greedy: bid the CCGT above its cost, e.g. 105 €/MWh. Drag its block up, or use the slider. Did its profit go up?
  3. Bid the CCGT above 120 €/MWh. It is no longer dispatched, and its profit drops to zero.
  4. Raise retail demand until supply runs out. The price jumps to the cap of 4,000 €/MWh.
  5. Press Reset: everybody bids their real cost (SRMC) again.
Timeline of one auction: day D-1 (trading) → day D (delivery)
D-1 · morning
Forecasts & biddingTraders forecast demand, wind, solar and outages. They build bid curves for each plant and each client.
12:00 CET
Gate closureAll orders are locked at the power exchange (NEMO, e.g. OTE, OKTE, EPEX, HUPX). After this, nothing can change.
12:00–12:45
Euphemia (SDAC)One algorithm clears all coupled countries at once. It maximises total welfare and respects cross-border grid limits.
≈ 12:45–13:00
ResultsPrices and accepted volumes are published for each bidding zone and each quarter-hour.
D-1 · afternoon
Nominations & intradaySchedules go to the TSOs. Intraday auctions (IDA1 15:00, IDA2 22:00, IDA3 10:00 D) and continuous trading fix forecast errors.
Day D
Delivery96 quarter-hours. The 15-min MTU has applied since 1 Oct 2025; before that, there were 24 hourly products. Imbalances are settled afterwards.

MTU = market time unit. NEMO = nominated electricity market operator. SDAC = single day-ahead coupling. Below we show one MTU (one quarter-hour or one hour). The logic is identical for each of the 96.

Your bids (one MTU)
True cost (SRMC) = …
Offering less than you have is called withholding.
Suppliers buy for households at any price, so they bid at the 4,000 €/MWh cap.
Demand bids (fixed)Retail: price-inelastic (bids 4,000)
Industry: 400 MW, buys only below 120 €/MWh
Flexible load / export: 300 MW, below 70 €/MWh
Clearing price
–
paid to all accepted sellers
Cleared volume
–
MW in this MTU
Price-setting unit
–
the marginal unit
Producers' profit
–
inframarginal rent, € per hour
profit = (P − SRMC) × MWdemand curve (stepwise bids)faded = offered but not acceptedDrag a block up/down to change its offer price
–

What is going on?

Supply curve. Each seller offers volume (MW) at a price (€/MWh). Sort the offers from cheapest to most expensive and you get a staircase. This is the merit order.

Demand curve. Buyers bid how much they pay at most. Households cannot react within a day, so suppliers buy their volume at any price. Some industry and exports only buy if power is cheap.

Clearing. The price is where the two staircases cross. Every accepted seller gets this same price; every accepted buyer pays it. This is called uniform pricing or pay-as-clear.

Key concept: why bid your marginal cost?In pay-as-clear, your bid almost never sets your own price. It only decides whether you run. Bid above cost and you can miss hours where the price is between your cost and your bid: lost profit. Bid below cost and you can run at a loss. Bidding SRMC (short-run marginal cost = fuel + CO₂ + variable O&M) is the best strategy for a price-taker.
…unless you have market powerIf you are often the marginal unit and nobody can replace you, a mark-up raises the price for all your inframarginal capacity. Regulators watch for this under REMIT. Withholding capacity to push up prices is market manipulation.

Price limits (SDAC). The harmonised range is −500 to +4,000 €/MWh. The maximum rises automatically by +500 €/MWh if the price goes above 70 % of the maximum in two MTUs on two different days within 30 days. In August 2022 this rule triggered a rise to 5,000, but EU ministers suspended it. The day-ahead cap is still 4,000. Intraday (SIDC) has ±9,999 €/MWh.

Scarcity. If demand exceeds all offers, the price goes to the cap. This represents the value of lost load (VOLL), the value customers put on not being cut off.

Euphemia also handles block orders (all-or-nothing over several hours), linked orders and flow-based grid constraints. It maximises consumer + producer surplus + congestion rent over the whole coupled area.

The green areas are the inframarginal rent, the profit each plant earns above its running cost. Nuclear and wind earn a lot because a gas plant sets the price but their own cost is low. This rent pays for their fixed costs: capital, staff, maintenance. A trading desk earns money by forecasting the clearing price better than the market, and by bidding its plants exactly at SRMC every day without mistakes.

Real world: roughly 1,500 TWh a year (over half of EU consumption) is traded in SDAC. CZ (OTE), SK (OKTE) and HU (HUPX) are all coupled through SDAC. The results feed straight into the next steps: merit order builder →

!

Your task (≈ 10 min)

  1. Pick a day type. Each one changes demand, wind, solar and the neighbours' prices.
  2. Choose an hour with the slider, or click a bar in the price chart. Which plant is marginal (thick black outline)?
  3. Press ▶ Play the day and watch the marginal plant change from night to the evening peak.
  4. Raise gas to 60 €/MWh. How much does the daily base price move? Which hours do not move at all?
  5. Set wind to 180 % or more (or 0 %). Which hours change most?
  6. Tick Island mode (no imports or exports) and compare the price profile.
Scenario illustrative CZ/SK-like fleet
or click a bar in the price chart
Lignite is mined next to the plant, so its fuel price is fixed (≈ 7 €/MWhₜₕ).
% of the day type's normal wind profile
Price
–
€/MWh
Marginal unit
–
Daily base
–
average of 24 h, €/MWh
Peak (08–20)
–
€/MWh
Merit order for the selected hour: supply offers (bars) vs demand (black line)
Bar width = available MW, bar height = offer price (normally SRMC). Faded = not dispatched. Dashed tick = true SRMC where the bid differs (must-run, subsidised RES). Hover any block for details.
24 h prices, colour = technology that set the price
24 h generation stack (dispatched MW)
domestic demanddemand + exportscolours as in the merit order legend above

What is going on?

Every hour is a new auction. Demand changes during the day, and so do wind and solar. The point where demand crosses the staircase moves left and right, so a different plant becomes marginal and the price jumps from step to step.

The order of the staircase comes from short-run marginal cost (SRMC):

SRMC = fuel price / η + CO₂ price × EF / η + VOM

η = efficiency, EF = t CO₂ per MWh of fuel (gas 0.202, hard coal 0.34, lignite ≈ 0.38), VOM = variable O&M. A 58 % CCGT at 35 €/MWh gas and 75 €/t CO₂: 60.3 + 26.1 + 2 ≈ 88 €/MWh.

Key concept: the marginal plant sets the priceNuclear, wind and solar sit on the left. They almost never set the price, but they decide how far right demand reaches into the expensive part. More wind shifts the whole staircase to the right. Each MW of wind pushes out the most expensive plant: the merit-order effect.

Why the price stays near the neighbours' price. When the local price is above the neighbours', the cheaper import offers get used. When it is below, exports are accepted. With enough interconnection the local price sticks to the regional price. Tick Island mode to see what the local fleet alone would do.

A fundamental desk runs exactly this kind of model, with every real unit, outage, fuel price and weather forecast, for every hour of the next days and years. If your forecast for tomorrow's 18:00 is 140 €/MWh and the market trades at 120, you buy and hold the position into the auction. If a nuclear unit trips (try the checkbox), the firm that re-runs its stack fastest trades first.

Real world: CZ has about 4 GW of nuclear and 5–6 GW of lignite/coal, falling. SK is mostly nuclear and hydro. The fleet here is illustrative, not a unit list. Real models include ramping limits, start-up costs, CHP heat obligations and reservoir management. See Modelling.

!

Your task (≈ 8 min)

  1. Click Normal evening. A gas plant sets the price on the flat middle of the curve.
  2. Click Scarcity: a cold, dark, still evening with a nuclear trip. Where on the hockey stick are we now?
  3. Click Negative price: a sunny Sunday at noon. Who is paid to stop producing?
  4. Move the demand slider slowly across the steep part (above ≈ 11 GW). Feel the hockey stick.
  5. In the missing-money calculator, find how many scarcity hours a peaker needs to cover its fixed costs.
Scenario illustrative, island mode
Slide along the supply curve. Wind, solar and outages stay as in the scenario.
Clearing price
–
€/MWh
Marginal unit
–
Spare capacity
–
available − demand, MW
Curtailed / unserved
–
MW
Merit order at this moment
The hockey stick: price as a function of demand
Missing-money calculator: can a peaker live on scarcity hours?
Annualised capex + fixed O&M of an OCGT / engine, k€ per MW per year
Peaker SRMC
–
€/MWh (OCGT 38 %)
Rent earned
–
k€ / MW / year
Hours needed
–
at this scarcity price
Coverage
–
of fixed cost
–

What is going on?

Normal hours: price = SRMC of the marginal unit. The middle of the curve is flat because many gas and coal plants have similar costs. So the price is stable but follows fuel prices.

Scarcity: at the right end there is little left: oil units, demand response, then nothing. A few hundred MW of extra demand (or a trip) moves the price from 100 to 900 €/MWh or even to the cap. This is the hockey stick.

Negative prices: at the left end, some sellers bid below zero. Nuclear and must-run CHP would rather pay than ramp down. Subsidised wind and solar keep their premium (or never see the price at all, like rooftop PV). If they exceed demand plus export, the price goes negative and flexible merchant plants are paid to switch off.

Key concept: inframarginal rent = fixed-cost recoveryA plant covers its fixed costs only from hours where price > its SRMC. The marginal plant earns nothing in the hour it sets the price. The last plant in the stack (the peaker) can therefore only recover its fixed costs in scarcity hours. Cap those prices and nobody builds peakers: this is the missing money problem. The answer is capacity mechanisms (paying for MW available, not MWh), strategic reserves or scarcity pricing.
Flexibility earns money exactly at the two ends of the hockey stick. Batteries, pumped hydro and demand response buy at −20 and sell at +300. A peaker sold forward is worth little, but the option to run in 50 crazy hours a year is worth a lot. Traders value it like a call option (see Trading).

Real world: negative DA hours in DE reached about 450 in 2024 and were even more frequent in 2025, mostly on sunny weekends. On 12 Dec 2024 (a still, dark winter evening) DE/CZ hourly prices went above 900 €/MWh. Poland and Belgium have capacity markets. Germany is designing one for new gas plants.

!

Your task (≈ 8 min)

  1. Set transfer capacity to 0 MW. The zones are isolated, so prices differ a lot.
  2. Raise capacity slowly. When do the prices become equal (the line is no longer congested)?
  3. On the Summer weekday, zone A exports at noon (solar) and imports at night. Click hours in the chart and watch the arrow flip. Then try Dunkelflaute.
  4. Look at the congestion income vs capacity chart. Why is TSO income highest at a medium capacity?
Two coupled zones illustrative
Commercial capacity the TSOs offer to the market, the same in both directions
Zone A: "DE-like"Lots of wind (8 GW) and solar (15 GW), plus coal, lignite and gas. No nuclear. Demand ≈ 6–13 GW.
Zone B: "CZ/SK-like"Nuclear (4 GW), lignite, some gas and hydro, little wind and solar (2 GW). Demand ≈ 5–11 GW.

Each zone is a closed merit order (no third countries). Coupled clearing: first one merged merit order. If the resulting flow exceeds the capacity, the flow is fixed at the limit and each zone clears on its own.

Zone A · DE-like
–
–
Zone B · CZ/SK-like
–
–
Congestion income
–
flow × price spread, € / day, to the TSOs
Welfare gain
–
generation cost saved vs isolated, € / day
Congested hours
–
of 24
Avg |A − B| spread
–
€/MWh
Prices in both zones and the flow A → B over the day
Zone A merit order (selected hour)
Demand line includes exports (or minus imports).
Zone B merit order (selected hour)
Daily value of the line vs capacity

What is going on?

Unconstrained: with enough capacity, both zones act as one market. There is a single merit order, a single price, and the cheapest plants of both zones run. Power flows from the cheap zone to the expensive one until the prices are equal.

Congested: if the line is too small, the flow stops at the limit. The exporting zone stays cheaper and the importing zone more expensive. The prices split.

Congestion income = flow × (Pimport − Pexport)

The exchange buys at the low price in A and sells at the high price in B. The difference goes to the TSOs, who must use it for grid investment and for firm cross-border capacity.

Key concept: market coupling = implicit auctionTraders no longer buy cross-border capacity separately. Euphemia allocates it implicitly together with the energy. Power always flows from low to high price, and no capacity is wasted. Since June 2022 the Core region (incl. CZ, SK, HU, DE, AT, PL, RO…) uses flow-based coupling: instead of one NTC number per border, the grid model with PTDFs limits all flows together (see Modelling › Grid & PTDF). The 4M market coupling (CZ-SK-HU-RO) joined the wider SDAC in June 2021 and then flow-based Core.

Welfare gain is never negative: coupling can only lower total generation cost. But it is shared unevenly. Consumers in the exporting zone pay more, and producers in the importing zone earn less.

Cross-border spreads are a whole business. Long-term transmission rights (FTRs, sold in yearly and monthly auctions) pay the DA price spread, so traders bid for them based on spread forecasts. Owners of plants near a border earn the price of the zone they sit in. Forecasting when a border congests (sun in DE, evening in HU) is valuable, because the spread can be 50–150 €/MWh for a few hours.

Real world: CZ, SK and HU are often coupled at the same price. DE is often cheaper in solar hours, when it exports south and east. HU is often the most expensive zone in the evening peak (import-dependent, at the end of the flow chain). Typical spreads: DE–HU evening 20–60 €/MWh, CZ–SK often 0.

!

Your task (≈ 8 min)

  1. Move gas from 35 to 70 €/MWh. How much does the power price move? Compare with 1/η.
  2. Press the 2020 and Aug 2022 presets. Explain 45 → 450 €/MWh in one sentence.
  3. In the fuel-switch chart, find the CO₂ price where gas becomes cheaper than coal.
  4. If real data is shown below, check that power follows the "CCGT cost" line from 2021 onwards.
Gas → power pass-through in a typical evening hour illustrative CE-like stack
Presets:
Power price
–
€/MWh, this hour
Marginal unit
–
Pass-through
–
ΔP / ΔGas at this point
+10 €/MWh gas →
–
change of power price
Fuel switching: coal vs gas as CO₂ gets more expensive
Coal ⇄ gas switch
–
€/t CO₂ (coal 40 % vs CCGT 55 %)
Lignite ⇄ gas switch
–
€/t CO₂ (lignite 37 % vs CCGT 55 %)
Clean spark spread
–
power − CCGT 55 % cost, €/MWh

Lines are SRMCs (€/MWh of electricity) at the gas and coal prices chosen on the left. Above the switch price, gas plants move to the left of coal in the merit order.

Real data: monthly gas (TTF) vs baseload power real data

What is going on?

Gas is the price setter. In Central Europe the evening and winter hours usually need gas plants after nuclear, renewables, lignite and coal are used up. Then the price ≈ CCGT SRMC, and every €1 on gas adds about €1/η ≈ €1.8–2.0 to power.

ΔP ≈ ΔGas / η (η = 0.50–0.58)

2022: TTF went from about 20 to over 200 €/MWh. A 50 % CCGT then needs 400 + 35 (CO₂) ≈ 435 €/MWh. That is what the market paid, even in hours when most power came from cheaper nuclear, coal or wind: pay-as-clear.

Key concept: implied heat rate & clean spark spreadImplied efficiency = Gas / (Power − CO₂ × 0.202/η)
Clean spark spread = Power − Gas/η − CO₂ × 0.202/η
If the spread is positive, the CCGT earns money running. The market quotes it daily for every month, quarter and year ahead. Clean dark spread is the same for coal.

Fuel switch: coal emits about 0.85 t CO₂/MWhel, a CCGT about 0.37. Each €1/t on CO₂ makes coal about €0.5/MWh more expensive relative to gas. Above the switch price, gas runs first. EU climate policy is designed to work like this.

A gas plant owner hedges the spark spread: sell power forward, buy gas and CO₂ forward in the right ratio (1 MWh power ↔ 1.8 MWh gas + 0.37 t CO₂). The margin is then locked, whatever happens to fuel prices. A utility with nuclear and lignite is long gas through power: its profit rises with gas, so it sells power forward to protect against a gas price fall. Getting the ratio right is the hedger's job.

Real world: DE base power and TTF moved almost one-to-one (×2) during 2021–2023. Since 2024 more solar hours are set by renewables, so the base price "decouples" a bit at midday but still follows gas in the evening.

!

Your task (≈ 6 min)

  1. Open each day using the buttons.
  2. For every day, name the marginal technology at 03:00, 13:00 and 19:00.
  3. Find the hours where the countries decouple (different prices). Which border was congested?

What is going on?

The duck curve. On sunny days the midday price falls (sometimes below zero) and the evening price rises, when solar disappears and gas plants must ramp up. The daily shape matters as much as the level: a solar farm earns the midday price (its capture price), not the base price.

Key concept: same algorithm, different outcomesEach of these days was cleared by exactly the logic of tabs 1–4. Sunny days give negative prices at the left end of the curve. Dunkelflaute pushes demand to the steep right end. Congestion causes the gaps between countries.
Shape is traded: peak vs base products, PPA pricing (what is a solar MWh worth?), battery arbitrage (buy at −50, sell at +250) and pumped hydro. A forecaster who knows on Friday that Sunday will be negative can sell short, or plan to switch off flexible plants and get paid for it.
Section 3 · Modelling

Power market models: from equations to decisions

How do energy companies "see" the price of 2030? We start with a 10-minute crash course in linear programming, the maths inside every market model. Then we look at a real in-house model built with the free, open-source tool PyPSA. We cover how it is built, calibrated and compared with commercial providers and the forward market. Then we use it for scenarios: weather, fuel, new Slovak nuclear and pumped storage, and price spikes. The last tab covers the physics of the grid (PTDF), which is a great PhD playground. One rule throughout: a model only matters if it changes a decision.

PyPSA 1.2.4 + HiGHS (open source) ≈123 scenario runs + calibration 7 CWE zones + CZ/SK extension Benchmarked vs 4 providers, market curve, EEX Thesis & PhD hooks in every tab
!

Your task

  1. Click or drag in the first plot. Find one feasible point and one infeasible point. Which one is cheaper, and why can't you have it?
  2. Press "Walk the vertices". The simplex method never looks inside the region. It jumps from corner to corner, and every step is cheaper.
  3. Make the optimum jump to another vertex: make gas cheaper than coal, change the demand, or switch the CO₂ cap off.
  4. Read the shadow price of the CO₂ cap (50 €/t at the start). Raise the cap by 10 t/h. Does the cost fall by about 10 × the shadow price? Compare with the re-solve column.
  5. In part 2, lower the line limit until the merit-order point leaves the feasible segment. Read the two nodal prices. Their difference is the shadow price of the line.
  6. Switch part 2 to "Market view (one zone)". There is one price now. Who pays for the redispatch?
1

Pure maths: a linear program you can see

Two decision variables, so we can draw it. x₁ = MW from plant A (coal), x₂ = MW from plant B (gas). The objective and every constraint are linear, so each constraint is a straight line and its allowed side is a half-plane. The feasible region (green) is where all half-planes overlap. Illustrative numbers.

Objective: minimise cost c₁·x₁ + c₂·x₂
Fuel cost only. CO₂ enters as a cap, not as a price.
Constraints (click to switch on/off)
Gas: e₂ = 0.40 t/MWh. Rotates the CO₂ line.
The LP right now
Click or drag anywhere in the plot to test a point.
feasible regionshaded = forbidden side of a constraintiso-cost lines (same cost)best reachable iso-cost line
Vertices (corners) of the feasible region (click a row)
Why only corners?The cost is linear, so moving along an edge makes it go steadily up or down. You can always slide to an end of the edge without paying more, so a corner is always at least as good as anything inside.
Constraints at the optimum: binding? shadow price? (solver dual vs re-solving the LP)
Numerical checks (computed live)
2

The same picture is the power market: economic dispatch with a grid bottleneck

Now xA = gas CCGT in the city (node A), xB = cheap nuclear in the north (node B). The north has only 150 MW of local load, so most of its power must travel over one line with limit F. The demand constraint is an equality, xA + xB = D, so the feasible region shrinks from an area to a line segment. The line limit xB − 150 ≤ F cuts that segment. Illustrative numbers.

View
150 MW in the north (B), the rest in the city (A)
Gas 35 €/MWh, CO₂ 70 €/t, 55 % efficiency → ≈ 90 €/MWh
Plant€/MWhCapacity
B · North nuclear25900 MW
A · City gas CCGT901000 MW
Numerical checks (computed live)

Three nodes, loop flows and PTDFs: Grid & PTDF tab. A 24-hour version with storage: PyPSA tab. PyPSA builds exactly this LP, with millions of variables.

3

The problem definition behind every market model

Scale the 2-variable picture up to every plant, every hour and every line in Europe. The structure stays the same: variables, one objective, linear constraints. The prices come out as duals.

Decision variables (what the solver chooses)

  • pg,t: output of plant g in hour t (MW)
  • chs,t, diss,t, es,t: storage charge, discharge, state of charge
  • fℓ,t: flow on line or interconnector ℓ
  • curtailment and load shedding (expensive "slack" variables)
  • capacity-expansion models also choose Pgmax: what to build

Objective

  • min Σt Σg cg · pg,t (total cost)
  • + start-up costs (unit commitment), + annualised investment (expansion)
  • Market version: max welfare = value of accepted demand bids − cost of accepted supply offers (Euphemia)
  • Same optimum if demand is fixed

Constraints

  • Energy balance per node and hour: generation − exports = load
  • Capacity: p ≤ Pmax × availability (wind and solar profiles)
  • Ramp: |pt − pt−1| ≤ R
  • Storage: et = et−1 + η·cht − dist/η, 0 ≤ e ≤ E
  • Lines: f = PTDF × injections (Kirchhoff), |f| ≤ F
  • Reserves: spare capacity ≥ requirement; CO₂: Σ emissions ≤ cap

Outputs (what you use)

  • Dispatch per plant and hour → revenues, fuel burn, capture prices
  • Flows, curtailment, storage schedules
  • Prices = duals of the energy balance (λn,t)
  • Duals of line limits = congestion rents; dual of the CO₂ cap = carbon price
  • Duals of capacity limits = value of one more MW → investment signal
LP vs MILP
LP (linear program)MILP (mixed-integer)
Variablesall continuoussome integer, e.g. on/off ug,t ∈ {0,1}
Typical modeleconomic dispatch, capacity expansion (PyPSA default)unit commitment: min stable load pmin·u ≤ p ≤ pmax·u, start-up cost, min up/down time
Solvingsimplex (walk the vertices, as in part 1) or interior point. Fast even for millions of variables.branch-and-bound: solve many LPs, fixing u = 0 or 1. NP-hard; time can explode.
Pricesduals are clean pricesno duals for integers → fix the binaries, re-solve the LP, read duals (or special pricing rules)
Who uses itPyPSA long-term runs, our in-house model, most studiesEuphemia (block and complex orders are all-or-nothing), TSOs, plant schedulers, PyPSA with committable=True
Scale and solvers (orders of magnitude, approximate)
ProblemVariablesSolved in
Part 1 of this tab2microseconds, in your browser
24-hour toy in the PyPSA tab≈ 200milliseconds, in your browser
One zone, 30 assets, 8760 h≈ 0.3 millionseconds (HiGHS)
In-house CWE + CZ/SK model, 1 year hourly≈ 1–5 millionminutes (HiGHS)
PyPSA-Eur: ~300 nodes × 8760 h, with investment≈ 10–100 millionhours, 100+ GB RAM, often a commercial solver
Euphemia (EU day-ahead): every order of the coupled zones, 96 quarter-hoursMILPa strict time limit, every day after 12:00 CET

Solvers. HiGHS: free and open source (University of Edinburgh), the default in PyPSA and SciPy. Gurobi, CPLEX, Xpress: commercial, faster on huge MILPs, free licences for students. Rule of thumb: variables ≈ assets × hours, and constraints are of the same order.

What is going on? Three ideas that run the power market

1 · The optimum sits on a corner

A linear objective over a region bounded by straight lines is cheapest at a vertex, where two constraints cross. If the iso-cost line is parallel to an edge, the whole edge is optimal (a tie). This is why George Dantzig's simplex method (1947) only walks from vertex to neighbouring vertex and stops when no neighbour is cheaper. In a convex problem a local optimum is the global optimum. Large models also use interior-point methods, which cut through the inside of the region.

2 · Shadow prices (duals)

Every constraint gets a number: y = Δ(optimal cost) / Δ(right-hand side). A constraint with slack has y = 0: relaxing it changes nothing. A binding constraint has y ≠ 0. The dual of the demand constraint is the cost of one more MWh, which is the electricity price. The dual of the CO₂ cap is the carbon price that would give the same dispatch. The dual of a line is what one more MW of transmission is worth.

The solver gets duals for free from the final simplex tableau. We verify them by re-solving with RHS ± 1. The optimal cost is convex in the RHS, so z(b) − z(b−1) ≤ y ≤ z(b+1) − z(b) must hold.

3 · From merit order to nodal prices

With only demand and capacity constraints, the LP solution is the merit order: cheapest plant first. A line limit can cut off that point. The optimum then moves to the boundary: cheap B is backed down and expensive A runs. That is redispatch. The cost increase is the congestion cost. With nodal pricing each node gets the dual of its own balance (LMP). The price difference × flow is the congestion rent that the grid owner collects. A one-zone market (Germany, most of Europe) shows one price and the TSO pays for redispatch afterwards.

An optimiser decides how a portfolio is dispatched and bid. 1 GW sold at 60 €/MWh is ≈ €525m of revenue a year, so a schedule 1 % better is worth ≈ €5m a year. The shadow prices show traders where the value is. A large dual on a CO₂ cap means carbon prices must rise. A large dual on a border means price spreads, so long-term transmission rights on that border are worth buying. A large dual on a capacity limit means one more MW (a battery, an upgrade) pays. Euphemia, PyPSA and every TSO tool solve this same LP or MILP. Understanding the duals means understanding the prices.
!

Your task

  1. Click at least three different business questions and read which model fits each one.
  2. Open "Battery business case 2030". Why does an optimisation (LP) model win here and ML lose?
  3. Open "Hedge Cal-27". Here the forward market beats every model. Why?
  4. In the MOM vs PyPSA chart, switch to "Uncertainty". Two models give the same mean. Do they see the same risk?
Pick a business question
Which model fits? (fit score 0–5 · lecturer's judgement, illustrative)
Two in-house models: MOM vs PyPSA, German baseload

MOM (merit order) vs PyPSA (LP optimisation)

What is going on? Three families of models

1 · Fundamental models

They rebuild the market from physics and economics: plants, fuel, weather, demand, grid. Then they find the cheapest dispatch.

  • Merit-order / stack model (our in-house MOM). Sort the bids by cost and intersect them with demand, hour by hour. It is fast, so you can run 500 Monte-Carlo weather/demand simulations.
  • LP dispatch (PyPSA). One big linear program over 8760 hours that dispatches plants, storage and cross-border flows together. The price is the shadow price of the energy balance.
  • Unit commitment (MILP). Adds on/off decisions, start-up costs and minimum load. It is closer to how real plants run and gives better spikes, but it is about 10× slower.

2 · Statistical / ML models

They learn from history: regression, gradient boosting, neural networks on weather forecasts, load, outages and recent prices.

They are excellent for hours to days ahead (day-ahead bidding, intraday). They fail when the world changes: 2022 gas crisis, 3× more solar in 2030, a new nuclear block. They cannot extrapolate to a market that has never existed.

3 · Hybrid

A fundamental model provides the structure (merit order, residual load) and ML corrects the residual errors: spikes, negative prices, bidding behaviour. Most trading desks end up here.

Time horizon decides the tool

HorizonDecisionTypical model
Minutes–hoursIntraday, balancingML, nowcasting
Day-aheadBids, battery scheduleML + fundamentals
Weeks–monthsHydro, outages, hedgesStack model + weather
1–3 yearsHedging (Cal products)Forward market + fundamental fair value
5–30 yearsInvest, value, buildLP / UC scenarios, capacity expansion
"All models are wrong, some are useful" (George Box)A model is useful when it answers a concrete question better than the alternative, which is often just the forward curve. Always ask: which decision changes if the model says X instead of Y?
A battery developer needs the 2030 hourly spread (TB4), not the baseload price. A fundamental LP model that co-optimises storage tells you how the spread shrinks as more batteries are built. That number decides whether a €50m project gets financed. For hedging Cal-27 the market price is the benchmark you trade against. The model tells you whether to hedge more or less than your standard policy.
!

Your task

  1. Click every box of the pipeline (inputs → … → decision) and read what is needed.
  2. In the tiny LP, raise solar to ≥ 12 GW. What happens to the midday price, and why?
  3. Now add a battery ≥ 2 GW. Watch the midday price rise and the evening peak fall. Who sets the price now?
  4. Move the shadow-price check to an evening hour (≥ 17:00). Does the dual equal the cost of one extra MWh?
  5. Copy the PyPSA code and run it at home (pip install pypsa highspy).
The pipeline: what it takes to run a PyPSA market model (click the boxes)
1 · InputsGrid, demand, RES profiles, plants, fuel & CO₂, NTCs, storage
2 · Build networkPyPSA-Eur workflow (run once)
3 · CalibrateOverwrite fleet, bids, NTC per year
4 · Solve LPHiGHS, 8760 h, 10–15 min
5 · Outputs → decisionsPrices = duals, TB4, capture rates
Tiny LP: one zone, 24 hours, solved live
Free (0 €/MWh) but only when the sun shines

Fleet: nuclear 2 GW (10 €/MWh), CCGT 5 GW, OCGT 3 GW, demand response / shedding at 500 €/MWh. CO₂ fixed at 75 €/t. Illustrative system.

We re-solve with +0.01 GW and −0.01 GW of demand in that hour
Minimal PyPSA model (tested with PyPSA 1.2.4 + HiGHS)
import numpy as np
import pandas as pd
import pypsa                      # pip install pypsa highspy

n = pypsa.Network()
n.set_snapshots(pd.date_range("2030-06-01", periods=24, freq="h"))
h = np.arange(24)

# two zones: windy north, load centre south
n.add("Bus", ["north", "south"], carrier="AC")
n.add("Carrier", ["wind", "solar", "gas"])

# hourly availability profiles (0..1 of installed capacity)
wind_cf = 0.55 + 0.25 * np.cos(2 * np.pi * h / 24)          # windier at night
solar_cf = np.clip(np.sin(np.pi * (h - 6) / 12), 0, None)    # 06:00-18:00

n.add("Load", "load_north", bus="north", p_set=2_000)        # MW
n.add("Load", "load_south", bus="south",
      p_set=9_000 + 2_000 * np.sin(np.pi * (h - 8) / 12).clip(0))

gas_eur_mwh_th, co2_eur_t, eff = 30.0, 80.0, 0.55
n.add("Generator", "wind_north", bus="north", carrier="wind",
      p_nom=8_000, p_max_pu=wind_cf, marginal_cost=0.0)
n.add("Generator", "solar_south", bus="south", carrier="solar",
      p_nom=6_000, p_max_pu=solar_cf, marginal_cost=0.0)
n.add("Generator", "gas_south", bus="south", carrier="gas",
      p_nom=12_000, marginal_cost=(gas_eur_mwh_th + 0.202 * co2_eur_t) / eff)

# interconnector: transport model, 3 GW in both directions
n.add("Link", "north_south", bus0="north", bus1="south",
      p_nom=3_000, p_min_pu=-1, efficiency=1.0)

# optional: a 1 GW / 4 h battery behind the bottleneck
n.add("StorageUnit", "battery_north", bus="north", p_nom=1_000, max_hours=4,
      efficiency_store=0.94, efficiency_dispatch=0.94,
      cyclic_state_of_charge=True)

status, condition = n.optimize(solver_name="highs")   # builds + solves the LP

prices = n.buses_t.marginal_price    # EUR/MWh = dual of each bus balance
print(prices.round(1))
curtailed = (n.generators_t.p_max_pu["wind_north"] * 8_000
             - n.generators_t.p["wind_north"]).sum()
print("curtailed wind MWh:", round(curtailed))
print("system cost EUR:", round(n.objective))

What you get: at night the link is full, so the north price is 0 €/MWh (wind is curtailed) and the south price is 83.9 €/MWh (gas). Two prices appear because of one congested line. Curtailment is 8.8 GWh without the battery and 4.5 GWh with it. The battery soaks up wind that cannot be exported. Tab 8 explains this in detail.

What you need: checklist
ItemFree optionIn our model
Grid topologyPyPSA-Eur (OpenStreetMap / ENTSO-E grid)10 buses, clustered
Weather → RES profilesERA5 reanalysis (Copernicus), SARAH-3ERA5-2013 + 11 measured years
DemandENTSO-E Transparency, OPSDReference TWh, hourly shape
Power plantspowerplantmatching, ENTSO-EPlant DB, 3 efficiency tranches
Fuel & CO₂Exchange forwards (TTF, EUA)Provider A deck + stochastic paths
Cross-border capacityJAO, ENTSO-E NTCCommercial NTC caps
SolverHiGHS (open source)HiGHS; Gurobi ≈2–4× faster
Computea laptop8 cores, 6–8 GB RAM, 10–15 min/run
SkillsPython, pandas, linear programming, a lot of patience for data cleaning

What is going on? The price is a dual variable

PyPSA writes the market as one linear program. It minimises total cost, and in every hour t and at every bus supply has to equal demand:

min Σg,t cg·pg,t
s.t. Σg pg,t + storaget + importst = dt   [λt]
0 ≤ pg,t ≤ availabilityg,t,  line & storage limits

The multiplier λt (the shadow price or dual) of the balance constraint is the cost of serving one more MWh in hour t. In a competitive market that is exactly the clearing price. The tiny LP above checks this numerically.

Why storage changes everything. With a battery, the midday price is no longer "0 because the sun shines". It becomes the opportunity cost of the battery: evening price × efficiency. In our full model, storage and cross-border trade set the German price in about 26 % of hours. You cannot get that from a simple merit-order sort.

What PyPSA does not capture (from our model card):

    The same LP that gives prices also gives dispatch and revenues of every asset. Add 100 MW of battery in Slovakia and re-solve. The change in total system cost and in the battery's revenue is the core of the business case and the grid-connection decision. Open-source tools mean a student can build this in a thesis, and a company can audit every constraint.
    !

    Your task

    1. Step through all 10 calibration stages (buttons or "Next"). Watch the mean, the zero-price share and the max.
    2. Find the stage where a sign bug made the model pay to export. How much did the fix move the mean?
    3. In the chart below, open the daily profile and compare stage 8 with the final model. What changed at midday and in the evening?
    4. Open the duration curve and the error table. Why is the hourly correlation low even for a good model?
    Calibration stage (DE, delivery 2030)

    Lines: model mean and median (€/MWh, left axis). Bars: share of hours at ≤ 0.5 €/MWh (%, right axis). Dashed lines show the Provider A targets.

    Error scores vs Provider A (2030)

    Derived. Model and reference use different weather years, so hour-by-hour timing cannot match. Monthly values, the average-day profile and the duration curve are the meaningful scores.

    Sanity check vs reality (DE)
    Lessons learned (from our calibration log)
      Context: what actually happened. EPEX DE day-ahead 2018–2026

      Exchange outturn (2026 = first 266 days). The model's first year is 2026, a forecast, so there is no backtest. History is used for plausibility only.

      Why calibrate? A raw optimisation model is "too perfect"

      An LP model assumes perfect competition, perfect foresight and plants that can ramp freely. Real markets have frictions, so we add them as explicit, documented mechanisms:

      • Must-run and CHP: plants that also deliver heat run in winter even at low prices.
      • Bid mark-ups / scarcity: in tight hours real bids go above cost (peak layer +38 €/MWh, 5 % withholding, demand response at 160/230 €/MWh).
      • Negative RES bids: subsidised renewables keep producing below zero (bids at 0/−15/−45 €/MWh).
      • Interconnector limits: commercial NTCs, not physical line ratings. Otherwise French nuclear "floods" Germany.
      • Hydro and pumped storage: a perfect-foresight LP cycles them too well, so they are derated to 30 %.

      Calibration is a trade-off, not curve fitting. At stage 8 the mean was within 1 % but the daily shape was flat (TB4 52 vs 79). The shape mechanisms fixed the spreads, and the mean moved to +3.7 %. For a battery client the shape matters more than the level, so we accepted it.

      Bugs are part of modelling. An inverted sign made the model pay to export. A stale index mask put Belgian nuclear plants into Germany. Both were found by checking when flows happen, not only how much.

      Do not over-fit. The model still has too few negative hours (7.7 % vs 15.5 %). Forcing it would need invented bid tranches. We document it instead, and it is a great thesis topic.

      A calibrated model is a controlled copy of the market. Once it reproduces the reference, you change one thing (your battery, a new nuclear block, a gas shock) and read the delta. Deltas are far more robust than levels. That is what a desk sells internally: "+1 GW of batteries lowers TB4 by about 1 €/MWh", not "the price will be 76.4".
      !

      Your task

      1. Click the legend chips to hide and show sources. Which forecast is the outlier for 2030?
      2. In the dispersion view, select 2027. Why is the exchange (EEX) so far above all models? (Hint: open the "vintage" box.)
      3. Switch the dispersion view to TB4. Do the models agree on spreads as well as on levels?
      4. Look at the CEE chart. Why is Slovakia more expensive than Germany in 2030?
      German baseload forecasts by source (€/MWh, yearly average)

      Note the uneven x-axis: 2032 → 2035 → 2040. Provider B is in real euros (inflation removed), so it is lower by construction. Vintages: model and Provider A from August 2026, EEX close on 16 September 2026.

      Year
      Metric
      Why do forecasts differ?
      • Fuel deck: the gas and CO₂ assumptions explain most of the level.
      • RES build-out: GW of solar and wind, and how fast.
      • Demand: heat pumps, EVs, data centres (2030: 525–553 TWh across sources).
      • Flexibility: batteries, demand response, hydro (this drives spreads).
      • Method: LP vs stack vs bidding behaviour (this drives spikes).
      • Vintage: when the run was made.
      Vintage: why is EEX far above in 2027?

      All numbers (€/MWh)
      Central Europe: SK, CZ, HU, PL (€/MWh)

      Diamonds: exchange Cal-30 quotes (Sep 2026). Model values exist only for the CEE runs (2027, 2029–2031).

      Why buy several vendor views and still build your own model?

      Commercial providers sell long-term price forecasts (tens of thousands of euros per year each). Companies buy several because they disagree. In 2030 our sources range from about 69 to 98 €/MWh. You only learn something by understanding why.

      An in-house model is not about being "more right". It lets you own the assumptions: plug in your own gas view, your own battery pipeline, your Slovak plants. You can explain every number to a trader, a risk committee or a bank.

      The forward market is the benchmark. If EEX Cal-30 trades at 79.8 and your fair value is 76, the market already "knows" something or is paying a risk premium. You do not trade against a vendor PDF. You trade against the curve.

      Levels converge, spreads do not. By 2030 most views sit at 70–80 €/MWh. TB4 (battery spread) ranges from 67 (PyPSA) to 93 (Provider B). For a battery investor, that disagreement is the risk.

      Data vintage caveatOur model uses the August 2026 fuel deck. In September 2026 gas spiked: TTF Cal-27 traded at 58.6 vs 45.5 in the model deck, and EEX Cal-27 jumped from about 106 to 127 €/MWh. Most of the near-term gap is fuel vintage, not model error. Re-running with today's fuel curve is step one before any decision.
      Hedging: a nuclear or hydro producer sells forward when the market is above its fair value, and waits when it is below. Each extra €/MWh on 2 TWh/year of hedged output is €2m. Origination: PPA prices for solar are set from the capture price, which comes from the model's hourly shape, not from the baseload forward.
      !

      Your task

      1. Click at least three weather years. How much does the 2030 mean move? How much does TB4 move?
      2. Switch the metric to hours ≥ 300 €. Which weather pattern is the scarcity year?
      3. In the fuel part, select P10 and then P90. Compare how Germany and Slovakia react.
      4. Move the threshold slider on the S-curve. What is the probability that a CCGT costs more than 100 €/MWh to run?

      A · Weather years: same 2030 fleet, 11 historical weather patterns

      Weather year
      Metric

      * Approximate capture rates are pre-curtailment and biased low. Use them only to rank weather years.

      B · Fuel scenarios: P10 / P50 / P90 commodity decks (2030)

      Fuel world
      CCGT running cost: 100 simulated fuel paths

      Distributions, not point forecasts

      Weather barely moves the annual mean in our model (76.5–78.0 €/MWh, about ±1 %). The annual energy is fixed and trade absorbs a lot. But weather moves spreads and spikes: TB4 ranges 73–78, and hours ≥ 300 € range from 0 to 41. Every measured year gives 10–20 % more spread than the smooth ERA5-2013 reanalysis year.

      Caveat: the weather runs vary shapes only (annual volumes are normalised), so the level impact is understated. Making weather years volume-true is an open thesis.

      Fuel moves the level: P10 → P90 shifts Germany from 58 to 90 €/MWh (+31). Slovakia, which is nuclear- and hydro-heavy, moves only from 82 to 91 (+9). The same shock gives a very different exposure.

      P10/P50/P90: P90 means a 90 % chance of being below that value. Banks finance projects on P90-type downside cases. Risk teams set limits from the tails. The "expected" price alone is never enough.

      Why the S-curve mattersA gas plant does not earn the average spread. It runs only when profitable, so it holds an option on the spread, and the option is worth more when uncertainty is higher. Point forecasts systematically undervalue flexible assets (gas peakers, batteries, pumped hydro).
      Battery or plant valuation: run the business case across the weather × fuel grid and report P10/P50/P90 net present value. The lender sizes the debt on the downside, and the equity investor looks at the upside. Hedging: if most of your price risk is fuel (Germany), hedge gas and CO₂ together with power. If it is weather and hydro (Slovakia), hedge shape and volume instead.
      !

      Your task

      1. In the base world, add Bohunice AP1000. How much do SK, CZ and DE prices fall? What happens to Slovak exports?
      2. Now try Málinec pumped storage. Why does the price level hardly move while TB4 falls?
      3. Select "+ Both" and switch the world to fuel P10 or P90. Is the effect of the new assets robust?
      4. Click the open question card you would like to work on in a thesis.
      World (background scenario, 2030)
      Slovak addition
      The projects
      SK average day 2030: base vs + both
      Pumped storage, SK average day (GW)

      Negative = pumping (midday solar), positive = generating (evening).

      SK generation 2030 (TWh)
      Open questions: not in the model yet, great thesis topics
      Click a card.

      What is going on in Slovakia?

      In 2030 Slovakia is priced above Germany (model: SK 87.9, CZ 89.5, DE 76.4 €/MWh). It has little solar, so there is no deep midday trough. The evening peak is set by imports or gas through congested borders. Nuclear (≈21 TWh of 29 TWh demand) makes it almost balanced over the year, but not hour by hour.

      +1.25 GW nuclear: SK −3.4 €/MWh, CZ −1.6, DE −0.1. Slovakia goes from ≈1.2 to ≈9.8 TWh net export. The price effect leaks to neighbours through interconnectors, so most of the extra energy is exported at the border price.

      +1.2 GW / 10 h pumped storage (Málinec): the price level is unchanged, but SK TB4 falls by 1 €/MWh. Storage moves energy from cheap to expensive hours. It flattens the daily shape, and it earns exactly that shape.

      Robust deltas: across all fuel and weather worlds, "+ both" lowers SK by 3.3–5.6 €/MWh. The level is uncertain (fuel moves it ±5), but the effect of the decision is stable. That is what a decision-maker needs.

      Caveat: Bohunice targets commissioning around 2040. Testing it in the 2030 market shows "what such a block does", not a 2030 forecast. CEE level bias vs Provider A: SK +0.1 to +3.8 %, CZ +2.4 to +6.6 %. Trust the deltas.

      Asset valuation: a new nuclear block lowers the price it sells at (it cannibalises itself), by ≈3.4 €/MWh × ≈9 TWh ≈ €30m per year. It also lowers the price earned by the existing ≈21 TWh of Slovak nuclear output by the same amount (≈€70m per year). Both numbers belong in the investment case. Pumped storage earns the spread, and its own spread shrinks as it operates. The model quantifies both before billions are committed. Traders use the SK–DE spread forecast to price cross-border capacity.
      !

      Your task

      1. Select "Negative hours" and compare the model with the observed 2024/2025 values. How big is the gap?
      2. Switch to "Distribution by source". Which source has the most extreme maximum, and which the flattest distribution?
      3. Move the battery fleet slider to ≥ 15 GW. What happens to TB4, and to the value of the last GW?
      4. In the Slovak stress chart, select Fuel P90. How expensive are the top 1 % residual-load hours?

      Battery build-out vs battery spread (DE 2030)
      Model points: 7.9 (low), 11.5 (base), 15.1 GW (high). In between = interpolated.

      TB4 = daily average of the 4 highest minus the 4 lowest hourly prices, which approximates a 4-hour battery's gross spread. The band shows the in-house MOM model across 500 simulations (P05–P95).

      Slovakia: price vs residual load (2030 base)
      SK price in the tightest hours

      Why LP models underestimate extremes, and how to fix it

      In an LP the price is a shadow price: it spikes only when a hard limit binds (capacity, NTC, the 400 € cap). Reality has more:

      • Strategic bidding and scarcity mark-ups in tight hours (Provider B max 747 vs model 361 €/MWh).
      • Forced outages: plants trip; our model only uses average derates.
      • Unit commitment: start costs and minimum load create both spikes and negative prices.
      • Perfect foresight: model storage always charges at the right hour. Real storage does not.
      • Subsidy vintages and inflexible CHP: many plants keep producing below zero. The model has only 3 RES bid tranches, so it has 286 negative hours in 2030, while reality already had 573 in 2025.

      Fixes (each a thesis): unit commitment (MILP), stochastic outages (Monte Carlo), scarcity functions fitted to history, more bid tranches calibrated to observed negative hours, or an ML layer trained on the model's residual errors (hybrid).

      Batteries cannibalise themselves. Low → high battery build (7.9 → 15.1 GW) lowers TB4 from 71.9 to 63.5 €/MWh, about −1 €/MWh per GW. The mean price barely moves (< 0.5 €). Batteries redistribute value within the day. Who sets the price? Storage and cross-zone trade in 26 % of 2030 hours, which is more than CCGT.

      Spikes are where flexible assets earn their money. A peaker or battery may make half of its annual margin in 50–100 hours. A model with thin tails undervalues flexibility and leads to under-investment. Getting the tails right is the difference between rejecting and approving a battery project, and it decides how much to pay for one in M&A.
      !

      Your task

      1. Switch the view to "Market (one zone)". The market ignores the grid, so which lines are overloaded (> 100 %)?
      2. Raise wind at A to ≥ 11 GW. Does more wind reach the load at B? Where does it go instead?
      3. Put a battery at node A (≥ 1.5 GW). Then move it to node B. Which node relieves congestion and earns more?
      4. Change the A–C line reactance (as a phase-shifter would). Watch the PTDF table and the loop flow change.
      5. Switch to the evening hour (H2). Is the grid still congested? What does the battery do now?
      View
      H2 (evening): 40 % of this
      H2: no sun
      A: 1 GW, C: 2 GW. In H2 all loads are +15 %.
      Other lines x = 1. Higher x = the line "pushes back" flow (like a phase-shifting transformer)
      Battery (charges in H1, discharges in H2, 90 % efficient)
      Generators (cost €/MWh) and dispatch, GW
      PTDF matrix (slack = B)

      Entry = share of 1 MW injected at the node (and withdrawn at B) that flows on the line, in its arrow direction.

      Flow-based domain: which net positions the grid allows

      Each line gives two straight boundaries: |PTDFℓ,A·NPA + PTDFℓ,C·NPC| ≤ Fℓ. The white area is feasible. ● = market result, ◆ = grid-secure result. This is exactly how the European day-ahead algorithm (Euphemia) handles flow-based coupling, with zones in place of nodes.

      Numerical checks (computed live)
      Real model: German border utilisation 2030 (PyPSA, % of NTC)

      What is going on? Electricity does not follow contracts, it follows physics

      DC power flow. For planning studies we linearise the AC equations: flow on a line ∝ angle difference / reactance. Then every flow is a linear function of the nodal injections:

      flow = PTDF × net injection

      The PTDF (Power Transfer Distribution Factor) matrix depends only on the grid (reactances). With three equal lines, 2/3 of a transfer A→B goes directly and 1/3 loops via C. You cannot send power "only on the direct line". This is a loop flow.

      Congestion → price separation. When a line is full, the next MWh at B must come from expensive local plants, while cheap wind at A is curtailed. With nodal pricing (LMP) every node gets its own price: λn = λ − Σℓ PTDFℓ,n·μℓ. In a one-zone market (Germany today) there is one price, and the TSO pays redispatch afterwards. Germany pays several € billion per year for redispatch and curtailment.

      From nodes to Europe: flow-based market coupling. Since 2022 the Core region (incl. CZ, SK, DE, PL, AT, HU) clears the day-ahead market with flow-based constraints inside the Euphemia algorithm:

      PTDFzone→CNEC · NP ≤ RAM
      • CNEC: critical network element and contingency (a line, checked also with another line tripped).
      • RAM: remaining available margin = Fmax − reliability margin − flows already "booked" by the base case.
      • GSK (generation shift key): assumes which plants inside a zone change output when the zone's net position changes. Nodal PTDF × GSK = zonal PTDF. This is an approximation. If the real plants differ, the real flows differ.
      • minRAM 70 % (EU Regulation 2019/943): TSOs must offer at least 70 % of each critical element's capacity for cross-zonal trade.
      • Loop flows in CEE: north-German wind flows to the south through PL and CZ. Phase-shifting transformers on the DE–PL and DE–CZ borders now push that flow back.
      Why this is a perfect PhD areaOpen questions with real money behind them: better GSKs (by machine learning?), forecasting flow-based parameters (RAM, PTDF) a day ahead, the effect of storage on the flow-based domain, bidding-zone splits (Germany north/south), flow-based for intraday and balancing, robust or probabilistic RAM. You need power-system physics, optimisation and data science, which is exactly the FEI skill set. See thesis topics.
      Trading: whoever forecasts the flow-based domain best forecasts cross-border price spreads (SK–HU, CZ–DE). Those drive the value of long-term transmission rights bought in auctions. Battery siting: a battery on the "export-constrained" side of a bottleneck (node A here) earns from curtailment and relieves the grid. The same battery behind the bottleneck earns less and helps less. Redispatch markets: assets in the right place get paid by the TSO to move.
      Section 4 · From models to money

      Trading on fundamentals: hours, years and decades

      The same megawatt-hour is traded many times: years ahead as a forward, the day before in the auction, minutes before delivery in intraday. Each time horizon has its own drivers, models and ways to make (or lose) money. Here you will trade the weather, hedge a power plant, value an investment — and finally test your instincts in the trader quiz on real market events.

      ⏱ Short term: weather 📅 Mid term: forwards & hedging 🏗 Long term: NPV & M&A 🎯 Quiz: 9 real events 2022–2026
      !

      Your task

      1. Click all three horizons and read who does what, with which data — and what can go wrong.
      2. Open Mid term and select delivery years 2022 and 2023: was selling next year's power forward a good idea?
      3. Sort the 8 real-life decisions at the bottom into the right horizon.
      One megawatt-hour, traded across time — click a horizon
      15 minuteshoursdaysmonths1–3 years5 years10–30 years

      Real data

      Mini game — which horizon does this decision belong to?

      What is going on?

      Short term is about weather and flexibility. Tomorrow's price is set by load minus wind and solar (the residual load). Small changes in the weather forecast move prices a lot. Money is made by reacting faster and more accurately than the rest of the market, and by owning assets that can react, like batteries, hydro and gas engines.

      Mid term is about fuels and the balance of supply and demand: gas, CO₂, coal, hydro reservoirs and French nuclear availability. Producers sell their output forward to lock in a margin (hedging). Traders take positions when their fundamental model disagrees with the forward curve.

      Long term is about structure: how many solar panels, batteries and gas plants there will be, carbon policy, and demand from heat pumps, EVs and data centres. Nobody knows the price in 2040, so companies use scenarios and ask: "Does this investment still work in the bad scenario?"

      Forward price ≠ forecast you can beatThe forward is the market's best collective estimate plus a risk premium. It can be wrong by a factor of three in either direction, as 2021–2023 shows.
      A group with power plants and a trading arm needs all three horizons. Short term: many small daily wins from dispatching plants and batteries in the best hours and avoiding imbalance penalties. Mid term: lock in the spread between power and fuel for 1–3 years, so that a price crash does not bankrupt the company. Add small speculative positions where the fundamental view is strong. Long term: buy assets for less than they are worth to you (with your optimisation and trading skills), and build only when the NPV holds up in the bad scenarios.
      !

      Your task

      1. Move the wind slider and watch tomorrow's hours slide along the merit-order curve.
      2. Press one of the 11:00 forecast update buttons and read what the update is worth as a trade.
      3. Real data: open Dunkelflaute 12 Dec 2024. Above what residual load did prices explode?
      4. Open Easter Sunday 2026 and compare DE with PL and FR in the country chart.
      Tomorrow's forecast (DE, illustrative)

      The dashed line is the 09:00 forecast, which the market has already priced in. The sliders are the 11:00 update. The DA auction closes at 12:00.

      Germany has >70 GW of wind capacity: output ranges from ~1 to ~50 GW.
      A sunny May midday: 45+ GW. A grey December day: 1–5 GW.
      11:00 forecast update
      Supply and demand per hour (11:00 forecast)
      Merit-order curve: each dot is one hour of tomorrow

      Flat in the middle (lignite, coal, gas set the price), very steep at both ends: negative when wind and solar exceed demand, explosive when only the last peakers are left.

      Real days — DE hourly data (ENTSO-E, EPEX via PAP)

      Load, wind, solar (GW) and DE price (€/MWh)
      Price vs residual load: the real merit order (all 5 days)
      Same day in 7 coupled bidding zones

      What is going on?

      Day-ahead (DA). All of Europe runs one auction at 12:00 for the next day. Every bidding zone gets one price per period (15-minute periods since 1 Oct 2025). Bids are based on the forecasts available in the morning, so the last weather update before 12:00 matters most.

      Intraday (ID). After the auction, forecasts keep changing. Continuous intraday trading lets you buy or sell up to shortly before delivery, to correct your position.

      Imbalance. Whatever you still produce or consume differently from your schedule is settled by the grid operator (TSO) at the imbalance price. This is usually much worse than the market, so good forecasts save real money.

      Shape. Forwards are traded as flat blocks (base = all hours, peak = 08–20 on weekdays). Real production and consumption follow an hourly shape. Shape trading means buying a block forward and selling the individual hours in DA (or the reverse). Solar always sells at midday, when prices are lowest. That is why its capture price is below the base price.

      Why the curve matters. In our illustrative curve, 1 GW of forecast error moves the price by only ~1.6 €/MWh at 30 GW residual load, but by ~85 €/MWh at 63 GW. The same weather error is worth 50× more on a dunkelflaute evening.

      Weather desks earn by being faster and more accurate than the market: if the 11:00 update says less wind, buy before the auction; the price you get is the DA price that everyone else pays. Batteries and pumped hydro earn the daily spread: charge in the cheapest hours (on Easter Sunday they were even paid to charge), discharge in the evening peak. Gas engines earn a year's margin in a few dunkelflaute hours. Everyone saves money by avoiding imbalance penalties.
      !

      Your task

      1. Move the hedge ratio from 0 % to about 80 %. Compare the worst case (P5) and the probability of a loss.
      2. Lignite plant: also hedge the CO₂ (≥ 80 %). This is the spread hedge, the one generators really use.
      3. Raise volatility to 60 %. Does hedging become more or less valuable?
      4. Switch to the solar park and over-hedge (> 100 %). What happens in a bad-weather year?
      Your plant and your hedge for Cal-27

      The price at which you can sell 2027 power today.
      Share of expected output sold today at the forward price. Above 100 % = speculative short.
      Lignite emits ~1.1 t CO₂/MWh. Buy the certificates now at today's price.
      Std. dev. of the annual price change. ~25–35 % in normal years; 2022 was far above 80 %.
      Distribution of the 2027 result: 1 000 simulated price paths (m€)
      Result vs realised 2027 power price (each dot = one scenario)

      Unhedged (red), your result rises and falls with the power price. Fully hedged (gold), the line is flat: you have locked in the margin, whatever happens.

      How the model works (illustrative)
      P2027 = F · exp(σ·Z − σ²/2)
      , lognormal, mean = today's forward
      Result = V·(P − fuel − CO₂·EUA) − fixed costs
      + hedge·Vexp·(F − P) + CO₂hedge·Vexp·k·(EUA − EUA₀)
      • EUA volatility 30 %, correlation with power 0.7. Seeded random numbers (EPIC.rng), so the results are reproducible.
      • Volume risk: lignite availability 80 % ± 4 % (outages); solar yield ± 7 % (weather).
      • Simplification: the plant runs regardless of price. A real plant is an option and switches off when the spread is negative.

      Why do companies hedge — and how is that different from speculation?

      A hedge is a trade that reduces the risk you already have. A lignite plant is naturally long power: it gains when prices rise and loses when they fall. Selling its output forward makes the position flat. A spread hedge (sell power, buy CO₂) locks in the clean dark spread, which is the plant's actual margin.

      Hedging does not change the expected profit (look at the mean: almost identical). It narrows the distribution, so bad years become survivable. The price of that is giving up the upside: generators that sold 2022 forward early missed most of the 2022 windfall.

      Why bother? (1) Survival: fixed costs, salaries and debt have to be paid in bad years too. (2) Financing: banks lend more, and more cheaply, against hedged cash flows. (3) Planning: budgets, dividends and investments need predictable numbers. (4) Collateral: exchange hedges need margin. In August 2022 some European utilities needed emergency credit lines just to pay margin calls.

      Speculation creates new risk on purpose: selling more than you produce (> 100 %), or buying gas because your model says storage is too low. It is allowed, but within strict risk limits (VaR, stop-loss), sized so that being wrong does not hurt the company.

      For the generator: the hedge turns an uncertain 2027 result into a known one (see the "locked-in" row), which the company can plan, borrow and invest against. For a trading house like EPC: it is a service. Generators, industrial customers and utilities need someone to take the other side of their hedges, to structure them (shape, volume, fuel and CO₂ together) and to manage the resulting portfolio. That earns a bid–offer margin and structuring fees, plus the value of combining many opposite positions in one portfolio.
      !

      Your task

      1. Solar park, Base scenario: is the NPV positive? Now try the Low and High scenarios.
      2. Sign a PPA for ≥ 50 % of the output. Watch the Low–High range in the scenario table shrink.
      3. Battery: change the cycles per day. Which input drives the value most?
      4. CCGT: find the capacity payment that makes the Base-case NPV positive.
      Investment case (illustrative)
      The return investors and banks require. Riskier asset → higher WACC.
      Fixed price = 93 % of Base-case revenue. In return the WACC falls by up to 1.5 pp, because banks lend more against contracted cash flows.
      Cash flows per year (m€) and cumulative discounted cash flow
      The long-term model's output
      Same asset, same settings, all three scenarios

      What is going on?

      NPV (net present value) = today's value of all future cash flows, discounted at the WACC, minus the investment. NPV > 0 means the project earns more than investors require. IRR is the discount rate at which NPV = 0. Payback is the year in which the cumulative cash flow turns positive.

      Almost all of the uncertainty sits in one input: the long-term price (capture price for solar, daily spread for batteries, spark spread × running hours for gas). That number comes from a long-term fundamental model (PyPSA-type capacity expansion plus scenarios for gas, CO₂, demand and the renewables build-out). A different scenario can turn a project worth hundreds of millions into a write-off.

      Cannibalisation: every new solar park lowers midday prices for all the others, so the solar capture rate falls. More batteries compress the spreads they live on. Gas plants run fewer hours but earn more per hour.

      PPA as financing. A buyer (a car factory, a data centre, a utility) pays a fixed price for 10–15 years. The developer gives up some upside, but the cash flow becomes bankable: more debt, lower interest, a lower WACC. Many solar and wind parks in Europe are only built thanks to PPAs. Batteries and gas plants use tolling or floor contracts the same way.

      M&A. When buying an existing plant, the maximum price is the present value of its future cash flows ("Asset value" tile). Two bidders with different price models, or different abilities to optimise and trade the asset, put different values on the same plant. The one with the better model wins the deal at the right price; the one with the optimistic model wins it at a loss.

      Developers earn the difference between the asset's value and its cost (NPV > 0), often by selling the project once it has a PPA and a permit. Utilities and investors earn the IRR over 20–30 years. Traders and originators earn by structuring the PPA or tolling contract and by managing its shape and volume risk. Bad long-term models lose money on a large scale: the write-downs on European gas and coal plants after 2012 ran into billions.
      !

      Your task

      1. Read the context and the chart. Only data up to your decision is shown. Make your first call.
      2. After the reveal, read why it moved and what you could have noticed.
      3. Finish all 9 questions and check your hit rate and your P&L.
      4. Bonus: what would you do with the market today (October 2026)?
      Trader quiz: 9 real events, 2022–2026
      Hit rate
      0 / 0
      Hypothetical P&L
      €0

      What you know
        Price chart

        How to read this quiz (and its limits)

        What "correct" means. For forward questions (gas or power for future delivery), we compare your call with the price 10 trading days after the event. If the move is smaller than ±6 %, "no trade" counts as correct. For spot questions (tomorrow's day-ahead), we compare tomorrow's daily DA average with today's; a change below ±10 €/MWh counts as "no trade".

        Hypothetical P&L. Forward questions: €1 m position, P&L = ±% move × €1 m. Spot questions: 50 MW for 24 h, P&L = ± price change × 1 200 MWh. No trade = €0.

        Caveat: hindsight biasWe picked famous events because prices moved. In real life most days are noise, and you do not know which day will become "the event". Nine questions are not a track record. The context only includes facts that were public before the decision. 2026 events whose cause our data does not confirm are marked data-only.

        Data: TTF gas (ICE Endex front-month, day-ahead assessment), EEX DE base forwards, EPEX/OTE day-ahead, ENTSO-E load and renewables, all via the EPC PAP platform. Forwards trade on weekdays only.

        Speculative trading pays when your view is better than the market's: faster weather data, a better fundamental model, a better reading of storage, outages or politics. Asset-backed trading is where most of the money in a utility trading house comes from: the same view helps decide when to hedge the fleet, when to keep a plant or battery open for the spot market, and how to price a PPA. A view that cannot be turned into a position with a risk limit is just an opinion.
        Section 5 · What can you do next?

        Master theses, PhD topics & student projects

        Every topic below comes from a real question an energy trading desk has. Each card says what you would build, what data and methods you need, and — most importantly — why a company would pay for the answer.

        !

        Your task

        1. Filter by area or level.
        2. Pick one topic and read the “why a company cares” line — could you explain it to a trader in one sentence?
        Area
        Level

        !

        Your task

        1. Tick what you enjoy and what you already know.
        2. Look at your top three matches — they are highlighted in the topic explorer too.
        I enjoy…
        I want…
        Your best matches

        Tick a few boxes and press the button.

        From idea to defended thesis — the EPIC way

        1 · Pick a questionStart from the topic explorer or bring your own. A good question has a decision attached.
        2 · Talk to usShort call with an EPC mentor (trader / analyst / quant) and your FEI supervisor to scope it.
        3 · Get dataStart with open data (ENTSO-E, OKTE, Energy-Charts, ERA5). EPIC can add market data under an NDA.
        4 · Build & testPython, Git, reproducible notebooks. Back-test against reality, measure value in €, not only RMSE.
        5 · PresentDefend at FEI and present to the trading desk. Best work → internship or junior role.

        What makes a thesis “actionable”?

        • A decision: which MW to sell where, hedge or not, build or not.
        • A benchmark: what do we do today (naive rule, market forward, vendor forecast)?
        • A metric in money: € gained in a back-test, risk reduced, hours saved.
        • Honest validation: out-of-sample, no look-ahead (use only data available at decision time!).
        A forecast that is 5 % more accurate but arrives after the 12:00 day-ahead gate closure is worth exactly zero. Timeliness and robustness matter as much as accuracy.

        Skills that pay off

        Must have

        Python (pandas, numpy)GitSQL basicsstatisticsclear writing

        Great to have

        optimisation (LP/MILP)PyPSA / linopyML (LightGBM, PyTorch)power systemstime seriescloud / Spark
        Starter kit (one weekend)Install pypsa + highspy, download one year of SK & CZ prices from ENTSO-E with entsoe-py, build the merit order of section 2 in Python and compare with reality. You are now ahead of most applicants.

        Contact

        Interested in a topic, internship or project? Contact the lecturer or the EPIC coordinator — write which topic, your study programme and expected thesis year.

        EP CommoditiesFEI TUKE
        !

        Shorter projects

        1. These fit a semester project, a hackathon or a summer internship (2–8 weeks).
        Section 6 · Keep going

        Links, references & FAQ

        Everything you need to continue on your own: open data, free modelling tools, books and papers, how this lab was built, and answers to the questions students usually ask.

        How each section was built

        Books & papers