Calculate heat production rates in well-mixed batch fermenter I have a formula to calculate the heat production rates in well-mixed batch fermenter: $$V * c_p * \rho * \frac{dT_j}{dt} = F * c_p * \rho * (T_0 - T_j) + U * A * (T_R - T_j) + r_Q * V$$


*

*U [kJ/($m^2$ * h * K)] = 1000

*$\rho$ [kg/$m^3$] = 1000

*$c_p$ [kJ/(K * kg)] = 4.18

*V [$m^3$] = 10

*A [$m^2$] = 16.7

*$T_R$ [°C] = 30

*$T_0$ [°C] = 10


$T_R$ is the constant temperature in the reactor. The reactor of volume
$V_R$ is cooled by a jacket of area A. The applied cooling water temperature $T_0$ is constant. The cooling water flow F is controlled and measured. Goal is to measure the jacket temperature ($T_j$ =cooler effluent temperature).
I want to resolve this formula for the heat term $r_Q$ like this $$r_Q * V = V * c_p * \rho * \frac{dT_j}{dt} -F * c_p * \rho * (T_0 - T_j) - U * A * (T_R - T_j)$$so I have to resolve the term $\frac{dT_j}{dt}$ but I have no idea how to substitute the values for it.
I have the following values for $T_j$ and time t given:
(EDIT: add given values for F)


*

*t = 0, $T_j$ = 29.98°C, F = 0.0048 [$m^3$ / h]

*t = 5, $T_j$ = 29.94°C, F = 0.0130 [$m^3$ / h]

*t = 10, $T_j$ = 29.83°C, F = 0.0375 [$m^3$ / h]

*t = 20, $T_j$ = 28.72°C, F = 0.2792 [$m^3$ / h]


My question: how do I insert the given values into formula $\frac{dT_j}{dt}$?
Example: At t = 0, I tried $\frac{29.98 - 29.98}{0 - 0}$ = $\frac{0}{0}$.
Similar at t = 5,  $\frac{29.98 - 29.94}{5 - 0}$ etc. This does not seem right.
Can anyone please tell me how to correctly substitute the values in question?
 A: your equation is:
$$a\,{\frac {d}{dt}}T \left( t \right) =-b\,T \left( t \right) +c(r_Q)\tag 1$$
the solution of equation (1) with the initial condition $T(0)=0$ is:
$$T(t)={\frac {c(r_Q)}{b}}-\frac{c(r_Q)}{b}\,e^{-b\,t\,/a}\tag 2$$
where 
$$a=V\,c_{{p}}\rho$$
$$b=F\,c_{{p}}\,\rho+U\,A$$
$$c(r_Q)=F\,c_{{p}}\,\rho\,T_{{0}}+U\,A\,T_{{R}}+r_{{Q}}\,V$$
with the solution (2) and for example if $\quad \frac{dT(t)}{dt}|_{t=0}=c_0\quad $ you can  solve equation (2)  for  $r_Q$ and obtain:
$$r_Q=-{\frac {F\,c_{{p}}\rho\,T_{{0}}+U\,A\,T_{{R}}-c_{{0}}\,a}{V}}
$$
A: This is a good question! You have three options:


*

*The crude option, focus on the middles between your data points. The temperature in those middles can be estimated as $(T(t_1)+T(t_2))/2$ while the derivative can be estimated as $(T(t_2)-T(t_1))/(t_2-t_1)$.

*The fancy option, solve the differential equation—it is not that hard, because if you solve it for the special case when $dT_j/dt=0$ you get a solution $T_j(t)= A$ for some constant $A$, and then if you solve the general case by substitution $S(t) = T_j(t)-A$ which gives just $S'(t) = -\kappa S(t)$, solved for $S(t) = s e^{-\kappa t}.$ The key here is to find a value of $s$ such that the equation best fits the data points. There are technical ways to do this but honestly you could just do it on a spreadsheet: in column A maybe you have time $t$ and in column B you have $T_j(t)$ in say cell C2 you type some guess for $s$, in cell C3 you write the formula =C2 and drag that down to fill the column, now you can change the entire column by changing the value up top. Then in cell D2 you write this formula for what that $s$ predicts for $T_j(t)$, and in E2 you compute the squared error =POWER(D2-B2, 2), fill those columns down, sum the last one, play with $s$ to make the sum of squared errors go down. Then once you have a good $s$, you can solve for everything in terms of your best fit of the model.

*You may also try a model-assisted derivation, but this is more sensitive if the model is not very exact for the measurements.  This is like the above but you skip the formalities of determining $s$ and just determine $A$ and then since $T_j'(t) = S'(t)$ you can just maybe say $T_j'(t) = -\kappa(T_j(t) -A),$ so you only need the measurements of $T$ to get the derivatives. But you should be a little careful with this because if the model does not exactly describe the phenomenon, all of that error has been transferred to $dT/dt$ as there is absolutely no coupling between the values at different times in your calculation, unlike both of the above approaches.
