modelling european power supply and demand with matlab … · modelling european power supply and...

23
Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger

Upload: others

Post on 22-Mar-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

Modelling European Power Supply and demand with

MATLAB and Parallel Computing

Lea Bloechlinger

Page 2: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

2 Bank of America Merrill Lynch

Power Trading and Analysis

Trading

• Commodities

– Power (DE, FR, UK, BE, NL,..) Base, Peak, Offpeak

– Coal, Gas, Emissions

• Futures and Forwards (Financial and Physical), Options

• Intraday, Day-Ahead, Weeks, Months, Quarter, Year

Analysis

• Fundamental approach

• Model the whole power system, estimate the marginal costs, compare with

market prices, derive trade ideas

Page 3: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

3 Bank of America Merrill Lynch

Fundamental Analysis

• What are the costs of meeting all power demand in CWE

– using the available generation capacity

– taking into account the different characteristics of units (efficiency,

ramping flexibility, etc.)

– taking into account the expected renewable production

– assuming optimal border flows within CWE

– assuming border flows from external countries according to price

differentials in the forward curves

Stack model which provides an hourly cost curve for the BoY and YA

Compare with market prices and follow day on day changes

Page 4: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

4 Bank of America Merrill Lynch

Stack Model

1. Input Data

2. Optimization Model

3. Results

Page 5: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

5 Bank of America Merrill Lynch

Generation Units

1700 Units wo wind/solar/hydro

• Characterised by

– Fuel Type: Nuke, Lignite, Coal, Gas, Fuel Oil, Diesel Oil, Biomass

– Technology: ST, GT, CCGT, CHP

– Capacity

– Efficiency / Age

– Operating Modus

• Which implies different

– Variable Costs

– Startup Costs

– Ramping Flexibility

Page 6: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

6 Bank of America Merrill Lynch

Generation Units – Daily Changes/Uncertainty

• Variable costs depend on fuel and emission price which permanently

changes

• Available capacity

– Planned Maintenance

• Daily unit-specific information provided by some utilities

• Daily fuel-specific information provided by TSO covering majority of

plants

• Own assumptions, seasonal shapes for not-covered unit and the

longer end of the curve

– Unplanned Outages

• Realtime UMM (urgent market messages)

Page 7: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

7 Bank of America Merrill Lynch

Abstraction in Model

30

35

40

45

50

55

60

65

0

2000

4000

6000

8000

10000

12000

14000

16000

18000

20000

22000

Capacity (MW)

Net E

ffic

iency (

%)

Gas 2:

Gas 1:

Gas 3:

Gas 4:

Gas 5:

Gas 6:

Page 8: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

8 Bank of America Merrill Lynch

Renewable Generation

• Wind, Solar, Hydro • Zero Variable Costs

Germany Wind Forecasts

0

2,000

4,000

6,000

8,000

10,000

12,000

15/9

Hr

1

15/9

Hr

13

16/9

Hr

1

16/9

Hr

13

17/9

Hr

1

17/9

Hr

13

18/9

Hr

1

18/9

Hr

13

19/9

Hr

1

19/9

Hr

13

20/9

Hr

1

20/9

Hr

13

21/9

Hr

1

21/9

Hr

13

22/9

Hr

1

22/9

Hr

13

23/9

Hr

1

23/9

Hr

13

24/9

Hr

1

24/9

Hr

13

Max w eekly historic

Min w eekly historic

Historic average

Meteopow er 15/09/12

04:00

Point Cabon 13/09/12

Point Cabon 14/09/12

Meteologica 15/09/12

06:00

Meteologica 14/09/12

23:00

Previento 14/09 08:25

Previento 15/09 06:00

TSO

Page 9: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

9 Bank of America Merrill Lynch

European Power Grid

Page 10: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

10 Bank of America Merrill Lynch

Crossborder Transmission Lines

• Crossborder Transmission Lines

– 11 external borders

NO, SE, DK1, DK2, PL, CZ, HU, SI, IT, ES, IE

– 9 internal borders

• Characterised by

– Installed Capacity

– Available Capacity - Daily updates published by TSO

– Price Differential - Permanently changing

Page 11: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

11 Bank of America Merrill Lynch

• Short-/Mid-term Demand

– Weather data (temperature, cloud cover,..)

– Calendar (hour, weekday, month)

• Long-term Demand

– Economy, IP Numbers

– Efficiency measures

Demand

Page 12: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

12 Bank of America Merrill Lynch

Stack Model

1. Input Data

2. Optimization Model

3. Results

Page 13: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

13 Bank of America Merrill Lynch

Optimization Problem - Linear Program

min f‘x minimize costs

s.t. A x < = b e.g. Production < Available Capacity

A_eq x = b_eq e.g. Demand = Supply

x < = ub e.g. Available Cap < Installed Cap

-x < = lb e.g. Production > 0

Some numbers for an optimization period of 1 month (DE, FR, NL, BE, UK, CH)

• No decision variables x: 262’080

• No of <= restrictions: 253’440

• No of = restrictions: 48’960

• A: [253’440x262’080 double] A_eq: [48’960x262’080 double]

• b: [253’440x1 double] b_eq: [48’960x1 double]

• f: [262’080x1 double] lb, ub, x: [262’080x1 double]

Page 14: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

14 Bank of America Merrill Lynch

Implementation Details

• Object-Oriented Approach

– OptProg

• Contains all matrices going into the Linear Program

• Use of dependent properties (easily link parts of matrices)

– Stack

• Contains all input and output

• Intuitively organized

• Advantages of Object-Orient Approach

– Maintainability

– Easily extentable

Page 15: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

15 Bank of America Merrill Lynch

Use of LinProg

• options =

optimset('LargeScale', 'on','Algorithm', 'interior-point', 'TolFun', 0.00001);

• [x,fval,exitflag,output,lambda] =

linprog( OptProg.d_f.Value, f

OptProg.A, A

OptProg.d_b.Value, b

OptProg.A_eq Aeq

OptProg.d_b_eq.Value, beq

OptProg.d_lb.lb, LB

OptProg.d_ub.ub, UB

[],

options);

Page 16: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

16 Bank of America Merrill Lynch

Implementation Details

• Parallel Computing

– Linprog not possible to run in parallel but model can be cut along time-

dimension

– Depending on ratio of time window and number of scenarios parfor loop

either over time or scenarios

– Easy implementation, see next slide

Page 17: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

17 Bank of America Merrill Lynch

Easy Implementation of Parallel Computing

if nR < 3 % if less then three time periods

for i = 1:nR % normal loop over time but

[obj, optp] = runBase(countries, datestr(sdts(i)), datestr(edts(i)),

publishDate, scenID, ExtractID);

obj = addDummies(obj);

parfor j = 1:length(scenIds) % but parfor-loop over scenarios

runDem(obj, optp, scenIds(j), fullDataSet, modelIds(j), series)

end

end

else % if more then three time periods

parfor i=1:nR % parfor-loop over time periods

[obj, optp] = runBase(countries, datestr(sdts(i)), datestr(edts(i)),

publishDate, scenID, ExtractID);

obj = addDummies(obj);

for j = 1:length(scenIds) % and normal loop over dem scenarios

runDem(obj, optp, scenIds(j), fullDataSet, modelIds(j), series)

end

end

end

Page 18: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

18 Bank of America Merrill Lynch

Agenda

1. Input Data

2. Optimization Model

3. Results

Page 19: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

19 Bank of America Merrill Lynch

Stack

CountryStack DE CountryStackFR ... CountryStack UK

Demand Supply Borders

Demand Solar Wind RoR CHP ImCap ExCap ImFlow NetFlow ImPrice ImFee ...

Fcst Seasonal

FuelUnits HydroUnits

Fuel Efficiency VarCost ProdCost StartupCost Cap Avail Production Reserve

Page 20: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

20 Bank of America Merrill Lynch

Results

• Due to the object-oriented approach easy but still flexible way to illustrate

results also for unexperienced Matlab users

>> obj = stacks(countries, startDate, endDate, publishDate, scenarioID)

>> obj = create_opt_stack(obj)

>> help stack/plot_generation

out = plot_generation(obj, Country, varargin)

Plots the generation by unit together with the netdemand for the chosen country.

Returns the plotted data as a dataset.

Variable Description Default/List of Choice

obj stack mandatory

Country Country mandatory

frequency Time Frequency *Hourly, Daily, Weekly, Monthly

quality Quality *Base, Peak, OffPeak, OffPeak5D, WE

gen Switch Gen/Avail/Cap *Gen/Avail/Cap

startDate Start of plot *obj.StartDate

endDate End of plot *obj.EndDate

fuellevel fuel or unit level *false/true

addprice add prices *false/true

See also plot_demand, plot_stack, plot_border, plot_allborders, plot_price

Page 21: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

21 Bank of America Merrill Lynch

Results

13-Sep-12 14-Sep-12 15-Sep-12 16-Sep-12 17-Sep-12 18-Sep-120

10

20

30

40

50

60

0

10

GW

DE - Gen and NetDemand - Base

ML DE Lignite 3 - 12.69

ML DE Nuclear 1 - 15.14

ML DE Lignite 1 - 15.74

ML DE Lignite 2 - 16.13

ML DE Coal 4 - 35.62

ML DE Coal 3 - 36.74

ML DE Coal 2 - 38.02

ML DE Coal 1 - 40.02

ML DE Gas 5 - 44.45

ML DE Gas 4 - 54.39

ML DE Gas 3 - 60.38

ML DE Gas 2 - 67.08

ML DE Gas 1 - 82.51

ML DE Oil 2 - 90.8

ML DE Gas 6 - 102.26

ML DE Oil 1 - 164.38

NetDemand

Demand

NetNetDemand

Page 22: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

22 Bank of America Merrill Lynch

13-Sep-12 14-Sep-12 15-Sep-12 16-Sep-12 17-Sep-12 18-Sep-120

10

20

30

40

50

60

0

GW

FR - Gen and NetDemand - Base

ML FR Nuclear 1 - 13

ML FR Nuclear 2 - 24

ML FR Coal 3 - 40.68

ML FR Coal 2 - 41.12

ML FR Coal 1 - 43.48

ML FR Coal 4 - 45.39

ML FR Gas 1 - 51.27

ML FR Hydro Res 1 - 65.13

ML FR Hydro Res 2 - 72.32

ML FR Gas 2 - 79.13

ML FR Hydro Res 3 - 80.36

ML FR Hydro Res 4 - 88.4

ML FR Oil 1 - 135.17

ML FR Oil 2 - 135.17

NetDemand

Demand

NetNetDemand

Page 23: Modelling European Power Supply and demand with MATLAB … · Modelling European Power Supply and demand with MATLAB and Parallel Computing Lea Bloechlinger . Bank of America Merrill

23 Bank of America Merrill Lynch

Benefits of Matlab

• Model moved from xls/vba to Matlab/Database

– Much more flexibility regarding

• time aggregation

• geographic coverage

• scenario analysis

– Increase in performance

• Much easier handling of large dataset