Our compartmental model has two compartments:
For the our variables, let
\[ \begin{align*} \frac{dx}{dt} & = I - k_1x, \,\,\, x(0)= x_0 \\ \frac{dy}{dt} & = k_2x - \frac{k_3 y}{y+M}, \,\,\, y(0)= 0 \end{align*} \]
\[ \begin{align*} \frac{dx}{dt} & = I - k_1x, \,\,\, x(0)= x_0 \\ \frac{dy}{dt} & = k_2x - \frac{k_3 y}{y+M}, \,\,\, y(0)= 0 \end{align*} \]
\[ \begin{align*} \frac{dx}{dt} & = I - k_1x, \,\,\, x(0)= x_0 \\ \frac{dy}{dt} & = k_2x - \frac{k_3 y}{y+M}, \,\,\, y(0)= 0 \end{align*} \]
\[ \frac{dy}{dt} \sim \frac{- k_3 y}{y+M} \propto \left\{ \begin{align*} -k_3, &\,\,\, y \, \gg M \\ - \frac{k_3}{M}y, &\,\,\, y \, \ll M \end{align*} \right. \]
\[ \begin{align*} \frac{dx}{dt} & = I - k_1x, \,\,\, x(0)= x_0 \\ \frac{dy}{dt} & = k_2x - \frac{k_3 y}{y+M}, \,\,\, y(0)= 0 \end{align*} \]
\[ \begin{align*} x_0 = 3x_s & = \frac{3(14g)}{(0.82 L/kg)(68 kg))} = \frac{3(14g)}{(0.82L)(68)(100*10 ml/L)} \\ & = \frac{3(14) g}{(0.82)(68)(10)100 ml} \cong 0.0753 \, \mathrm{BAL} \end{align*} \]
\[ \begin{align*} k_3 & = \frac{8 g/hr}{(0.82 L/kg)(68 kg))} = \frac{8 g/hr}{(0.82L)(68)(100*10 ml/L)} \\ & = \frac{8 g/hr}{(0.82)(68)(10)100 ml} \cong 0.0143 \, \mathrm{BAL/hr} \end{align*} \]
Ch28model11(6,500)
Ch28model11(6,500)
Ch28model11 <- function(T,N) {
#Chapter2.8 Model I; Empty Stomach, three drinks at start.
#Perform Rk4 for alcohol in GI-tract and bloodstream
#T is the time length for [0, T]
#N is the number of time steps
h = T/N #This is the time step size
#System Parameters
t0 <- 0
x0 <- 0.075 #initial value for GI-tract
y0 <- 0 #initial value for bloodstream
k1 <- 6 #k1 value for GI-tract
k2 <- 6 #k2 value for bloodstream
k3 <- 0.014 #k2 value for bloodstream
M <- 0.005 #Modeling constant from reading
I <- 0 #Zero drinks after initial amount
#System of ODEs
f1 <- function(x) {I - k1*x}
f2 <- function(x,y) {k2*x - k3*y/(y + M)}
\[ \begin{align*} \frac{dx}{dt} & = I - k_1x, \,\,\, x(0)= 0 \\ \frac{dy}{dt} & = k_2x - \frac{k_3 y}{y+M}, \,\,\, y(0)= 0 \end{align*} \]
Ch28model12(6,500,3)
Ch28model12(6,500,3)
Ch28model12 <- function(T,N,n) {
#Chapter2.8 Model I: Empty Stomach, continuous drinking.
#Perform Rk4 for alcohol in GI-tract and bloodstream
#T is the time length for [0, T]
#N is the number of time steps
#n is the number of drinks per hour
h = T/N #This is the time step size
#System Parameters
t0 <- 0
x0 <- 0 #initial value for GI-tract
y0 <- 0 #initial value for bloodstream
k1 <- 6 #k1 value for GI-tract
k2 <- 6 #k2 value for bloodstream
k3 <- 0.014 #k2 value for bloodstream
M <- 0.005 #Modeling constant from reading
I <- 0.025*n #BAL input from drinking continuously
#System of ODEs
f1 <- function(x) {I - k1*x}
f2 <- function(x,y) {k2*x - k3*y/(y + M)}
\[ \begin{align*} \frac{dx}{dt} & = I - k_1x, \,\,\, x(0)= x_0 \\ \frac{dy}{dt} & = k_2x - \frac{k_3 y}{y+M}, \,\,\, y(0)= 0 \end{align*} \]
Ch28model21(6,500)
Ch28model21(6,500)
Ch28model21 <- function(T,N) {
#Chapter2.8 Model II: Full Stomach, three drinks at start.
#Perform Rk4 for alcohol in GI-tract and bloodstream
#T is the time length for [0, T]
#N is the number of time steps
h = T/N #This is the time step size
#System Parameters
t0 <- 0
x0 <- 0.075 #initial value for GI-tract
y0 <- 0 #initial value for bloodstream
k1 <- 6 #k1 value for GI-tract
k2 <- k1/2 #k2 value for bloodstream
k3 <- 0.014 #k2 value for bloodstream
M <- 0.005 #Modeling constant from reading
I <- 0 #Zero drinks after initial amount
#System of ODEs
f1 <- function(x) {I - k1*x}
f2 <- function(x,y) {k2*x - k3*y/(y + M)}
\[ \begin{align*} \frac{dx}{dt} & = I - k_1x, \,\,\, x(0)= 0 \\ \frac{dy}{dt} & = k_2x - \frac{k_3 y}{y+M}, \,\,\, y(0)= 0 \end{align*} \]
Ch28model22(6,500,3)
Ch28model12(6,500,3)
Ch28model22 <- function(T,N,n) {
#Chapter2.8 Model II: Full Stomach, continuous drinking.
#Perform Rk4 for alcohol in GI-tract and bloodstream
#T is the time length for [0, T]
#N is the number of time steps
#n is the number of drinks per hour
h = T/N #This is the time step size
#System Parameters
t0 <- 0
x0 <- 0 #initial value for GI-tract
y0 <- 0 #initial value for bloodstream
k1 <- 6 #k1 value for GI-tract
k2 <- k1/2 #k2 value for bloodstream
k3 <- 0.014 #k2 value for bloodstream
M <- 0.005 #Modeling constant from reading
I <- 0.025*n #BAL input from drinking continuously
#System of ODEs
f1 <- function(x) {I - k1*x}
f2 <- function(x,y) {k2*x - k3*y/(y + M)}