Getting started
OSeMOSYS is written in the free and open source software GNU Mathprog - a part of the GNU linear programming kit (GLPK). GNU Mathprog is a mathematical programming language. A free linear programming solver is used to solve OSeMOSYS models.
OSeMOSYS User Manual
The first place to get started with learning OSeMOSYS is the User Manual. This can be downloaded below and describes the OSeMOSYS modelling framework and explains the steps involved in building a new model using the UTOPIA sample dataset as an example. The user manual will be frequently updated to coincide with the development of the OSeMOSYS code. As a community effort, we encourage users to visit the Discussion Forum page or Contact us with feedback on the OSeMOSYS User Manual.
Further information on GLPK, including download instructions, can be found here: http://sourceforge.net/projects/winglpk/
An easy-to-read introduction to linear programming using GLPK is available below.
An easy-to-read introduction to linear programming using GLPK is available below.
Using CPLEX
For larger models, the default solver of GLPK, glpsol, may be inadequate and it may be necessary to use a commercial solver such as CPLEX. In order to do this, the following steps should be followed:
The file produced through the above process contains the results of the model run in a format that is easy to analyse, either directly or after being copied into another software platform such as MS Excel.
- In order to use CPLEX, the OSeMOSYS model and data files first need to be combined into a single .lp file. To do this, open the command prompt and use the following command: glpsol -m [OSeMOSYS model file] -d [Data file] --wlp [Input_Filename.lp]
- After the lp file generation is done, close the command prompt window. Open CPLEX. Type ‘read’ and press enter. The name of the file to read is: ‘C:\Input_Filepath\Input_Filename.lp’
- After the file is read, type ‘optimize’ and press enter.
- After the optimization is done, type ‘write’ and press enter. The name of file to write is: ‘C:\Output_Filepath\Output_Filename.sol’
- Now that the solution file is written, close the CPLEX window and open the command prompt again. The solution file will need to be sorted and reordered. For this, download the python sorting script that was developed for this function and copy it in to the Python 3.5.0 installation folder ('C:\Python35\' is the default installation directory). This script can be downloaded from the link below. Go to the directory ‘C:\Python35\’. Type python transform_31072013.py Output_Filename.sol Output_Filename.txt. For this step, you will need to have Python 3.5.0 installed. Python 3.5.0 can be downloaded from here. Click on the link “Download Python 3.5.0” and follow the installation instructions. The steps described here assume that the Python installation directory is C:\Python35.
- After the python script is done, type ‘sort/+1<C:\Python35\Output_Filepath\Output_Filename.txt>C:\Python35\Output_Filename_sorted.txt’
The file produced through the above process contains the results of the model run in a format that is easy to analyse, either directly or after being copied into another software platform such as MS Excel.
Version history
On this page you will find the successive versions of OSeMOSYS developed from the original code. These older versions include improvements in functionality as well bug fixes and serve to trace the progress of OSeMOSYS.
The latest version(s) of OSeMOSYS can downloaded from the Getting Started page. |