Introduction to Optimization

See also: Setting Up Optimization in LEAP


LEAP includes the capability to automatically calculate least-cost capacity expansion and dispatch of supply-side Transformation modules based on the use linear programming-based optimization frameworks.  

Optimization frameworks calculate the least-cost expansion and dispatch of power plants for an electric system, where optimal is defined as the energy system configuration with the lowest total net present value of the social costs of the system over the entire period of calculation (from the base year through to the end year), subject to various constraints such as meeting energy demands, or limiting emissions.

In calculating an optimal system LEAP takes into account all of the following relevant costs and benefits incurred in the system including:

A least cost system can optionally be calculated subject to a number of user specified constraints including maximum annual levels of emissions for any given pollutant (CO2, SOx, NOx, PM10, etc.) and minimum or maximum capacities for certain plant types.  For example, an expansion pathway for an energy system could be calculated that meets a minimum renewable portfolio standard (RPS) whilst also staying within a target for reducing greenhouse gas (GHG) emission.

Bear in mind that optimization calculations tell the user what theoretical future configuration of an energy system will yield the lowest overall cost to society.  But such pathways may not represent realistic policy options in a particular country for many different reasons including their social and environmental acceptability or the perceived need to preserve energy security or the diversity of energy supply.  On the other hand, with LEAP’s simpler accounting calculations, the user tells the model what energy system they want to see built.  That is, expert judgment is used to assess what pathways are feasible.  These pathways are not necessarily optimal in the sense of being least-cost but they may be more realistic.   

The optimality of a given pathway may be very sensitive to input assumptions such as future capital costs, future efficiency assumptions, future fuel costs or future GHG mitigation targets. A system that is optimal for a country under one set of assumptions (e.g. low growth in fuel prices) may be far from optimal under another set of assumptions (e.g. high growth in oil prices).  Generally, the goal in energy planning is not to identify a single optimal solution, but rather to identify robust energy policies that work well under a range of plausible input assumptions.   You can easily use LEAP’s scenario capabilities to calculate explore different optimal solutions under different sets of input assumptions.

Optimization Calculations Supported in LEAP

Optimization calculations in LEAP work through integration with either of two different optimizing frameworks:

LEAP has supported the OSeMOSYS platform for many years and we will continue to do so for some years to come. OSeMOSYS has the advantage of being distributed as part of LEAP so no additional software is required to use it and its also included with each LEAP license.  However, OSeMOSYS also tends to be slow, especially with large problem sets, and it is built upon a modeling language (GLPK) that no longer appears to be actively developed. SEI therefore took the decision to create a new optimization framework called NEMO that has strong advantages over OSeMOSYS, and which also is well-placed to meet the future developmental needs of the LEAP user community. Like OSeMOSYS, NEMO is also source, but unlike OSeMOSYS, it is built in a new programing language called Julia, originally developed at MIT.

Julia is fast, flexible, and well suited for scientific and numerical computing. It also has a vibrant and growing community of users. This makes NEMO particularly good at the types of optimization problems encountered in LEAP: linear (LP) and mixed integer linear programming (MILP), especially for large problem sets.  

SEI's research efforts are now devoted to the NEMO system and in general we recommend that most LEAP users transition to using NEMO. Using NEMO with LEAP has a number of advantages versus using OSeMOSYS with LEAP. Namely:

NEMO must be installed separately from LEAP but is freely available for download from the LEAP web site. No additional license is required and there is no additional cost involved in using NEMO with LEAP. Once installed, NEMO is seamlessly connected to LEAP.  More information here on solvers supported by LEAP and NEMO.

The table below provides a quick comparison of the OSeMOSYS and NEMO frameworks:

Controlling which framework/solver Used by LEAP

Users of LEAP need never interact directly with either OSeMOSYS or NEMO or any of their data or results files.  LEAP automatically writes the data files required by these frameworks making use of the same data you already input into LEAP including process efficiencies, availability rates, emission factors, unit capital costs, fixed and variable O&M costs, fuel costs and externality values.  

The results of the optimization are automatically read back into LEAP so that all relevant results can be viewed in LEAP in its standard Results, Energy Balance and Cost-Benefit reports.  LEAP also automatically handles all unit conversions necessary for reading and writing the data files required by OSeMOSYS and NEMO.

Optimization can be optionally used in one or more scenarios for calculating capacity expansion, whilst other scenarios can continue to use LEAP's accounting calculations in which the user exogenously specifies the expansion pathway.   Just like LEAP, the two optimization models calculate both capacity expansion (i.e. how many megawatts of power plants are built) and process dispatch (i.e. how many megawatt-hours of each power plant will be dispatched in each time slice of each year).   

You can control which scenarios use optimization by simply editing the Optimize variable in LEAP in any given scenario.  When this variable is set to Yes, the default optimization framework and solver will be used (currently OSeMOSYS with the free GLPK solver).  When set to No, LEAP will use its accounting and simulation calculations.  For finer grade control, you can even make use of different frameworks and solvers to calculate different scenarios.  This can be useful for checking that different frameworks and solvers yield the same results.  In some rare cases they may yield slightly different results (most often due to optimizations of the solver code designed to speed up calculations).  The allowable keywords used for the Optimize variable are currently as follows:

Note that the commercial solvers CPLEX, GUROBI and XPress must be purchase installed separately from LEAP and NEMO. MOSEK is installed with NEMO but you must have a properly purchased and installed license file for MOSEK in order for it to calculate. Use the orange  Exp button () in the data entry table to quickly choose a framework and solver from among those installed.  

For more information: