WEEK #2: Cobwebbing, Equilibria, Exponentials and Logarithms Goals: Analyze Discrete-Time Dynamical Systems Logs and Exponentials Textbook reading for Week #2: Read Sections 1.6 1.7
2 Graphical Analysis To prepare for this topic, you should read Section 1.6 in the textbook. A powerful way to understand the behaviour of discrete-time dynamical systems is to use graphs to understand the behaviour. Example: The first 4 steps of the solution to the morphine system, a t+4 = 0.7a t + 10. are shown below, for the starting point a 0 = 0 mg, and a 0 = 50 mg.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 3 First, we draw the solution graph, which is usually what we want in the end. This is the prediction of morphine levels over time. t a t a t+4 t a t a t+4 0 0 10 0 50 45 4 10 17 4 45 41.5 8 17 21.9 8 41.5 39.05 12 21.9 25.33 12 39.05 37.335
4 For the same example, however, it is useful to see how we can also view the morphine levels over time in the updating function, a t+4 = 0.7a t + 10. This process is called cobwebbing and uses the y = x line as an important reference line.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 5 t a t a t+4 t a t a t+4 0 0 10 0 50 45 4 10 17 4 45 41.5 8 17 21.9 8 41.5 39.05 12 21.9 25.33 12 39.05 37.335
6 Association: why is the y = x line important when drawing inverse functions? Why is the y = x line, or a t = a t+4 line in this example, important on the graph of the updating function?
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 7 When the updating function a t+4 = 0.7a t + 10 crosses the a t = a t+4 line, what is special about that a value? Confirm this by finding a t+4 if we start at the intersection value, a t = 100 3 33.333.
8 Cobwebbing Cobwebbing is a graphical technique for visualizing the solution to a discrete-time dynamical model using only the updating function. From Section 1.6, 1. Graph the updating function and the diagonal. 2. Starting from the initial condition on the horizontal axis, go up to the updating function and over to the diagonal. 3. Repeat until you have taken the specified number of steps, or until you find the pattern. 4. Sketch the solutions at time 0, 1, 2, and so forth on an m t vs. t solution graph.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 9 Example: Logistic Curve We will now use cobwebbing to predict the long-term behaviour of the solution, given the graph of the updating function below. We will study the effect of three different starting points. m t+1 0 10 20 30 40 50 0 10 20 30 40 50 m t
10 Generate a cobwebbing diagram on the updating function graph, and then show the approximate solution for the system, given a starting point of m 0 = 50. Note that we have zoomed in on the graph for clarity. m t+1 35 40 45 50 m t 35 40 45 50 35 40 45 50 m t 0 2 4 6 8 10 t (steps)
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 11 Repeat the cobwebbing process, but start near m 0 = 20. m t+1 15 20 25 30 35 40 45 m t 15 20 25 30 35 40 45 15 20 25 30 35 40 45 m t 0 2 4 6 8 10 t (steps)
12 Finally, repeat the process again starting near m 0 = 10. m t+1 0 5 10 15 m t 0 5 10 15 0 5 10 15 m t 0 2 4 6 8 10 t (steps)
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 13 What can you say about the long-term behaviour of this system?
14 Equilibria A point m is called an equilibrium of the system m t+1 = f(m t ) if, when we set m t = m, we also get f(m ) = m t+1 = m. The star here indicates a special value of m; using it for equilibria is a very common notation in mathematical biology, as well as in economics.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 15 Example: Indicate the equilibria on the graphs from the last two examples. Morphine Example Logistic Example a t+4 0 10 20 30 40 50 m t+1 0 10 20 30 40 50 0 10 20 30 40 50 0 10 20 30 40 50 a t m t
16 Do all the equilibria eventually end up as likely asymptotes for the long-term behaviour, in the morphine example? Do all the equilibria eventually end up as likely asymptotes for the long-term behaviour, in the logistic example?
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 17 Finding Equilibria Algebraically The equilibria spotted on the graphs are helpful for understanding the system at a glance, but sometimes we want a numerical value for the equilibria, m. Equilibria Algorithm Given a system m t+1 = f(m t ) you can find the equilibria, m, by setting both m t and m t+1 equal to m in the updating function, then solving for m. What we are doing is setting m t = m t+1, which was our definition of an equilibrium.
18 Example: For the morphine dosage updating function, a t+4 = 0.7a t + 10 find the equilibrium value(s) for a. Does this agree with the graphical analysis earlier?
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 19 Example: Find the equilibria for a bacteria population, knowing that the bacteria population doubles in size every 3 hours: m t+3 = 2m t Interpret the result you get, thinking about bacterial population growth.
20 Parameters in Models A parameter is a quantity that is constant in the model, but possibly unknown. It differs from a variable in that it doesn t change while the model is being used, but may change for different applications. e.g. The metabolism value of 0.7 for morphine metabolism is a parameter, that would represent a standard patient. In another patient, however, the rate could be different, like 0.5 or 0.8. e.g. The dosage rate of 10 mg per 4 hours is also a parameter, which could be changed by the physician. In practice, a parameter is usually represented by a letter or symbol. It can be very helpful to work with the system with those symbols rather than numbers, to see how the values of the parameters affect properties e.g. the equilibria.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 21 Using Parameters in Models Example: Find the equilibrium morphine level for the model a t+4 = βa t + d where β and d are parameters (think unknown constants ). Your answer will be in terms of β and d.
22 Say that the target equilibrium level of morphine in a patient (based on their weight and age) is 40 mg, and that a blood test indicates the metabolism parameter for this patient is β = 0.8. Find the required dosage for this patient so that their morphine level over time will approach the target level, in the long run.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 23 Exponential Functions In your first assignment, you have seen the natural occurrence of exponential functions as solutions to discrete-time dynamical systems. Example: If a bacteria population follows the updating function p t+1 = 2p t what is the solution, or the function p(t), for an initial population of p 0?
24 Find the solution for a population modeled by the updating function q t+1 = 0.75q t Which population is growing, and which population converges to zero? What is the condition for an exponential of the form growing or shrinking? f(t) = a t
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 25 The number a is a positive number and is called the base of the function f. If 0 < a < 1, then the output of f decreases as the input increases and f models exponential decay. If 1 < a, then the output of f increases as the input increases and f models exponential growth. The exponential function isn t defined for negative bases (except with the help of complex numbers, in a later course) All exponential functions of the form f(t) = a t have graphs that pass through the point (0, 1), and lie entirely above the x-axis.
26 Sketch the graph of f(t) = a t for various bases a on the axes below. Is the horizontal line through (0, 1) also the graph of an exponential function? If so, what is its base?
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 27 What is the domain of a t? What is the range of a t?
28 Rules for Computing with Exponential Functions 1. a X+Y = a X a Y 2. a X Y = ax a Y 3. a XY = (a X ) Y = (a Y ) X 4. (ab) X = a X b X
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 29 A useful characteristic of exponential functions (f(t) = a t ) is that whenever the value of t is increased by a constant, the corresponding value of f(t) is multiplied by a corresponding number. Let f(t) = 4 t. How can we write f(t + 3) in terms of f(t)?
30 Logarithms For any function f(t) that is always increasing or always decreasing and is continuous, we can define the inverse function. That is, we can define a function g(t) such that g(f(t)) = t. We often write the inverse of f(t) as f 1 (t); note that this is not the same as 1/f(t). What test can be used to determine if a function has an inverse?
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 31 Since exponential functions, f(t) = a t, are continuous and always increasing (if a > 1) or always decreasing (if 0 < a < 1), we can define an inverse to any exponential function. The inverse function of a t is called the logarithm to base a, and is written log a t or log a (t). Log/Exponential Equivalency a c = t means log a t = c Without using a calculator, find log 10 (1/100) and log 10 (10, 000).
32 The following identity follows from the fact that a t and log a (t) are inverse functions: log a (a t ) = t and a log a t = t
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 33 By combining the exponential rules with the inverse property, we can obtain the following rules for all logarithmic functions. Rules for Computing with Logarithms 1. log a (AB) = log a A + log a B 2. log a (A/B) = log a A log a B 3. log a (A P ) = P log a A Example: With the help of logarithms, solve the equation 3e 5x+1 = 5.
34 Example: Find the doubling time of the population function P(t) = 500(1.4 t ). For the population function P(t) = 500(1.4) t, find how long it takes to reach a population of 10 6.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 35 Log Bases With exponential functions, we can choose different bases (e x, 2 x, 1 3t. So too can we choose different bases for logarithms: log e (x) (or ln(x)), log 10 (x), or log 6 (x), etc. The functions a t and log a are not provided on calculators unless a = 10 or a = e (see next section of these notes). For other values of a, a t and log a can be expressed in terms of 10 t and log 10. To calculate log a t, we use the following formula:
36 Conversion of Log Bases log a t = log t log a = lnt ln a Prove the above formula, using the Rules for Computing with Logarithms and the fact that log a t = c means t = a c.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 37 What does the value of value log 2 (10) represent? Use the base conversion and your calculator to approximate this value.
38 Graphs of Logarithmic Functions Since the logarithm in base 10 is commonly used in science, we define log t (no subscript) to mean log 10 t, for brevity. The graph of log t may be obtained from the graph of 10 t by reversing the axes (that is, by reflecting the graph in the line y = t).
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 39 10 10 t log 10 (t) 10
40 What is the domain of log t? What is the range of log t?
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 41 The Number e and the Natural Logarithm For reasons that are are not immediately obvious, the most commonly used base for logarithms in mathematics, as well as many sciences, is not 10, but the number e = 2.71828... This logarithm is called the natural logarithm and is written ln t (pronounced lawn t ). The natural logarithm and the corresponding exponential function, e t, are very important functions that reoccur throughout mathematics. Population models are often expressed using the exponential growth equation: P(t) = P 0 e kt If we are modeling population growth, why must k > 0 in the above equation?
42 The formula in P(t) = P 0 e kt form for exponential decay is exactly the same as for growth, except that k < 0 (why?). We say that the function P 0 e kt is growing (or decaying if k < 0) at a continuous rate of k; this phrase will only refer to functions of the form P 0 e kt.
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 43 On the axes below, sketch the graphs of y = e kt for k = 1, 2, 1. 4 3 2 1 4 3 2 1 1 2 3 4 1 2 3 4
44 Converting between forms Sometimes we naturally find an exponential in the a t form, and sometimes the natural exponential e kt might actually be more directly useful. We need to be able to convert between the two easily. Example: Use the log and exponentials rules to write the function f(t) = 2.5 t in the form f(t) = e kt
Week 2 Cobwebbing, Equilibria, Exponentials and Logarithms 45 Example: Use the log and exponentials rules to write the function f(t) = e 0.672 t in the form f(t) = a t