Question 7.8: Temperature Dynamics of a House with a Heater The room shown...
Temperature Dynamics of a House with a Heater
The room shown in Figure 7.30 has a heater with heat flow rate input of q_{0}. The thermal capacitances of the heater and the room air are C_{1} and C_{2}, respectively. The thermal resistances of the heater-air interface and the room wall-ambient air interface are R_{1} and R_{2}, respectively. The temperatures of the heater and the room air are T_{1} and T_{2}, respectively. The temperature outside the room is T_{0}, which is assumed to be constant.
a. Derive the differential equations relating the temperatures T_{1}, T_{2}, the input q_{0}, and the outside temperature T_{0}.
b. Using the differential equations obtained in Part (a), determine the state-space form of the system. Assume the temperatures T_{1} and T_{2} as the outputs.

Learn more on how we answer questions.
a. Applying the law of conservation of energy to the heater, we have
\frac{\mathrm{d} U}{\mathrm{~d} t}=q_{\mathrm{hi}}-q_{\mathrm{h} o^{\prime}}
where
\begin{aligned} \frac{\mathrm{d} U}{\mathrm{~d} t} & =C_{1} \frac{\mathrm{d} T_{1}}{\mathrm{~d} t}, \\ q_{\mathrm{hi}} & =q_{0}, \\ q_{\mathrm{ho}} & =\frac{T_{1}-T_{2}}{R_{1}} . \end{aligned}
Substituting these expressions gives
C_{1} \frac{\mathrm{d} T_{1}}{\mathrm{~d} t}=q_{0}-\frac{T_{1}-T_{2}}{R_{1}},
which can be rearranged into
C_{1} \frac{\mathrm{d} T_{1}}{\mathrm{~d} t}+\frac{1}{R_{1}} T_{1}-\frac{1}{R_{1}} T_{2}=q_{0}.
Applying the law of conservation of energy to the room air, we have
\frac{\mathrm{d} U}{\mathrm{~d} t}=q_{\mathrm{hi}}-q_{\mathrm{ho^{\prime}}}
where
\begin{aligned} \frac{\mathrm{d} U}{\mathrm{~d} t} & =C_{2} \frac{\mathrm{d} T_{2}}{\mathrm{~d} t}, \\ q_{\mathrm{hi}} & =\frac{T_{1}-T_{2}}{R_{1}}, \\ q_{\mathrm{ho}} & =\frac{T_{2}-T_{0}}{R_{2}} . \end{aligned}
Substituting these expressions gives
C_{2} \frac{\mathrm{d} T_{2}}{\mathrm{~d} t}=\frac{T_{1}-T_{2}}{R_{1}}-\frac{T_{2}-T_{0}}{R_{2}},
which can be rearranged into
C_{2} \frac{\mathrm{d} T_{2}}{\mathrm{~d} t}-\frac{1}{R_{1}} T_{1}+\left(\frac{1}{R_{1}}+\frac{1}{R_{2}}\right) T_{2}=\frac{1}{R_{2}} T_{0} .
The system of differential equations can be written in second-order matrix form as
\left[\begin{array}{cc} C_{1} & 0 \\ 0 & C_{2} \end{array}\right]\left[\begin{array}{c} \frac{\mathrm{d} T_{1}}{\mathrm{~d} t} \\ \frac{\mathrm{d} T_{2}}{\mathrm{~d} t} \end{array}\right\}+\left[\begin{array}{cc} \frac{1}{R_{1}} & -\frac{1}{R_{1}} \\ -\frac{1}{R_{1}} & \left(\frac{1}{R_{1}}+\frac{1}{R_{2}}\right) \end{array}\right]\left\{\begin{array}{c} T_{1} \\ T_{2} \end{array}\right\}=\left\{\begin{array}{c} q_{0} \\ \frac{1}{R_{2}} T_{0} \end{array}\right\} .
b. To represent a thermal system in the state-space form, the temperature of each thermal capacitance is often chosen as a state variable. As specified, the state, the input, and the output are
\mathbf{x}=\left\{\begin{array}{l} x_{1} \\ x_{2} \end{array}\right\}=\left\{\begin{array}{l} T_{1} \\ T_{2} \end{array}\right\}, \quad \mathbf{u}=\left\{\begin{array}{l} q_{0} \\ T_{0} \end{array}\right\}, \quad \mathbf{y}=\left\{\begin{array}{l} T_{1} \\ T_{2} \end{array}\right\} .
The state-variable equations are
\begin{aligned} & \dot{x}_{1}=\frac{\mathrm{d} T_{1}}{\mathrm{~d} t}=-\frac{1}{R_{1} C_{1}} T_{1}+\frac{1}{R_{1} C_{1}} T_{2}+\frac{1}{C_{1}} q_{0} \\ & \dot{x}_{2}=\frac{\mathrm{d} T_{2}}{\mathrm{~d} t}=\frac{1}{R_{1} C_{2}} T_{1}-\left(\frac{1}{R_{1} C_{2}}+\frac{1}{R_{2} C_{2}}\right) T_{2}+\frac{1}{R_{2} C_{2}} T_{0}, \end{aligned}
or in matrix form
\left\{\begin{array}{l} \dot{x}_{1} \\ \dot{x}_{2} \end{array}\right\}=\left[\begin{array}{cc} -\frac{1}{R_{1} C_{1}} & \frac{1}{R_{1} C_{1}} \\ \frac{1}{R_{1} C_{2}} & -\left(\frac{1}{R_{1} C_{2}}+\frac{1}{R_{2} C_{2}}\right) \end{array}\right]\left\{\begin{array}{l} x_{1} \\ x_{2} \end{array}\right\}+\left[\begin{array}{cc} \frac{1}{C_{1}} & 0 \\ 0 & \frac{1}{R_{2} C_{2}} \end{array}\right]\left\{\begin{array}{l} u_{1} \\ u_{2} \end{array}\right\} .
The output equation is
\left\{\begin{array}{l} y_{1} \\ y_{2} \end{array}\right\}=\left[\begin{array}{ll} 1 & 0 \\ 0 & 1 \end{array}\right]\left\{\begin{array}{l} x_{1} \\ x_{2} \end{array}\right\}+\left[\begin{array}{ll} 0 & 0 \\ 0 & 0 \end{array}\right]\left\{\begin{array}{l} u_{1} \\ u_{2} \end{array}\right\} .