What did the finger say to the thumb?
I'm in glove with you.
Develop a general IVP-based model for the amount of radioactive material as a function of time.
From the Balance Law, we know that
\[ \small{ \begin{Bmatrix} \mathrm{net \, rate \, of \, change} \\ \mathrm{of \, a \, substance} \end{Bmatrix} = \begin{Bmatrix} \mathrm{rate~in} \end{Bmatrix} - \begin{Bmatrix} \mathrm{rate~out} \end{Bmatrix} } \]
Word equation:
\[ \small{ \begin{Bmatrix} \mathrm{rate \, of \, change \, of} \\ \mathrm{mass \, of \,radioactive } \\ \mathrm{material \, at \, time \,} t \end{Bmatrix} = - \begin{Bmatrix} \mathrm{rate \, of \, change \, of} \\ \mathrm{mass \, of \,decayed } \\ \mathrm{material \, at \, time \,} t \end{Bmatrix} = - k \begin{Bmatrix} \mathrm{mass \, of \,radioactive } \\ \mathrm{material \, at \, time \,} t \end{Bmatrix} } \]
Using the assumptions, word equation and specification of variables and parameters, our IVP is:
\[ \small{\frac{dN}{dt} = - kN, \,\,\, N(t_0) = n_0 } \]
Solve IVP using separation of variables:
\[ \small{ \begin{aligned} \frac{dN}{dt} &= - kN, \,\,\, N(t_0) = n_0 \\ \int \frac{dN}{N} &= - k \int dt \\ \ln N & = -kt + C \\ N(t) &= e^{-kt+C} = A e^{-kt}, \,\, A = e^C\\ N(t_0) &= Ae^{-kt_0} = n_0 \,\, \Rightarrow \,\, A = n_0 e^{kt_0}\\ N(t) & = \left(n_0 e^{kt_0}\right) e^{-kt} \\ N(t) &= n_0 e^{-k(t-t_0)} \end{aligned} } \]
Note that when \( \small{ t_0 = 0, \, N(t) = n_0 e^{-kt} } \).
From Listing 2.2 in book:
Our IVP is then
\[ \small{\frac{dN}{dt} = - 2N, \,\,\, N(0) = 10^5 } \]
The solution is given by
\[ \small{ N(t) = 10^5 e^{-2t} } \]
\[ \begin{align} \frac{dy}{dt} & = f(t,y), \,\, y(t_0) = y_0 \\ a &= hf(t_i,y_i) \\ b &= hf\left(t_i + 0.5h, y_i + 0.5a \right) \\ c &= hf\left(t_i + 0.5h, y_i + 0.5b \right) \\ d &= hf\left(t_i + h, y_i + c \right) \\ y_{i+1} & = y_i + \frac{1}{6} (a + 2b + 2c + d) \\ t_{i+1} &= t_i + h \end{align} \]
rk4plot <- function(f,x0,y0,h,n){
#f is the slope formula from the differential equation
#x0 is the initial value for x
#y0 is the initial value for y
#h is the step size
#n is the number of steps to take (number of iterations)
#Initialize vectors
x <- rep(0,n+1) #x is vector of n+1 zeros
y <- rep(0,n+1) #y is vector of n+1 zeros
x[1] <- x0
y[1] <- y0
#RK4 Loop
for(i in 1:n) {
a <- h*f(x[i], y[i])
b <- h*f(x[i] + h/2, y[i] + a/2)
c <- h*f(x[i] + h/2, y[i] + b/2)
d <- h*f(x[i] + h, y[i] + c)
y[i+1] <- y[i] + 1/6*(a + 2*b + 2*c + d)
x[i+1] <- x[i] + h
}
#Plot numerical solution
return(plot(x,y,type="l", col="blue"))
f <- function(x,y){-2*y}
rk4plot(f,0,10^5,0.1,40)
Matches Desmos graph of analytic solution, and also Fig 2.3 in textbook.
Recall analytical solution \( \small{N(t) = n_0 e^{-k(t-t_0)} } \)
Let \( t = \tau \) denote the half-life. Then
\[ \small{ \begin{align*} N(t+\tau) & = 0.5N(t) \\ n_0 e^{-k(t+\tau-t_0)} &= 0.5 n_0 e^{-k(t-t_0)} \\ n_0e^{-kt}e^{-k\tau}e^{kt_0} &= 0.5 n_0 e^{-kt}e^{kt_0 } \\ e^{-k\tau} &= 0.5 \\ -k\tau & = \ln\left(2^{-1}\right) = -\ln(2) \\ k & = \frac{\ln(2)}{\tau} \end{align*}} \]
\[ \tau \cong 5568 \, \mathrm{years} \]
\[ \small{ \begin{align*} k & = \frac{\ln(2)}{\tau} \\ & = \frac{\ln(2)}{5568} \\ & \cong 0.0001245 \end{align*}} \]
R to compute \( k \): log(2)/5568
[1] 0.0001244876
log(x) for \( \ln(x) \).log10(x) for \( \log(x) \).log(x,b) for \( \log_b(x) \).
Assume our previous IVP model applies here:
\[ \small{ \frac{dN}{dt} = - kN, \,\,\, N(0) = n_0, \,\,\, t > T } \]
The solution to the IVP for \( \small{^{14}} \) C is
\[ \small{ N(t) = n_0 e^{-kt}, \,\,\, k \cong 0.0001245 } \]
From \( \small{N(t) = n_0 e^{-kt}} \), we substitute \( \small{ t } \) = \( \small{T} \) and use algebra to solve for \( \small{T} \) as follows:
\[ \small{ \begin{aligned} N(T) & = n_0 e^{-kT} \\ e^{-kT} &= \frac{N(T)}{n_0} \\ -kT &= \ln\left(\frac{N(T)}{n_0} \right) \\ T &= -\frac{1}{k} \ln\left(\frac{N(T)}{n_0} \right) \end{aligned} } \]
From \( \small{N(t) = n_0 e^{-kt}} \), we have
\[ \small{N'(t) = -k n_0 e^{-kt} = -k N(t)} \]
From previous slide,
\[ \small{ T = -\frac{1}{k} \ln\left(\frac{N(T)}{n_0} \right) } \]
The values of \( \small{N(T)} \) and \( n_0 \) are not known. However,
\[ \small{ \frac{N'(T)}{N'(0)} = \frac{- k N(T)}{-k N(0)} = \frac{N(T)}{n_0} } \]
Recall that a decay rate of \( ^{14} \) C in charcoal fragments from cave measured 1.69, and for living tissue it was 13.5. Then
\[ \small{ \frac{13.5}{1.69} = \frac{N'(T)}{N'(0)} = \frac{N(T)}{n_0} } \]
Thus
\[ \small{ T = -\frac{1}{k} \ln\left(\frac{N(T)}{n_0} \right) = -\frac{1}{k} \ln\left(\frac{13.5}{1.69}\right) \cong -16,692 } \]
-1/0.0001245*log(13.5/1.69)
[1] -16690.45
\[ \small{ \frac{13.5}{1.69} = \frac{N(T)}{n_0} \,\, \Rightarrow n_0 \cong 0.125 N(T)} \]
1.69/13.5
[1] 0.1251852