Simple Half-life calculation
Now you have a Calculus test the next day at 12:00 PM (Noon). You're wondering how much Hydrocodone will be left in your system. How do you figure that out?
Well since you learned a few things from that class, you start by writing a differential. You know that the drug content will be excreted by your system at a first order rate proportional to the amount left in your body, you call that k. Q represents the initial quantity that you ingested, and dQ/dt is your body's drug removal rate for Hydrocodone, t will be time in hours.
dQ/dt = -k * Q (1)
Now you have to solve k. But first in order to do that, solve this differential equation using basic rules of calculus and derivative tables. Q_0 means initial quantity of Q at time 0.
Q = Q_0 * e ^ ( −k * t) (2)
You have the internet at your disposal, you google "hydrocodone half life" and you find out that it's 3.8 hours. Knowing that you write another equation based off of (2). Based off the definition of half life, the quantity Q of Hydrocodone in your body times e to the power of -k times the half life t=3.8 is equal to half of whatever value of Q at that time was. So you write that out like so
(1/2) * Q_0 = Q_0 * e ^ (-k * 3.8) (3)
All you're doing is filling in the variables. Using algebra, you solve for k by moving all the other variables to the other side of the equal sign
k = ( -1 / 3.8 )* ln 0.5 (4)
k ~= 0.182 (5)
Anyone with Algebra level math skills can do this
Line by line Breakdown
Line 1: Import differential equation solver library
Line 6: Declare function that represents differential equation.
Line 7: Use with(as.list(...)) to so function exists in list form, which the programming language prefers.
Line 8. The rate equation, we wrote above. k is the constant, Q is the quantity of Hydrocodone in our blood.
Line 9: Similar to line 7, returns result as a list which the program prefers.
Line 13: Giving the equation's initial conditions. Remember Q is quantity, and it was 10 mg. c is a constructor for a vector in R. Similar to 9 and 7, it's just a data-type for parameter inputs that the program prefers.
Line 14: The rate constant. You remember from equation (5) that k is approximately 0.182, so you define it as that in the form the program prefers (wrapped in c's constructor)
Line 15: You specify the time range you're interested. I did the 0th hour until the 24th hour, with a time step of 1 hour.
Line 16: You use the given solver ode, which takes in parameters (initialCondition, bounds, differential equation, parameters). Respectively those are defined as y, times, pharm, parms.
Line 21: Plots out the data points, you're interested when the x value is 12, because that means its 10 hours away, right when your calculus test begins
When executed it shows this:
If Q_0 = 10 , Q(12) = 10 * e ^ (−0.182 * 12) ≈ 1.126 mg. So there will be approximately 1.126 mg left in the body after 12 hours.
Are we done yet?
So another common scenario that comes up is when we're dealing with nootropics with very long half lives like Modafinil (~15 hrs), Clomiphene(~ 72 hrs), Memantine (~ 80 hours), Testosterone Enanthate (~ 240 hours) and dosing strategy over time, we end up not knowing what amount is left in our system. In our next post, we're going to be showing you
A. A much more realistic representation of the above situation
B. How to plot these graphs so that you can plan for dosing long half life nootropics.
Intestine (I) Quantity coupled with Blood (B) Quantity
Below shows your plasma concentration of a drug with a 72 hour half life, if you take 10 mg every 24 hours.