Download and Installation

The Temoa energy system model is implemented with Pyomo, which is in turn written in Python. Consequently, Temoa will run on Linux, Mac, Windows, or any operating system that Pyomo supports.

There are several open source software elements required to run Temoa. Because the licenses vary between them, we cannot create a single, customized installation package. However, the installation process does not take very long. Here are the pieces you will need to install, and it is best to install them in the order given below:

  1. Python. Temoa currently requires Python v2.7. If you run Temoa with Python 3, you are likely to encounter errors. Also, rather than simply downloading Python from python.org, you may want to instead consider installing a Python distribution. The main advantage of using a Python distribution is that it automatically curates a large number of Python packages (e.g., numpy, scipy, matplotlib), thus eliminating the need for ad hoc Python package management. For our own development, we currently use a Python distribution called Anaconda, which is available for free through Continuum Analytics. Another popular distribution is Enthought Canopy (the 'Express version is freely available). If you install such a distribution for use with Temoa, make sure that during installation it gets added to your PATH.
  2. Pyomo. Temoa employs APIs from PYthon Optimization Modeling Objects (Pyomo), which was developed at Sandia National Laboratories. This is the software that allows us to implement the algebraic formulation of Temoa in Python without using commercial algebraic modeling languages, such as GAMS or AMPL. Pyomo is installed with two simple commands that utilize the Python 'pip' utility:
    $ pip install pyomo 
    $ pip install pyomo.extras
    For more information on Pyomo installation, see these instructions.
  3. A linear optimization solver. We recommend GLPK as it is GPL software and thus free. A couple notes on GLPK installation. If you follow the link above, it points you to the download of a tarball that must be extracted and compiled in C. The procedure is relatively straightforward if you are running Linux, as a c compiler is already installed. If using Windows, you can download a pre-compiled version here. If you plan to run Temoa with large datasets and/or conduct uncertainty analysis, you may want to consider commercial linear solvers such as CPLEX or Gurobi. Both offer free academic licenses. Note that whatever solver you choose, it must be added to your PATH or Pyomo won't be able to find it.
  4. The Temoa model. There are a couple of options for obtaining and running Temoa from github. If you want to simply test the model, you can download Temoa from github as a zip file. Navigate to our github page, and click the green 'clone or download' button near the top-right corner. Select 'Download ZIP,' and you can download the entire Temoa 'energysystem' (our main branch) to your local machine. The second option creates a local copy of the source code and input data archived in our GitHub repository. This is a two step process: first install git and then 'clone' the repository. Under Linux, git can be installed through the default package manager. Git for Windows and Mac can be downloaded here. To clone the Temoa repository, navigate to the directory where you want the model to reside and type the following from the prompt:
    $ git clone https://github.com/TemoaProject/temoa/
    Note that cloning the repository will supply the latest version of the code, and allow you to archive changes to the code and data in your own local git repository.

The installation procedures above are meant to be generic and should work across different platforms. Nonetheless, system-specific ambiguities and unexpected conditions inevitably arise. Please use the Temoa forum to ask for help.

Running Temoa

The most basic way to run Temoa is with an input data (DAT) file:

$ python temoa_model/ /path/to/dat/file

This option will simply run the model and output the results to the shell. To make sure the model is functioning correctly, try running with the 'Utopia' dataset:

$ python temoa_model/ /data_files/utopia-15.dat

To run the model with more features, use a configuration ('config') file. An example config file called 'config_sample' resides within the 'temoa_model' folder. The config file allows the user to specify the input / output data files and provides the option to save the lp file, log file, and model output to an Excel file.

$ python temoa_model/ --config=temoa_model/config_sample

For more information, see the Temoa user manual.