{ "cells": [ { "cell_type": "markdown", "id": "35a53b91-f1eb-4c06-983f-3aaa32ac5a87", "metadata": { "tags": [] }, "source": [ "# Steady-state and step response\n", "\n", "[](https://mybinder.org/v2/gh/cghiaus/dm4bem_book/HEAD?labpath=%2Ftutorials%2F02_2_2Toy.ipynb)\n", "\n", "[Steady-state](https://en.m.wikipedia.org/wiki/Steady_state) analysis focuses on the behavior of a system after transients have settled, specifically when the system reaches a stable equilibrium at a constant input.\n", "\n", "[Step response](https://en.m.wikipedia.org/wiki/Step_response) analyses system's dynamic response to a sudden change in input (i.e., to a step input). Step response is concerned with transient behavior, such as how the system responds immediately after the input change and how it eventually settles into a new steady-state.\n", "\n", "**Objectives:**\n", "- Find the steady-state values for thermal circuit and state-space.\n", "- Estimate the time step and the settling time from eigenvalue analysis.\n", "- Simulate the step response.\n", "- Compare the steady-state results with step response after settling time.\n", "\n", "\n", "> Figure 1. Thermal circuit for the cubic building." ] }, { "cell_type": "code", "execution_count": 1, "id": "764b77e2-3f93-4484-9842-6b328305d517", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "\n", "import dm4bem" ] }, { "cell_type": "markdown", "id": "55996710-77de-4f3d-a33a-1006e6911424", "metadata": {}, "source": [ "The following assumptions are done:\n", "- The indoor air temperature is controlled or not (i.e., the building is in free running).\n", "- The heat capacity of air and of glass is neglected or not.\n", "- The time step is calculated from the eigenvalues or it is imposed at a value designated as $\\Delta t$." ] }, { "cell_type": "code", "execution_count": 2, "id": "6f842ded-7a14-4a9b-85a2-d4e815262048", "metadata": {}, "outputs": [], "source": [ "controller = False\n", "neglect_air_glass_capacity = False\n", "imposed_time_step = False\n", "Δt = 498 # s, imposed time step" ] }, { "cell_type": "markdown", "id": "adbccd8a-d608-44ff-a796-e26d4432110f", "metadata": {}, "source": [ "The thermal circuit was described in the section on modelling (Figure 1). It is given by a _thermal circuit_ imported from the file [./toy_model/TC.csv](./toy_model/TC.csv). \n", "\n", "A thermal ciruit file contains the incidence matrix $A$, the diagonals of matrices $G$ and $C$, and the vectors $b$, $f$, and $y$ (see example below). If there is no value in a cell, it is considered `0`." ] }, { "cell_type": "code", "execution_count": 3, "id": "68d9fdda-aa62-4e46-9bbb-10cf18766f4d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Matrices and vectors for thermal circuit from Figure 1\n" ] }, { "data": { "text/html": [ "\n", "
\n", " | A | \n", "θ0 | \n", "θ1 | \n", "θ2 | \n", "θ3 | \n", "θ4 | \n", "θ5 | \n", "θ6 | \n", "θ7 | \n", "G | \n", "b | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "q0 | \n", "1 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "1125.000000 | \n", "To | \n", "
1 | \n", "q1 | \n", "-1 | \n", "1.000000 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "630.000000 | \n", "0 | \n", "
2 | \n", "q2 | \n", "0 | \n", "-1.000000 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "630.000000 | \n", "0 | \n", "
3 | \n", "q3 | \n", "0 | \n", "0.000000 | \n", "-1 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "30.375000 | \n", "0 | \n", "
4 | \n", "q4 | \n", "0 | \n", "0.000000 | \n", "0 | \n", "-1 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "30.375000 | \n", "0 | \n", "
5 | \n", "q5 | \n", "0 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "-1 | \n", "1 | \n", "0 | \n", "0 | \n", "44.786824 | \n", "0 | \n", "
6 | \n", "q6 | \n", "0 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "-1 | \n", "0 | \n", "1 | \n", "0 | \n", "360.000000 | \n", "0 | \n", "
7 | \n", "q7 | \n", "0 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "0 | \n", "-1 | \n", "1 | \n", "0 | \n", "72.000000 | \n", "0 | \n", "
8 | \n", "q8 | \n", "0 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "165.789474 | \n", "To | \n", "
9 | \n", "q9 | \n", "0 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "0 | \n", "-1 | \n", "630.000000 | \n", "0 | \n", "
10 | \n", "q10 | \n", "0 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "0 | \n", "9.000000 | \n", "To | \n", "
11 | \n", "q11 | \n", "0 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "0 | \n", "0.000000 | \n", "Ti_sp | \n", "
12 | \n", "C | \n", "0 | \n", "18216000.000000 | \n", "0 | \n", "239580 | \n", "0 | \n", "0 | \n", "32400 | \n", "1.089E+06 | \n", "nan | \n", "nan | \n", "
13 | \n", "f | \n", "Φo | \n", "0.000000 | \n", "0 | \n", "0 | \n", "Φi | \n", "0 | \n", "Qa | \n", "Φa | \n", "nan | \n", "nan | \n", "
14 | \n", "y | \n", "0 | \n", "0.000000 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "0 | \n", "nan | \n", "nan | \n", "