Linear Program (LP) Solver and Formulation

WEAP uses a mixed-integer linear program (MILP) to maximize satisfaction of requirements for demand sites, reservoir filling, user-specified instream flows and hydropower, subject to demand priorities, supply preferences, mass balance and other constraints. The MILP solves all the simultaneous equations listed above.   

WEAP includes two MILP solvers (lpsolve and XA), and an option to link to another (Gurobi).  lpsolve is open source; XA and Gurobi are commercial.  On very large models, the commercial solvers can perform much faster (up to ten times faster) than lpsolve, and are usually more robust.  lpsolve is free for everyone to use; XA is free for everyone to use until 15 July 2020; Gurobi is free only for academic use ( ).  Keep in mind that, due to the nature of the complex numerical calculations performed by MILP solvers, each solver will yield slightly different results.  This means that WEAP results can vary slightly depending on the solver used.

To choose which solver to use, go to the Main Menu: General, Solver, and choose between lpsolve and XA.  If you have Gurobi, copy gurobi70.dll or gurobi75.dll (make sure to copy the 32-bit version, not 64-bit) into the WEAP program folder.  After you do this and restart WEAP, you should see Gurobi as a third option on this menu.

For more information, see: