Amoxicillin Example
> restart;
The patient's kidneys eliminate half the drug every hour, and
the patient takes a 500 mg pill every 4 hours.
Initial Condition
.
Recurrence formula
= 531.25
= 533.203125
= 533.3251953
. . .
Now define
using the initial conditions and the recurrence formula.
> u := proc(n) if n<=0 then 500 else 500 + 0.5^4*u(n-1) fi end;
Double check the four values that we already know.
> u(0); u(1); u(2); u(3);
Plot the amount of amoxicillin in the patient's body after taking 25 pills over a 6 day period.
>
pts := [seq([n,u(n)],n=0..24)]:
plot(pts, style=point);
The values appear to have rapidly approached a
limiting
value. Let's check a few values.
> u(10); u(15); u(20);
To 10 digits these are the same. But if we increase our precision to 25 digits we will see
some small differences.
>
Digits := 25;
u(10); u(15); u(20);
Digits := 10;
Of course, while these differences are interesting from a mathematical point of view, differences
that are less than one hundredth of a milligram would be of no practical significance.
Suppose that we assume that there is a number,
, which remains the same for each iteration.
Then we would have the relation
. We can simply solve this equation for
and learn that
= 533.3333333.
Given a recursion formula
, a
rest point
is any number,
, for which
.
Although this was a simple equation which was easy to do by hand, we can also solve it
using the
solve
command in Maple. This can be helpful when the equation is complicated.
Simply type
solve
along with the equation and the variable to solve for
.
>
solve(L = 500 + 0.5^4*L,L);