Code on a screen.

The Low-carbon Expansion Generation Optimization (LEGO) open source model is a mixed-integer quadratically constrained expansion planning program capable of optimizing generation and transmission investments, as well as operating decisions for current and future highly-renewable power systems.

LEGO is a complex yet easy to handle multitool, applicable for academic research, commissioned research projects, as well as teaching. LEGO’s modeling philosophies are: modularity and flexibility. Its underlying temporal framework enables addressing a plethora of technical, economic, and policy studies. Depending on a studies’ scope one can compose their individual modeling environment of interest, by simply deciding which thematic LEGO blocks to use and which to omit.

Model Description

LEGO’s objective function minimizes total system costs (investment and operational) for a static horizon e.g., one year. LEGO runs on either chronological hourly data, or representative periods. This, for example, provides computational advantages of representative period frameworks when modeling short- and long-term storage technologies simultaneously. LEGO currently includes following model option blocks:

  • mixed-integer (MIP) versus a relaxed MIP framework
    (MIP framework enables unit commitment (UC) constraints)
  • enabling network constraints or omitting them (single node problem)
  • DC- versus AC-Optimal Power Flow (via second order cone programming (SOCP))
  • enabling or omitting demand-side management (DSM)
  • enabling or omitting rate of change of frequency (RoCoF) constraints
  • enabling or omitting cycle depth stress function (CDSF) constraints
  • enabling or omitting the hydrogen sector e.g., electrolyzer units

Alongside model options, one can specify their individual generation and/or transmission investment portfolio. Thus, one can decide if LEGO considers a

  • generation (GEP)
  • transmission (TEP)
  • generation and transmission (GEP & TEP) expansion or
  • operational-only


Last but not least, LEGO also includes various policy options:

  • Green production specifies the minimum share of total demand to be covered from renewable generation
  • Carbon budget specifies the total CO2 emission budget and a CO2 price
  • Firm capacity specifies the minimum share of firm generation capacity
Modules of the LEGO model.
© IEE, TU Graz


In order to contribute battling the climate crisis and encouraging people to engage in studying power systems, we decided to provide LEGO’s source code as open source on GitHub. There you can also find input/output data files of various case studies to start exploring right away.

  • LEGO-Base-Case-Study-7LRP: Base case study for the model with stylized power system and 7 representative days.
  • LEGO-Base-Case-Study-Hourly: Base case study for the model with stylized power system and chronological hourly representation of time horizon of one year.

Institute of Electricity Economics and Energy Innovation
Inffeldgasse 18
8010 Graz

Tel.: +43 316 873 7901
Fax: +43 316 873 7910

Related Links