how do i write exponential y=A(a-e^kt) in terms of t?

bwind

New member
Joined
Sep 5, 2020
Messages
4
hi,

There are various formula for measuring blood alcohol absortion rates and synchronous metabolism rates.
Let's say blood alcohol level (y) at time t is given by:

y = A(1-ekt) - 0.015t

Where:
A is a constant that considers gender, weight and drink
K is a constant that considers the change in absorption rates if someone has eaten.

How can I write this in terms of t (time)? To querey some when questions? Like when is all alcohol metabolised so that y=0?

Many thanks.
Bwind
 
hi,

There are various formula for measuring blood alcohol absortion rates and synchronous metabolism rates.
Let's say blood alcohol level (y) at time t is given by:

y = A(1-ekt) - 0.015t

Where:
A is a constant that considers gender, weight and drink
K is a constant that considers the change in absorption rates if someone has eaten.

How can I write this in terms of t (time)? To querey some when questions? Like when is all alcohol metabolised so that y=0?

Many thanks.
Bwind
For the given equation, you cannot "invert" and create a function for 't [e.g. t = f(y)]

Only possibility of estimating 't' would be through numerical approximation.
 
There are various formula for measuring blood alcohol absortion rates and synchronous metabolism rates.
Let's say blood alcohol level (y) at time t is given by:

y = A(1-ekt) - 0.015t

Where:
A is a constant that considers gender, weight and drink
K is a constant that considers the change in absorption rates if someone has eaten.

How can I write this in terms of t (time)? To querey some when questions? Like when is all alcohol metabolised so that y=0?
You probably mean "solve for t (time)", making t the output. It is already written "in terms of t", which means that t is an input.

As has been said, this can't be done algebraically.
 
y is in terms of A, k and t. The only way to get y just in terms of t it would have to be that you can express A and K in terms of t which isn't true in this case.
 
0.015t is a very short time. I expect you could get results sufficiently accurate if you ignored it. If you were looking at bloodalcohol levels over a day the error would be only about 20 minutes.
I would suggest dropping the term 0.015t from the equation. You can then express t in terms of the other variables. Then try a few examples and see whether results are accurate enough.
 
Last edited:
0.015t is a very short time. I expect you could get results sufficiently accurate if you ignored it. If you were looking at bloodalcohol levels over a day the error would be only about 20 minutes.
I would suggest dropping the term 0.015t from the equation. You can then express t in terms of the other variables. Then try a few examples and see whether results are accurate enough.
ignore that, it's incorrect! Could you give the expected range of values for each unknown - there could be a way to get a good approximation.
 
You could linearize the exponential. The Maclaurin series for \(\displaystyle e^x\) is \(\displaystyle e^x= 1+ x+ \frac{1}{2}x^2+ \cdot\cdot\cdot+ \frac{1}{n!}x^n \cdot\cdot\cdot\). "Linearize" by dropping all higher power terms: \(\displaystyle e^x\) is approximately \(\displaystyle 1+ x\) for small x so \(\displaystyle e^{kt}\) is approximately \(\displaystyle 1+ kt\). Then \(\displaystyle y= A(1- e^{kt})- 0.015t\) is approximately \(\displaystyle y= A(1- 1- kt)- 0.015t= -Akt- 0.015t= (Ak- 0.015)t\).

From that it is easy to see that \(\displaystyle t= -\frac{y}{Ak+ 0.015}\), approximately.
 
Thanks for the replies. I will work my way through. Unhelpfully I have not written the initial equation correctly. It should be:

y = A(1-e-kt) - 0.015t [its -kt]

I have attached a basic graph of the application. The -0.015t represents the metabolising rate by decimal hour. The first half of the equation prior to this represents the alcohol absorption rate (the graph shows K=2, k=6 depending on food) and then straigt assumes that the alcohol is absorbed instantly.

I am trying to write a formula that will allow me to estimate how long in decimal hours it takes for blood alcohol % to get to a value (notably .05 , or zero). Thanks again.
 

Attachments

  • blood_graph.pdf
    79.6 KB · Views: 4
You could try the Newton-Raphson iterative method. Make a guess for \(t_0\) and this equation should give you a better value...

[math] t_{n+1} = t_n - \frac{y + 0.015 t_n - A \left(1-\mathrm{e}^{-k t_n}\right)}{0.015+ k A\mathrm{e}^{-k t_n} } [/math]
You can repeat for extra accuracy. Say A=1, k=2, y=0.05, and you make a good guess \(t_0= 50\). Plugging into the above gives \(t_1=63.3333333...\) which is VERY accurate in a single iteration.

If you start with a bad guess of t0=1, then t1=3.799254..., t2=59.572777..., t3=63.333333... three iterations gets an accurate answer.
 
You could try the Newton-Raphson iterative method. Make a guess for \(t_0\) and this equation should give you a better value...

[math] t_{n+1} = t_n - \frac{y + 0.015 t_n - A \left(1-\mathrm{e}^{-k t_n}\right)}{0.015+ k A\mathrm{e}^{-k t_n} } [/math]
You can repeat for extra accuracy. Say A=1, k=2, y=0.05, and you make a good guess \(t_0= 50\). Plugging into the above gives \(t_1=63.3333333...\) which is VERY accurate in a single iteration.

If you start with a bad guess of t0=1, then t1=3.799254..., t2=59.572777..., t3=63.333333... three iterations gets an accurate answer.

Thanks for this. It is beguiling. I can reproduce your example. The challange I have is that a is usually quite a small number (e.g. 0.06 is 3 standard drinks for a 70kg man). I would expect t to be a little over 1 (t is in decimal hours). With these numbers i dont get the same estimates by iterating.
 
[math] t_{n+1} = t_n - \frac{y + 0.015 t_n - A \left(1-\mathrm{e}^{-k t_n}\right)}{0.015+ k A\mathrm{e}^{-k t_n} } [/math]

I think I made a sign mistake in the denominator above, it ought to be...

[math] t_{n+1} = t_n - \frac{y + 0.015 t_n - A \left(1-\mathrm{e}^{-k t_n}\right)}{0.015- k A\mathrm{e}^{-k t_n} } [/math]
But this doesn't explain the convergence problem you observed in post11. The function's value never touches y=0.05 (shown by the green line below)...

graph.png

So the iterative process can't possibly find a solution! (blue curve is your function when A=0.06, k=2)

If you try again, this time searching for the t value where the function intersects y=0 instead of 0.05 then you'll get convergence.

While iterating, it's probably best if you check that the gradient remains -ve for the current t value, and start with a high initial guess of t. If the gradient becomes +ve then it's a fair bet that the function never touches the particular y value that you're searching for.

[math]\frac{dy}{dt} = kA\mathrm{e}^{-kt} - 0.015[/math]
 
Top