Next: Exercises Up: Exponentials - Part 1 Previous: Purpose
f(x) = bxwhere b is a positive constant and x is any real number. The number b is often called the base. The special case b=1 is usually excluded, because that would just give the constant function f(x)=1.
Defining an exponential function in Maple is straightforward. For example, to define and plot the exponential function
f(x) = 2xthe following Maple commands could be used. They also show how to obtain numerical values for several x values.
> f := x -> 2^x;
The behavior of an exponential function depends very much on whether the base, b is smaller or larger than 1. For example, look at the plot generated by the following command. Make sure you understand which curve is which, and how these two curves are related.
A problem that often arises in applications is to fit data to an exponential function. For example, suppose you knew that g(x) was an exponential function and that . You can use this information to solve for the value of b, because it must satisfy the equation
In Maple, this can be done with the solve or fsolve command. The following example shows how to find the value of b, and use it to construct the function g(x). Notice the use of the label b1 in the definition of the function.
> b1 := solve(b^2.5 = 1/Pi,b);
> g := x -> b1^x;
You might ask why it wouldn't have been simpler to just use b for the label. The answer is that this would have worked the first time you executed the command, but would generate an error the second time you tried it, as shown below.
> b := solve(b^2.5 = 1/Pi,b);
> b := solve(b^2.5 = 1/Pi,b);
Error, (in solve) a constant is invalid as a variable, .6326158238The problem the second time is that the label b has a value after the first command above, so it can't act as a variable in the second command.
The conclusion you should draw here is the following. If you need to solve an equation in Maple and want to label the result so you can use it later, don't use the same name for the variable in the equation and the label. Before you go on, you should clear out the value of b with the command below. This makes b back into a variable.
> b := 'b';
In exponential growth and decay problems, the independent variable is almost always t, representing time. Another convention is to always write the exponential functions in terms of the natural constant e. That is, the general function describing exponential growth is written
f(t) = A ektwhere A is a constant and k is a positive constant. The general form for exponential decay is
g(t) = A e-ktwhere A is a constant and k is a positive constant. The reason these conventions are used is that these forms arise naturally in solving problems that involve exponential growth and decay. The constant A is the value of the function at t=0. The constant k is called the growth rate in exponential growth and the decay rate in exponential decay. In a process that can be modeled by exponential functions, the rate constant k depends only on the process and the conditions under which it is carried out.
For example, suppose that growth of a population of bacteria can be modeled by an exponential function. By running an experiment in which the number of bacteria are counted as a function of time, a value of k can be determined. The crucial fact is that the value of k depends on the environmental conditions of the experiment, but does not depend on the initial amount of bacteria present. That is, the same value of k can be used to model the growth of the same bacteria in other experiments, as long as the environmental conditions are the same as in the original experiment. Put more simply, if you do another experiment with the same bacteria under the same conditions, only the value of A, the number of bacteria present initially, changes.
C(t) = C0 e-kt
For example, suppose that for a particular drug, the following data were obtained. Just after the drug is injected, the concentration is 1.5 mg/ml (milligrams per milliliter). After four hours the concentration has dropped to 0.25 mg/ml. From this data we can determine values of C0 and k as follows. The value of C0 is the initial concentration, so we have
C0 = 1.5To find the value of k we need to solve the equation
0.25 = 1.5 e-4kwhich we get by plugging in t=4 and using the data C(4)=0.25. Maple commands for solving for k and defining and plotting the function C(t) are shown below.
> k1 := solve(0.25=1.5*exp(-4*k),k);
> C1 := t -> 1.5*exp(-k1*t);
Now, suppose we are working with the same drug, but the initial dose is doubled. Under the assumptions we have made, this means that the initial concentration would also double to 3.0 mg/ml, and the concentration C(t) given by our model would be
C(t) = 3.0 e-ktwhere k would have the same value, k=0.4479398673 found above.
A problem facing physicians is the fact that for most drugs, there is a concentration, m, below which the drug is ineffective and a concentration, M, above which the drug is dangerous. Thus the physician would like the have the concentration C(t) satisfy
m < C(t) < MThis requirement helps determine the initial dose of a drug and when the next dose should be administered. For example, suppose that for the drug in the experiment the maximum safe concentration is 5 mg/ml, or M=5, and the minimum effective concentration is 0.6 mg/ml, or m=0.6. Then the initial dose must not produce a concentration greater than 5 mg/ml. Suppose that the initial dose is chosen to produce an initial concentration of 4.75 mg/ml. Then how many hours later will the drug concentration reach the minimum effective level? The answer is about 4.6 hours, as shown by the following commands.
> C2 := 4.75*exp(-k1*t);
William W. Farr