See also: Optimization in LEAP

The following are the steps for setting up optimization in LEAP:

First, decide which framework you want to use: OSeMOSYS or NEMO. If you are unsure, you can refer to this overview of the advantages and disadvantages of each framework. OSeMOSYS comes installed with LEAP, but NEMO will need to be installed separately. Instructions for installing NEMO coming soon.

Next, decide which solvers you wish to use. GLPK and Cbc come installed with LEAP. MOSEK is installed with LEAP, but you will need to separately purchase and install a license key if you wish to use it with LEAP/NEMO. CPLEX and GUROBI need to be purchased and installed separately from LEAP and NEMO. Once your solvers are installed LEAP should automatically detect them. No additional work is needed to connect the solvers to LEAP and NEMO. More information here on getting access to the solvers that are supported by LEAP and NEMO.

Once you have setup your optimizing framework and solver, or if you are having problems getting them installed, we suggest you visit the Help: About screen. This screen will give you a summary of which frameworks and solvers are installed.

Next, you should view the Optimization tab of the General: Settings screen. Here you can specify whether you wish to use emissions constraints and you can also configure how optimization calculations appear on-screen during a LEAP calculation. You should also check a few other key settings on the Costing tab of the Settings screen. In particular:

check that the Discount Rate is positive.

check that the cost annualization method is set to Capital Recovery Factor.

Next, select the Transformation module for which you wish to calculate an optimal capacity expansion pathway. Typically this will be the module in your LEAP data set that deals with electricity generation. Transformation modules are listed immediately below the top level Transformation branch in the LEAP tree structure (visible in the Analysis View).

Create and select a new scenario in the General: Scenarios screen or select an existing scenario that will be calculated using the optimization methodology.

Select the Transformation module where you wish to set up an optimization calculation, and then go to the Optimize variable located at the module branch and set its value to Yes (to use OSeMOSYS/GLPK) or use one of the other functions to specify a different framework and solver. For example, you might enter NEMO(GLPK) or NEMO(CPLEX). Use the orange Exp button () in the data entry table to quickly choose a framework and solver from among those installed (as shown on right). Note that you cannot conduct optimization calculations for Current Accounts.

Once you have switched on optimization you will see a number of new variables displayed for each process in the optimized module. In addition, some variables used for LEAP's simulation and accounting methods (like Endogenous Capacity) will no longer be available. Make sure you input the minimum level of data required for an optimization calculation within these variables. Optimization calculations generally require more supporting data than LEAP’s basic simulation and accounting methods. In particular you need to specify process efficiencies and availability rates, unit capital costs, fixed and variable operating & maintenance costs, and (where appropriate) fuel costs. Most of these data values are specified at or below the processes listed under the selected Transformation module. If you are analyzing GHG or local air pollution emissions and wish to consider an optimal system that takes into account pollution damage costs then you will also need to specify emission factors and pollutant externality values. Emission constraints and externality costs are entered under the top-level Effects tree branch. If that branch is not visible, return to the Optimization tab of the General Settings screen and make sure Include Emissions Constraints is selected.

When using NEMO you can also specify Transformation processes to model energy storage. These special types of processes are represented in the LEAP Tree by a battery icon (). Note that energy storage modeling is only supported when using NEMO. It is not supported either when using LEAP's accounting and simulation methods or when using LEAP with OseMOSYS. Energy storage processes also require some additional data to be specified such as Starting Charge, Minimum Charge, and Full Load Hours.

Note that you can set up multiple scenarios, each of which can calculate optimized expansion pathways with different assumptions. For example, different pathways may make different assumptions about economic growth, fuel price inflation and mitigation targets or may impose different constraints such as a Renewable Target. You can even make use of different optimizing frameworks and solvers in different solvers, which can be a useful way of checking their results against each other.

Viewing Results

Once you have followed the above steps you may now go to the Results View to see results for this scenario. LEAP will automatically interface with your chosen framework and solver as needed during calculations. If the optimization calculations fail to solve (i.e. they fail to find an optimal pathway) then LEAP’s calculations will be halted, an error message will be displayed and you will be given an opportunity to review the detailed debugging messages from the solver.