introduction to zimpl and scip - blogs...

15
Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016 Prof. Damien Ernst Contact: Quentin Gemine [email protected]

Upload: others

Post on 21-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Energy Markets Introduction to ZIMPL and SCIP

Academic year 2015-2016 Prof. Damien Ernst

Contact: Quentin Gemine [email protected]

Page 2: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Practical information• 26/02/2016 Presentation of assignment.

• 18/03/2016 First Q&A session.

• 15/04/2016 Second Q&A session.

• 27/04/2016 Submission deadline. Submit PDF & ZIMPL to [email protected]

• 29/04/2016 Project defense. Presentation of 15 slides & 15 min maximum per group.

• 04/03/2016 Introduction to ZIMPL for mathematical programming.

Page 3: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Linear programing (LP)

Objective and constraints are linear expressions, and variables have continuous domains.!

Example:!

!

!

!

Properties: !

•The feasible domain is a polyhedron.!

•Optimal solution(s) lie on the boundary of that polyhedron.

40From «How the European day-ahead electricity market works» (2014), by Bertrand Cornélusse

Page 4: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Feasible domain

Graphical representation of a Linear Program

41

Objective increases in this direction x2

x1 0

Constraints

6Bounds

From «How the European day-ahead electricity market works» (2014), by Bertrand Cornélusse

Page 5: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Convex optimization

Those results generalize to problems more general than LP, that is when the objective and the feasible domain are convex.!

There is a theoretical guarantee that there exist algorithms to solve those problems efficiently.!

Example: (convex) Quadratic Programming (QP) are problems where the objective is quadratic and constraints are linear. The simplex and barrier algorithms can be adapted to QP.

45From «How the European day-ahead electricity market works» (2014), by Bertrand Cornélusse

Page 6: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Mixed Integer programing (MIP)

Idem as before, except that some variables must take integer values.!

In general, relaxing the integrality requirement and solving the resulting continuous optimization problem does not yield a feasible solution to the original problem. Simple rounding procedures do not necessarily restore feasibility, and even if it does, do not guarantee optimality. However, the continuous relaxation provides a bound on the optimum of the original problem.!

Simple enumeration of combinations of integer variable values is computationally undoable. Branch-and-bound is a clever way to do enumeration. It progressively imposes integer values and uses the solution to intermediate continuous relaxations to obtain bounds and thus avoid exploring some combinations, without losing optimal solutions.

46From «How the European day-ahead electricity market works» (2014), by Bertrand Cornélusse

Page 7: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

SCIP Optimization suite

SCIP Optimization Suite is a software that includes all the tools required to read and to (try to) solve a mathematical program.

It allows you to use the high level language ZIMPL to define mathematical programs.

Download SCIP athttp://scip.zib.de/

Page 8: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

ZIMPLExamples and all the required documentation about ZIMPL can be found in its user manual (http://zimpl.zib.de/download/zimpl.pdf).

Example:

From «ZIMPL User Guide» (2014), by Thorsten Koch

Page 9: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

ZIMPLMany useful numerical expressions:

From «ZIMPL User Guide» (2014), by Thorsten Koch

Page 10: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Modeling a pool market

From «Capacity Expansion in Competitive Electricity Markets» (2013), by Efthymios Karangelos

Page 11: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Modeling a pool market

Production data:

# Set of generators set G := {1..3}; # Marginal cost of production of generators [€/MWh] param mc[G] := <1> 30, <2> 45, <3> 60; # Maximal production of generators [MW] param p_max[G] := <1> 8000, <2> 3000, <3>4000;

Page 12: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Modeling a pool market

Consumption data (LDR):

# Number of bins set N := {1..5}; # Relative duration of each bin [%] param w[N] := <1> 0.08, <2> 0.24, <3> 0.36, <4> 0.19, <5> 0.13; # Load consumption level for each bin [MWh] param demand[N] := <1> 6000, <2> 9500,

<3> 11000, <4> 1200, <5> 13000;

Page 13: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Modeling a pool market

Balance constraint:

subto balance:

(sum <g> in G: P[n,g]) == demand[n]; forall <n> in N:

Page 14: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Modeling a pool market

Objective:

minimize cost: sum<g> in G: mc[g]*P[n,g];

minimize cost: (sum<g> in G: mc[g]*P[n,g])/demand[n];

minimize cost: sum <n> in N: (sum<g> in G: mc[g]*P[n,g])/demand[n];

minimize cost: sum <n> in N: w[n]*(sum<g> in G: mc[g]*P[n,g])/demand[n];

Page 15: Introduction to ZIMPL and SCIP - Blogs ULgblogs.ulg.ac.be/damien-ernst/wp-content/uploads/sites/9/2016/03/zimpl... · Energy Markets Introduction to ZIMPL and SCIP Academic year 2015-2016

Getting a solution with SCIP.pool_market.zpl:

in your terminal/console:> scip -f pool_market.zpl … primal solution: ================ objective value: 34.2786483253588 P#1#1 6000 (obj:0.0004) P#2#1 8000 (obj:0.000757894736842105) P#2#2 1500 (obj:0.00113684210526316) P#3#1 8000 (obj:0.000981818181818182) P#3#2 3000 (obj:0.00147272727272727) P#4#1 8000 (obj:0.000475) P#4#2 3000 (obj:0.0007125) P#4#3 1000 (obj:0.00095) P#5#1 8000 (obj:0.0003) P#5#2 3000 (obj:0.00045) P#5#3 2000 (obj:0.0006) …