Yes

Syntax

Yes

See also: Operators, No,  AND, OR, NOT

Summary

Returns a value of 1.  Equivalent to True.

Controlling Optimization

When used with the Optimize and Energy System Optimization variables to switch on module level or energy system optimization, the Yes function can take optional additional parameters,  which are used to select a specific solver and to control limited foresight optimization. 

In this context, the allowed extended syntax is as follows:

Yes(Solver)

Yes(Solver,  Year1, Year2, ..YearN)

Yes(Solver,  Presolve, Extra NEMO Parameters,  Year1, Year2, ..YearN)

These additional parameters are only allowed when specifying the Optimize and Energy System Optimization variables.

Optional Parameters

  • Solver: The optional solver parameter is the name of a particular solver to use with NEMO.  Allowable values are: Gurobi, CPlex, XPress, MOSEK, Cbc, HiGHS, or GLPK.  Solver labels are not case sensitive. If the solver parameter is omitted, LEAP will instruct NEMO to use the fastest available solver installed on your PC (assumed to be Gurobi, CPLEX, XPress, and then HiGHS in that order).  When specifying a particular solver, if that solver is not installed, the optimization calculation will fail and generate an error. 

    For best calculation performance and maximum portability of your model, it is best to NOT specify a particular solver.  However, this may occasionally be useful, for example if you want to check that different installed solvers are producing the same results. In some cases, different solvers may yield slightly different results (most often due to the solver being designed to speed up calculations). Note also that by using this function you can use different solvers when calculating different scenarios.   

    The commercial solvers CPLEX, GUROBI and XPress must be purchased and installed separately from LEAP and NEMO. MOSEK is installed with NEMO but you must have a properly purchased and installed license file to use it. Use the orange  Exp button () in the data entry table to quickly choose a solver from among those installed on your PC.  

 

  • Presolve: This optional parameter should be set to yes (1) or no (0) and is used to switch presolve off or on.  Presolve is on by default.

 

  • Extra NEMO Parameters: This optional parameter is simply a text string, which can be used to pass additional parameters to NEMO.

 

  • Limited Foresight Years: The Yes function can also take a list of years to enable limited foresight optimization. If no years are specified, NEMO will use perfect foresight optimization. The list of years must be in ascending chronological order. Any years before the first scenario year or after the end year will be ignored. Each calculated year will be grouped based on whether it occurs before or on each grouping year.

    With perfect foresight optimization, all years are optimized at the same time. With limited foresight optimization, years are divided into groups, each of which is separately optimized. Results from each group provide the starting conditions for the next group. 

    With both limited foresight and perfect foresight optimization, you can elect to calculate selected years only, using the Results Every option on the Settings:Years screen. Note that limited foresight optimization requires NEMO v2.2 or later.    

Examples for Controlling Optimization

  • Yes: Switches on perfect foresight optimization and instructs NEMO to use the fastest available solver.
  • Yes(CPLEX): Switches on perfect foresight optimization and instructs NEMO to solve using the CPLEX solver.
  • Yes(2030, 2040): Switches on limited foresight optimization.  Calculated years will be put into three groups: (1) any calculated years up to and including 2030, (2) any calculated years from 2031 to 2040, (3) Any calculated years after 2040.
  • Yes(HIGHS, 2030, 2040): Limited foresight optimization using the HiGHS solver.
  • Yes(Gurobi, false 2030, 2040): Limited foresight optimization using the Gurobi solver, with presolve switched off.

 

Note: for compatibility with older versions of LEAP, you can also use the deprecated NEMO function, which takes the same parameters as the Yes function.