SkillAgentSearch skills...

Dm4bem

Dynamic models for building energy management

Install / Use

/learn @cghiaus/Dm4bem

README

Dynamic Models for Building Energy Management

Binder License: MIT

These tutorials present a complete example of thermal dynamic simulation of a building. For the sake of simplicity, a toy model is used for the building in which 5 identical two-layer walls, a glass wall, air infiltration, and an indoor temperature control system are modelled.

The tutorials go through obtaining weather data from internet, modelling the thermal transfer with thermal networks, transforming the thermal networks into systems of differential algebraic equations and state-space representation, and implementing customized control algorithms into the numerical integration loop.

The advantage of the method, as compared with other existing alternatives, is that the state-space representation is obtained; therefore eigenvalues analysis is achievable.

The disadvantage is that, in the current implementation, application on large models is tedious and prone to errors.

The notebooks can be run interactively on MyBinder.org by clicking on the button Binder.

Note: In the folder M, the repository containes the MATLAB® v. 6 scripts and the PDFs of the tutorials for MATLAB® implementation.

Tutorials

  1. Weather data and solar radiation on a tilted surface.
  2. Thermal circuit and state-space representation for a thermal circuit with capacities in every node: simple wall.
  3. Thermal circuit and state-space representation for a thermal circuit with capacities in some nodes: cubic building.
  4. Thermal circuits assembling.
  5. Switch between models: heating & cooling and free-running.
  6. Control input: heating & cooling and free-running.
  7. Radiation coupled with convection.
  8. Sensible thermal load in steady-state.
  9. Air flow by ventilation.

Annexes

  1. Thermal networks for heat trasfer in buildings

Project sessions

The assignments are written in Jupyter notebooks and posted on Github in the repository indicated in each assignment. Each repository needs to have:

  • README.md file that contains at least the names of the members of the team and a link to mybinder.org.
  • environment.yml file that lists the dependencies required for the project.

The Jupyter notebooks need to contain Markdown cells structured with headings and equations need to be written in LaTeX.

Model

  • Draw the plan of a two-zone building.
  • Formulate the hypothesis for boundary conditions.
  • Chose the types of windows, doors, and walls.
  • Draw the thermal circuit:
    • temperature nodes,
    • flow-rate paths,
    • thermal conductances for conduction, convection, long-wave radiation, advection, and P-controllers,
    • sources of temperature and flow-rate,
  • Number the temperature nodes and the flow-rate branches (starting from 0).
  • Calculate the thermal conductances for conduction, convection, long-wave radiation, and advection.
  • Calculate the thermal capacities.
  • Write down the incidence matrix $A$, the conductance matrix $G$ and the capacity matrix $C$ of the system of Algebraic Differential Equations (DAE).
  • Define the inputs: temperature sources (vector $b$) and flow rate sources (vector $f$).
  • Write in Pyhthon the incidence matrix $A$, the conductance matrix $G$ and the capacity matrix $C$ of the system of Algebraic Differential Equations (DAE).
  • Write in Pyhthon the vectors of pointers to the temperature sources $b$, flow-rate sources $f$, and outputs $y$.
  • Assignment 1: Model

Steady-state

  • Implement in Python the matrices $A$, $G$ and $C$ of the system of Diferential Algebraic Equations (DAE).
  • Give values to inputs (temperature sources, $b$, and flow rate sources $f$).
  • Calculate steady-state response of the system of Diferential Algebraic Equations (DAE).
  • From the systems of Diferential Algebraic Equations (DAE), obtain the matrices $A_s$, $B_s$, $C_s$, and $D_s$ of the state-space representation.
  • Give the values of the input vector $u = [b_T^T, f_Q^T]^T$.
  • Obtain the steady-state response of the state-space representation.
  • Compare the results obtained for the system of Diferential Algebraic Equations (DAE) with the results obtained for the state-space representation.
  • Assignment 2: Steady-state

Simulate step response

  • Determine the time step and the settling time.
  • Give the input vector $u$.
  • Integrate in time the differential equations.
  • Plot the results.
  • Discuss the results.
  • Assignment 3: Simulate step response

Simulate response to weather

  • Define start and end time.
  • Prepare the inputs:
    • read weather data,
    • calculate the solar irradiance on the walls,
    • resample the weather data
    • give the other inputs (e.g., internal gains),
    • give the input vector in time.
  • Define the initial conditions.
  • Integrate in time.
  • Plot the results.
  • Discuss the results.
  • Implement other controllers (dead-band, model predictive control).
  • Discuss the results.
  • Assignment 4: Simulate response to weather

Reproducible report

  • Write the report in Jupyter notebooks.
  • Publish the report on GitHub and MyBinder.
  • Assignment 5: Reproducible report

Support

  1. GitHub Docs:
  2. Anaconda cheetsheet
  3. Python
  4. Jupyter notebook cheatsheet
  5. NumPy for MATLAB users
  6. Get started with Binder
  7. Markdown and LaTeX introduction

References

  1. C. Ghiaus (2013). Causality issue in the heat balance method for calculating the design heating and cooling load. Energy 50: 292-301 DOI 10.1016/j.energy.2012.10.024, HAL 03605823

  2. C. Ghiaus, N. Ahmad (2020). Thermal circuits assembling and state-space extraction for modelling heat transfer in buildings, Energy, 195:117019 DOI 10.1016/j.energy.2020.117019, HAL 03600778

  3. C. Ghiaus (2021). Dynamic Models for Energy Control of Smart Homes, in S. Ploix M. Amayri, N. Bouguila (eds.) Towards Energy Smart Homes, Online ISBN: 978-3-030-76477-7, Print ISBN: 978-3-030-76476-0, Springer, pp. 163-198 (ref.) DOI 10.1007/978-3-030-76477-7_5, HAL 03578578

  4. J. Kneifel (2013). Annual Whole Building Energy Simulation of the NIST Net Zero Energy Residential Test Facility Design, NIST Technical Note 1767, DOI 10.6028/NIST.TN.1767

  5. U.S. Department of Energy (2022). EnergyPlus v.22.1.0 Documentation, Engineering Reference (link)

  6. Solar Energy Laboratory, University of Wisconsin-Madison (2009). TRNSYS 17 Volume 4 Mathematical Reference (link)

  7. NIST (2008) Guide for the Use of the International System of Units (SI) (link)

  8. BIPM (2008) Evaluation of measurement data — Guide to the expression of uncertainty in measurement (link)

  9. BIPM (2019) The International System of Units (SI), 9th edition (link)

Exam questions

Thermal comfort

  1. Sensible and latent heat.
  2. Variation of internal (stored energy).
  3. Average heat rate generated by human metabolisme.
  4. Environmental factors that influence the thermal comfort.
  5. Relationship between Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD).
  6. Mean radiant temperature and operative temperature.

Modeling

  1. Definition of science.
  2. Shortly describe the four paradigms of science (empirical, theoretical, computational and data science).
  3. Reproducibility crises: definition and how to overcome it.
  4. Describe the repro
View on GitHub
GitHub Stars28
CategoryDevelopment
Updated3d ago
Forks14

Languages

Jupyter Notebook

Security Score

95/100

Audited on Apr 1, 2026

No findings