\[ \small{ \begin{Bmatrix} \mathrm{rate~heat~generated~by} \\ \mathrm{reaction~per~unit~volume} \end{Bmatrix} \\ = \rho Q A e^{-E/(RT)} } \]
\( \rho \) = reacting substance density (moles/volume)
\( Q \) = heat of reaction (J/mole)
\( A \) = reaction parameter (1/sec)
\( E \) = activation energy
\( R = 8.314 \) J/(K mole)
\( T = U + 273.15 \) K
\[ \small{ \begin{Bmatrix} \mathrm{rate~of} \\ \mathrm{heat~loss} \end{Bmatrix} = hS(T - T_a) } \]
\( h \) = Newton cooling coefficient J/(\( m^2 \) sec K)
\( S \) = surface area \( m^2 \)
\( T \) = temperature of body K
\( T_a \) = ambient temp K
\[ \begin{aligned} \small{ \begin{Bmatrix} \mathrm{rate~of~change~of} \\ \mathrm{heat~content} \end{Bmatrix} } &= \small{ \begin{Bmatrix} \mathrm{rate~heat~generated} \\ \mathrm{by~reaction} \end{Bmatrix} -\begin{Bmatrix} \mathrm{rate~heat~lost} \\ \mathrm{to~surroundings} \end{Bmatrix}} \\ \\ \rho V c\frac{dT}{dt} &= \rho V Q A e^{-E/(RT)} - hS(T - T_a) \end{aligned} \]
\[ \rho V c\frac{dT}{dt} = \rho V Q A e^{-E/(RT)} - hS(T - T_a) \]
\[ \begin{aligned} \left[\rho V \right] &= \left(\frac{\mathrm{moles}}{V}\right)V = \mathrm{moles} \\ [c] &= \frac{J}{kg~K} \end{aligned} \]
\[ \rho V c\frac{dT}{dt} = \rho V Q A e^{-E/(RT)} - hS(T - T_a) \]
\[ \sigma \frac{d \theta}{dt} = \lambda e^{-1/\theta} - (\theta - \theta_a) \]
\[ \theta = \frac{RT}{E}, ~ \theta_a = \frac{RT_a}{E}, ~ \lambda = \frac{\rho A V Q R}{h S E}, ~\sigma = \frac{\rho V c}{h S} \]
\[ \begin{aligned} \theta = \frac{RT}{E} &\Rightarrow T = \frac{E}{R}\theta \\ & \Rightarrow \frac{dT}{dt} = \frac{E}{R}\frac{d\theta}{dt} \\ &\Rightarrow \rho V Q A e^{-E/(RT)} = \rho V Q A e^{-1/\theta} \\ &\Rightarrow hS(T - T_a) = hS(E/R)(\theta - \theta_a) \\ \rho V c T'(t) &= \rho V Q A e^{-E/(RT)} - hS(T - T_a) \\ \frac{\rho V c E}{hSR}\frac{d\theta}{dt} &= \frac{\rho V Q A }{hS} e^{1/\theta} - (E/R)(\theta - \theta_a) \\ \sigma \theta'(t) &= \lambda e^{-1/\theta} - (\theta - \theta_a); ~\sigma = \frac{\rho V c}{h S},~ \lambda = \frac{\rho A V Q R}{h S E} \end{aligned} \]
Ch104Ex1 <- function(T) {
#T = time length in seconds for [0, T]
N <- 10000 #N is the number of time nodes
h <- T/N #Time step size in seconds
#System Parameters
sigma <- 1.0 #reaction speed
theta_a <- 0.2 #dimensionless ambient temp
L1<-2.84 #reaction efficiency
L2<-2.85 #reaction efficiency
L3<-2.86 #reaction efficiency
#Slope functions for ODEs
f1<-function(x) {L1*exp(-1/x)-(x-theta_a)}
f2<-function(x) {L2*exp(-1/x)-(x-theta_a)}
f3<-function(x) {L3*exp(-1/x)-(x-theta_a)}
Ch104Ex1(300)
Ch104Ex1(300)