Truong X. Nghiem

MLE+: a Matlab-EnergyPlus Co-simulation Interface

© 2010-2013 by Truong X. Nghiem.

This page is about the legacy version of MLE+. Current development of MLE+ is hosted by the Real-time and Embedded Systems Laboratory (mLab) at the University of Pennsylvania, at http://mlab.seas.upenn.edu/mlep.

Contents

MLE+ is a Matlab toolbox for co-simulation with the whole-building energy simulator EnergyPlus. It is designed for engineers and researchers who are familiar with Matlab and Simulink and want to use these software tools in building energy simulation. MLE+ is particularly useful for:

  • Controller design: the energy simulation is carried out by EnergyPlus while the controller is designed and implemented in Matlab or Simulink.

  • Simulation and data collection: a large number of simulations, with different scenarios, can be carried out and their data is collected, stored and processed in Matlab. The data can then be used for various purposes, e.g. for learning a model of the building system.

  • Simulation-based optimization: a non-linear optimizer, e.g. one in the Matlab's Global Optimization Toolbox, can be used to find optimal parameters or control sequences of the building system, by considering the building as a black-box whose execution is performed by simulations by EnergyPlus.

MLE+ toolbox provides a set of Matlab functions and classes, as well as a Simulink library, for performing co-simulation with EnergyPlus.

Currently, EnergyPlus versions 6.0 and 7.0 are supported.

Comparison with BCVTB

BCVTB (Building Controls Virtual Test Bed) is a software environment for coupling different simulation programs for distributed simulation. It is based on the Ptolemy II software environment and is developed at the Lawrence Berkeley National Laboratory.

The co-simulation feature in EnergyPlus was originally developed for BCVTB, however the communication protocol is open and can be used by any program to perform co-simulation with EnergyPlus. MLE+ is an example of such programs.

Although Matlab/Simulink can be coupled with EnergyPlus via BCVTB, its full functionality cannot be used because it is only called by BCVTB as a client. For example, interactive execution and debugging Matlab code are not possible. In fact, if the Matlab code or the Simulink model has an error, it is much more difficult to find and fix it with BCVTB than with MLE+ (which runs in the standard Matlab environment). Furthermore, for users who mostly work with Matlab/Simulink and have never used Ptolemy, learning a new environment as Ptolemy is time-consuming and might not be worthwhile.

Advantages of BCVTB over MLE+ include:

  • It is always up-to-date with the co-simulation feature in EnergyPlus.

  • It can be used to couple other programs besides EnergyPlus and Matlab/Simulink, such as Modelica and Radiance. However, in the future, MLE+ will incorporate interfaces to these programs as well.

  • It is free, open-source and runs on Java. Note that MLE+ is also free and open-source, but it requires Matlab/Simulink which are commercial.

Advantages of MLE+ over BCVTB include:

  • It takes full advantage of the Matlab/Simulink environment, including interactive simulation, code debugging, low-level co-simulation API (Application Programming Interface), code generation, and all available toolboxes. In other words, it integrates better with the Matlab/Simulink environment.

  • It is easier to extend MLE+, using Matlab programming, for specialized applications and functions. An example is large-scale optimization of building's design parameters using parallel simulations (with Matlab's Parallel Computing Toolbox and Distributed Computing Server). Another example is a GUI for rapid development of building controllers, be it a simple PID controller or a complex Model Predictive Controller.

  • It is familiar to users who mainly use Matlab/Simulink, such as control engineers.

Developers

MLE+ is developed by Truong X. Nghiem.

Screenshots

Below are several screenshots of MLE+ 1.0.

A Simulink model with MLE+ block simulates a building and a controller which computes the zone temperature set-points.

MLE+ in Simulink

A plot of results of the same system simulated by plain Matlab code using MLE+ functions and class.

MLE+ in Matlab code

Use cases

I plan to publish a list of real use cases of MLE+ on this website. If you have successfully used MLE+ in your research or application, and you want to share your story, please email me.

Change History

  • 2012/04/23: MLE+ development was split into 2 branches: MLE+-legacy (the old toolbox for co-simulation with EnergyPlus) and MLE+ (new toolbox with more functionalities). MLE+ now supports EnergyPlus 7.0.0. Also the development was moved from github to bitbucket due to a problem with the github system.

  • 2012/01/12: website is updated; MLE+ development is hosted on github (removed); (partially) fixed an error of MLE+ running on Windows.

  • 2011/02/01: MLE+ 1.0 r16 is released; fixed a problem with the dimension of input ports of the E+ Simulink block.

  • 2010/11/24: MLE+ 1.0 is released.

Download

The development of MLE+ is hosted on bitbucket.

  • Browse the source code of the toolbox.

  • Download an archive file of the source code of the toolbox.

  • Occasionally, official release of the toolbox may be available on this site. For now, there is no official release.

Documentation and Support

Citing MLE+

Truong X. Nghiem, “MLE+: a Matlab-EnergyPlus Co-simulation Interface.” URL: http://www.seas.upenn.edu/~nghiem/mleplus.html.

BibTeX code

@MISC{mleplus,
author = {Truong X. Nghiem},
title = {{MLE+}: a {Matlab}-{EnergyPlus} Co-simulation Interface},
howpublished = {\url{http://www.seas.upenn.edu/~nghiem/mleplus.html}}
}

License

MLE+ is open-source software. You are free to use it however you like. You may redistribute it. You may modify it to suit your need.

If you redistribute MLE+ or derive your work from MLE+, you should give credit to the authors by including their names and/or a link to the website of MLE+. You are encouraged to share any derivative work.

Disclaimer: MLE+ IS DISTRIBUTED WITHOUT ANY WARRANTY. THE AUTHORS MAKE NO EXPRESS OR IMPLIED WARRANTIES OR CONDITIONS INCLUDING, WITHOUT LIMITATION, THE WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE SOFTWARE. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES CAUSED BY USING THE SOFTWARE.