Carnegie Mellon University
April 08, 2024

Temoa Modernization

By Jeff Hyink

The Tools for Energy Model Optimization and Analysis, or TEMOA, software has been developed and applied by international energy researchers. The original code is over a decade old and has grown in the interim through the hard work of researchers and graduated students exploring how energy systems will evolve. As the user base and applications have expanded, so have the breadth of questions about energy futures with regard to environmental change and policy decisions. In parallel, the complexity of the energy system and policies governing it have grown.  Along the way, some significant “technical debt” has accumulated related to the model’s internal structure, external dependencies, and ability to tackle these diversifying questions.

In an effort to keep TEMOA central to the Open Energy Outlook (OEO) Initiative’s success, the OEO team initiated a significant code modernization project to produce TEMOA version 3.0. In late 2023, OEO engaged with Western Spark, a Veteran Owned Small Business (VOSB) in an effort to restructure some of the core model components, modernize the codebase, and increase model performance. Several of the core objectives of the modernization effort include:

  • Bring all of the core language and external dependencies up to date. In the course or active research, there is seldom time to make the numerous adjustments needed to pace the evolution of software packages key to model maintenance and performance.  This effort brings all of the supporting python and external library dependencies up to date for increased performance, project security, and to help onboard newer users.
  • Introduce several best practices to the development cycle. The TEMOA codebase had reached a size that necessitated a better, dedicated approach to testing code and event logging needed to ensure performance and facilitate future development.  This update cycle has introduced diverse code testing elements and many modernizations in the codebase to make the model more performant and approachable by developers interested in modifying the core model.
  • Refine the execution of different operating modes within the model. Over the course of its use, there have been several efforts to build novel extensions to the codebase to handle differing types of uncertainty analysis or explore alternative solutions.  Those approaches were somewhat fragile extensions to the main body of the project.  This restructuring effort commonizes much of the execution path and refines some of the internal elements of modules, wholly refactors others, and is intended to provide more rapid and accurate answers to questions on uncertainty.

So, where are we?  We have passed the halfway point and are finishing refinements and testing of TEMOA Version 3. This delivery should be more approachable to new users, performant on large models, and more familiar to developers who wish to dive in on model modifications to answer new questions on evolving perspectives of future energy policies and options.  Testing on the new codebase shows it to be faster by a factor of 10x in many cases for model creation.  Additionally, a rich log output details model execution and highlights possible data errors to guide users in the development of more accurate models.  An energy network evaluation and visualization tool has also been incorporated to help visualize network complexity and possible data errors.

We’re excited to support both experienced researchers working on complex research tasks and newcomers looking to explore the world of energy system modeling and TEMOA’s capabilities. Of course, version 3 maintains OEO’s commitment to open-source data and analytic tools that are fundamental to quality, reproducible, and defensible research products.  The fully updated project and database should be available to all researchers in the spring of 2024.

The author is the owner and principal of Western Spark LLC and is grateful for the opportunity to partner with the OEO team and the Scott Institute to refresh and expand the TEMOA model.  He can be reached by email at info@westernspark.us or through the website https://westernspark.us.