Download

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

If you already have Python, Coopr, and a solver, you can just download the Temoa EEO model. If these are not already in place, then the installation is currently in two parts:

  1. Install Python v2.7 and SetupTools.
  2. Run the Temoa Installer script.

Installation instructions for: [Unix] [Mac OS X] [Windows]

We have tested the installation process on multiple machines, but unexpected conditions inevitably come up. Please use the Forum to ask for help.

The rest of this page covers the following topics:

Temoa Software Components

To run Temoa, you will need:

  • Python – a very robust open source scripting language that has become a staple of the scientific community. At this time (Dec 2011), Temoa requires Python v2.7. You may (not) have success with an earlier version. Unless you run Windows, it is likely already installed on your computer.
  • COOPR – Temoa employs COmmon Optimization Python Repository (Coopr), a set of open source optimization libraries developed by Sandia National Laboratory. Temoa makes use of two key components within Coopr: (1) Python Optimization Modeling Objects (Pyomo), an application programming interface (API) that emulates an algebraic modeling language similar to GAMS or AMPL and (2) Python-based Stochastic Programming (PySP), which partially automates the process of stochastic problem formulation. Coopr is open source, and can be freely downloaded from Sandia.
  • Solver – Pyomo is a description language for optimization models, but must be linked to a search algorithm (i.e., solver) to find an optimal solution. The Temoa energy system is (currently) a linear formulation, and therefore requires a solver that works on linear programming problems. If you are using a university machine, both CPLEX and Gurobi can be used for free. In addition, GLPK is freely available to all interested parties. As GLPK is free, it offers the lowest barrier to entry among the available solvers and consequently is what we explain how to install here. However, be warned that it is a great deal less efficient (slower) than CPlex, Gurobi, and other commercial linear solvers.
  • Temoa model – we are in early development stages of the project, but we have a working prototype. Note that all of our code is registered under the GNU Public License, and is therefore publicly available to all interested parties. (Interested developers: look to the section Development Version in this page for the repository checkout command and URL.)

In general, once you’ve downloaded and installed all of the above, working with the model is currently a command line venture. The command to run it is (Unix/Mac) $ coopr_python temoa.py or (Windows) \> python temoa.py

Note that you do not need the install script to actually run Temoa; it is just a convenience script to aid installing the below software. The Temoa model is a single file Python script.

Testing the Installation

Temoa has only a single file, temoa.py, so once the above 3 prerequisite components are installed, you're done. Testing your setup is as simple as running one of the example data sets. Open a new terminal, and navigate to where you placed temoa.py:

$ cd temoa/

   # just see what options the Temoa command line provides
   # Windows users: > python  temoa.py  -h
$ coopr_python  temoa.py  -h
usage: temoa.py [-h] [--graph_format GRAPH_FORMAT] [--show_capacity]
                [--graph_type GRAPH_TYPE] [--use_splines]
                dot_dat [dot_dat ...]

positional arguments:
  dot_dat               AMPL-format data file(s) with which to create a model
                        instance. e.g. "data.dat"

optional arguments:
  -h, --help            show this help message and exit
  --graph_format GRAPH_FORMAT
                        Create a system-wide visual depiction of the model.
                        The available options are the formats available to
                        Graphviz. To get a list of available formats, use the
                        "dot" command: dot -Txxx. [Default: None]
  --show_capacity       Choose whether or not the capacity shows up in the
                        subgraphs. [Default: not shown]
  --graph_type GRAPH_TYPE
                        Choose the type of subgraph depiction desired. The
                        available options are "explicit_vintages" and
                        "separate_vintages". [Default: separate_vintages]
  --use_splines         Choose whether the subgraph edges needs to be straight
                        or curved. [Default: use straight lines, not splines]


   # run Temoa with the supplied Utopia data set and save results to a file:
   # Windows users: > python  temoa.py  utopia.dat  >  utopia.results
$ coopr_python  temoa.py  utopia.dat  >  utopia.results
[    0.08] Reading data files.
[    0.96] Creating Temoa model instance.
[    1.65] Solving.
[    1.77] Formatting results.

  # inspect the results:
  # Windows users: > notepad  utopia.results
$ head  utopia.results
Model name: Temoa Entire Energy System Economic Optimization Model
Objective function value (TotalCost): 35657.0718528
Non-zero variable values:
     0.578040628071     V_Activity(1990,inter,day,E01,1960)
     0.1445872          V_Activity(1990,inter,day,E31,1980)
     0.04337616         V_Activity(1990,inter,day,E31,1990)
     0.0739960119289    V_Activity(1990,inter,day,E51,1980)
     4.752987012987     V_Activity(1990,inter,day,IMPDSL1,1990)
     3.319567099567     V_Activity(1990,inter,day,IMPGSL1,1990)
     1.806376962722     V_Activity(1990,inter,day,IMPHCO1,1990)

Development Version

While we make available snapshots of the Temoa code base that we believe to be stable and correct, you are also welcome to check out the bleeding edge as we develop. To do so, make sure that you have Subversion installed, and then check out our repository with a command like one of these:

   # just what we've deemed stable
$ svn  co  http://svn.temoaproject.org/temoa/trunk  temoa_trunk

   # parallel development branches that we may (not) merge into the mainline trunk.
$ svn  co  http://svn.temoaproject.org/temoa/branches  temoa_branches