# Find ordinary differential equation which discribes the situation of heating up a building

First of all I would like to emphesize that I am not a physicist, our professor gave us this exercise to train our ability of making differential equations.

Since it is related to physics only, I have few questions.

Let $t$ be time, $T(t)$ - temperature inside the building at time $t$, $T_1(t)$ - temperature outside. Speed of heat loss from the building is given by $k_1(T_1(t)-T(t))$ in $[\frac{J}{sec}]$, where $k_1 > 0$ is constant. Speed of heat transfer into building (central heating) is given by $q + k_2(T_0-T(t))$, where $q,k_2>0$ are constants. $T_0$ is fixed temperature (intepretation: $q$ is a speed of heat transfer into the building, such that for fixed outside temperature, the temperature inside remains constant and equal to $T_0$). Let $c$ be heat capacity of the building. Find the differential equation which describes relation between temperature $T$ and time $t$.

Hint: Due to conservation of energy, amount of heat transfered into the building by central heating minus heat loss, between time $t$ and $t+\Delta t$ is given by $c \cdot (T(t+\Delta t) - T(t))$

Since I am not a physicist, I was thinking like this: Given were two rates of change energy in time, firstly the speed of heat loss, secondly the speed of heating up, both in $energy/time$. The total heat transfer in time interval $\Delta t$, for me, will be total speed of heat transfer (given - lost) times time interval $\Delta t$ (Is it correct?).

Then I thought it would be ok to compare $c \cdot (T(t+\Delta t) - T(t))$ with $[k_1(T_1(t)-T(t))+q + k_2(T_0-T(t))]\cdot \Delta t$ . Then, as a mathematician I would like to divide both sides by $\Delta t$ and just let it converge to zero. Is it even close?

Another question I have is about $T_1(t)$ temperature outside. In the heat loss rate it is given by function of time, but in the heat transfer into the building it is said (interpretation given) that we consider fixed outside temperature. How we relate these two?

Moreover, what physics law describes such situation? I bet that given exercise is just one case, so how can we generalize relationship between the speed of temperature change and heat transfer?