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
[Maple Math] .

Recurrence formula
[Maple Math] = 531.25
[Maple Math] = 533.203125
[Maple Math] = 533.3251953
. . .
[Maple Math]

Now define
[Maple Math] 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;

[Maple Math]


Double check the four values that we already know.

> u(0); u(1); u(2); u(3);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]


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);

[Maple Plot]


The values appear to have rapidly approached a
limiting value. Let's check a few values.

> u(10); u(15); u(20);

[Maple Math]

[Maple Math]

[Maple Math]


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;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]


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,
[Maple Math] , which remains the same for each iteration.
Then we would have the relation
[Maple Math] . We can simply solve this equation for [Maple Math]
and learn that
[Maple Math] = 533.3333333.

Given a recursion formula
[Maple Math] , a rest point is any number, [Maple Math] , for which [Maple Math] .

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);

[Maple Math]