5
$\begingroup$

Setup

So... I kinda handled most of my proof but I need help with some of the stuff I just kinda went with until it worked out. The problem relates to medicine and its decay in the body. We are given that the medicine will release over a period of $b$ hours and another dose is given at time $T$.

Known Values

Decay Constant is 1. Each dose contains 1 gram of medicine. We know that $b=\frac{5}{4}$ & $T=\frac{5}{2}$. We are also given that $y(0)=0$ y being the amount of medicine in the body at time $t$. Finally we're given the simple equation $rate=rate_{in}-rate_{out}$.

Looking at our values we find that $\frac{4}{5}$ grams are released per hour over the course of $\frac{5}{4}$ hours. Using this and our value of T it's possible to make a piecewise function for the release $(rate_{in})$ of the medicine, $g(t)$. This function is "on" over the intervals $0<t<\frac{5}{4}$ & $\frac{5}{2}<t<\frac{15}{4}$ (note that $\frac{15}{4}$ just comes from $\frac{5}{2}+\frac{5}{4}$) and is "off" (to explain only having decay) between $\frac{5}{4}<t<\frac{5}{2}$ & $\frac{15}{4}<t<5$ (Idk if those should be $\le$ signs or not but that's less important right now).

I only know how to turn this into a rectangular window function like: $u(\frac{5}{4})-u(\frac{5}{2})$ and so on and so on but regardless... we can gather that because our $rate_{out}$ is reliant of the amount of grams present, that it's just something times our $y(t)$ function. Okay here's the two parts I need help on (three technically because I'm still not happy with my explanation for why the out function is $y(t)$:

What I Need Help With

I set up an initial value problem that looks like this: $y'(t)=\frac{4}{5}g(t)-\frac{4}{5}y(t)$ and I'm pretty confident it's right.... but I don't know how to explain why I multiplied by $\frac{4}{5}$ (I just guessed based off of searches I had been doing but I've lost what I actually searched up) because the only thing I can think of is that because $\frac{4}{5}$ is $\frac{g}{h}$ that means that there's SOME kinda rate of change equal to $\frac{4}{5}$ but surely it can't be $\frac{dy}{dt}$ since then our IVP wouldn't work right? I guess it could also be a way of making our $rate=rate_{in}-rate_{out}$ equation EQUAL $\frac{4}{5}$ or something silly? Idk, this one probably needs more help than the next.

Also once I found that the Laplace transform of this solves to: $\frac{\frac{4}{5}G(s)}{s+\frac{4}{5}}$ I then basically tried to get $G(s)$ to equal the laplace of what I thought was the rectangular window function: $g(t)=(u(t)-u(t-\frac{5}{4}))+(u(t-\frac{5}{4})-u(t-\frac{5}{2}))$ but you can already see the problem right there. Stuff would cancel out. I remedied this by realizing that the equation through the next bounds $(\frac{5}{4}<t<\frac{5}{2})$ would have to pass through the last point given by the equation in the previous bounds... or in other words, to find the correct $y(t)$ we'd have to multiply say $y(t-b)\cdot(u(t-b)-u(t-c))$ by the result of $y(b)\cdot(1-u(b-b))$ (1 comes from $u(t)=1$) and so on and so forth and so I ended up getting:$y(t)=(1-e^{-\frac{4}{5}t})(u(t)-u(t-\frac{5}{4}))+(1-e^{-1})(e^{-\frac{4}{5}(t-\frac{5}{4})})((u(t-\frac{5}{4})-u(t-\frac{5}{2}))+(e^{-\frac{4}{5}(t-\frac{5}{2})})(1-(1-(e-1)e^{-2}))((u(t-\frac{5}{2})-u(t-\frac{15}{4}))+etc$

but see the problem is that we get that weird $1-(e-1)e^{-2}$ for the 3rd window which I can't come up with a good explanation for other than some weird shenanigans turning making one of our $u$ somehow equal $u(t)$? Like best I got is that because technically we're looking at the point $\frac{5}{2}$ for both sides you actually get 1-whatever because the step functions are interacting with each other???

Anyways if someone's willing to help just prove or AT LEAST EXPLAIN WITH WORDS why these things work that'd be much appreciated. Just something so I can justify what I did because while it did in fact work... it's been like a day since I wrote half of this stuff down and for some reason I didn't write why it works so...

EDIT: MAJOR BREAKTHROUGH ON THE SECOND HALF

(Potentially)

(I think I've got the first half but it doesn't hurt to check so I'm leaving it), I still need some help explaining why it works BUT, I've found that for whatever reason, you can find the bit out in front of the second window (the $(1-e^{-1})$ part of $(1-e^{-1})(e^{-\frac{4}{5}(t-\frac{5}{4})})$ just by subtracting $e^{-\frac{4}{5}t}$ from $(e^{-\frac{4}{5}(t-\frac{5}{4})}$. It's just that the $(1-e^{-1})(e^{-\frac{4}{5}(t-\frac{5}{4})})$ is oversimplified, that entire equation is equal to $-e^{-\frac{4}{5}t}+e^{-\frac{4}{5}(t-\frac{5}{4})}$ The only problem is... where does that negative $e^{-\frac{4}{5}t}$ come from? My current way of thinking about this is that it's almost as if the first bound $u(t), u(t-5/4), etc$ is what's looked at during the inverse Laplace transform? Because all the unit step functions should be (in theory according to my IVP) multiplied by $1-e^{-\frac{4}{5}(t-a)}$ (a is $u(t-a)$) once the inverse Laplace transform is all said and done. However, if this were truly the case many things would cancel out before actually separating in order to do this leading me to believe that either the first $u(t-a)$ speaks for the entire rectangular window function OR it's something even deeper in the algebraic solving, something like: $(-e^{-\frac{4}{5}t}+e^{-\frac{4}{5}(t-\frac{5}{4})})+(1-e^{-\frac{4}{5}\left(t-\frac{5}{2}\right)})$ (this one is specifically for the third window function and I found it to be correct). Thing is... WHY? Why does that work?

New Update

I think I've figured out a way to make this work actually. What if we just set $g(t)=0$ when $\frac{5}{4}<t<\frac{5}{2}$ and when $\frac{15}{4}<t<5$ since we said that $g(t)$ was our rate in right? Well I think we have that by just setting $g(t)=1$ for when the medicine is active we end up with the correct function THAT I'VE KNOWN ALL THIS TIME BTW BUT DOUBTED IT WOULD BE ACCEPTED: $\left(1-e^{-\frac{4}{5}t}\right)u\left(t\right)-\left(1-e^{-\frac{4}{5}\left(t-\frac{5}{4}\right)}\right)u\left(t-\frac{5}{4}\right)+\left(1-e^{-\frac{4}{5}\left(t-\frac{5}{2}\right)}\right)u\left(t-\frac{5}{2}\right)-\left(1-e^{-\frac{4}{5}\left(t-\frac{15}{4}\right)}\right)u\left(t-\frac{15}{4}\right)-\left(1-e^{-\frac{4}{5}\left(t-5\right)}\right)u\left(t-5\right)$.

I think that this just straight up works so... idk I'll leave this up but this is probably our answer.

$\endgroup$

1 Answer 1

1
+100
$\begingroup$

Introducing some formalism, calling the unit step as $\unicode{x1D7D9}(t)$ we have that the medicine delivery is made as

$$ g(t) = \frac 1b \sum_{k=0}^n \left(\unicode{x1D7D9}(t-kT)-\unicode{x1D7D9}(t-kT-b)\right) $$

so the differential relationship reads

$$ y'(t) = g(t) - \gamma y(t) $$

with Laplace transform

$$ (s+\gamma) \hat y(s) = \frac 1{bs}(1-e^{-b s})\sum_{k=0}^n e^{-k T s} + y_0 $$

If $n\to\infty$ then the transformed ode reads

$$ (s+\gamma) \hat y(s) = \frac 1{bs}\left(\frac{1-e^{-b s}}{1-e^{-Ts}}\right) + y_0 $$

and then

$$ \hat y(s) = \frac{1}{b(s+\gamma)s}\left(\frac{1-e^{-b s}}{1-e^{-Ts}}\right)+\frac{y_0}{s+\gamma} $$

with a well defined inverse.

$$ y(t) = y_0e^{-\gamma t}+\frac{1}{\gamma b}\sum_{k=0}^{\infty}\left(\left(1-e^{-\gamma (t-k T)}\right) \unicode{x1D7D9}(t-k T)-\left(1-e^{-\gamma (t-k T-b)}\right) \unicode{x1D7D9}(t-k T-b)\right) $$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .