Metadata-Version: 2.4
Name: constrain
Version: 0.7.0
Summary: ConStrain is a data-driven knowledge-integrated framework that automatically verifies that building system controls function as intended.
License-File: LICENSE.md
Keywords: data,simulation,verification,building,bms,hvac,commissioning
Author: Lei, Xuechen
Author-email: xuechen.lei@pnnl.gov
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: brickschema (==0.7.1)
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: eppy (>=0.5.63,<0.6.0)
Requires-Dist: fuzzywuzzy (>=0.18.0,<0.19.0)
Requires-Dist: jsonschema (>=4.21.1,<5.0.0)
Requires-Dist: matplotlib (>=3.8.2,<4.0.0)
Requires-Dist: numpy
Requires-Dist: pandas (>=2.1.3,<3.0.0)
Requires-Dist: pydash (>=7.0.6,<8.0.0)
Requires-Dist: pyqt6 (>=6.6.1,<7.0.0)
Requires-Dist: python-levenshtein (>=0.27.1,<0.28.0)
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
Requires-Dist: scikit-learn (>=1.3.2,<2.0.0)
Requires-Dist: scipy (>=1.11.4,<2.0.0)
Requires-Dist: seaborn (>=0.13.0,<0.14.0)
Requires-Dist: setuptools (>=69.0.0,<70.0.0)
Requires-Dist: tqdm (>=4.66.1,<5.0.0)
Requires-Dist: uuid (>=1.30,<2.0)
Project-URL: Homepage, https://github.com/pnnl/ConStrain
Project-URL: Repository, https://github.com/pnnl/ConStrain
Description-Content-Type: text/markdown

# <span style="color:orange">_Con_</span>trol <span style="color:orange">_Strain_</span>er (<span style="color:orange">_ConStrain_</span>): A Data-driven Control Verification Framework (formally known as <span style="color:orange">_ANIMATE_</span>)

<!-- # ANIMATE: a dAtadriveN buildIng perforMance verificATion framEwork -->

Unit tests status: ![Tests](https://github.com/pnnl/ConStrain/actions/workflows/unit_tests.yml/badge.svg)

# Background and Motivation

Advances in building control have shown significant potential for improving building energy performance and decarbonization. Studies show that designs utilizing optimized controls that are properly tuned could cut commercial building energy consumption by approximately 29% - equivalent to 4-5 Quads, or 4-5% of the energy consumed in the United States. Driven by the significant control-related energy-saving potential, commercial building energy codes (such as ASHRAE 90.1) have progressed with many control-related addenda. For example, from the publication of 90.1-2004 to 90.1-2016 (four code cycles), 30% of the new requirements are related to building control (with most of them focused on HVAC system control).

However, one of the challenges to realizing those savings is the correct implementation of such advanced control strategies and regularly verifying their actual operational performance. A field study found that only 50% of systems observed have their control system correctly configured to meet the energy codes requirement, and control-related compliance verification is typically not included in the commissioning (Cx) scope. The current control verification is often manually conducted, which is time-consuming, ad-hoc, incomplete, and error-prone.

# What is _ConStrain_?

ConStrain is a data-driven knowledge-integrated framework that automatically verifies that controls function as intended. The figure below shows an overview of ConStrain and how it can be used. ConStrain was born out of the need of automating the verification of time-series data describing the behavior of building components, especially the control functions.

ConStrain is designed around three key features: building control knowledge integration, analytics, and automation. The framework includes three major components: a control verification algorithm library, an automated preparation process and verification case generation, a standardized performance evaluation and reporting process.

While the development of ConStrain was motivated by use cases with building energy modeling (BEM), it is now evolved for more application scenarios towards real building control verification.

![Overview of ConStrain](constrain_overview.png)

# Who shall be interested in this framework?

- Cx agent – reduce effort and cost, while increasing rigor.
- Building operator – implement Continuous Commissioning (CCx) to avoid performance drift.
- Authority having jurisdiction (AHJ) – achieve better compliance rates for control provisions in code.
- Mechanical engineer/energy modeler – ensure that chosen systems and their controls will comply with code.
- Energy code/control guideline developer – identify ambiguity in code languages.
- BEM users and software developer – identify control related issues in simulation engine.

# Current Version of _ConStrain_?

The current version of ConStrain includes the framework implementation, a preliminary development and implementation of the verification library (based on ASHRAE 90.1-2016 control related requirement), and the test cases of verification algorithms using prototype building models. The current list of implemented verification algorithms includes supply air temperature control, economizer high limit, integrated economizer control, zone temperature control (dead band), zone temperature control (setback), hot water temperature reset, chilled water temperature reset, etc.

See the Publications section for more information and example of uses of the framework.

## Get Started

- [General project documentation](https://pnnl.github.io/ConStrain/index.html)
-Jupyter notebook demos are located in the [demo](https://github.com/pnnl/ConStrain/tree/develop/constrain/demo) folder:
  - [TSPR simulation cases](https://github.com/pnnl/ConStrain/tree/develop/constrain/demo/tspr_cases/tspr_cases.ipynb)
  - [Guideline 36 workflow verification](https://github.com/pnnl/ConStrain/blob/develop/constrain/demo/G36_demo/g36_demo_workflow_runner.ipynb)
  - [Brick demo](https://github.com/pnnl/ConStrain/blob/develop/constrain/demo/brick/brick_workflow_demo.ipynb)
- Visit [API documentation page](https://pnnl.github.io/ConStrain/) to learn about how to use the ConStrain API.
- Visit [Guideline 36 Verification Items List](./design/g36_lib_contents.md) to learn more about the ASHRAE Guideline 36 related verification in ConStrain verification library.
- Visit [Local Loop Verification Items List](./design/local_loop_verification_items_list.md) to learn more about local loop performance verification library.
- Visit [Brick Integration Doc](./design/brick_integration_doc.md) to learn more about the beta version of brick schema integration API.

## Publications

- [Chen Y., M. Wetter, X. Lei, J. Lerond, P.K. Anand, Y. Jung, P. Ehrlich, and D.L. Vrabie. 2023. "Control Performance Verification – The Hidden Opportunity of Ensuring High Performance of Building Control System." In Building Simulation 2023 Conference](https://publications.ibpsa.org/conference/paper/?id=bs2023_1660)
- [Lei X., J. Lerond, Y. Jung, and Y. Chen. 2023. "Development of an Application Programming Interface for a Building Systems Control Performance Verification Framework." In 2023 ASHRAE Annual Conference](https://doi.org/10.63044/s23lei50)
- [Chen Y., J. Lerond, X. Lei, and M.I. Rosenberg. 2021. "A Knowledge-based Framework for Building Energy Model Performance Verification." In Building Simulation 2021 Conference](https://publications.ibpsa.org/conference/paper/?id=bs2021_30725)

## Referencing

If you wish to cite ConStrain in academic work please use: Lei, X., Lerond, J., Jung, Y. J., & Chen, Y. (2026). ConStrain (Version 0.7.0) [Computer software]. https://github.com/pnnl/ConStrain

<!-- Pending DOI for new ConStrain -->

