Differential Equation to Model Temperature of Water

Question

The water in a hot-water tank cools at a rate which is proportional to $T − T_0$, where $T$ is the temperature of the water in degrees celcius at time $t$ minutes and $T_0$ is the temperature of the surrounding air in degrees celcius. When $T = 60$, the water is cooling at $1$ celcius per minute. When switched on, the heater supplies sufficient heat to raise the water temperature by $2$ degrees celcius each minute (neglecting heat loss by cooling). If $T = 20$ when the heater is switched on and $T_0$ = 20. Find the differential equation $\frac{dT}{dt}$ (Where both heating and cooling are taking place).

So the temperature leaving the water is leaving at a rate of $\frac{dT_{out}}{dt}=k(T-T_0)$ for some constant $k$. We can find $k$ by letting $T=60$,$T_0=20$ and $\frac{dT_{out}}{dt}=-1$. I assumed here that the air temperature is staying constant at $20$ as I'm thinking that is what the last scentence of the question implied but it is hard to tell. From this I found that $\frac{dT_{out}}{dt}=\frac{20-T}{40}$

It was given that $\frac{dT_{in}}{dt}=2$ so the overall temperature must be: $$\frac{dT}{dt}=\frac{dT_{in}}{dt}-\frac{dT_{out}}{dt}$$ $$\frac{dT}{dt}=\frac{60+T}{40}$$

However, the answer should be $\frac{dT}{dt}=\frac{100-T}{40}$. Please let me know where I went wrong. Thanks.


Solution 1:

You're basically there, you just have a sign error. You've already accounted for the fact that $\frac{dT_{out}}{dt}$ has a cooling effect – it's negative for $T>20$. So $$ \frac{dT}{dt} = \frac{dT_{in}}{dt} + \frac{dT_{out}}{dt}, $$ not $-$. That gives you the right answer.