Math notation for heating object An object with mass $m$ and heat capacity $c_{p}$ is exposed to heating $P_{th} $[kW] and thermal losses $\dot q$ [kW/°C]. The energy equation illustrating the process of heating it from $T_{max}$ to $T_{min}$ is, if I'm not mistaken:
$$P_{th} \cdot t = m \cdot c_{p} \cdot (T_{max}-T_{min})+\dot q \cdot \int_{}^{t}  (T(t)-T_{ambient})dt$$
I'm determining the time it takes $(t)$ via the following piece of python code, which I'm trying to explain in the context of a thesis:
T = T_min
t = 0
while T <= T_max:
    t += 1
    T += (P_th - q*(T - T_ambient)) / (m*cp)

Since $t$ is determined by a finite number of discrete steps, the integral notation above would, in my opinion, not be an accurate depiction of this process. I know that iterative processes such as this, are usually denoted by something like: $T_{max}=f^{t}(T_{min})$. Would this be accurate and if yes - how can it be transformed to $t=...$ ?
 A: If $\overset{\centerdot }{\mathop{q}}\,$ is constant, I just write the analytical solution, which have nothing to do with the Python problem. A little bit too long for a simple comment. Hope it can help !
If all is constant, you have the differential equation $m{{c}_{p}}\frac{dT}{dt}+\overset{\centerdot }{\mathop{q}}\,(T-{{T}_{ext}})={{P}_{th}}$ 
I pose $\delta T=T-{{T}_{ext}}$, $\tau =m{{c}_{p}}/\overset{\centerdot }{\mathop{q}}\,$ and $\delta {{T}_{f}}={{P}_{th}}/\overset{\centerdot }{\mathop{q}}\,$ so the equation is simply $\tau \frac{d\delta T}{dt}+\delta T=\delta {{T}_{f}}$
The solution is $\delta T=C{{e}^{-t/\tau }}+\delta {{T}_{f}}$ 
At $t = 0$, we have the initial condition :  $\delta {{T}_{\min }}=C+\delta {{T}_{f}}$ or $C=\delta {{T}_{\min }}-\delta {{T}_{f}}$ so $\delta T=(\delta {{T}_{\min }}-\delta {{T}_{f}}){{e}^{-t/\tau }}+\delta {{T}_{f}}$ 
and finally  $\delta {{T}_{\max }}=(\delta {{T}_{\min }}-\delta {{T}_{f}}){{e}^{-{{t}_{\max }}/\tau }}+\delta {{T}_{f}}$ 
Conclusion : ${{t}_{\max }}=\tau \ln \left( \frac{\delta {{T}_{f}}-\delta {{T}_{\min }}}{\delta {{T}_{f}}-\delta {{T}_{\max }}} \right)$
