Download
The TEMOA energy system formulation is written in Pyomo, which is in turn written in Python. For most users, the biggest implication of this is that it will run anywhere. TEMOA will run on Windows, Linux, Mac, or any operating system that supports Python. At the moment, since we haven’t yet created a single install package, it also means there is an initial hurdle for many to overcome. We explain the hurdle below, so hopefully you can get up and running. As always, we encourage you to contact us with any questions or problems.
Parts of TEMOA
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 (Jun, 2010), TEMOA requires at least v2.6. You may (not) have success with an earlier version. Unless you run Windows, it is likely already installed on your computer.
- COOPR – an optimization suite of tools developed by Sandia National Labs. TEMOA heavily uses the Pyomo subproject. If you are aware of AMPL, Pyomo tackles roughly the same problem area, but with a different syntax. Coopr is open source, and is a free download from Sandia.
- Solver – Any optimization solver. Pyomo is a description language for optimization models, but it is not a solver. It can, however, “speak the language” of a plethora of solvers. This means that a model that uses Pyomo can run on a university machine with a CPlex or Gurobi license, while a researcher works on the same model at home with the Free GLPK solver. No more is the model limited by a single solver.As GLPK is free, it offers the lowest barrier to entry of the solvers available, and consequently is what we explain how to install here. However, be warned that it is also the weakest in that it can only solve linear programming models (LPs) and is a good deal less efficient (slower) than almost every other solver on the market.
- TEMOA model – we are in early development stages of the project, but we have a working a prototype of the U.S. Electric Energy Sector. (Interested developers: look to the section “Development Version” in this page for the svn 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 pyomo elc.py elc.dat
Installation for Windows Users
As outlined above, there are four parts to getting up and running with the TEMOA model.
- Installing Python Download the “Python 2.6 Windows installer” package from the Python Download page. (Note that the release series is 2.6 and the bug-fix release is denoted by an additional decimal point. So 2.6.3 and 2.6.5 are both the same version of Python, but 2.6.5 contains more recent bug fixes.) There are no special caveats, just double-click the install package, and click next through the various wizard pages.
- Install SetupTools Though not strictly necessary, installing PyPi’s SetupTools makes the following step much easier.Download and install the
setuptoolsinstaller that matches the version of Python that you installed in the previous step. - Installing COOPR Now that you have Python and PyPi, the easiest method to install Coopr is to use PyPi’s Coopr
easy_installmethod. Open a terminal by going to Start→Run, and typing incmdin the window. You should be presented with a black window with a prompt that looks likeC:\Documents and Settings\your_user_name>. Typecd Desktopand hit enter. The prompt should change toC:\Documents and Settings\your_user_name\Desktop>. Now type\Python2.6\Scripts\easy_install.exe Cooprand hit enter. This will ask the PyPi website how to install Coopr, and then automatically do just that. When the script finishes, and you’re returned to a prompt, Coopr will be installed. - Installing GPLK GLPK is a free optimization solver from the fine GNU community. Download the GLPK for Windows setup program and run through its wizard installation.Note: Though Coopr can interface with a plethora of solvers, we discuss only GLPK because it is both philosophically free (open source), and also gratis. You are welcome to install other solvers but they are outside the scope of this introduction and download page.
- Installing TEMOA Finally, download the TEMOA model [zip]. Unzip it to the folder of your choice.
- Testing the installation Navigate to Start→Programs→Python→IDLE (Python GUI). At the prompt (
>>>) typefrom coopr.pyomo import *If you get back an empty prompt on the very next line, then you have successfully installed Coopr.
Installing in Linux
Ubuntu
- Install Python, GLPK Open up a terminal via Applications→Accessories→Terminal. At the prompt, type
sudo apt-get install glpk-utils python subversionand hit enter. Type your password, and in a moment, you’ll have Pythonm, GLPK, and Subversion installed.For the curious, subversion is a very powerful “Source Code Management” (SCM) tool, but we only use it here in the next step to install Coopr. - Install COOPR The easiest way to install Coopr is with Sandia National Laboratories’ install script. Download it, and then, back at the prompt, type
python coopr_install. The script is noisy, but in about 5 minutes, it should finish.When it finishes, add the Coopr binaries to your path so you can run it from the commandline:$ echo "export PATH=\$PATH:$(pwd)/coopr/bin" >> ~/.bash_profile
Logout of the terminal by typing
exitat the prompt. This is important to update the PATH variable you just set. - Installing TEMOA Finally, download TEMOA with subversion:
svn co http://svn.temoaproject.org/temoa/trunk/ temoa - Test the installation To test the installation, reopen a terminal, and navigate to the elc folder you just unzipped. From there, type
pyomo elc.py elc.datand hit enter. If you see output like below, then you have successfully installed the TEMOA project.
Development Version
If you would like the developer version, you can check it out from the source repository
svn checkout http://svn.temoaproject.org/temoa/trunk temoa
Successful Installation
Here is sample output from an initial run of the TEMOA model:
$ cd elc
$ pyomo elc.py elc.dat
# ==========================================================
# = Solver Results =
# ==========================================================
# ----------------------------------------------------------
# Problem Information
# ----------------------------------------------------------
Problem:
- Lower bound: 2740078.006
Upper bound: inf
Number of objectives: 1
Number of constraints: 133
Number of variables: 210
Number of nonzeros: 606
Sense: minimize
# ----------------------------------------------------------
# Solver Information
# ----------------------------------------------------------
Solver:
- Status: ok
Termination condition: unknown
Error rc: 0
# ----------------------------------------------------------
# Solution Information
# ----------------------------------------------------------
Solution:
- number of solutions: 1
number of solutions displayed: 1
- Gap: 0.0
Status: optimal
Objective:
f:
Id: 0
Value: 2740078.006
Variable:
xc[gt_p,2000]:
Id: 0
Value: 307.787
xc[gt_p,2001]:
Id: 1
Value: 328.306
xc[gt_p,2002]:
Id: 2
Value: 348.825
xc[gt_p,2003]:
Id: 3
Value: 369.344
xc[gt_p,2004]:
Id: 4
Value: 389.864
xc[gt_p,2005]:
Id: 5
Value: 410.383
xc[gt_p,2006]:
Id: 6
Value: 430.902
xc[gt_p,2007]:
Id: 7
Value: 451.421
xc[gt_p,2008]:
Id: 8
Value: 471.94
xc[gt_p,2009]:
Id: 9
Value: 492.459
xc[gt_p,2010]:
Id: 10
Value: 512.978
xc[hydro_s,2000]:
Id: 66
Value: 2
xc[hydro_s,2001]:
Id: 67
Value: 2
xc[hydro_s,2002]:
Id: 68
Value: 2
xc[hydro_s,2003]:
Id: 69
Value: 2
xc[hydro_s,2004]:
Id: 70
Value: 2
xc[hydro_s,2005]:
Id: 71
Value: 2
xc[hydro_s,2006]:
Id: 72
Value: 2
xc[hydro_s,2007]:
Id: 73
Value: 2
xc[hydro_s,2008]:
Id: 74
Value: 2
xc[hydro_s,2009]:
Id: 75
Value: 2
xc[hydro_s,2010]:
Id: 76
Value: 2
xc[nuclear,2008]:
Id: 85
Value: 239.996
xc[nuclear,2009]:
Id: 86
Value: 298.211
xc[nuclear,2010]:
Id: 87
Value: 299.263
xc[coal,2000]:
Id: 110
Value: 310.526
xc[coal,2001]:
Id: 111
Value: 311.579
xc[coal,2002]:
Id: 112
Value: 312.632
xc[coal,2003]:
Id: 113
Value: 313.684
xc[coal,2004]:
Id: 114
Value: 314.737
xc[coal,2005]:
Id: 115
Value: 315.789
xc[coal,2006]:
Id: 116
Value: 316.842
xc[coal,2007]:
Id: 117
Value: 317.895
xc[coal,2008]:
Id: 118
Value: 57.162
xc[wind_ons,2009]:
Id: 152
Value: 170.246
xc[wind_ons,2010]:
Id: 153
Value: 749.001
xc[gtcc_s,2000]:
Id: 165
Value: 260.826
xc[gtcc_s,2001]:
Id: 166
Value: 262.368
xc[gtcc_s,2002]:
Id: 167
Value: 263.91
xc[gtcc_s,2003]:
Id: 168
Value: 265.452
xc[gtcc_s,2004]:
Id: 169
Value: 266.995
xc[gtcc_s,2005]:
Id: 170
Value: 268.537
xc[gtcc_s,2006]:
Id: 171
Value: 270.079
xc[gtcc_s,2007]:
Id: 172
Value: 271.622
xc[gtcc_s,2008]:
Id: 173
Value: 273.164
xc[gtcc_s,2009]:
Id: 174
Value: 211.984
xc[gtcc_s,2010]:
Id: 175
Value: 0.300787
xc[geo,2008]:
Id: 206
Value: 23
xc[geo,2009]:
Id: 207
Value: 23
xc[geo,2010]:
Id: 208
Value: 23
$
The TEMOA Project