I'm trying to code a programme to determine the maximum alcohol content in the blood during an evening of drinking as well as the time until one is sober. I think I got the hours until sober correct. But the alcohol content seem to be too high by a factor of ten but I can't see where i'm failing. Any help is appreciated. See code below.
-The body is assumed to begin burning the alcohol from t0.
-The alcohol consumption is assumed to be evenly distributed.
Code:
Alcohol <- function(m,L5,L40,h) {
Promille <- numeric(h*60)
t <- c(1:(h*60))
d <- 0.789; #Alcohol density
b <- 0.077*m; #Expected blood volume
bm <- b*1.06*1000; #Expected blood mass (in grams)
br <- 0.1*m; #Expected alcohol burn rate (in grams)
gAlc <- (L5*d*0.05+L40*d*0.40)*1000; #Amount of alcohol consumed (in grams)
Hs <- gAlc/br; #Hours from first drink until sober
for (i in 1:(h*60)) {
g <- (gAlc/(h*60))*i; bu <- (br/60)*i
Promille[i] <- ((g - bu)/bm)*1000
}
plot(t,Promille,"l")
Hs
}
Alcohol(92,3,0,4)
-The alcohol consumption is assumed to be evenly distributed.