Modeling and simulation

Modeling and simulation#

This chapter presents the modeling and simulation of thermal behavior of a multi-layer wall and of a toy model of a house.

The workflow is:

  • Modelling: obtain the thermal circuit and the state-space representation.

    • Draw the thermal network based on the description of the building and on modelling assumptions.

    • Calculate the parameters of the thermal network: conductances and capacities.

    • Name the temperature and flow-rate sources.

    • Chose the temperature nodes considered as outputs.

    • Write the matrices and vectors (\(A, G, C, b, f, y\)) of the differential algebraic equations.

    • Create the thermal circuit TC data structure and convert it to state-space representation (matrices \(A_s, B_s, C_s, D_s\) and input vector \(u_s\)).


  • Tests in steady-state and step response: test if the model is wrong (falsifiability). If the model fails these tests, then it is wrong; if the model passes these tests, it does not mean it is correct.

    • Compare and interpret the steady-state results obtained for thermal circuit and state-space representation.

    • Perform eigenvalue analysis of the state matrix \(A_s\) of the state-space representation and analyze the maximum time step (for numerical integration with Euler explicit or forward method) and the settling time. If the maximum time step is:

      • too small: set to zero the capacities that, with the related conductance (or resistance), produce the small time step (e.g., air, windows, doors);

      • too large: consider the discretization of elements which have thermal capacities and resistances (e.g., walls, ground).

    • Simulate the time response (by using Euler explicit and implicit method) to different step inputs.

    • Compare the settling time obtained from simulation of step response with that obtained by eigenvalue analysis.

    • Compare the steady-state value obtained from thermal circuit and state-space representation.


  • Inputs: prepare the input data set, i.e., time variation of weather and scheduled sources of temperatures and flow-rates.

    • Read the weather data (outdoor temperature, direct solar irradiance and diffuse solar irradiance).

    • Calculate the solar irradiance on the outdoor and indoor surfaces of the walls.

    • Define the schedules for temperature sources (e.g., indoor temperature set point) and flow rate sources (e.g., internal gains).

    • Obtain the input data set.


  • Simulation: integrate in time the state-space model for the given inputs.

    • Transform the input data set into input vector in time for state-space representation.

    • Set the initial conditions.

    • Integrate the states in time (e.g., by using Euler forward and/or backward methods).

    • Calculate the outputs from the states.

    • Plot the results.