Brian Birgen Mariah Birgen Wartburg College,...

207
Modeling Calculus Brian Birgen Mariah Birgen Wartburg College, Waverly, IA 50677 [email protected] [email protected]

Transcript of Brian Birgen Mariah Birgen Wartburg College,...

Modeling Calculus

Brian Birgen

Mariah Birgen

Wartburg College,

Waverly, IA 50677

[email protected]

[email protected]

Contents

Chapter 1. Modeling 11. Introduction 22. Modeling 2

Chapter 2. Calculus 91. Lines, Slopes, and Functions 102. Derivatives and Difference Quotients 143. Properties of the Derivative 184. Differential Equations and Slope Fields 245. Euler’s Method 306. The Anti-Derivative and the Integral 36Chapter 2 Review 40

Chapter 3. Exponential Models 411. The Modeling Process 422. Population and Doubling Time 463. Newton’s Law of Heating and Cooling 524. Logistic Population Model 565. Harvesting Model 616. Drug Dosing 667. Gastro-Intestinal Tract 72Chapter 3 Review 76

Chapter 4. Second Order Differential Equations 771. Classical Mechanics, a Brief Introduction 782. Air Resistance 873. Springs 924. Bungee Jumping 99Chapter 4 Review 104

Chapter 5. Numerical Integration 1051. Trapezoid, Midpoint, and Simpson’s Rules 1062. Improved Euler’s Method 1123. Runge-Kutta Method 116Chapter 5 Review 120

Chapter 6. Systems of Differential Equations 1211. Interacting Species 1222. Competition and Symbiosis 129

i

3. S - I - R Model 1364. Malaria 140Chapter 6 Review 144

Chapter 7. Sequences and Series 1451. Sequences 1462. Series 1503. Power Series 154Chapter 7 Review 158

Chapter 8. Projects 1591. Electrical Circuits 1602. Rocket Motion 1643. Hot Air Balloons 1684. Pendulums 1715. Chronic Wasting Disease in Deer 1726. BioAccumulation 1737. Pan Water Cycle 1748. Rumor Mill 176

Appendix A. Mathematical Model Report 1791. Statement of Problem 1792. Model Design 1793. Model Solution 1794. Results and Conclusions 1805. Appendices 180

Appendix B. Vensim Tutorials 1811. Vensim Tutorial 1 1822. Vensim R© PLE Tutorial 2 198

Appendix. Index 201

Appendix. Bibliography 203

ii

CHAPTER 1

Modeling

1. Introduction

Welcome to the new and improved Calculus sequence. This document is designed toexplain to you how your Calculus experience will progress over the next year.

History. At the beginning of the twentieth century, the Calculus curriculum becamestandardized. Students would first learn about limits, followed by derivatives, definition andrules, and applications. Next students would learn integrals, definition, the FundamentalTheorem of Calculus, and rules, and applications. Finally, students would learn aboutsequences and series. When AP Calculus was introduced to the high school curriculum,they were unable to fit this much material into a year of high school, especially since topicshad been dropped from earlier classes. Thus, applications, sequences and series were de-emphasized.

Thus, students would arrive on college campuses with credit for an entire year of Calculus,but without necessary fundamental ideas and tools. Specifically, students would know sometechniques of how to calculate derivatives and integrals but have no idea how these toolswould be used.

Calculus became a filter for many majors. Students were required to take the class, notbecause the ideas would be used in future courses, but because passing the class demonstrateda certain amount of stubbornness and resilience. This is offensive and wrong. Many of theadvances of the twentieth century are based on calculus and part of the beauty of the subjectis in its usefulness.

This course is designed to give you a deep understanding of how Calculus, the study ofaccumulation and change, is applicable in a wide variety of subjects. Here, we will use ideasof accumulation and change to model the world around us. These models are created toanswer questions, both small and large. A small question might be:

I woke up on a cold morning and went to the garage to my bicycle which Iride to work. I noticed that one of my tires was flat. Should I fix the tireand ride in or Should I walk?

A large question might be:

Given the predicted increasing variability in climate, after a major hurri-cane, what decisions need to be made when rebuilding to reduce risk to lifeand property?

The mathematics of answering questions like this is often called Modeling. A course on mod-eling can be described as using all the mathematics you know to start answering questions.In this course, you will learn modeling, but you will also learn calculus the way the foundersof the discipline, Isaac Newton and Gottfried Leibnitz, thought about calculus. Do not letanyone tell you this is not a calculus course. It is simply more “traditional” calculus. Itlooks nothing like the calculus that you may or may not have seen in high school.

2. Modeling

Mathematical modeling is a process of taking a question from the world and finding aquantitative, that is numerical, answer. This section will walk you through how the processcan work. Keep in mind that not all parts of this process are going to need to be used in

2

each model. It is hard to talk about modeling without some reference question, so for anexample, we will take the small question from the previous section,

I woke up on a cold morning and went to the garage to my bicycle whichI ride to work. One of my tires is flat. Should I fix the tire and ride in orshould I walk?

Five Minute Model. Modeling is an iterative process, meaning you start with thequestion, find a solution, verify your solution, and then return to the question to improvethe solution. Generally, to get your head wrapped around the question, it is important tostart with a “five minute model”. Take five minutes with your team and brainstorm your firstmodel. This will be a rough, dirty, simplistic model and usually result in something which ispretty divorced from reality, but it will help you understand what the important questionsare that you will need to focus on as you work to improve your model. As part of themodeling process, you need to communicate your model. A template for the communicationprocess is included at the end of this book. You are encouraged to try this with the bicyclequestion.

Statement of Problem. What is the question you are trying to answer? Often theoriginal statement is pretty vague and needs clarifying. You may need to re-state the originalquestion more specifically in order to understand it. Are you trying to find the largest orleast of something? This is called optimization and is a common objective in modeling.What are you optimizing and why?

Which option will take less time for me to get to work, fixing my tire orwalking in?

Model Design. What are all the things you need to help you find out the answer toyour question? Make a list. You can add or take away from this list as you work throughthe question, but use your knowledge of the world to brainstorm what you know or need toknow about the question.

• Temperature• Size of tire• Distance to travel• Experience in fixing tires• Existence of spare tube• Riding speed• Walking speed• Other weather factors (wind, rain, snow, ice, etc.)• Clothing (will I need time to change my clothes if I get them greasy?)

You can probably come up with several more items to put on this list basedon your experience with riding bicycles.

Model Creation. Next, decide what you need from your list to come up with a rea-sonable answer for your question. Identify which list items you might be able to turn intonumbers, quantify . These are usually referred to as variables. Some of your variables aredependent on other variables. Write the relationship down. Some of your list items may endup being very difficult to quantify. You may decide to set them aside for future use in a later

3

version of your model. You may find that, as you work on turning things into variables, youneed to add to your list. Adding a variable is referred to as making a clarifying assump-tion and taking away a variable is referred to as making a simplifying assumption. Youwill make many simplifying assumptions as part of your five minute model, but it is nice tohave the list to refer to when you start making your model more accurate.

In the real world, most variables have units. Time might be measured in seconds, minutes,hours, or centuries. Distance might be measured in inches or kilometers. Give all yourrelevant variables units. Try to keep all your units from the same family. If you are workingin metric, stay in metric. If you are working in British units, stick with those. Units also helpidentify the relationships among variables and might clarify which variables are dependentand independent.

At this point, you may need to go do research and collect data. Research may meanrunning an experiment to collect data, or going to the web site of the bicycle manufacturerto look up relevant information. Keep track of where the information you look up comesfrom because you are going to eventually need to reference the sources and put them in abibliography. Not doing so is plagiarism. However, you may decide that you can make someeducated guesses from your own experience. This is fine for your five minute model, butmake sure you keep track of where you are guessing because when you improve the model,you will need to track down more reliable data.

When a scientist works in the laboratory, she keeps a lab book with relevant data asevidence of her own work. You will need to do this as well. When you write up your report,when you use information and data, go back to this lab book to report on your modelcreation. The amount of detail in this section varies, but should always include

• Statements of simplifying assumptions and the rationale behind them.• Definitions of variables with units.• Relations between dependent and independent variables.• The variable you will use to eventually answer your model question.

Clearly labeled diagrams of the relationships among variables and sub-models can be veryhelpful in understanding the model.

After some deliberation, it is decided the time it takes to get to work in min-utes, T , is the variable we wish to optimize (make smallest). When walkingto work, T is dependent on the distance to work, D, measured in meters(m), and the walking speed, W , measured in meters per minute(m/min).When biking to work, T will be dependent on both the time, TF , in min-utes to fix the flat tire and the time, TR, to ride to work which is in turndependent on D and the biking speed, B, also in m/min. For a simplemodel, TF will be fixed but may include washing-up time and you canmake note of other factors such as climate issues for future models. Ourconstants, TF , D, TR,W , and B, will be first estimated and then measuredexperimentally.

Sub-Models. Sometimes when creating the model we find that there are other questionswhich need answers that are, in themselves, modeling questions. These can be referred toas sub-models. The team working on the bicycle question may decide later to treat TF as a

4

sub-model rather than a fixed amount. In this case, we have the sub-model

TR = D/B.

Model Solution. Now it is time to use your model to create a solution. For verycomplicated models, this may require learning a completely new area of mathematics, suchas calculus, or learning to use a software system, such as Maple or VenSim. For simplermodels, it can be as simple as combining your knowledge of units with your variables tocome up with an equation. This is what you have been doing in your previous mathematicsclasses as part of the dreaded “word problem.” However, when modeling, you are creatingthe word problem from your own experiences, so you have a pretty good idea about how totackle the problem.

Once you have solved the math part of the problem, you are not yet done. You need toreflect on the consequences of your solution. What does the result have to say about theoriginal question? Does the answer make sense? Does the model fail to provide a realisticanswer? If so, you may have to go back and put in some of those assumptions you discardedwhen you were simplifying the model? You will repeat this process as necessary until youcome up with a reasonable answer or you run out of time.

Once we have the constants, TF , D,W,B, we calculate that

T =

DW

if walking

TF + DB

if bicycling.

Therefore, we should take the time to fix the flat if DW> TF + D

B.

Results and Conclusions. Before you put away the model, it is important to checkyour solution with the real world. Maybe you can’t run all the experiments immediately,but as the model creator, as long as the model is in use, you bear some responsibility formaintaining the model. If you are using the bicycle model, you may want to change yourresults when you move or purchase a new bicycle.

One of the most fascinating mathematical models is that used to predict weather. Themodel is very complicated and has lots of sub-models. It exhibits a phenomena called “chaos”which means that if you start from two very similar positions, you can end up with verydifferent results. This is why you trust the weather forecast for tomorrow, but don’t putmuch faith in 10-day predictions.

5

This page intentionally left blank.

Name:

Homework 1.2. Create a five minute model for the following scenarios: Include thingslike variables, estimated constants, variable relationships, etc.

1. How much plastic is in the county landfill?

2. How much gasoline does your car consume at idle?

3. How long do you need to brush your teeth?

4. If you stack paper, how many pages would make an inch?

5. How long will the laptop battery last as a function of the age of the machine?

6. How much does each hour of college cost you?

7. How does fuel efficiency vary with the speed driven?

7

CHAPTER 2

Calculus

1. Lines, Slopes, and Functions

One of the big ideas of Calculus is that we can approximate curves with straight lines,or complicated functions with linear functions. We try to learn information about the rateat which a function is changing by focusing on a small region and attempting to find a linethat looks just like the function, at least close by. This is helpful because lines are easy tounderstand. Let’s take some time to look at the relevant properties of lines to understandwhat mathematicians see as important. In this section we are assuming that you have learnedall about lines in previous classes and are just refreshing your knowledge. If this is not thecase, contact your instructor for further assistance.

The form of a line which students are most familiar with is the slope-intercept formof the line, where a line is written as y = mx + b. In this case m is the slope and b is they-intercept. A line which is written in this form will cross the y-axis in exactly one location,specifically (0, b). This line will also pass through the point (1, b+m) which gives us the twopoints which define a line. For example, the line y = 2x+ 1 passes through the points (0, 1)and (1, 3), as seen in Figure 1:

−2 2

−3

−2

−1

1

2

3

Figure 1. The line y = 2x+ 1

The slope measures the rate at which y changes relative to the change in x. In the linein slope-intercept form, we see that as x increases from 0 to 1, the y value increases fromb to b + m. That is, as x increases by 1, y increases by m. The slope tells us how muchthe output of the function (in this case y) changes for each unit the input of the function(in this case x) changes. In particular, if the slope ispositive, that is greater than zero, asin Figure 1, then the output increases as the input increases and the graph appears to beclimbing. If the slope isnegative, that is less than zero, then the output decreases as theinput increases and the graph appears to be falling. If the slope iszero, then the output isconstant.

To find the slope of the line through any two points, we would divide the change in theoutput by the change in the input. As a formula, the slope of the line between (x1, y1) and(x2, y2) is given by m = (y2− y1)/(x2−x1). For example, the slope between the points (5, 9)and (2, 4) is equal to 4−9

2−5= 5

3. It is worth noticing that the value of the slope only depends

on the use of two different points on the line, (x1, y1) and (x2, y2), and does not depend on

10

which points we use, because we get the same answer no matter what points we choose. Infact, that is one of the definitions of a line.

Once the slope of the line between two points is known, it is straightforward to find theequation of the line between those two points. Simply plug the value of the slope along withone of the two points (either (x1, y1) or (x2, y2)) into the slope-intercept form of the liney = mx+ b and solve for b. Continuing the example above, plug the slope of 5

3and the point

(5, 9) in to y = mx + b to get 9 = 535 + b. This simplifies to b = 9 − 25

3= 2

3. Thus, the

equation of the line through (5, 9) and (2, 4) is y = 53x+ 2

3.

The slope-intercept form of the line has certain advantages to it. The main one is thateach line has a unique representation in slope-intercept form. This makes life easy on teacherswho have to grade homework assignments, because there is only one right answer. However,there is another form of the line that is often easier to solve for and work with called theslope-point form of the line. If we know the slope of the line, m, and one point on theline, (x0, y0), we can find the equation of the line. The slope-point form of the line through(x0, y0) with slope m is given by y = m(x − x0) + y0. This can be put into slope-interceptform with a little effort. In fact, the slope-intercept form of the line is simply the slope-pointform of the line when x0 = 0, that is, when the point is the y-intercept.

Functions. Both of these forms of writing lines have the advantage of representing a lineas a function. That is, it is in the form y = f(x) (like y = 2x+ 1). Functions are an integralpart of the language of Calculus because they are how we represent rules and operations.They come in many forms, like polynomial, f(x) = x3 + 2x + 5, exponential, g(x) = 2x,trigonometric, f(t) = sin(2t), and logarithmic, h(t) = log2(t). What every function has incommon is that it is a rule in which for every possible input, there is only one output. Infact, this is the reason that, when we write f(x) =

√x, we implicitly mean the positive

square root of x. If we allowed for negative square roots f(x) =√x would no longer be a

function.There are four ways of representing functions: algebraically, graphically, in a table, and

in a verbal description. Each representation may look different, but it should give you thesame information about the function.

Algebraic notation is frequently used to explain how to compute a given operation. Whenwe write

f(x) = x2 + 3x−√x+ 1,

we are told where to input the x value. In this example, f(3) = 32 + 9 −√

4 = 16 andf(0) = 02 + 0 −

√1 = −1. This algebraic notation does not require us to be restricted to

numbers. We can compute

f(2x) = (2x)2 + 3(2x)−√

2x+ 1 = 4x2 + 6x−√

2x+ 1

or

f(x+ h) = (x+ h)2 + 3(x+ h)−√x+ h+ 1 = x2 + 2xh+ h2 + 3x+ 3h−

√x+ h+ 1.

Each time we apply the rule given in the definition of the function by plugging in thevalues everywhere the input x is used. In fact, there is no difference between the statementsf(x) = x2 + 3x−

√x+ 1 and f(t) = t2 + 3t−

√t+ 1. They both give the same information

about how to apply the given rule. However, it is not clear from this way of writing functionsthat for every possible input, there is only one output.

11

Functions can also be represented by graphs. These are ways to visually represent theinformation contained in the definition of a function. For example, if our function is v(t) =3t − t2, we represent the fact that v(1) = 2 with the point (1, 2), and we represent thatv(3) = 0 with the point (3, 0), each time listing the input in the first position and the outputin the second position. If we collect all the points which satisfy our function, they form agraph in the t− v plane, as shown in Figure 2. We generally represent the input variable, t,on the horizontal axis and the output variable, v, on the vertical axis. One of the advantagesof the graphical representation of a function is that it is easy to tell that, for every possibleinput, there is only one output. If you have the graph of a function, any vertical line willonly intersect the graph in one point.

t

v

−1 1 2 3 4

−3

−2

−1

1

2

Figure 2. A graph of v(t) = 3t− t2

12

Name:

Homework 2.1.

1. Find the line through the given two points.a) (3, 6) and (5, 2)

b) (−1, 8) and (3,−2)

c) (5, 7) and (0,−2)

d) (1.3, 2.5) and (2.8, 5.8)

2. Find the line through the given point with the given slope.a) (1, 2) with a slope of 3

b) (5, 3) with a slope of −4

c) (−2,−1) with a slope of 2

d) (−3.4, 1.8) with a slope of 0.8

3. Evaluate the given function at the given point. Simplify.a) f(x) = x2 − x3 + 5 at x = 3

b) g(x) =x3 − 2x+ 2

x2 + 1at x = 5

c) v(x) = 3x2 − 4x+ 1 at x = 2t+ 1

d) m(t) =t2

t+ 1at t = x+ h

4. Sketch a graph of the given function using the given range.a) f(x) = x2 − 1 on −3 ≤ x ≤ 3

b) g(t) = (t− 1)2 on −4 ≤ t ≤ 4

c) f(t) = (3t+ 2)2 − 1 on −5 ≤ x ≤ 2

d) g(x) = |4− x2| on −4 ≤ x ≤ 5

13

2. Derivatives and Difference Quotients

If you were driving down the highway and your speedometer were broken, you wouldhave difficulty determining how fast you were going, your instantaneous speed unless youpassed a speed trap that flashed a number. However, you could compute your average speedusing your odometer to determine how far you had traveled and your watch to determinehow long that had taken. By computing the change in distance divided by the change intime, you would obtain the average speed over that stretch of time. I am sure the nice officerwould believe you.

For a function, f(x), you can compute the average rate of change in the same way. Dividethe change in output by the change in input, and you would find the average rate of changeover that range of input values.

Average rate of change of f(x) over the interval [a, b] =f(b)− f(a)

b− a

For example, the average rate of change of f(x) = x3 − 2x over the interval [1, 3] would be

f(3)− f(1)

3− 1=

21− (−1)

2− 0= 11.

If you were curious about the instantaneous speed of the car with the broken speedometer,you could attempt to compute your average speed over small intervals of time. It is reasonableto expect that over small time intervals, your speed would be fairly constant, so the averagespeed would be close to the instantaneous speed. In the case of the function f(x), we cancompute the average rate of change over small intervals. To demonstrate in the interval [a, b]that b is close to a, we rewrite b as a+ ∆x. So we consider the interval [a, a+ ∆x] for smallvalues of ∆x. In this case, the average rate of change is

f(a+ ∆x)− f(a)

(a+ ∆x)− a=f(a+ ∆x)− f(a)

∆x.

In order to compute the instantaneous rate of change of a function, we will compute theaverage change over smaller and smaller intervals. For example, to compute the instanta-neous rate of change of f(x) = x3 − 2x at a = 1, we create Table 1:

As the ∆x value gets smaller, the average slope gets closer and closer to a value of 1,so we can conclude that the instantaneous slope is 1. Notice that the table includes bothpositive and negative values of ∆x. This allows us to determine if the slope from the rightand the slope from the left match up at the point a. One place where this argument fallsapart is if the function has a corner, then the slope from the right and from the left will bedifferent, so that it would be impossible to determine the instantaneous slope. We say thistype of function is non-differentiable at the corner point.

This instantaneous slope is an important value that gives us information about the shapeof the graph of the curve, at least locally. Recall from our work with lines that if a line haspositive slope, that line is increasing. Similarly, if a function has a positive instantaneousrate of change, the function is increasing (at that point). We will define this instantaneous

14

∆xf(a+ ∆x)− f(a)

∆x

0.11.13 − 2.2− (−1)

.1= 1.31

-0.1.93 − 1.8− (−1)

−.1= 0.71

0.011.013 − 2.02− (−1)

.01= 1.0301

-0.01.993 − 1.98− (−1)

−.01= 0.9701

0.0011.0013 − 2.002− (−1)

.001≈ 1.003

-0.001.9993 − 1.998− (−1)

−.001≈ 0.997

Table 1. Approximating the Instantaneous Rate of Change with DifferenceQuotients

slope to be the derivative of f at a (denoted dfdx

(a) or f ′(a))1 as:

df

dx(a) = f ′(a) = lim

∆x→0

f(a+ ∆x)− f(a)

∆xWe use the notation lim

∆x→0to refer to the limit as ∆x approaches 0. We compute the value

for smaller and smaller values of ∆x, and determine if it is approaching a particular value.Tangent Line. Consider a line defined by two points,(a, f(a)) and (a + ∆x, f(a + ∆x)).

This type of line, called a secant line, passes through the graph of the function, f(x), attwo points with slope

f(a+ ∆x)− f(a)

a+ ∆x− a=f(a+ ∆x)− f(a)

∆x.

Just as the average slope of the function approximates the instantaneous slope, the secantline which passes through the points (a, f(a)) and (a+∆x, f(a+∆x)) approximates anotherline, the tangent line to the curve by letting ∆x get smaller and smaller. Think ofthe graph of your function. If your function has a derivative at a, there is a line that just“kisses” the graph of the function at (a, f(a)). That is, if the graph of y = f(x) is smoothand doesn’t have any corners or breaks, it is possible to find a line which is tangent to thecurve at the point (a, f(a)). The tangent line approaches the graph of the function, justtouches the graph and then continues linearly. The slope of this tangent line will be thederivative of f at a.

1There are many different notations for differentiation because different mathematicians and scientistsdiscovered them all around the same time and invented different ways of representing the same concept.This might make a good extra credit paper if you are interested

15

t

y

• •

−1 1 2 3

1

2

3

Figure 3. Secant Lines (gray) and the Tangent Line (dark) to a Curve

16

Name:

Homework 2.2. For each of the following functions, numerically approx-imate thederivative at the given value a using the difference quotient for the givenstepsize ∆x.

1. f(x) = x3 at a = 1 with ∆x = 0.1

Note: Computef(a+ ∆x)− f(a)

∆x=

1.13 − 13

.1

2. f(x) = x3 at a = 1 with ∆x = 0.01

3. f(x) = x3 at a = 1 with ∆x = 0.001

4. f(x) =1

xat a = 2 with ∆x = 0.5

5. f(x) =1

xat a = 2 with ∆x = 0.05

6. f(x) =1

xat a = 2 with ∆x = 0.005

7. f(x) = 3x at a = −1 with ∆x = 0.2

8. f(x) = 3x at a = −1 with ∆x = 0.002

9. f(x) =√x+ 4 at a = 5 with ∆x = 0.25

10. f(x) =√x+ 4 at a = 5 with ∆x = 0.0025

11. f(x) = cos(x) at a = π2 with ∆x = 0.01

12. f(x) = cos(x) at a = π2 with ∆x = 0.0001

17

3. Properties of the Derivative

The goal of this section is to learn to use the derivative of a function to describe thebehavior of the original function. We won’t be able to recover the whole function, but wecan still learn quite a bit. Going back to the car analogy for a minute, if all you know aboutthe behavior of the car is how fast you are going at any time, you can figure out how faryou have driven, but you cannot figure out where you end up unless you know where youstarted.

We can use the the value of the derivative at a particular point to determine the tangentline. For example, if we know that f(2) = 4 and f ′(2) = −1, then we know that the tangentline to the function f(x) at x = 2 passes through the point (2, 4) (just as the function does)and has slope of −1. We conclude that the tangent line is

y − 4 = −1(x− 2) or y = 4− (x− 2).

In general, the tangent line to the function f(t) at t0 is given by

y = f(t0) + f ′(t0) · (t− t0).

Next, although we have been computing the value of the derivative at a particular point,there is no reason we can’t compute this at every point where the function is smoothlydefined. So if f(t) is defined for all real numbers and has no discontinuities or corners, thenwe can define the derivative, f ′(t), to be another function defined for all real numbers. Thederivative, as a function, gives the slope of the tangent line at every point t. While it canget very tedious to compute by hand, determining the limit of the difference quotient overand over again, in this class we will use technology to expedite the process.

−2 −1 1 2

−2

−1

1

2

3

Figure 4. A Function and its Derivative

In Figure 4, the original function is graphed as a solid line, and the derivative is graphed asa dashed line. When the original function is increasing, the derivative is positive. Similarly,when the original function is decreasing, the derivative is negative. If the original functionhas a horizontal tangent, which happens at a maximum or minimum, then the derivative iszero.

18

As the function gets steeper, the derivative gets more positive or more negative. InFigure 4, as t increases from −2 to 0, the function is first decreasing, then obtains itsminimum, then increasing and then increasing more until t = 0. Through this entire interval,the graph appears to be a cup or a valley and the derivative is increasing. This valley-shape,in which the slope is increasing, is referred to as being concave up. If the slope of thefunction is decreasing over a region, the graph of the function appears to be a mountain topand the function is said to be concave down. A point where the concavity changes, suchas from concave up to concave down or vice versa, is called an inflection point.

x−3 −2 −1 1 2 3

−1

1

2

3

4

5

Figure 5. Graph of f(x)

We can graphically analyze the graph of a function and sketch a graph of its derivative.Consider the function f(x) given in Figure 5. Notice that for values less than −1, thefunction is primarily constant, so the derivative is close to zero. Between −1 and 1, thefunction decreases, making the derivative is negative. For values larger than 1, the functionis increasing, so the derivative is positive. Additionally, the function has a horizontal tangentline at x = 1, where the minimum occurs and the derivative is zero there. For values largerthan 0, the function is concave up, so that the derivative will be increasing in this region.

When units are available (see Figure 6), we can draw in the tangent line and measurethe slope of the tangent line This helps us estimate a slope between approximately −0.8 and0 is approximately −2.

We use the technique of estimating slopes to sketch the graph of the derivative of Figure 6in Figure 7.

Finally, the derivative of a function depends only on its shape and not on its value. Twofunctions which have the same shape will have the same derivative, even if one is shifted upfrom the other. If two functions differ by exactly a constant, then they will have the samederivative.

19

x−2 −1 1 2

−1

1

2

Figure 6. Using Units to Estimate the Value of f ′(x)

x−2 −1 1 2

−2

−1

1

2

Figure 7. Graph of f ′(x)

20

Name:

Homework 2.3. For each of the following graphs, sketch a graph of thederivative on the same set of axes.

1.

−4 −3 −2 −1 1 2 3 4

−4

−3

−2

−1

1

2

3

4

2.

−4 −3 −2 −1 1 2 3 4

−4

−3

−2

−1

1

2

3

4

21

3.

−4 −3 −2 −1 1 2 3 4

−4

−3

−2

−1

1

2

3

4

4.

−4 −3 −2 −1 1 2 3 4

−4

−3

−2

−1

1

2

3

4

22

5. The temperature, H, in degrees Celsius, of a cup of hot tea placed on thekitchen counter is given by H = f(t), where t is in minutes starting fromthe moment the tea was put on the counter.(a) Is f ′(t) positive or negative? Give a reason for your answer.

(b) What are the units of f ′(20)? What is its practical meaning in termsof the temperature of the tea?

(c) How would your answers change if the object being discussed was aglass of ice water?

6. You are told that water is flowing through a pipe at a constant rate of10 cubic feet per second. Interpret this rate as the derivative of somefunction.

7. Let f(x) be the elevation of the Mississippi river x miles from its source.What are the units of f ′(x)? What can you say about the sign of f ′(x)?

8. When you breathe, a muscle, called the diaphragm, reduces the pressurearound your lungs which causes them to expand and fill with air2. Thetable shows the volume of a lung as a function of the reduction in pres-sure from the diaphragm. Pulmonologists, or lung doctors, define thecompliance of the lung as the derivative of this function.

Pressure reduction Volume(cm of water) (liters)

0 0.205 0.2910 0.4915 0.7020 0.8625 0.9530 1.00

(a) What are the units of compliance?

(b) Estimate the maximum compliance of the lung.

(c) Explain why the compliance gets small when the lung is nearly full(about 1 liter).

2Imagine an accordion player. The player uses his arms to pull the instrument apart just like thediaphragm pulls on the lungs

23

4. Differential Equations and Slope Fields

One of the most useful aspects of Calculus is the ability to describe a function in terms ofhow it is changing, or, in terms of its derivative. We can often determine when a quantity willbe increasing or decreasing as a function of either its value or its time or both. An equationinvolving derivatives whose solution is a function is known as a differential equation.Some examples of differential equations include:

dy

dt= 3y

dy

dx= 2y − x

dy

dt= y2 − t2 dy

dt= 0.1(25− y)

The solution to a differential equation is not one function, y(t), but a so-called family offunctions. This means that there is a collection of functions that satisfy the differentialequation. Generally, the functions are related in some way or another, often by a parameter.For example, the family of functions f(x) = c is a solution to the differential equationdfdx

= 0. Sometimes we want to be more specific in our search for a solution and will requireour solution to pass through a particular point (usually the value when t = 0). This type ofproblem is called an initial value problem, which consists of a differential equation and aninitial condition3. Assuming a nicely behaved differential equation (for some vague definitionof nicely behaved), these initial value problems always have a unique solution4. In general,initial value problems are of the form

dy

dt= f(t, y) y(t0) = y0

where f(t, y) describes the differential equation, and y(t0) = y0 gives the initial condition.In this setting, y(t) is the solution we are looking for.

There exist algebraic methods for finding exact solutions to a variety of differential equa-tions, however these will not be explored in this text. Instead, we will focus on numerical andgraphical techniques for finding approximate solutions to differential equations. This has theadvantage of being easier and more applicable to a larger variety of differential equations.

The first observation to make is that, given an initial value problem

dy

dt= f(t, y) with y(t0) = y0,

we can quickly determine dydt

(t0) by plugging it into the differential equation. From this, wecan find the tangent line to the solution curve at (t0, y0). For example, in the initial valueproblem of

dy

dt= y + t with y(1) = 2,

we can observe that the value of dydt

(1) = 3, because dydt

= y + t = 2 + 1 (by combining thedifferential equation with the initial conditions). Because the solution curve passes through

3Notice that we are being a bit sloppy in our nomenclature since t0 is not required to be zero and so theterm “initial” could be a bit misleading.

4There are many poorly behaved differential equations, but they are not studied in undergraduatemathematics courses because they rarely show up in real-world applications. For some reason, having astable world that we live in implies that the rules that govern that world are nicely behaved.

24

the point (1, 2) and has slope equal to 3 at that point, the tangent line to the curve at (1, 2)will be y − 2 = 3(t− 1) or y = 2 + 3(t− 1). See Figure 8.

Extending this notion, we can determine the slope of the solution to the differentialequation at every point by plugging it into the differential equation. If we drew everytangent line to every solution curve our graph would rapidly get very messy. Instead, weonly draw short little lines through each point with the appropriate slopes to give us localinformation. We call the collection of all these short lines a slope field. At every point, wedetermine the slope and fill in a small line segment with the correct slope. For example, forthe differential equations dy

dt= y+ t, we can compute the slope at many different points and

place them in Table 2.

Table 2. Slope Table for dydt

= t+ y

t y dydt

= t+ y-1 -1 -20 -1 -11 -1 0-1 0 -10 0 01 0 1-1 1 00 1 11 1 2

−2 −1 1 2

−2

−1

1

2

Figure 8. Slope Field for dydt

= t+ y

Once we have enough points, we can fill in the slope field by drawing a short line withthe appropriate slope at each point. Observe in Figure 8 that one could trace the curvesby following along the slope lines in the correct direction. For example, the straight liney = −t − 1 appears to be a solution to this differential equation. The slope of the liney = −t − 1, dy

dt, is −1. By substituting the function and the derivative into the original

25

differential equation, we find equality:

dy

dt= t+ y

= t+ (−t− 1) = −1

There are other solutions to the differential equation that are not straight lines. By drawingin the curves that have the correct slopes at each point, we can sketch in approximate solutioncurves.

−2 −1 1 2

−2

−1

1

2

Figure 9. Slope Field with Solution Curves

Notice in Figure 9 that our graphical solution is easier to see with more computations.When we compute the slope at more points, there are more slope lines to follow, and moreaccurate graphs of the solutions can be drawn.

Observe that, depending on where you start sketching in your solution on the slopefield, you will likely draw a different curve. These correspond to the different solutions fordifferent initial conditions. A single differential equation will have a family of solutions, butif we impose an initial condition, that is, pick a particular point to start sketching, we willhave just one solution.

Finally, we can check our analysis of the differential equation by looking at the slopefield. For example, in the differential equation

dy

dt= t+ y,

the slope, dydt

, is positive when t + y > 0 (that is when y > −t). It must follow then, thatin the region above the line y = −t the solution curves will all be increasing (because yincreases if dy

dt> 0). Along the line y = −t, the slopes will all be zero. Curves that cause the

differential equation to be zero are called nullclines. In Figure 9, the solution curves havehorizontal tangents when they cross the line y = −t. In fact, the solution curves must allhave minimums when they cross this line, because the slope is changing from a negative valueto a positive value as it crosses that line. Similarly, the solution curves are all decreasingwhen y < −t because the slope dy

dttakes on negative values. In this way we can anticipate

the behavior of the solutions to the differential equations from the equations themselves.

26

We know from the previous section that points where the derivative of a function equalszero are important. These points correspond with where the function is horizontal. Forevery differential equation, the points where the differential equation equals zero are knownas the nullcline. On the nullclines, the lines of the slope field are horizontal. For example:

dy

dt= y + t = 0

y = −t.If you look at Figure 9, the lines are horizontal along the line y = −t.

Equilibrium Solutions. For some differential equations, we can find a very valuablesolution to a differential equation called the equilibrium solution. This is a solution thatdoes not change. The nullclines are equilibrium solutions if they do not depend on t. Justlike for nullclines, we find the equilibrium solution by setting the differential equation equalto zero. Not all differential equations have equilibrium solutions, but when they exist, theyare very important. For example

dy

dt= y − 2 = 0

y = 2.

For the differential equation,dydt

= y − 2, if we start with the initial value, y = 2, thesolution does not change. This is the equilibrium solution. Equilibrium solutions dividethe solution space into regions that cannot be crossed. Additionally, all solutions are eitherdrawn towards, attracted to, or pushed away from, repelled from, equilibrium solutions.We classify an equilibrium solution as stable if all nearby solutions are attracted to it andunstable if all nearby solutions are repelled by it.

27

This page intentionally left blank.

Name:

Homework 2.4.

1. Identify which differential equation corresponds to which slope field.

a.dy

dx=

2y

1 + y2

b.dy

dx= y2 − 3

c.dy

dx= 2y − x

d.dy

dx= y2 − xy

1.

−3 −2 −1 1 2 3

−3

−2

−1

1

2

3

2.

−3 −2 −1 1 2 3

−3

−2

−1

1

2

3

3.

−3 −2 −1 1 2 3

−3

−2

−1

1

2

3

4.

−3 −2 −1 1 2 3

−3

−2

−1

1

2

3

2. For each of the differential equations, find the nullclines.3. For each of the slope fields above, sketch the solution curves for the initial values.

y(0) = 1 y(0) = 0 y(0) = −1

4. Which of the differential equations have equilibrium solutions? Sketch in the equilibriumsolutions on the appropriate slope fields.

29

5. Euler’s Method

In the previous section, we demonstrated how to find graphical solutions to differentialequations. The solution to a differential equation will, for each point, have a slope thatmatches the value of the differential equation at that point. In this section, we will developa technique to find an approximate numerical solution for a differential equation.

Suppose we are given a differential equation with an initial condition of the form:

y′ = f(t, y) with y(t0) = y0.

The solution to the problem is a curve passing through the point (t0, y0) which satisfies thedifferential equation. In particular, the instantaneous slope of the curve passing through thepoint (t0, y0) will be f(t0, y0).

y = y0 + f(t0, y0) · (t− t0)

Since we only have information about the solution at (t0, y0), we will use that to find thestraight line approximation to the solution curve, see Figure 10.

0.5 1 1.5 2

0.5

1

1.5

2

Figure 10. Straight Line Approximations and Exact Solution

We will use this straight line approximation for some pre-determined amount of time,∆t. At some new time, called t1 with t1 = t0 + ∆t, we will find the y value at t = t1 whichgives us a new point (t1, y1) where y1 = y0 + ∆y. Specifically, substituting t + ∆t into theequation of the line, we get

y1 = y0 + f(t0, y0) · (t0 + ∆t− t0)

= y0 + f(t0, y0)∆t

Once we have this new point, we repeat the process of finding a straight line approximationpassing through the new point (t1, y1). The only thing we have to pay attention to iscalculating the slope of our new straight line approximation using the differential equation.The next line has slope y−y1

t−t1 = f(t1, y1), which we use for the same pre-determined amountof time ∆t. This gives us a new time, t2 = t1 + ∆t at which we find a new y value,

y2 = y1 + f(t1, y1)∆t

30

This process can be repeated over and over to give a series of approximate values. Therecursive formulas are

tn+1 = tn + ∆t and yn+1 = yn + f(tn, yn)∆t.

This method for approximating solutions to a differential equation

y′ = f(t, y) with y(t0) = y0.

is called Euler’s method.

Example. For example, we can use Euler’s method to find an approximate solution tothe differential equation:

y′ = y − t with y(0) = 0.5

We need to define a value of ∆t, so we will use ∆t = 0.25. Observe that in our notationf(t, y) = y − t, so that:

y1 = y0 + (y0 − t0)∆t = 0.5 + (0.5− 0)× 0.25 = 0.625

t1 = t0 + ∆t = 0 + 0.25 = 0.25

y2 = y1 + (y1 − t1)∆t = 0.625 + (0.625− .25)× 0.25 = 0.7188

t2 = t1 + ∆t = 0.25 + 0.25 = 0.5

y3 = y2 + (y2 − t2)∆t = 0.7188 + (0.7188− .5)× 0.25 = 0.7734

t3 = t2 + ∆t = 0.5 + 0.25 = 0.75

y4 = y3 + (y2 − t2)∆t = 0.7734 + (0.7734− .75)× 0.25 = 0.7793

t4 = t3 + ∆t = 0.75 + 0.25 = 1.0

Thus, the solution of y′ = y− t with y(0) = 0.5 has a solution with y(1) ≈ .7793. Generally,we record some intermediate details in a table or a spreadsheet while we calculate so thatwe don’t loose track of what we are doing. Specifically: Initialize t0 and y0

Initialize NumberOfStepsfor n going from 1 to NumberOfSteps do the following:

tn = t0 + n∆t(1)

∆yn = f(tn−1, yn−1)∆t(2)

yn = yn−1 + ∆yn(3)

where ∆t is the step change in time and f(t, y) = dydt

= y′(t, y). We usually calculate

∆t = tend−t0n

. You can set up a table like Table 3, or a spreadsheet to keep track of thedetails.

As we saw in Figure 10, this is an approximate solution. As long as our solution curve isanything other than a straight line, the Euler’s method approximation will differ from theactual solution. Furthermore, after every step, the error will accumulate, so that the fartheraway from the starting point we go, the larger the error will be. One can reduce the errorby decreasing the step size, ∆t. This, however, also increases the number of computationsto reach the same end value of t.

31

tn yn ∆t y′ = f(tn, yn) ∆y0 0.5 0.1 0.5 0.05

0.1 0.55 0.1 0.45 0.0450.2 0.595 0.1 0.395 0.03950.3 0.6345 0.1 0.335 0.03350.4 0.6680 0.1 0.268 0.02680.5 0.6947 0.1 0.195 0.01950.6 0.7142 0.1 0.114 0.01140.7 0.7256 0.1 0.026 0.00260.8 0.7282 0.1 -0.072 -0.00720.9 0.7210 0.1 -0.179 -0.01791.0 0.7031 – – –

Table 3. Euler’s method with ∆t = 0.1

If we repeat the example above with ∆t = .1, we get the calculations in Table 3. Having∆t = 0.1 yields a better approximation of y(1) ≈ 0.7031, especially when compared with theexact value which is 2− e

2≈ .6409. We can be precise about the improvement by calculating

the relative error,

∣∣∣∣correct− resultcorrect

∣∣∣∣.∆t Euler’s Method Value Relative Error0.5 0.7793 21.6%0.1 0.7031 9.7%

Note that, in Figure 10 the solution curve is concave down and thus, it curves away fromthe the straight line approximation. It follows that when the solution curve is concave down,Euler’s method gives an overestimate for the exact value of the curve. Similarly, when thesolution curve is concave up, Euler’s method will give an underestimate.

32

Name:

Homework 2.5.

1. Fill in the following table to approximate the solution to the initial value problem:

dy

dt= −y y(0) = 2,

using the stepsize ∆t = .5 to find an approximate value for y(2).

n tn yn ∆t y′ = f(tn, yn) ∆y

0 0 2 0.5

1 0.5

2 0.5

0.5

– – –

2. Fill in the following table to approximate the solution to the initial value problem:

dy

dt= 1 + y + t y(0) = −1,

using the stepsize ∆t = .25 to find an approximate value for y(1).

n tn yn ∆t dydt

∆y

33

3. Fill in the following table to approximate the solution to the initial value problem:

P ′ = .3

(1− P

1000

)P P (0) = 300

using the stepsize ∆t = .2 to find an approximate value for P (1).

n tn Pn ∆t P ′ ∆P

– – –

4. Use Euler’s method to approximate the solution to the initial value problem:

y′ = t2 − y2 y(1) = 2

using the stepsize ∆t = .1 to find an approximate value for y(2).

34

5. Use Euler’s method to approximate the solution to the initial value problem:

dy

dx=−yx

y(1) = 1

using the stepsize ∆x = .2 to find an approximate value for y(3).

6. Use Euler’s method to approximate the solution to the initial value problem:

dP

dt= .4

(1− P

2000

)P P (0) = 800

using the stepsize ∆t = .1 to find an approximate value for P (2).

7. Use Euler’s method to approximate the solution to the initial value problem:

dy

dt= ty −√y y(0) = 1

using the stepsize ∆t = .1 to find an approximate value for y(2).

8. Use Euler’s method to approximate the solution to the initial value problem:

dy

dx=−xy

y(3) = 4

using the stepsize ∆x = .1 to find an approximate value for y(5). What happens if youtry to find the an approximate value for y(5.5)? Why?

35

6. The Anti-Derivative and the Integral

Anti-Derivatives. One question which frequently arises in the setting of differentialequations is to find a find function with a specific derivative. That is, find a function y(t)so that y′(t) = f(t) for a specific f(t). Such a function with a specific derivative is called ananti-derivative. That is, if F ′(t) = f(t) then F (t) is an anti-derivative of f(t). Notice thatbecause the derivative of a constant is zero and because differentiation is additive, if F (t) isan anti-derivative of f(t), then so is F (t) +C for any constant. For this reason, one refers tothe general anti-derivative of a function F (t) + C, which is the family of all anti-derivativesof a given function.

We can use Euler’s method to find an approximate anti-derivative of a specified function.We need only find one anti-derivative, since they all differ by a constant, so we will solve theinitial value problem

y′(t) = f(t) with y(a) = 0

where a is a particular value where f(t) is defined. In order to compute the value of y(b),

we divide the interval from a to b into n subintervals each of length ∆t =b− an

. If we call

t0 = a, we use Euler’s method to solve the differential equation.

y1 = y0 + f(t0, y0)∆t = f(t0)∆t t1 = t0 + ∆t

y2 = y1 + f(t1, y1)∆t = t2 = t1 + ∆t

= f(t0)∆t+ f(t1)∆t

y3 = y2 + f(t2, y2)∆t t3 = t2 + ∆t

= f(t0)∆t+ f(t1)∆t+ f(t2)∆t

and so on

yn = f(t0)∆t+ f(t1)∆t+ f(t2)∆t+ · · ·+ f(tn−1)∆t

So that y(tn) (which is y(b)) is approximately equal ton−1∑i=0

f(ti)∆t. Additionally, it

is understood that as n gets larger (so that ∆t gets smaller) this will become a betterapproximation for the actual value of F (b).

It is worth visualizing this summation. If we recognize each f(ti)∆t term as the heightof a rectangle multiplied by the width of a rectangle. See Figure 11.

Fundamental Theorem of Calculus. Notice thatn−1∑i=0

f(ti)∆t is the area contained in

a series of rectangles. This area appears to be approximately the area above the x-axis andbelow the graph of the curve, generally referred to as the area under the curve. As we make∆t smaller, the anti-derivative found by Euler’s method will be a better approximationfor the area under the curve. This summation is approximately equal to the area underthe curve between the values of a and b. Furthermore, as ∆t gets smaller this summationbecomes a better approximation for the area under the curve. This observation lead to the

36

1 2 3 4

0.5

1

1.5

2

Figure 11. Rectangles Approximate the Area Under the Curve

Fundamental Theorem of Calculus : there is a direct relationship between an anti-derivativeand the area under the curve. It should be mentioned that this area is bit more complicatedthan traditional area, because if f(ti) is negative (below the x-axis) this will give us a‘negative’ area.

We refer to this the signed area under the curve y = f(t) between a and b to be the

definite integral of f(t) between a and b (denoted

∫ b

a

f(t)dt or simply∫ b

af). Essentially, the

theorem says that that if we use smaller and smaller ∆t in Euler’s Method, we can define,∫ b

a

f(t)dt = limn→∞

n−1∑i=0

f(ti)∆t,

and this integral gives us an anti-derivative of f(t). The an is important because there arean infinite number of anti-derivatives for any function and the Euler’s Method limit is givingus one, specific one.

Theorem 2.1 (The Fundamental Theorem of Calculus). If F (t) =

∫ t

a

f(x) dx then F ′(t) =

f(t).

Left and Right Sums. Euler’s approach of approximating the integral is called a leftsum. The height of each rectangle is determined by the value at the left end of the subinterval.This lead mathematicians to ask the question, “Is there something special about using theleft end of the subinterval?” Of course not, one can also approximate the area under thecurve by means of a right sum, in which the height of the rectangle is determined by thevalue at the right end of each subinterval. See Figure 12.

For example, when computing an approximate value for∫ 3

1f(t)dt using ∆t = 0.5, the

interval from 1 to 3, is broken up into 4 subintervals. The left sum will yield

f(1) · 0.5 + f(1.5) · 0.5 + f(2) · 0.5 + f(2.5) · 0.5,while the right sum will yield

f(1.5) · 0.5 + f(2) · 0.5 + f(2.5) · 0.5 + f(3) · 0.5.

37

1 2 3 4

0.5

1

1.5

2

Left Sum

1 2 3 4

0.5

1

1.5

2

Right Sum

Figure 12. A Left Sum and a Right Sum for the same Integral

In a more traditional Calculus class, time is spent learning algebraic techniques for eval-uating integrals. These techniques allow us to find exact formulas for a few of the differentialequations seen throughout this book. However, in this course, numerical approximations aresufficient and also allow us to evaluate integrals for which no algebraic techniques exist. Wewill revisit the topic of integration in Chapter 5, with a particular interest in finding betterapproximations for the area under the curve.

38

Name:

Homework 2.6. For each of the following functions, numerically approx-imate the integral over the given range for the given stepsize, first using leftsums and then using right sums.

1.

∫ 2

1

t3 dt with ∆t = 0.5

Note: This is f(t) = t3 from a = 1 to b = 2

2.

∫ 2

1

t3 dt with ∆t = 0.1

3.

∫ 2

−1

2− t2 dt with ∆t = 0.6

4.

∫ 4

−2

2− t2 dt with ∆t = 0.6

5.

∫ 4

−1

4 + t− t2 dt with ∆t = 0.5

6.

∫ 10

5

√x dx with ∆x = 0.2

7.

∫ 3

0

1

1 + x2dx with ∆x = 0.5

8.

∫ 1

−1

1− t2

1 + t2dt with ∆t = 0.25

9.

∫ 2

1

√s2 + 1 ds with ∆s = 0.1

10.

∫ 3

0

cos(2θ) dθ with ∆θ = 0.2

39

Chapter 2 Review

Big Ideas• Lines

– Finding equations of lines using multiple approaches• Functions• Average Rate of Change• Derivatives

– Sketching derivatives from graphs of functions– Units of derivatives

• Differential equations and initial value problems• Euler’s method• Integrals

At this point you should be able to• Given two points, find an equation of the line that they lie on• Given a point and a slope, find an equation of the line that goes through the point

with the given slope• Identify whether or not a graph is a function• Find the average rate of change of a function between two time steps• Numerically approximate a derivative of a function at a particular spot• Find the units of the derivative of a function given the units of the original function

and the independent variable• Given the graph of a function, sketch the derivative of the function so that a reader

could recognize from your sketch where the original function is increasing, decreas-ing, concave up, and concave down• Given a slope field of a differential equation, sketch a solution curve for the corre-

sponding differential equation• Given a differential equation, find the nullclines and, if existent, the equilibrium

solutions• Given a slope field of a differential equation, identify the nullclines and, if existent,

the equilibrium solutions for the corresponding differential equation• Use Euler’s method to find approximate solutions to an initial value problem by

hand and by using a computer• Use Left and Right Sums to find approximate values for definite integrals

To prepare for assessment on this chapter, write your own questions for each of the abovetasks. If there is time, have everyone in your team do the same thing and then attempt tosolve each other’s question.

40

CHAPTER 3

Exponential Models

1. The Modeling Process

Farmer Brown wants to enclose 100 square feet of field with the minimum amount of fencein a rectangular shape. To many, this may seem like an odd and fruitless endeavor. Mostmath books are filled with contrived examples constructed to demonstrate particular math-ematical techniques. It is unusual to ask the questions first and then find the mathematicswhich will help solve the problem. However, this is the way mathematics was discoveredinitially; starting with a problem, then developing the mathematics to solve it.

The real problem with this approach is that most problems are very hard and complicatedwith many confusing parts. To attack a more complex problem, like describing the motionof a bungee jumper or a hot air balloon, is simply too hard to solve using the same methodsused by Farmer Brown. One needs to simplify the problem enough so that it solvable, andthen add in the more complex aspects of the model one at a time until the original questionis solved. This approach is known as mathematical modeling: replacing a problem found inthe real world with a mathematical model that has been simplified enough to be solvable.Ideally, the solution of a mathematical model has some bearing on the solution of the realworld problem, but that is not always the case.

The ability to conceptualize, model, and solve problems is a skill companies look for.This is one of the reasons why employers want to hire people with lots of mathematicstraining. Studying mathematics is training in problem solving, paying attention to detail,and abstraction. You train to take a complicated project and break it down into smaller,manageable parts and then reassemble those parts into a reasonable and rational whole. Thefollowing steps will help organize the model-creation process.

Brainstorming. At this point, you want to write down all the variables, constants,concepts, links, and other things that you think are going to be involved in solving theproblem. You don’t have to leave out the crazy ideas because you may ignore them laterwhen we start making assumptions. Identify which things will change (these are calledvariables) and which will not (these are called constants).

The first time you attack any question, you should try to come up with a five minutemodel . This is your very first pass at the question and should help point out to you wherethe more complex parts are going to be when you begin to refine your model. You shouldnot necessarily expect your five minute model to give you an answer that makes sense, butto give you ideas about what items are important.

Assumptions. Assumptions are the decisions you, as the modeler, make to assist in math-ematizing and quantifying the original problem. If you were modeling the flu, you may decideto fix the size of the population susceptible to the flu to those students living in the resi-dence hall. If you were modeling population growth, you may decide to ignore age or size ofpopulation as a part of reproduction rate. As you go, keep track of your assumptions andmake sure you list them all when you are writing a report about your solution. Assumptionsare an important part of your model because different assumptions may lead to differentmodels, and therefore, different results.

Some of the most important assumptions are decisions about relationships between vari-ables. If one variable is dependent on the values of other variables, it is called a dependent

42

variable. Variables which do not depend on any other variables or constants are called in-dependent variables. You may find, as you improve your model, something which you hadassumed was constant may actually be a variable.

Another important beginning piece of the model is to determine what the units will befor your variables and constants. This becomes useful when you start to put things together.Try to be consistent with your units. Do not measure some parts in seconds and others inyears.

Restate the Problem. At this point, you should be able to restate the problem inyour own words and clarify what is being asked. In particular, many times the problem asksfor an optimal1 solution, but may be unclear as to what is meant by optimal. The problemstatement should include your independent and some of your dependent variables.

Sub-Models. Some questions are so big that they need to be broken down into sub-questions, which then will create sub-models. For example, if you are trying to model thefuel efficiency of a car, you may want one model for city driving and another for freewaydriving because gasoline consumption is different between when you are driving at highspeeds and when you are in stop-and-go traffic.

Creating a mathematical description. Once you are confident you know what ques-tion you are attempting to answer and have a list of dependent and independent variables,you want to explore the mathematical relationships among them. At first this is not easy,but as you become more experienced, it will start to make more sense. This process is verysimilar to how you would attack a word problem in earlier mathematics courses, except thatyou may discover along the way that you need more information. When this happens, yougo back to the previous section and brainstorm ways you are going to get that information.

In the end, you will have a list of variables and constants with equations that relate themtogether. Each variable will have units that are logically consistent within your system ofequations.

Solving the model. It turns out that many models are unsolvable using the algebraictechniques you may have learned in previous courses, so we are going to use numericaltechniques to find approximate solutions. Most of the time the errors that occur usingnumerical techniques are small compared to the errors in measurement which are requiredto approximate constants and validate your model. We use a software package to do thenumerical calculations for us, but keep in mind that you could do all these by hand if youreally wanted to.

Vensim R© PLE. Vensim R© PLE 2 (http://vensim.com/) is software created by VentanaSystems, inc. We use Vensim R© PLE in this class because it is free for personal and academicuse. At this point you will want to run through the first Vensim R© PLE tutorial to familiarizeyourself with the program. If you get to the point in your career where you are a professionalmathematical modeler, you will need to move to a paid version.

1maximum or minimum2Personal Learning Edition

43

Results. Once your model is working, it is time to ask yourself some questions:

• Are the results what you would expect? How realistic are they?• For how long does your model work? Sometimes simplifying assumptions have

solutions that work in the short term, but not in the long term.• If you have real world data, how well does your model match the data? Does it

capture the general trend of the data even if it does not fit exactly?• How robust are your results? That is, if you perturb the value of one or more of your

constants do you get generally the same results, or do you get something radicallydifferent?• Do your results answer the question that was asked?• Can you go back to some of your simplifying assumptions and replace them with

sub-models to improve your model?

If the mathematical solution matches the real world data, we report our solution. If not,we adjust our assumptions, to help us find a better solution. When you write the report onyour model, be sure to include the answers to any of the above questions that are relevantto your problem.

Writing up your Model. Your model is not finished until you write a report aboutit and share it with the world. In this course, this usually means writing at least a portionof the model report and possibly giving an oral report to the class. Later on, it may meansubmitting your model report to a peer-reviewed journal to be published and eventuallyshow up in Google Scholar. There is an example of a report in Appendix A.

44

Name:

Homework 3.1. This homework is to help you practice the part of the modeling processwhere you take a question and build a model to solve it. In each case, the answer will be alist of variables and constants with appropriate units, simplifying assumptions, and one ormore differential equation(s) which describe the mathematical model.

1. The rate at which an investment I grows is proportional to the size of the investment.

2. The rate at which at an object’s temperature H cools is proportional to the differencebetween the object’s temperature and the temperature of the surrounding environment.

3. The rate at which an iceberg melts is inversely proportional to the iceberg’s volume.

4. The rate at which a rain drop evaporates is proportional to the surface area of the raindrop. (Assume the rain drop is spherical.)

5. The rate at which an ice cube melts is proportional to the surface area of the ice cube.(Assume the ice cube is a cube.)

45

2. Population and Doubling Time

Simple Population Growth Model. One of the simpler applications of the mathema-tial modeling apporach is population growth. We would like to gain a better understandingof how populations grow over time so that we can plan for future populations. We would liketo describe some variables that influence how populations grow. Observe that a populationgrows from birth rate and decreases from death rate, thus the birth rate is a positive rate ofchange and the death rate is a negative rate of change.

For our first, five minute model of population growth, we will assume that the numberof births and deaths is proportional to the size of the population. This will help explainwhy the number of births in Chicago, Illinois is more than the number of births in Ada,Ohio. This is due to the fact that there is a larger population of people present to be havingbabies. At the same time, the number of deaths in Chicago is more than the number ofdeaths in Ada. Notice that we are not saying anything about the birth rate per family ordeath rate per person; we are referring to absolute numbers, which is the rate of change ofthe population.

This enables us to write a simple model for a population. We observe that the change ina population is the increase in population minus the decrease in population.

Model: 3.1 (Simple Population Growth). Ignoring migration, we get the simple model of:

Change in Population = births - deaths

If we let the population in our town to be represented by the function P (t), notice thatthat change in population is the derivative of P (t). In our model, the number of births anddeaths are assumed proportional to the size of the population, so we write births = bP (t)and deaths = dP (t)(proportionality constants b and d). The above relation becomes

dP

dt= bP (t)− dP (t) = (b− d)P (t)

Notice that if a town’s death rate exceeds its birth rate, the town’s population will shrink,but if the birth rate exceeds its death rate the population will grow. We can incorporate thebirth rate and death rate into a single constant k = b− d so we get the standard model forexponential population growth

dP

dt= kP.

Table 1. Units of Variables associated with the Model

Variable or Constant Name UnitsP Population peoplet Time yearsk Population growth rate people/year

We also assume an initial population denoted P03 or P (0).

Suppose, for example, that k = 0.2 and P0 = 100. We select a suitable stepsize, ∆t = 0.1.Then Euler’s method is applied.

3Pronounced P-naught.

46

Table 2. Euler’s Method applied to P ′ = 0.2P, P (0) = 100

t P(t) ∆tdP

dt∆P

0 100 0.1 20 2

0.1 102 0.1 20.4 2.04

0.2 104.04 0.1 20.8 2.08

0.3 106.12 0.1 21.2 2.12

0.4 108.24 0.1 21.6 2.16

0.5 110.40 0.1 22.0 2.20

Notice in Table 2, each timedP

dt= kP = 0.2P (t) and ∆P =

dP

dt∆t.

Analytic Solution. For students who are missing the more traditional calculus ap-proach to problem solving, it is possible to use this technique in a more general situation tofind the analytic solution. Using just the general values of k, P0, and ∆t, we can use Euler’s

method to solvedP

dt= kP .

Table 3. Euler’s Method applied to Generic Exponential Growth Problem

n t PndP

dt∆Pn

0 0 P0 kP0 kP0∆t

1 ∆t P1 = P0 · (1 + k∆t) kP0 · (1 + k∆t) kP0 ·∆t · (1 + k∆t)

2 2∆t P2 = P0 · (1 + k∆t)2 kP0 · (1 + k∆t)2 kP0 ·∆t · (1 + k∆t)2

3 3∆t P3 = P0 · (1 + k∆t)3 kP0 · (1 + k∆t)3 kP0 ·∆t · (1 + k∆t)3

4 4∆t P4 = P0 · (1 + k∆t)4 kP0 · (1 + k∆t)4 kP0 ·∆t · (1 + k∆t)4

n n∆t Pn = P0 · (1 + k∆t)n kP0 · (1 + k∆t)n kP0 ·∆t · (1 + k∆t)n

47

This may seem a bit confusing at first, so let’s look in detail at a few Euler’s methodcalculations. Specifically,

P0 = P0

P1 = P0 + ∆P1

= P0 + kP0∆t

= P0(1 + k∆t)

P2 = P1 + ∆P2

= P1 + kP1∆t

= P0(1 + k∆t) + kP0(1 + k∆t)∆t

= P0(1 + k∆t+ k∆t(1 + k∆t))

= P0(1 + 2k∆t+ k2(∆t))2)

= P0(1 + k∆t)2

In general, we can see that

(1 + k∆t)n + k∆t(1 + k∆t)n = (1 + k∆t)n(1 + k∆t) = (1 + k∆t)n+1.

Remembering that these are approximations for true values of P (t), we get

P (n∆t) ≈ P0(1 + k∆t)n.

Let t = n∆t, so that ∆t = tn. This yields the formula

P (t) ≈ P0

(1 +

kt

n

)n

.

As n gets larger, this will approach the actual value of P (t). Without proof, we invoke theresult

limn→∞

(1 +

1

n

)n

= e

and recall our rule of exponentials,

xab = (xa)b or

(1 +

kt

n

)n

=

((1 +

kt

n

) nkt

)kt

which allows us to conclude

P (t) = limn→∞

P0

(1 +

kt

n

)n

= P0 limnkt→∞

((1 +

kt

n

) nkt

)kt

= P0ekt.

Thus, the advanced reader can see the solution to the differential equation P ′ = kP isP (t) = P0e

kt where P (0) = P0.

48

Exponential Functions. P (t) = P0ekt is not the only form in which we can write an

exponential function. One characteristic of exponential functions is that their relative growthrate4 is constant (this follows directly from our differential equation). This means that forexample, the time it takes for a growing exponential function to double is constant and doesnot depend on the size of the population. Suppose the doubling time for a population isten years. That means that in twenty years, the population would have doubled twice, andwould be four times its original size. In thirty years it would have doubled three times and beeight times its original size. In other words, every ten years we would multiply the originalpopulation by an additional factor of two.

Table 4. Demonstration of Doubling Time for Population Growth

time (in years) population populationoriginal size

0 P0 110 2P0 220 4P0 4 = 22

30 8P0 8 = 23

Check that, assuming an original size of P0, the population above fits the formula

P (t) = P02t/10.

In general, if the population doubles every D years the population could be calculated by

P (t) = P02t/D.

Now, for a quick review of logarithms. The definition of the logarithm function is theinverse of the power function.

y = logb x⇐⇒ x = by.

This means that we can translate the rules of multiplication, division, and exponentiationof power functions to logrithms with a bit of careful thought.

ba ∗ bc = ba+c ⇐⇒ logb(ac) = logb(a) + logb(c)(4)

ba/bc = ba−c ⇐⇒ logb(a

c) = logb(a)− logb(c)(5)

(ba)c = bac ⇐⇒ logb(ac) = c logb(a)(6)

Although logarithms can have any base, the most common bases are 10 and e. Generally,when you first learn about logarithms you start with base 10 (log(10) = 1, log(100) =2, log(1, 000) = 3). In advanced mathematics and science, it turns out that the most usefulbase is not 10, but e, which we will take for now as a number somewhere between 2 and 3that your calculator can figure out. Commonly, loge(x) is written ln(x).

What is the relation between P (t) = P02t/D and P (t) = P0ekt? Are they both correct?

To understand this, let D be the doubling time and observe that 2 = eln 2 so that

2t/D =(eln 2)t/D

= eln 2D

t.

We can conclude for the differential equation P ′ = kP , that k = ln 2D

and that the doubling

time is ln 2k

. This assumes that k is positive thus, the population is growing and will eventuallydouble. If k is negative, the population is shrinking. We can calculate the half-life (call it

4The definition of relative growth rate is P ′

P .

49

H), or the amount of time it takes for the population to shrink to half its original size, P0

2.

Assuming k is negative, by the same logic as above, the half-life is given by

H =ln 1

2

k= − ln 2

k.

50

Name:

Homework 3.2. Answer all questions so that the answer is accurate totwo decimal places. Pay attention to the units of your variables. All questionscan be answered without using Euler’s method.

1. A population grows at an exponential rate and doubles every 10 years.How long will it take for the population to triple?

2. An investment grows in value at an exponential rate. If the investmenttriples every 20 years, how long does it take for the investment to double?

3. An element decays at an exponential rate. If the element’s half-life is 280years, how much of the element is left after 1000 years?

4. A drug leaves the bloodstream at a rate proportional to the amountpresent. If the concentration of drug in the bloodstream decreases by50% in 15 hours, what percentage of the drug is present in the blood-stream after 35 hours?

5. If 100 mg of a drug with a half-life of 27 hours is injected into a patient,give a formula for the amount of drug in the patient’s bloodstream aftert hours.

6. Give the exact solution to the initial value problem:

dP

dt= .3P P (0) = 20

Sketch the graph of the solution. Determine the exact value of P(10).

51

3. Newton’s Law of Heating and Cooling

In the previous section, we developed a model of population growth where the rate ofchange of population is proportional to the population. It makes sense to study other modelswhere growth rate is proportional to the amount available. For example, Isaac Newtondiscovered a model of temperature change where the change of temperature is proportionalto the difference between the temperature of the object and the ambient temperature5. Thismodel is called Newton’s Law of Heating and Cooling. We observe that if a glass of coldlemonade placed in a warm room, it will heat up until it reaches the same temperature asthe room. Additionally, when the room’s temperature is hotter, the same glass of lemonadegets warm faster than when the room’s temperature is cooler. These two observations leadto Newton’s Law of Heating and Cooling, which states:

Model: 3.2. The change in an object’s temperature is proportional to the difference betweenthe object’s temperature and the ambient temperature

If we let T (t) be the temperature of the object and TR be the room temperature orambient temperature, we can write this statement as

dT

dt∝ T − TRorT ′ = k(T − TR).

We know from observation that if the room is warmer than the object, the object willincrease in temperature. This means that if TR > T we require T ′ > 0. We conclude thatk < 0. If the room is colder that the object, the object will cool down. This means that ifTR < T we require T ′ < 0. Notice that k is still required to be negative. We can observethat when the object is well insulated the change of temperature will be slow and thereforek will be small. Thus, the size of k is determined by the thermal conductivity which is afancy way of saying how insulated something is.

Just as in the previous section, we can use Euler’s Method to numerically solve thedifferential equation

(7)dT

dt= −0.1(T − 20) T (0) = 2

with ∆t = 0.2, where 20 is the ambient temperature measured in degrees Celsius and T (t)is the temperature in degrees Celsius of our glass of lemonade at time t minutes. The unitsof dT

dtwill be in degrees Celsius per minute.

Table 5. Euler’s Method applied to Lemonade

5The temperature surrounding the object.

52

t T(t) ∆t T ′ ∆T

0 2 0.2 1.8 0.36

0.2 2.36 0.2 1.76 0.353

0.4 2.71 0.2 1.73 0.346

0.6 3.06 0.2 1.69 0.339

0.8 3.40 0.2 1.66 0.332

1.0 3.73 0.2 1.63 0.325

According to Euler’s method, Table 5, the temperature of the lemonade will be approxi-mately 3.73 degrees Celsius after a minute. Observe that the rate of change of temperature,dTdt

, is steadily decreasing, so that T will be concave down. This also tells us that Euler’smethod produces an overestimate of the actual temperature. We pictorially represent thedifferential equation with a flow chart model as in Figure 2.

0.2 0.4 0.6 0.8 1

1

2

3

4

Time(Minute)

Object Temperature

Figure 1. Graph of Euler’s Method Data

Algebraic Solution. We can also use our work in the previous section to algebraicallysolve this differential equation. Recall that if P ′ = kP and P (0) = P0, the algebraic solutionwill be P (t) = P0e

kt. For the equation T ′ = k(T−TR) with T (0) = T0, we define P = T−TR.Because TR is assumed constant, P and T will differ by just a constant and will have thesame shape, so that we know P ′ = T ′. Then the equation T ′ = k(T − TR) becomes P ′ = kPan equation we know the solution to. We can conclude that

T (t)− TR = (T0 − TR)ekt or T (t) = TR + (T0 − TR)ekt

53

ObjectTemperature

Change inTemperature

RoomTemperaturek

Figure 2. Differential Equation as Flow Chart

5 10 15 20

10

20

30

Figure 3. Slope Field for Newton’s Law of Heating and Cooling

Graphical Solution. Finally, we can graphically solve the differential equation withslope fields. The slope field for the differential equation T ′ = −0.1(T − 20) is drawn inFigure 3. Additional solution curves are filled in and can be seen to have the shape ofthe exponential solution curve described above. We can also see, both algebraically andgraphically, that the constant function T (t) = 20 is a solution. In general, when T (0) = TR,the derivative T ′ will be zero, the temperature will not change, and the function will beconstant.

T (t) = k(T − TR), if T = TR, T (t) = k(TR − TR) = 0.

54

Name:

Homework 3.3.

1. For the initial value problem T ′ = −0.3(T − 15) with T (0) = 25, useEuler’s method with ∆t = .5 to estimate the value of T (3). Also find theexact value of T (3) and compare the two values. Does Euler’s methodgive you an overestimate or an underestimate? How could you know thiswithout computing the exact value?

2. When the coffee is poured into the mug, it is 180 degrees Fahrenheit. Themug is left sitting in a room of constant temperature of 75 degrees. Aftersitting for 3 minutes, the coffee has cooled to 160 degrees. I like my coffeeto be between 100 degrees and 140 degrees when I drink it. When shouldI start drinking my coffee? How much time do I have to finish my coffee?

3. A population of fish in a lake is known to double every fifteen yearswithout fishing. Assuming the lake starts with a population of 100 fish,how many fish can be harvested each year without the fish populationdecreasing?

Assuming the fish are harvested at a constant annual rate, H, theywill satisfy the differential equation:

dP

dt= kP −H

for some positive value of k. Because this differential equation lookssimilar to the above differential equations, these solutions will be verysimilar to the solutions for Newton’s Heating and Cooling, only with apositive growth constant.(a) Write the differential equation so that it looks like the differential

equation for heating and cooling.(b) Use the algebraic solution for heating and cooling to write an algebraic

solution to the population of fish with harvesting.(c) For what size fish population will harvesting at H fish/year cause

extinction?

55

4. Logistic Population Model

When food and resources are plentiful, the idea that population will grow at a rateproportional to its size makes sense. As a first model it works, but under that model thepopulation grows without bound and will eventually grow larger than what the environmentcan sustain.

A simple improvement to the exponential model is to incorporate the notion of carryingcapacity. We improve our model by making the assumption that there is some maximumsustainable population. When the population is small, the growth should be like our originalmodel, but when the population is close to that maximum population, called the carryingcapacity, the growth should become very small. We have taken our growth constant and arenow making it a function of the population size. Our model becomes:

Model: 3.3 (Logistic Growth). The rate at which a population grows is proportional to thesize of the population and to the relative difference between the population and the carryingcapacity.

If we let P (t) be the population as a function of time and M be the carrying capacity,our model becomes

(8)dP

dt= kP

(1− P

M

)The term, 1− P

M= M−P

M, is what we are calling the relative difference between the popula-

tions. The advantage of using this instead of just M − P is that M−PM

is unit-less. Think of

it as the percentage difference between the populations. When P is close to zero, 1 − PM

isnearly 1 and the numbers coming out of our model will be indistinguishable from the simplepopulation model. Thus, the value of k is comparable to the value of k is the exponentialmodel. Additionally, when P is nearly M , 1 − P

Mis nearly zero, just as we wanted in our

model improvement.Without even using a numerical solver, we can analyze the solutions. First observe that

k is assumed to be positive in this model. If P is positive but small relative to M , we wouldexpect the population to be growing. That is dP/dt will be positive. Because P is smallrelative to M the term 1− P/M will be positive. Based on the differential equation

positive =dP

dt=kP

(1− P

M

)=k(positive)(positive)

k must be a positive number.If the population exceeds the carrying capacity, so that P > M then 1 − P/M will be

a negative value. This causes the value for dP/dt to be negative and the population willdecrease. If the population is exactly zero or exactly at the maximum sustainable value, therate of change will be zero. This corresponds to the case when there is no growth becausethere is no population and the case where there is no growth because all the resources arebeing consumed and there is nothing left for additional population. In practical terms, whenthe population is close to M , it is a very unhealthy situation for the species. Generally thebirth rate does not change, but the death rate rises dramatically.

56

It follows that if the initial population is between 0 and M , the population will grow. AsP gets closer to M the growth rate will slow down until the population is nearly constantat M . When P is significantly less than M , the growth curve will appear to be exponential,but this behavior only lasts while P is small relative to M . If the initial population is aboveM , the population will decrease. As it gets closer to M the derivative will get closer to zero,so the rate at which the population shrinking will slow down. The population will againbecome nearly constant as P gets close to M .

We can compute this numerically using Euler’s method. If we let k = 0.2, M = 1000,P0 = 100 and ∆t = 0.1 we get Table 6.

Table 6. Numerical Calculation for Logistic Population Growth

n tn Pn ∆t P ′ ∆Pn

0 0 100 0.1 18 1.8

1 0.1 101.8 0.1 18.3 1.83

2 0.2 103.63 0.1 18.6 1.86

3 0.3 105.49 0.1 18.9 1.89

4 0.4 107.37 0.1 19.2 1.92

5 0.5 109.29 0.1 19.5 1.95

We can also observe the solutions graphically in Figure 4 by considering the slope field fora variety of initial conditions. We see that for small values of population (P ), the populationseems to grow exponentially. This continues until the population gets closer to the carryingcapacity, where the population growth slows down. As the population gets very close tothe carrying capacity, the population growth rate becomes nearly zero. If the populationis above the maximum sustainable level, the population will actually decrease until it getsdown to the maximum sustainable level. In real life, most populations will overshoot thecarrying capacity at first and then oscillate around the value before stabilizing. We don’tsee this result in our model, but there are more sophisticated models that do exhibit thisbehavior.

57

5 10 15 20

500

1,000

Figure 4. Slope Field for Logistic Population Growth

58

Name:

Homework 3.4. Recall that differential equations like

P ′ = 0.3P (1− P/2000)

have an infinite number of solutions, but if you are given an initial value,such as P (0) = 250, there should be a unique solution that goes through thepoint (0, 250). We call these initial value problems.

1. For the initial value problem

P ′ = 0.3P (1− P/2000) with P (0) = 250,

use Euler’s method with ∆t = .5 to estimate the value of P (10). Forwhat value of P does P ′ appear to reach its maximum value?

2. For the initial value problem P ′ = 0.7P (1− P/4000) with P (0) = 500,use Euler’s method with ∆t = .1 to estimate the value of P (5). For whatvalue of P does P ′ appear to reach its maximum value?

3. For the differential equation P ′ = kP (1− P/M) show that P always hasthe greatest positive slope when P is half of the carrying capacity.

59

4. Let carrying-capacity increase over time, so that M(t) = 1000 + 2t. For

the initial value problemdP

dt= 0.4P

(1− P

1000 + 2t

)with P (0) = 200,

use Euler’s method with ∆t = .2 to estimate the value of P (10). As tgrows large, what is the limiting value of P ′? Explain.

60

5. Harvesting Model

We can further improve our population model by assuming that while the population isgrowing, it is also being harvested at a constant rate. Supposing that P (t) represents thepopulation of fish in a lake, if we allow for H to be the rate at which fish are being harvested,we get the differential equation

(9)dP

dt= kP

(1− P

M

)−H

where M is the maximum sustainable population and k is the growth constant. This can berepresented by the flow diagram in the Figure 5.

Population

Population Growth

MaximumSustainablePopulation

GrowthConstant

Harvesting

Figure 5. Differential Equation as Flow Chart

Table 7. Formulas for Flow Chart

Variable Corresponding Formulas Vensim R© PLE FormulasGrowth Constant kMaximum Sustainable Popu-lation

M

Harvesting HPopulation Growth kP

(1− P

M

)Growth Constant *(1-Population/Maximum SustainablePopulation)

Population P INTEG( Population Growth - Har-vesting)

The harvesting is represented by the double arrow coming out of the population. Becausethe arrow is leaving the box variable, Vensim R© PLE automatically inserts the negativesign in front of the H term. For Population Growth, because the arrow is entering the boxvariable, the sign of Population Growth is positive.

For example, in the initial value problem

dP

dt= 0.2P

(1− P

1000

)− 32 with P (0) = 400,

when we solve using Euler’s method with ∆t = 0.5 we get:

61

Table 8. dPdt

= 0.2P(1− P

1000

)− 32 with P (0) = 400

t P(t) ∆t P ′ ∆P0 400 0.5 16 8

0.5 408 0.5 16.3 8.151.0 416.15 0.5 16.6 8.301.5 424.45 0.5 16.9 8.432.0 432.88 0.5 17.1 8.552.5 441.43 0.5 17.3 8.663.0 450.09 0.5 17.5 8.75

If we let this run for large values of t, observe that the population stabilizes at a value of800, not 1000 which used to be the maximum sustainable population. Due to the harvesting,the long term population will never reach the carrying capacity.

5 10 15 20

200

400

600

800

1,000

1,200

1,400

Figure 6. dPdt

= 0.2P(1− P

1000

)− 32

If we look at the graphical solutions in Figure 6 by using a slope field with a number ofdifferent initial conditions, we observe that most of the solutions approach a value of 800 inthe long run. However, there is now a lower bound that also affects the long term behavior.There is now a threshold population of 200, below which the population dies out due toover-harvesting.

Algebraic Solution. We can understand these values algebraically. Recall that equi-librium solutions are the values of P where P ′ = 0, that is those solutions of the differentialequation with zero slope. These correspond with P (t) = constant. By finding the equilib-rium solutions, that is, the constant solutions to dP

dt, we better understand the behavior of

the differential equation. We find equilibrium solutions by setting the differential equationequal to zero. Because constant functions have a derivative of zero, this approach will help

62

us find the constant solutions.

dP

dt= 0.2P

(1− P

1000

)− 32 = 0(10)

.2P − .0002P 2 − 32 = 0(Divide both sides of the equation by 0.2)

P 2 − 1000P + 160000 = (P − 200)(P − 800) = 0(11)

This differential equation has two equilibrium solutions, P = 200 and P = 800. Observethat for values of P less than 200, the value of P ′ will be negative, while for values between200 and 800 the value of P ′ will be positive. This means that P is decreasing for populationvalues below 200 and increasing for population values above 200. As a result the populationequilibrium at 200 is an unstable equilibrium. If the population is at exactly 200 it will staythere, but if the population is off by a little bit it will move further away from 200. Bycontrast for population values above 800 the population will decrease, and for populationvalues below 800 (and above 200) the population will increase. Population values near 800will get closer to a population value of 800, so we say 800 is a stable equilibrium.

Before we had good tools like Euler’s method and modeling software, the algebraic solu-tions were the best we could do in understanding more complex differential equations. Nowthat we have fast and powerful computers, the algebraic analysis helps us verify the under-standing we gain from numerical techniques so when we get to models without an algebraicsolution, we know we have a strong foundation.

63

This page intentionally left blank.

Name:

Homework 3.5. For each of the following differential equations, find all equilibriumvalues and determine whether the equilibrium is stable or unstable.

1.dP

dt= .3

(1− P

1000

)P

2.dW

dt= 300W −W 2 − 16875

3.dP

dt= .4

(1− P

5000

)P − 375

4.dV

dt=(100− V 2

) V

100

5.dy

dx=(1 + x− xy2

) (1− y2

)

6. A trout lake is stocked with 100 fish. The next year there are 200 fish. After many yearsthe fish population stabilizes at 1500 fish. If fishing is introduced to the lake how manyfish can be safely harvested each year from the lake without the lake eventually runningout of fish?

7. Suppose a population of deer satisfies the following differential equation:

dP

dt= .4P

(1− P

4000

)−H(t)

whereH(t) is the harvesting function. This means that the carrying capacity is .When the population is small, the growth constant is

Rather than allowing deer hunting for the entire year, hunting is only allowed duringthe first half of the year. Let

H(t) =

500 if 0 ≤ frac(t) < 1

2

0 if 12≤ frac(t) < 1

where frac(t) is the fractional part of t, so that we get a pulse train of height 200 andduration 0.5 with period 1. Build this model and, using either Vensim R© PLE or Euler’sMethod, determine in the long run what the maximum number and minimum numberof deer are each year.

65

6. Drug Dosing

Simple Model. When a drug is administered into the blood stream, the kidneys imme-diately start to filter it out again. Our simple model will assume the body is one unit, theblood stream. Let the amount of drug in the system be M(t).

Model: 3.4. The rate at which the drug is removed from the blood stream is proportionalto the amount of drug in the blood stream.

This gives an exponential decay differential equation described by

dM

dt= −kM

where k is a positive constant. The solution to this differential equation is M(t) = M0e−kt,

where M0 is the amount of drug (in milligrams) in the blood stream at t = 0 (where time isin hours). From our work on exponential models, we know that if H is the half-life of thedrug (the amount of time in hours it takes until half of the drug is filtered out of the bloodstream), then k = ln 2

H.

Multiple Doses. To make the model more realistic, the patient does not take one doseof the drug, but multiple doses spread out over time with doses every T hours. First, at timezero, the patient takes a dose of M0 milligrams. Thus, the drug in the system is describedby M(t) = M0e

−kt. Some amount of time T later there is M0e−kT of the drug in the blood

stream. At this time, the patient takes an additional dose of M0 milligrams of drug and thereis M0e

−kT + M0 milligrams of the drug in the blood stream. An additional T time later,there will be (M0e

−kT +M0)e−kT = M0e−2kT +M0e

−kT of the drug in the blood stream. Atwhich time, another dose of M0 is administered yielding M0e

−2kT +M0e−kT +M0 of the drug

in the system. As this process repeats, assuming a dose of size M0 every time T , we get

Table 9. Drug in Blood Stream after nth Dose

Dose Amount in blood stream after dose1st M0

2nd M0e−kT +M0

3rd M0e−2kT +M0e

−kT +M0

4th M0e−3kT +M0e

−2kT +M0e−kT +M0

......

nth M0e−(n−1)kT + · · ·+M0e

−2kT +M0e−kT +M0

So that after the nth dose there is

(12)n−1∑j=0

M0e−kjT

milligrams of the drug in the blood stream. There is an easier way to write Equation (??)using Geometric Series.

66

Geometric Series. Before we talk about series, we need to make a friendly nod towardsequences. A sequence is an ordered list of numbers. For example, 1, 2, 3, 4, 5, 6, · · · = nis a sequence. So is 1/2, 1/4, 1/8, 1/16, . . . . There are a lot of famous sequences that werestudied in the fifteenth through eighteenth centuries.

We can ask if a sequence converges, which means it tends towards a specific numbercalled the limit of the sequence. A sequence can “not converge” in two different ways. Thesequence can diverge, that is go off towards positive or negative infinity. For example, thesequence n diverges to infinity because it keeps getting larger and larger. Or, the sequencecan stay finite, but not go to one specific limit. It might do that by bouncing back and forthbetween a couple of numbers. For example the sequence (−1)n = 1,−1, 1,−1 . . . bouncesback and forth between −1 and 1 but never settles down and tends to only one number.

A series is the sum of a sequence. It is a list of numbers all added together. A seriescan be either finite or infinite. The most famous, and useful, series is known as a GeometricSeries. The special thing about a geometric series is that the ratio of successive terms isconstant. Geometric series can be finite, that is ending after a certain number of terms, orinfinite. In math, a geometric series looks like:

a+ ar + ar2 + ar3 + ar4 + · · ·+ arn−1

or

a+ ar + ar2 + ar3 + ar4 + · · ·+ arn + . . .

where the first series is finite and the second series is infinite. In mathematics, we oftenprefer not to write series with the dots. We have a shorthand notation for series that uses anuppercase sigma, Σ, which stands for sum. In this shorthand, we write the above like this:

a+ ar + ar2 + ar3 + ar4 + · · ·+ arn−1 =n−1∑j=0

arj

or

a+ ar + ar2 + ar3 + ar4 + · · ·+ arn + · · · =∞∑j=0

arj.

A geometric series can be written without any summation at all. To do this, we are goingto work with finite geometric series, although the same argument works for infinite geometricseries if r is small enough. In order to save ourselves some typing, we write Sn =

∑n−1j=0 ar

j.Now,

Sn =a+ ar + ar2 + ar3 + ar4 + · · ·+ arn−1

r ∗ Sn =ar + ar2 + ar3 + ar4 + ar5 + · · ·+ arn(multiply by r)

Sn − r ∗ Sn =a+ ar + ar2 + ar3 + ar4 + · · ·+ arn−1

− (ar + ar2 + ar3 + ar4 + ar5 + · · ·+ arn)(subract the first line from the second)

(1− r)Sn =a− arn(cancel out the appropriate terms)

Sn =a(1− rn)

1− r(divide both sides by (1− r))

67

This, by the way, gives us a clue on why mathematicians label the sum from 1 up to n−1as Sn. As n goes to infinity, different things happen if |r| is less than one, bigger than one,or equal to one. If |r| < 1, rn gets very small as n goes to infinity. Therefore, we could saythat the infinite geometric series is equal to a

1−r . However, if |r| ≥ 1, then rn grows withoutbound. We say that, in this case, the geometric series diverges.

A Return to Drug Dosing. Recall that the amount of drug in the system after ndoses was calculated to be

n−1∑j=0

M0e−kjT .

This is a geometric series with a = M0 and r = e−kT . We can solve for the total amountdrug in the bloodstream after the nth dose:

Sn =n−1∑j=0

M0e−kjT

=M0(1− e−nkT )

1− e−kTmilligrams.

Also, since e−kT < 1, we can even say that, no matter how many doses are given, the amountof drug in the bloodstream is always less than M0/(1− e−kT ) milligrams. This is importantbecause many drugs are toxic above a certain level and we want to avoid killing our patients.

Example. Suppose 100 milligrams of a drug with a half-life of 24 hours is administeredevery 8 hours. Remembering that when we have a half-life of 24 hours, k = ln(2)/24, afterthe 10th dose is given, there will be

1001− e−10 ln 2

248

1− e− ln 224

8= 100

1− e−10 ln 23

1− e− ln 23

≈ 436.64 milligrams

of the drug in the bloodstream.

Model Improvements. Of course, our model is still pretty simple compared to howdrugs truly work in the body. One obvious complaint would be that when we take a pill,we do not immediately absorb the drug into the bloodstream. It goes into the stomach first.We will get to this in a future section.

Another complaint is that when we take a pill, it is not all absorbed into the bloodstream.In fact, much of that swallowed pill just passes on through. This can be taken into accountby including an absorption fraction, 0 < q ≤ 1 into the model. Rather than assuming theentire M0 is in the blood stream, we start with a dosage of q ·M0, but the rest of the modelworks the same as before.

Finally, it must be admitted that not all people are of the same size and it is really theconcentration of drug in the bloodstream that matters. This seems pretty important, butto calculate concentration, all that needs to be done is to divide by the volume of blood inthe patient. According to Wikipedia (remember, we are still in a simple model), the typicaladult human has a blood volume of approximately 4.7 liters and 5 liters with females havingless than males. There are lots of things in the blood, like blood cells, and we are reallyonly interested in the volume of the plasma in which all this takes place So, if we assume the

68

volume of plasma in the system is v ≈ 3 liters, then the concentration of drug in the systemat any time is M(t)/v milligrams/liter.

Peaks and Troughs. The whole point of this model is to figure out that when takingdrugs, patients do not have a constant concentration of drug in the system, but a concentra-tion with highs and lows. In medical terms, these are known as peaks and troughs. These areimportant because all drugs have two essential concentrations, the Minimum TherapeuticConcentration and the Minimum Toxic Concentration. The Minimum Therapeutic Concen-tration (mtc) is the smallest concentration where the drug is doing some good to our patient.We would like to have the concentration of drug in the system to be above this level. Inpractice, it may take a couple of doses to build up to this situation. The Minimum ToxicConcentration(MTC) is the smallest concentration where the drug is harmful to our patient.We will require that our concentration always stay below this level.

There are some very tricky drugs in the pharmacy where the difference between the mtcand the MTC is not very large. Because it can be hard to know the exact half-life and bloodvolume in a specific patient, when giving very tricky drugs it is common to draw blood beforeand after a drug dose to measure these troughs and peaks. One of the reasons for coming upwith a mathematical model of drug concentration is to reduce the number of blood samplesthat must be taken from an already suffering patient.

Our model has calculated that the limit of the trough concentration (Proved in Homeworkproblem 7 is

qM0/(eln(2)T/H − 1)/v

and the limit of the peak concentration can be calculated similarly as

qM0/(1− e− ln(2)T/H)/v.

We can use our model to answer important questions about the size and dose spacing ofdrugs and the relationship between that and non-toxic, therapeutic drug concentrations.

69

This page intentionally left blank.

Name:

Homework 3.6. For problems 1 - 4, compute the following geometric series:

1.1

5+

2

25+

4

125+ · · ·+ 29

510

2.15∑j=0

3j

7j

3.12∑j=0

(.67)j

4.20∑j=0

5j+1

23j+2

5. Show that the term e−kT is less than 1 as long as k and T are positive.

6. Use the techniques of the section to show that with a dose of M0 milligrams deliveredevery T hours, the amount of drug in the system immediately before the nth dose is

M0e−kT (1− e−(n−1)kT )

1− e−kTmilligrams

7. Show that the long-term minimum concentration of drug in the system with dose of M0

milligrams, an absorption fraction of q, a half life of H hours, and a blood volume of vliters is

qM0

v(eln(2)T/H − 1)milligrams/liter

8. A new drug has a half life of 20 hours (that is, it takes the body 20 hours on averageto eliminate half of the drug present in the body). Assume effective repeated dosages of24 milligrams (the dosage is 200 mg, but only 12% of the drug is absorbed by the body,giving the effective dosage) are given every eight hours for 3 days. What is the amountof the drug present in the body before and after the final dose? (This will be the 10thdose.)

71

7. Gastro-Intestinal Tract

In the simple model for Drug Dosing, it was assumed that the drug was administereddirectly into the blood stream.

Model: 3.5. Suppose the medicine is administered in the form of a pill which is swallowedinto the stomach. The medicine is then absorbed into the blood stream at a rate proportionalto the amount of drug present in the stomach. As before, the drug is metabolized out of theblood stream at a rate proportional to the amount present. These two rates need not be thesame.

This is referred to as a “two compartment” model because we will have two box variablesand two differential equations with the drug first flowing into one compartment and fromthere into the second compartment before it leaves the system. If S(t) is the amount of drugin the stomach and B(t) is the amount of drug in the blood stream, the model will have twodifferential equations:

dS

dt=− r1S + digested(13)

dB

dt=r1S − r2B(14)

where r1 is the proportionality constant for drug flowing from the stomach into the bloodstream and r2 is the proportionality constant for the metabolism of the drug from the bloodstream. It is worth noting that we are assuming that the flow out of the stomach goesdirectly into the blood stream with no loss. This is why the r1S term shows up in both thedS/dt and dB/dt. This is a simplifying assumption; for some drugs, a significant amount ofthe drug passes from the stomach to the waste system. The digested flow is not yet includedin our system of differential equations. Our model yields the flow diagram, Figure 7.

Stomach

Digested

Blood Stream

absorption filtered

AbsorptionRate Filter Rate

Figure 7. Compartment Model for GI Tract

Table 10. Formulas for Compartment Model for GI Tract

72

Variable Corresponding Formulasdigested Many correct formulasStomach S INTEG(digested-absorption,0)absorption rate r1

absorption r1S absorption rate * StomachBlood Stream S INTEG(absorption - filtered,0)filter rate r2

filtered r2B filter rate* Blood Stream

We will assume that the absorption rate, r1, and filter rate, r2, are positive quantitiesthat can be computed, as before, from the half life of the drug as ln(2)/half-life, where thehalf-life associated with r1 is the time it takes for half of the drug in the stomach to beabsorbed into the bloodstream and the half life associated with r2 is the time it takes forhalf the drug to be filtered out of the bloodstream. We use ln(2) instead of ln 1

2because our

rates are positive.In wild humans it can be a complicated experiment to measure these half-lives. To

measure the half-life for the stomach, you start with 100% of the drug in the stomach. Thehalf-life is when half the drug is left in the stomach. To measure the half-life for the bloodstream, you technically need no drug in the stomach and 100% of the dose in the bloodstream. The half-life is when half the dose is left in the blood stream. This second is difficultin practice and usually these coefficients are estimated from less precise data. However, whenworking the homework problems, assume that this is the information you have been given.

73

This page intentionally left blank.

Name:

Homework 3.7.

1. For a particular treatment to be effective, the concentration of the drug in the blood-stream must be more that 10 micrograms per milliliter. However, if the concentration ofthe drug in the bloodstream exceeds 30 micrograms per milliliter, the patient will sufferlife threatening side effect. For a drug for which half-life of the drug for the stomachabsorption is 90 minutes and the half-life of the drug for being filtered out of the bloodstream is 15 hours, determine a dosage which will put the patient in the effective treat-ment range for twenty hours, without causing any life threatening side effects. Assumethe human body contains between 2.5 and 3 liters of blood.

2. A dose of 150 milligrams of a drug is administered every twenty four hours for five days.The half-life of the drug in the stomach is 2 hours, and the half life of the drug in theblood stream is 30 hours. When is the drug at its maximum concentration in the bloodstream? For how long is the drug over 40% of this maximum level?

3. It can be quite tricky to calculate the proportionality constants because of the interactionbetween the stomach and the kidneys. Assume a dose of 500 milligrams of a drugis swallowed. After an hour, half of the drug has been absorbed into the patient’sbloodstream. The kidneys filter the drug out of the bloodstream, so that after 24 hours,half of the drug is filtered out of the drug stream. Notice that this is not the same thingas the half-life for r2. Create a model to determine r2 and then determine when theamount of drug in the bloodstream is at its maximum level.

75

Chapter 3 Review

Big Ideas.

• Creating a differential equation to describe a model• Proportional growth differential equations• Vensim R© PLE• Simple population growth

– Proportionality– Differential equation– Algebraic solution– Half-lives and doubling time

• Heating and cooling• Logistic population growth

– Carrying capacity• Drug processing

– Single compartment model– Multiple drug doses– Geometric series– Two compartment model

At this point you should be able to.

• Translate a sentence into a differential equation or an initial value problem.• Find the analytic solution to a simple population growth initial value problem.• Use half-life or doubling time to find the algebraic solution to a simple population

growth initial value problem.• Use Euler’s method to solve a heating or cooling problem.• Use known algebraic solutions to solve a heating or cooling problem.• Solve logistic initial value problems with Euler’s method.• Graphically analyze logistic differential equations for carrying capacity and popula-

tions with rapid growth versus slow growth.• Find equilibrium solutions for simple population growth, logistic population growth

and logistic population growth with harvesting.• Identify geometric series and find closed form solutions for appropriate geometric

series.• Find long-term behavior of multiple drug dosing problems.• Set up Vensim R© PLE for a two-compartment drug dosing model.• Use Vensim R© PLE to set up and find graphical and numeric solutions to any

differential equations in this chapter.

To prepare for assessment on this chapter, write your own questions for each of the abovetasks. If there is time, have everyone in your team do the same thing and then attempt tosolve each other’s question.

76

CHAPTER 4

Second Order Differential Equations

1. Classical Mechanics, a Brief Introduction

The first model for movement which we will introduce is the notion of gravity popularizedby Galileo in the 16th century.

Model: 4.1. The force of gravity is constant.

This is our simplest model of the motion of a falling body. We make the assumption thatthe force applied by gravity does not depend on the height of the object falling. This is asimplification, but for objects smaller than an asteroid within a few miles of the surface ofthe earth this model works quite well which may be why it took Newton to figure out thatit was an incomplete theory. Additionally, we will ignore the effects of air resistance or liftor any other forces which might be effecting the motion of the falling object.

Isaac Newton was inspired to develop ideas of calculus based on his study of motion.These ideas formed the foundation of physics for centuries and are now what we refer to as“Classical Physics.” Newton’s three laws of motion are

(1) If object experiences no net force, then it moves with constant velocity, ~v. This tells

us that the change of velocity is determined by the net force, ~F .(2) The acceleration of an object, ~a, is proportional to the amount of net force F , in

the direction of the net force, ~F and is inversely proportional to the mass, m of theobject.

Force = Mass× Acceleration

(3) When one object exerts a force on another object, the second object exerts an equalforce in the opposite direction on the first object.

Our models will depend heavily on the first two laws, but we leave it to your physics professorto explain the third. The term force might seem a bit vague here. You may think of forceas an influence which changes an object’s momentum. The effects of all forces can be addedtogether1 to give the net force, which influences the object’s motion according to Newton’ssecond law of motion,

We need to make some more simplifying assumptions here. The first assumption is thatour objects are only moving in one dimension. That is, if we are dropping a bowling ball offof the roof, the ball will only fall straight down. It will not be tempted to head further awayfrom the building due to a big wind gust. The reason we do this is because position, velocity,acceleration are really vectors. Not only do they have a size, but they also have direction.By assuming that we are only going in one dimension, we simplify things by keeping trackof direction by looking at the sign of our variable. We choose our frame of reference sothat “up” is considered the positive direction, so that gravity acts downward in the negativedirection.

The force of gravity near the surface of the earth is closely related to the weight andis given by Mass × Gravitational Acceleration = −mg. The negative sign comes from ourirrational preference for positive constants. The value of g is constant, but the units we useto measure it are not. We have measured g is 9.81 meters/second2 or 32 feet/second2. Ofcourse, if force is mass times acceleration and there are no other forces, we can conclude thatin our simplest model, acceleration equals the gravitational acceleration.

1as vectors, again, ask your Physics professor

78

Acceleration, a, is a mathematical and technical term which describes how the velocity,v changes, that is, it is the derivative of velocity. Similarly, velocity is itself a mathematicaland technical term which is the derivative of position, y. Thus, acceleration is the secondderivative of position. This results in a differential equation of the form:

d2y

dt2= −g or y′′ = −9.81 m/s2

depending on units. In the grand scheme of things, this is a very simple differential equation,but our previous methods need a little help.

Euler’s method works well for first order differential equations, that is differential equa-tions with only first derivatives. But we cannot draw a tangent line based on the secondderivative. Also observe that initial location is not enough to describe a unique solution tothis differential equation. We will also need to know the object’s initial speed or velocity.The acceleration changes the object’s velocity which in turn changes the object’s position.In this course, we will think of this second order differential equation as a system of two firstorder differential equations.

dv

dt= −g v(0) = v0

dy

dt= v y(0) = y0

We can use Euler’s method to simultaneously solve both differential equations at the sametime.

Modeling Solution. We will put our system of first order differential equations in ourmodeling software by using two box variables since we have two differential equations, as inFigure 1.

Velocity

Change in Velocity

Change in Height

Height

Figure 1. Second Order Differential Equation as Flow Chart

79

Table 1. Second Order Differential Equation Formulas and Variables

Variable Corresponding FormulasAcceleration gChange in Velocity a AccelerationVelocity v INTEG(Change in Velocity, v0)Change in Position v VelocityPosition y INTEG(Change in Position,y0)

Euler’s Method for Systems of Differential Equations. Recall that for the firstorder differential equation y′ = f(t, y) with y(t0) = y0, we used the recursive formula yn+1 =yn + f(tn, yn)∆t, for some suitably chosen value of ∆t. If we have a system of first orderdifferential equations of the form y′ = f(t, y, v) and v′ = g(t, y, v) with initial conditionsy(t0) = y0 and v(t0) = v0, we can create a pair of recursive formulas:

yn+1 = yn + f(tn, yn, vn)∆t and vn+1 = vn + w(tn, yn, vn)∆t

In this case, f(t, y, v) gives the change in y per unit of t and w(t, y, v) gives the change inv per unit of t. In this way, we can use Euler’s method to solve second order differentialequations (and higher orders as well).

Suppose we have y′′ = −9.81 m/s2 with y(0) = 20 m and v(0) = 5 m/s. This can beconverted into the system y′ = v, v′ = −9.81, we can then solve with Euler’s method, using∆t = 0.25.

Table 2. Euler’s Method for y′ = v, v′ = −9.81

n tn yn vn f(t, y, v) w(t, y, v) ∆t ∆y ∆v= v = −9.81

0 0 20 5 5 −9.81 0.25 1.25 −2.4531 0.25 21.25 2.548 2.548 −9.81 0.25 0.637 −2.4532 0.50 21.887 0.095 0.095 −9.81 0.25 0.024 −2.4533 0.75 21.911 −2.358 −2.358 −9.81 0.25 −0.589 −2.4534 1.00 21.321 −4.810 −4.810 −9.81 0.25 −1.203 −2.453...

......

......

......

......

According to this approximation, the object will hit the ground after approximately 2.75seconds. We can plot the values of y(t) with with respect to time and obtain Figure 2.

Analytic Solution. If you have taken a traditional Calculus course, you may be morefamiliar with an analytic solution to the differential equation d2

dy2= −g.

To help the rest of us better understand the solution, recall that a function with constantslope is a linear function. Because dv/dt is constant, we can conclude that v(t) is a linearfunction with slope g and position at time zero v0. Thus, v(t) = −gt+ v0 which means thaty′ = −gt+ v0. We will offer without proof the solution this is differential equation as

y(t) = −g2t2 + v0t+ y0

80

0.5 1 1.5 2 2.5 3

5

10

15

20

25

Figure 2. Approximate Solution to Falling Object

(recall h(0) = h0). In the case where g = −9.81, v0 = 5 and y0 = 20, the exact solution willbe y(t) = −4.905t2 +5t+20, which closely matches the approximate solution show in Figure2.

81

This page intentionally left blank.

Name:

Homework 4.1.

1. An object is launched upward at a rate of 7 m/s from a position of 40 m. Assume gravityis 9.8 m/s2.

(a) Using Euler’s method with ∆t = 0.1, determine the object’s maximum position andat what time that occurs. Also determine at what time the object hits the groundand what the velocity is at that time.

(b) Using the analytic (exact) solution equation of motion for the object to determinethe object’s maximum position and at what time that occurs. Similarly determinethe time at which the object hits the ground and what the velocity at that time.

(c) Recall that the relative error is calculated by∣∣∣∣approximate value− exact value

exact value

∣∣∣∣ .What is the relative error between the Euler’s method solutions and the analytic

solutions?

Variable RelativeError

Maximum PositionTime of Maximum Position

Time to GroundVelocity at Ground

2. An object is launched upward at a rate of 20 ft/s from a position of 100 feet. Assumegravity is 32 ft/s2.

(a) Using Euler’s method with ∆t = 0.1, determine the object’s maximum position andat what time that occurs. Also determine at what time the object hits the groundand what the velocity is at that time.

(b) Using the exact equation of motion for the object to determine the object’s maximumposition and at what time that occurs. Similarly determine the exact value for thetime at which the object hits the ground and what the velocity at that time.

(c) Calculate the relative error between the exact equation and Euler’s method for this

problem.

Variable RelativeError

Maximum PositionTime of Maximum Position

Time to GroundVelocity at Ground

83

3. The force of gravity is not truly constant. It varies proportional to the inverse square of

the distance between the object in the center of the planet. Specifically, Fg =−mMG

r2,

where m is the mass of the object, M is the mass of the planet, G = 6.67428 ×10−11 N(m/kg)2. In the space below, draw a Vensim diagram for a body falling un-der the influence of the true gravitational force. Write a list of all your formulas, i.e.

change of position = velocity,d velocity

dt= change of velocity with an initial value of 0

m/s, etc.

84

4. Suppose a raindrop evaporates as it falls but maintains its spherical shape. Assumethat the rate at which the raindrop evaporates (that is, the rate at which it loses mass)is proportional to its surface area, where the constant of proportionality is -0.01. Thedensity (mass per volume) of water at 3.98C is 1 g/cm3. The surface area of a sphereis 4πr2, and the volume is 4πr3/3, where r is the radius. Assume no air resistance.(a) Assume that the initial radius is 0.3 cm. Determine the raindrop’s initial mass.

(b) Write a differential equation for the rate of change of mass with respect to time asa function of r.

(c) In the space below, write a Vensim diagram for a raindrop falling under the influenceof gravity and losing mass through evaporation. Write a list of all your formulas,

i.e. change of position = velocity,d velocity

dt= change of velocity with an initial

value of 0 m/s, etc.

85

If an object is launched into the air at an angle of θ, part of its initial velocity is usedfor vertical motion and part it used for horizontal motion. If the initial velocity is v0,then the vertical initial velocity is v0 sin(θ) and the horizontal initial velocity is v0 cos(θ).The force of gravity is entirely in the downward direction, so there is zero horizontalacceleration and normal vertical acceleration. If x(t) represents the horizontal positionand y(t) represents the vertical position the equations of motion become:

d2y

dt2= g

d2x

dt2= 0

dy

dt(0) = v0 sin(θ)

dx

dt(0) = v0 cos(θ)

y(0) = y0 x(0) = x0

5. Suppose an object is launched from the ground with an initial velocity of 10 m/s. UseEuler’s method with an appropriate ∆t to determine how far the object travels before ithits the ground again(a) if θ = 20 degrees.(b) if θ = 40 degrees.(c) if θ = 60 degrees.(d) if θ = 80 degrees.(e) Compare these answers. Determine the angle of launch that will maximize the

distance traveled.(f) Determine the angle of launch (to the nearest degree) that will cause the distance

traveled to be exactly 8 meters.You will want to use a computer for your calculations. You may use Excel, Python, orVenSim, but be sure to include your work when you hand in the homework.

86

2. Air Resistance

If you drop a penny from the observation deck of the Empire State Building and it hitssomeone, will it kill them? While the staff at the Empire State Building discourage this kindof experimentation, many a visitor has wondered about this. It turns out that the droppedpenny will be slowed due to air resistance and reach a terminal velocity much too slow to doanything more than leave a small bruise.

We will improve our model for falling bodies by introducing a second force, called a dragforce, or air resistance. For most objects (objects larger than a flea) the most common modelfor air resistance was developed by Newton, which states:

Model: 4.2. The drag force on a falling object is proportional to the cross sectional area ofthe object and to the square of the velocity

We can write this as FDrag = kAv2, where A is the cross sectional area and v is thevelocity. Since we know that air resistance serves to slow down an object, we make thefurther assumption that the force will always be in the opposite direction of the velocity, sothis equation is also written as

FDrag = −kAv|v|,

where k is positive and |v| is the speed or absolute value of the velocity. The value of kdepends on the shape of the object and the media the object is moving through. In thecase when the object is moving through air near the surface of the earth, the value for k isapproximately 0.65 (for v in m/s, A in m2 and Force in Newtons), which we will use in thistext.

Recall that all forces are added together before considering the net effect on the object’smotion. So an object in free fall, which is assumed subject only to gravity and air resistance(i.e. no wind or lift) will have the total force of:

Force Total = Force Gravity + Force Drag = −mg − kAv|v|

Recall Force = Mass×Acceleration, so that (assuming all motion is vertical) we obtain theequation: my′′ = −mg − kAy′|y′|.

If we were to drop a penny weighing 2.5 grams from the observation deck of the EmpireState Building (at an elevation of 373 meters), it would tumble as it fell. Rather than usethe whole cross sectional area of 2.8 cm2, we will let A = 1.5 cm2 because experience hastaught us that pennies tumble when they fall. When this is converted to a flow chart, weobtain Figure 3

Table 3. Variables and Formulas for Air Resistance

87

Velocity

Change in Velocity

Change in Height

Height

Acceleration Total Force

Mass Weight

Gravitational Constant

Speed Cross-Sectional Area

Drag Force

Drag Coefficient

Figure 3. Diagram for Air Resistance

Variable Corresponding FormulasHeight y INTEG(Change in Height,y0)Change in Height v VelocityVelocity v INTEG(Change in Velocity, v0)Change in Velocity a AccelerationAcceleration Total Force/MassMass m 0.0025 kgTotal Force Weight + Drag ForceWeight −mg Mass*Gravity

Gravityg 9.81m/s2

Drag Force −kAv|v| -Drag Constant*Cross-SectionalArea*Velocity*Speed

Speed |v| ABS(Velocity)Drag Constant k 0.65kg/m3

Cross-Sectional Area A 0.00015 m2

In the case where ∆t = 0.25, we penny will hit the ground after 24.75 seconds at a speedof 15.86 meters per second. The penny reaches a speed of 15.8 meters per second after 4.5seconds and finally achieves terminal velocity after 10 seconds.

It is possible to algebraically compute the terminal velocity. Terminal velocity occurswhen the velocity stops changing; that is when y′′ = 0. Our equation of motion becomes

88

0 = mg − kAy′|y′|. In the case of a falling object, terminal velocity will be negative so

|y′| = −y′. The equation becomes −mg = −kA(y′)2 so that terminal velocity is

√mg

kA.

89

This page intentionally left blank.

Name:

Homework 4.2.

1. Reproduce the model for a 2.5 gram penny dropped off the observation deck of the EmpireState Building and verify the time when the penny hits the ground. Use ∆t = .25 as inthe text, then use ∆t = .1 to determine if Euler’s method is giving an overestimate oran underestimate for the time it takes for the penny to land. How does the value of theterminal velocity change?

2. A tennis ball, weighing 57 grams with a diameter of 6.5 centimeters is shot up into theair at a speed of 40 meters per second. How high does the tennis ball go? When does itreach it’s maximum height? When does the ball hit the ground? At what speed does ithit the ground?

3. A skydiver weighing 90 kg jumps out of a helicopter hovering at a height of 2 kilometers.Assume a cross-sectional area of 0.5 square meters. After thirty seconds of free fall, theskydiver deploys the parachute and the cross-sectional area becomes 50 square meters.Reproduce the model for the skydiver. What is the skydiver’s terminal velocity with andwithout the parachute? How long does it take for the skydiver to reach the ground?

4. If we think about items falling from a great height, for example Austrian daredevil FelixBaumgartner who, in 2012 jumped from a platform more than 24 miles above the earthsurface, our model needs additional sophistication. There are two complications thatneed to be considered:(a) The force of gravity is not constant. For large distances, the gravitational force is

inversely proportional to the distance between the object and the center of the earth

FGravity =−GmM

r2

whereM is the mass of the earth, m is the mass of the object, G = 6.6730010−11m3kg−1s−2

is the gravitational constant (assumed to be constant), and r is the distance fromthe center of the object to the center of the earth.

(b) The density of air is not constant. Included in the “Drag Constant” are assumptionsabout the shape and slipperiness of your object and the density of the fluid (air isa fluid) in which your object is falling.

k =1

2Cρ

where C is the drag coefficient of your object (takes into account shape and slip-periness) and ρ is the density of the fluid. Further complicating the issue, ρkg/m3

for the atmosphere is going to be a function of the distance from the center of theearth and the temperature.

Thinking about the problem of Mr. Baumgartner, which complication do you think wasmore important to the modelers who were working with him while he prepared for hisjump? Why do you think this?

91

3. Springs

A spring is an object which when deformed exerts a restorative force which tries to returnthe object to its original position. The model which we use for the amount of force is knownas Hooke’s law. That is:

Model: 4.3. The restorative force of a spring is proportional to the displacement.This translates to

FSpring = k ∗ displacement.

This leads to the obvious question, what is displacement? Consider a spring hanginginnocently by one of its ends. Call the length of the spring at this point the natural length,N 2. It doesn’t do much. Now, a mischievous child tugs on the end of the spring. Whathappens? It bounces back and forth around the natural length. The difference between thespring length, L, and the natural length, N , (L − N), is called the displacement. Noticethat if the spring is compressed, i.e., N > L, the spring wants to get longer and the forceshould be downward or negative. When the spring is stretched, i.e., N < L, the springwants to get shorter and the force should be upward. Also, we need to talk a bit about ourproportionality constant, k. We have already used k as a proportionality constant in othercontexts and we don’t want to get confused, so we should give it a special name. We willcall it the spring coefficient and label it kS. Now, we have the model for a spring,

FSpring = kS(L−N).

Notice that we have two forces in our model, Weight and Spring Force. We also seem tohave two different terms that seem the same, position and length. The length of our springis a positive number. It answers the question, how long is the spring? Position could bepositive or negative depending on where the spring is in relation to an arbitrarily decidedzero of position. Most of the time we let the ground have zero position, but we do not haveto. In fact, when we work with springs, we often let zero position be the place where weattach one end of the spring. However, then the spring will hang down from that attachmentpoint and the other end of the spring will have position which is negative. If we make thischoice, then

Length = −Position.

Table 4. Variables and Formulas for Spring Force Model

2The physicists call this the unweighted equilibrium length for reasons that may become apparent.

92

Velocity

Change in Velocity

Change in Height

Height

Acceleration Total Force

Mass Weight

Gravitational Constant

Length

Natural Length

Spring Coefficient

Spring Force

Figure 4. Diagram for Spring Force Model

Variable Corresponding FormulasAcceleration Total Force/MassChange in Velocity a AccelerationVelocity v INTEG(Change in Velocity, v0)Change in Position v VelocityPosition y INTEG(Change in Position,y0)Length L -PositionWeight -Mass ∗Gravitational Coefficient

Gravitational Coefficient g 9.81 m/s2

Natural Length NSpring Coefficient kSSpring Force kS(L−N) Spring Coefficient ∗(Length - Nat-

ural Length)Total Force Spring Force + Weight

A Physicist’s Aside. Something very interesting happens when we try to find theequilibrium solution for our model. Intuitively, we know this exists because we have seen aspring with a mass on the end hanging still. We want to find the position and velocity whereboth dy

dt= 0 and dv

dt= 0. This is the same as having v = 0 and Total Force = 0. If we start

with v = 0 and make it so that dvdt

= 0, then v isn’t going to change, so all we really need

93

for an equilibrium solution is to find the position where Total Force = 0.

Total Force = 0 = FGravity + FSpring

= −mg + kS(L−N)

= kS(L−N − mg

kS)

= L− (N +mg

kS)

L = N +mg

kS

So, when we have a mass at the end of our spring we have an equilibrium length of N + mgkS

.

Also, we could do all our work with a spring force of FSpring = kS(L− (N+ mgkS

)) and measurethe displacement from the equilibrium length. This is what you would do if you were workingwith springs in a physics lab. However, in future sections, we will want to separate out thegravitational force, so we will stick with our original model.

Euler’s Method Example. For example, if the spring has a mass of 1 kilogram at thebottom end, an natural length of 1 meter and a spring coefficient of 4 Newtons per meter orkg/s2, and we use g = 9.81, the differential equation becomes

d2L

dt2= 13.81− 4L

We need two starting conditions, so let’s assume we push the spring back to a length of 1 andgently let it go. What we expect to happen is the mass to drop down past its equilibriumlevel to some maximum length and then bounce back up. Using Euler’s method, startingconditions of L(0) = 1 and L′(0) = 0, and ∆t = 0.1 produces

Table 5. Euler’s Method for Spring Force Model

n t L L′ L′′ ∆t ∆L ∆L′

0 0.0 1.000 0.000 9.810 0.1 0.000 .9811 0.1 1.000 0.981 9.810 0.1 0.098 .9812 0.2 1.098 1.962 9.418 0.1 0.196 .9423 0.3 1.294 2.904 8.633 0.1 0.290 .8634 0.4 1.585 3.767 7.471 0.1 0.377 .7475 0.5 1.961 4.514 5.964 0.1 0.451 .596

Looks pretty normal and expected, right?

If we continue, Euler’s method we obtain the graph in Figure 5. Observe that theamplitude of the bounces in the spring seem to be getting larger. In an undamped systemwithout an external force, we would anticipate the amplitudes to remain constant. Thisdemonstrates one of the problems with Euler’s method. Recall that Euler’s method givesoverestimates when the solution is concave down and underestimates when the solution isconcave up. In the case of the spring, this arrangement causes Euler’s method to yield largerand larger amplitudes over time. By choosing a small stepsize, this error can be decreased,

94

1 2 3 4 5 6 7

−4

−2

2

4

6

8

10

12

Figure 5. Euler’s Method Approximation for Spring Force Model

but it will never be eliminated. For this reason, in the next chapter we will develop somebetter methods for approximating the solutions to the differential equations.

At this point you can either leave us for a few days and learn the material in the nextchapter, or you can switch your Model in VenSim to “RK4 Auto” which will eliminate thisparticular issue for you. From here on, we assume you know about Runge Kutta and use itnearly exclusively in your computational modeling.

Analytic Solution. We claim without proof that the exact solution to the differentialequation y′′ + ω2y = 0 with y(0) = y0 and y′(0) = v0 is given by

y(t) = y0 cos(ωt) +v0

ωsin(ωt)

(assuming ω 6= 0). This gives a solution in which the amplitudes remain constant.Our differential equation

md2L

dt2= −k

(L− (N +

mg

k))

doesn’t look just like the equation above, but the solution can be found in a similar waywhere

L(t) = L0 cos(

√k

mt) + v0

√m

ksin(

√k

mt) +N +

mg

k

95

This page intentionally left blank.

Name:

Homework 4.3.

1. To calculate the weight displacement of a spring, we find the distancethe spring needs to be stretched so that the gravitational force is exactlyequal to the restoring force of the spring. This is also the same value thatwill give you the sum of forces equal to zero.(a) What is the weight displacement of a spring with spring constant 10

N/m that has a 1 kg mass at the end?

(b) What is the weight displacement of a spring with a spring constantof 25 N/m that has a 5 kg mass at the end?

(c) What is the weight displacement of a spring on the moon (g =1.62 m/s2) with a spring constant 5 N/m that has a 1 kg mass atthe end?

2. Suppose a weight of 8 N hangs from a spring with un-stretched lengthof 2 m and spring constant of 100 N/m. Then, the spring is compressedby 0.5 m. Using up as the positive direction and ignoring drag, give thefollowing with units:(a) The weight displacement

(b) The equilibrium position

(c) The maximum length

(d) The sign of the initial restoring force

(e) The restoring force when the length of the spring is 3.15 m

97

3. With up being the positive direction, give the formulas for each of thefollowing components of a bungee jump:(a) Total force

(b) Acceleration

(c) Weight

(d) Air friction (assuming Newtonian friction, sea-level air density, andabsolute value function ABS)

(e) Restoring spring force when length is greater than unweighted length

(f) Restoring spring force when length is less than unweighted length

4. Reproduce the model for a spring with a mass of 200 grams, an equilib-rium length of 1 meter and a spring constant of 1.8 Newtons per meter.Assume an initial length of 50 centimeters with an initial velocity of thelength increasing by 2 centimeters per second. Use Euler’s method with∆t = .2 to determine the approximate period of motion, that is, howoften the motion repeats.

5. Use the known solution for y′′ + ω2y = 0 shown in the text, to find thesolution to the differential equation L′′ + ω2L = C. Let y(t) = L(t) + Kwhere K is a constant so that the differential equation for y has the formshown in the text. (Recall that y′ = L′ and y′′ = L′′ if y(t) and L(t) differby a constant.) Show that the general solution for L′′ + ω2L = C withL(0) = L0 and L′(0) = v0 is given by

L(t) =C

ω2+ω2L0 − C

ω2cos(ωt) +

v0

ωsin(ωt)

6. Suppose an object with mass 20 grams is attached to a spring with springconstant 50 Newtons per meter and equilibrium length of 20 centimeters.Additionally, assume the object has a cross-sectional area of .01 squaremeters. Use the Newtonian model of air resistance to adjust the springmodel to account for air resistance to create a new model for spring mo-tion. Assume an initial length of 25 centimeter and zero initial velocity.Use Euler’s method with ∆t = 0.1 to create the model. Determine howlong it take before the amplitude of the oscillations stays less than 0.1centimeters.

98

4. Bungee Jumping

A bungee cord is a type of elastic rope. On April 1, 1979 members of the OxfordUniversity Dangerous Sports Club tied bungee cords to the top of the Clifton SuspensionBridge in Bristol, UK, tied the other end to one of their members and the sport of bungeejumping was created. According to Wikipedia, the jumpers were arrested shortly after.Bungee jumping has transitioned to better legal footing, but the basic premise is the same.When the person jumps initially there is the experience of free fall. The bungee cord is slackduring this stage and produces no force on the jumper. Once the bungee cord is stretchedis begins to exhibit force on the jumper slowing down the fall. As the cord stretches, thejumper is slowed down more and more, until at some point the jumper stops falling and islaunched back upward. As the cord retracts the jumper is launched upward, until the cordgoes slack again and the jumper again experiences free fall. This process repeats until thejumper slows down and comes to a stop.

From the modeling perspective, this is a combination of the model for free fall with airresistance combined with the model for the spring. This is our first example of a commonmodeling practice - that of creating several submodels and then stitching them together tosolve a very complicated problem. One difference between our previous spring model andbungee cords is that the spring force only responds to being stretched and not to beingcompressed. This gives us the modified spring force equation:

FCord =

kS(Length− Natural Length) if Length > Natural Length

0 if Length ≤ Natural Length.

This says, if Length is bigger than Natural Length, the bungee cord is engaged and we havea force that should be acting to pull us upwards. If Length is less than Natural Length, thebungee cord hangs slack and we have zero force. This is the reason we did not want to bringthe force of gravity into the spring force as discussed in the previous section. We do have toacknowledge that we are ignoring the, sometimes substantial, mass of the hanging cord.

The height of our jumper will be the height of the attachment point minus the length ofthe bungee cord. This enables us to use our previous model of free fall in Figure 3 withoutadjustment. By adding the parts of the spring model to the free fall model we obtain therather complicated looking model in Figure 6

For example, suppose a jumper weighing 75 kilograms, leaps from a height of 200 meterswith a cord of length of 80 meters with spring coefficient of 15 Newtons per meter attached atthe ankles. Further assume that the jumper has a cross sectional area of 0.5 square meters.This will give us the following set of equations:

Table 6. Variables and Equations for Bungee Jumping

99

Velocity

Change in Velocity

Change in Height

Height

Acceleration Total Force

Mass Weight

Gravitational Constant

Speed Cross-Sectional Area

Drag Force Drag Coefficient

Length

Spring Force Natural Length

Spring Coefficient

Figure 6. Diagram for Bungee Jumping

Variable Corresponding FormulasHeight y INTEG(Change in Height, 200)Length L = 200− y 200 - Height

Change in Height dydt

VelocityNatural Length N 80 metersVelocity v INTEG(Change in Velocity, 0)Change in Velocity dv

dtAcceleration

Speed |v| ABS(Velocity)Cross-Sectional Area A 0.5 m2

Drag Coefficient −0.65Drag Force FDrag Drag Coefficient ∗Cross-Sectional Area

∗Velocity ∗SpeedSpring Coefficient c 15 Newtons/meterSpring Force FSpring IF THEN ELSE( Length > Natural

Length, Spring Coefficient ∗(Length -Natural Length) , 0)

Mass m 75 kgGravity g 9.81Weight −mg -Mass∗GravityTotal Force Weight + Drag Force + Spring ForceAcceleration a Total Force/Mass

100

Since we are using the spring model, we know from previous work that in Vensim we willneed to make sure we are using Runge Kutta for our numerical integration package.

Euler’s Method. When we run the approximation using Euler’s method for ∆t = 0.125,we find the jumper comes to within 6 meters of the ground after approximately 9 seconds,before being launched up for the first bounce.

10 20 30 40 50 60 70 80 90 100

50

100

150

200

Figure 7. Height of Bungee Jumper

Of course, this is just an approximation. Recall that Euler’s method gives an under-estimate when the curve is concave up, so just like the case of the simple spring, the trueamplitude is smaller than what Euler’s method computes. The jumper actually never getscloser than 9 meters, but in the case of bungee jumper, this is the better type of error tomake.

101

This page intentionally left blank.

Name:

Homework 4.4.

1. Suppose a bungee cord of length 60 meters and spring coefficient of 20Newtons per meter is attached to a height 150 meters above the ground.(a) Assuming that a bungee jumper has a cross-sectional area of 0.5

square meters, determine the largest mass a jumper can have withouttouching the ground.

(b) Sketch a graph of your total force as a function of time for the Bungeejumper. Identify important parts of the graph and explain what ishappening at each time and why the sign of the force is appropriateat each of these times. Be sure to have times when the bungee jumperis in free-fall and times when he/she is close to the ground.

2. A bungee jumper wishes to have a“great ride” by coming as close to theground without hitting it. Assume the distance from the bridge abovethe bottom of the gorge is 100 meters the length of the bungee cord is 40meters. Assume the person has a cross-sectional area of 0.4 square metersand a weight of 90 kilograms. Find the spring constant of the bungee cordthat gives the best ride, assuming the spring constant must be a wholenumber. Find the whole number spring constant that gives the best ridefor weights of 70 kilograms and 50 kilograms.

103

Chapter 4 Review

Big Ideas.

• Newton’s second law of motion• Position, velocity and acceleration as a system of differential equations• Using Euler’s method to estimate solutions of systems of differential equations• Air resistance, terminal velocity, and drag forces• Spring force• IFTHENELSE logical statement• Bungee jumping• Problems with Euler’s method for estimating differential equations

At this point you should be able to.

• Write a system of differential equations with initial conditions that describes a simplefalling body model.• Write a system of differential equations with initial conditions that describes a

complex falling body model.• Create a Vensim PLE model of a system of differential equations with initial condi-

tions.• Write out the big picture of a differential equation from a Vensim model.• Analyze personal knowledge of a system in order to determine signs of proportion-

ality constants.• Write and explain the use of IFTHENELSE statements.

To prepare for assessment on this chapter, write with your own questions for each ofthe above tasks. If there is time, have everyone in your team do the same thing and thenattempt to solve each other’s question.

104

CHAPTER 5

Numerical Integration

1. Trapezoid, Midpoint, and Simpson’s Rules

The Trapezoid Rule. Recall in the section on the Integral, we defined the methodof left sum and right sum for approximating the signed area under a curve, known as the

integral. For the integral∫ b

af(t)dt, we divided the interval from a to b into n subintervals

each of length ∆t = b−an

. If we let t0 = a, t1 = t0 + ∆t, t2 = t1 + ∆t, and so on untiltn = tn−1 + ∆t = b. Notice that ti = a+ i×∆t. So that the left sum is given by

n−1∑i=0

f(ti)×∆t or equivalentlyn−1∑i=0

f

(a+

i

n(b− a)

)b− an

and the right sum is given byn∑

i=1

f(ti)×∆t or equivalentlyn∑

i=1

f

(a+

i

n(b− a)

)b− an

For example, when computing∫ 1

0etdt using n = 10, the left sum gives

e0 × 0.1 + e0.1 × 0.1 + e0.2 × 0.1 + e0.3 × 0.1 + · · ·+ e0.9 × 0.1 ≈ 1.63380

and the right sum gives

e0.1 × 0.1 + e0.2 × 0.1 + e0.3 × 0.1 + e0.4 × 0.1 + · · ·+ e1.0 × 0.1 ≈ 1.80563

This is an example of an integral which can be computed exactly. The exact value is knownto be e−1 ≈ 1.71828. This allows us to compute the error for the left sum and right sum fordifferent values of n, as in Table 1. Normally error is computed as an absolute value, but inthis case we wish to draw attention to whether we have an overestimate or an underestimate.

n Left Sum Left Error Right Sum Right Error10 1.63380 -0.0844824 1.80563 0.0873458100 1.70970 -0.0085771 1.72689 0.00860571000 1.71742 -0.0008590 1.71914 0.000859310000 1.71819 -0.0000860 1.71836 0.0000858

Table 1. Left Sum and Right Sum with Error for Values of n

In particular observe (as in Figure 1) that for an increasing function (such as et) the leftsum will always give an underestimate for the integral, while the right sum will always givean overestimate. Similarly for a decreasing function the left sum always gives an overestimatewhile the right sum always given an underestimate. Additionally observe in Table 1 that theerror for the left sum and right sum are approximately equal. It is also interesting to notethat the errors both decrease as n gets larger. When n grows by a factor of 10, the errorsboth shrink by a factor of 10.

Hopefully this inspires us to combine these two summation methods to create a newsummation method. If we average the left sum and right sum the error terms will partiallycancel out, leaving us with a better approximation. If we denote the left sum by L and the

106

0.20.40.60.8

0.5

1

1.5

2

2.5

0.20.40.60.8

0.5

1

1.5

2

2.5

Figure 1. Left Sum and Right Sum for an Increasing Function

right sum by R, we can define the trapezoid rule (denoted by T ) as T = L+R2

. More formally,one can derive the formula for the trapezoid rule as:

f(t0)× ∆t

2+

n−1∑i=1

f(ti)×∆t+ f(tn)× ∆t

2or equivalently

f(a)b− a2n

+n−1∑i=1

f

(a+

i

n(b− a)

)b− an

+ f(b)b− a2n

0.5 1 1.5 2

0.5

1

1.5

2

Figure 2. The Average of a Left Sum and Right Sum give the Trapezoid Rule

The reason this is called the trapezoid rule is that this method can also be derived by meansof approximation of the function f(t) by a linear function on each subinterval. While theleft sum and right sum are approximations by a series of constant functions, the trapezoidrule is an approximation by a series linear functions, as seen in Figure 2. When we averagethe left and right sum, we can split the difference in half, by means of a diagonal line. Thisdiagonal line gives our linear approximation on the subinterval.

We can make the same type of observation for the trapezoid rule and we did for the leftsum and right sum. As seen in Figure 2, when the function is concave down, the straightline approximation lies below the actual curve. That means that the trapezoid rule givesan underestimate when the curve is concave down. Similarly, the trapezoid rule will give anover estimate when the curve is concave up.

107

As an example, when computing∫ 1

0etdt using n = 10, the trapezoid rule gives (1.6338 +

1.8056)/2 = 1.7197, which is an overestimate of the exact value of 1.71828. Notice that et isconcave up for all values of t.

The Midpoint Rule. Another approach we can use to improve our numerical integra-tion technique is to select the middle point of each subinterval , instead of the left endpointor right endpoint. We will still use a constant function, but by selecting the middle pointthis will give a better approximation on the interval. This midpoint rule (denoted M) canbe obtained by the formula:

n−1∑i=0

f

(ti +

∆t

2

)×∆t or equivalently

n−1∑i=0

f

(a+

2i+ 1

2n(b− a)

)b− an

0.5 1 1.5 2

0.5

1

1.5

2

Figure 3. The Midpoint Rule

One can observe how the midpoint rule looks in Figure 3. On each subinterval there is aportion which is an overestimate and a portion which is an underestimate, but there areasseem to cancel each other out, giving a more accurate approximation.

As an example, when computing∫ 1

0etdt using n = 10, the midpoint rule gives

e0.05 × 0.1 + e0.15 × 0.1 + e0.25 × 0.1 + e0.35 × 0.1 + · · ·+ e0.95 × 0.1 ≈ 1.71757

Similarly to Table 1 we can compute the error for the midpoint rule and the trapezoid rulefor a variety of n values to observe trends in the error as n increases. These values are inTable 2.

Observe that the error terms shrink faster with respect to n for the trapezoid rule andmidpoint rule than they did for left sum and right sum. As the number of subdivision in-creases by a factor of 10, the errors decrease by a factor of 100. As with the left sum andright sum one of the methods gives an overestimate and the other gives an underestimate.We observed that the trapezoid rule gives overestimates for concave up functions and un-derestimates for concave down functions. Let’s discuss how the midpoint rule interacts withthe concavity of the function.

108

n Trapezoid Trap Error Midpoint Midpoint Error1 1.85914 0.1408591 1.64872 -0.069560610 1.71971 0.0014317 1.71757 -0.0007157100 1.71830 0.0000143 1.71827 -0.00000721000 1.71828 0.00000014 1.71828 -0.000000074

Table 2. Trapezoid and Midpoint with Error for Values of n

D

B

A C E

Figure 4. The Midpoint Rule and Concavity

In Figure 4 we have taken one rectangle as obtained using the midpoint rule, and focusedin on it. Here the point C is the midpoint between A and E, so the value of the functionat C determines the height of the rectangle. Also in the figure is the line tangent to thecurve at the point C, which passes through the points B and D. Notice that the area in thetriangle ABC is equal to the area in the triangle CDE. Therefore, the area under the linejoining A and E is equal to the area under the line joining B and D. Thus, the area of amidpoint rectangle is the same as the area created using a trapezoid with the top line beingcreated by the tangent line. In this figure we see that when the curve is concave down, theline curves below the tangent line at C, so that the midpoint rule yields an overestimate.A similar argument can show that the midpoint rule gives an underestimate for curves thatare concave up.

Simpson’s Rule. Notice that this arrangement is the opposite of the trapezoid rule. Forconcave up functions, the trapezoid rule gives an overestimate and the midpoint rule gives anunderestimate. For concave down functions, the trapezoid rule gives an underestimate andthe midpoint rule gives an overestimate. It would be nice if we could average the midpointrule and trapezoid rule together, like we did with the left sum and right sum, to find somebetter technique of integration.

The difficulty in this case is that the errors produced by the trapezoid rule and midpointrule are not the same size. If you look at Table 2, you will notice that the error for thetrapezoid rule is consistently about twice the size of the error for the midpoint rule. In orderto get the errors to cancel out, one would need two midpoint rules for every trapezoid rule.We can accomplish this by way of a weighted average. We define Simpson’s Rule (denoted

109

S) to be

S =T + 2M

3.

n 1 10 100Simpson’s 1.718861 1.71828188 1.718281828Simpson’s Error .000579 5.96× 10−8 5.96× 10−12

Table 3. Simpson’s Rule with Error for Values of n

Observe in Table 3 that Simpson’s Rule converges quickly to a very accurate approxima-tion. As the number of subdivision increases by a factor of 10, the error for Simpson’s Ruledecreases by a factor of 10 000.

It is worth mentioning that it is possible to develop Simpson’s Rule by another approach.If we consider the trapezoid rule as approximation by linear functions, one could ask if thereis value in approximations by second order curves (parabolas). This approach requiresthe integration formula for parabolas, but does lead to a better algorithm for computingthe approximate area under a curve. It can be shown that finding the area by parabolicapproximation is exactly equal to applying Simpson’s Rule as we have defined it above.

110

Name:

Homework 5.1. For each of the following functions, numerically approximate the in-tegral over the given range for the given stepsize, first using trapezoid Rule and then usingthe midpoint rule.

1.

∫ 2

1

t3 dt with ∆t = 0.5

2.

∫ 2

−1

2− t2 dt with ∆t = 0.6

3.

∫ 4

−1

4 + t− t2 dt with ∆t = 0.5

4.

∫ 10

5

√x dx with ∆x = 0.2

5.

∫ 3

0

1

1 + x2dx with ∆x = 0.5

6.

∫ 1

−1

1− t2

1 + t2dt with ∆t = 0.25

7.

∫ 2

1

√s2 + 1 ds with ∆s = 0.1

8.

∫ 3

0

cos(2θ) dθ with ∆θ = 0.2

For each of the following functions, numerically approximate the integral over thegiven range for the given stepsize, using trapezoid Rule, midpoint rule and Simpson’sRule.

9.

∫ 3

1

t3 − t2 − 2 dt with ∆t = 0.25

10.

∫ 3

1

ln(x+ 1) dx with ∆x = 0.2

111

2. Improved Euler’s Method

In this class, it helps to think as integrals as accumulation. If you have a hose full ofwater pouring into the swimming pool at a certain rate, the amount of water in the pool is anaccumulation (or integral) of all the water that is passing through the hose. The water in thehose is a flow (or derivative) of water. In Vensim, the integral is your box variable whereasthe derivative is your double-arrow flow. We need to learn how Vensim calculates the valuesfor flow and box variables. It is not enough to learn how to use a piece of software, it isimportant to learn what algorithms that software uses so that you understand the program’saccuracy.

Euler’s Method. You’ve already learned a basic algorithm for calculating integrals.Euler’s method is the simplest algorithm we used and we will review it. After that, we willgo on to some more complicated algorithms that are more accurate than Euler’s method.As you recall, Euler’s method uses the differential equation to calculate a slope and thenfinding new value by taking the old value plus the slope times the change in time. That is,

Initialize t0 and P0

Initialize NumberOfStepsfor n going from 1 to NumberOfSteps do the following:

tn = t0 + n∆t(15)

∆Pn = f(tn−1, Pn−1)∆t(16)

Pn = Pn−1 + ∆Pn(17)

where ∆t is the step change in time and f(t, P ) = dPdt

. We usually calculate ∆t = tend−t0n

.Recall when we first introduced the notion of integration, we were using Euler’s method

to find the antiderivative of a particular function. That is, we were attempting to find anapproximate solution to

P ′(t) = f(t) with P (a) = 0

This turned out to give us the left sum approximation to F (t) =∫ t

af .

Observe that the left sum approximation yields an underestimate for increasing functions.So when f(t) is increasing, Euler’s method gives an underestimate. If f(t) is increasing,then we know that f ′(t) ≥ 0. Since P ′(t) = f(t) can conclude that if f(t) is increasing, thenP ′′(t) = f ′(t) ≥ 0. So Euler’s method produces an underestimate to P ′(t) = f(t) when thesolution curve is concave up.

We can also draw the same conclusion by considering the straight line approximations.Since Euler’s method uses a straight line to approximate the solution to the differential equa-tion, any time the solution curve is concave up, Euler’s method will give an underestimate.Similarly, any time the solution curve is concave down, Euler’s method gives an overestimate.

Improved Euler’s Method. Recall in the previous section, we were able to improveon left sums as an approximate integration technique by averaging the value of the functionat multiple locations. This was called the Trapezoid method. We can use the same ideato improve on Euler’s method for finding approximate solutions to differential equations.Given the differential equation P ′(t) = f(t, P (t)) with initial condition P (t0) = P0, the

112

traditional Euler’s method uses the value of f(t0, P0) to determine the slope, and extendsalong a straight line in that direction to find the next point. So that

(t1, P1) = (t0 + ∆t, P0 + f(t0, P0)∆t)

In improved Euler’s method, one still extends along a straight line to find another point.But rather than letting that new point be (t1, P1), one computes the slope at that new pointas well. We find f(t0 + ∆t, P0 + f(t0, P0)∆t) and take the average of this new slope with theprevious slope of f(t0, P0) and use that to find our next point. See Figure 5.

y(t)0.1 0.2 0.3 0.4 0.5 0.6 0.7

0.2

0.4

0.6

Figure 5. Improved Euler’s Method

The algorithm is called Improved Euler’s Method. The new algorithm averages theestimated rises at t0 and t1 to give us to better prediction of the true rise between t0and t1.Here is the algorithm for Improved Euler’s Method. In this algorithm, f(t, P ) = dP

dt.

Initialize t0 and P0

Initialize NumberOfStepsfor n going from 1 to NumberOfSteps do the following:

tn = t0 + n∆t(18)

∂1 = f(tn−1, Pn−1)∆t, which is the rise from Euler’s Method(19)

∂2 = f(tn, Pn−1 + ∂1)∆t, this is the rise from the right side of the calculation(20)

∆Pn =∂1 + ∂2

2(21)

Pn = Pn−1 + ∆Pn(22)

For example, for the differential equation P ′(t) = t2 − P 2 with P (1) = 2 and ∆t = 0.1,Improved Euler’s Method proceeds as shown in Table 4. We conclude that P (1.5) ≈ 1.482.In practice, we often use a simpler table with just tn, Pn, ∂1, ∂2,∆Pn, but we leave it up toyou to decide when you can simplify your tables.

113

tn Pn f(tn, Pn) ∂1 f(t+ ∆t, P + ∂1) ∂2 ∆Pn

1 2.000 -3.000 -0.300 -1.680 -0.168 -0.2341.1 1.766 -1.909 -0.191 -1.041 -0.104 -0.1471.2 1.619 -1.180 -0.118 -0.562 -0.056 -0.0871.3 1.531 -0.655 -0.066 -0.189 -0.019 -0.0421.4 1.489 0.258 -0.026 0.108 0.011 0.0071.5 1.482 – – – – –

Table 4. Improved Euler’s Method in Practice

It worth mentioning that Improved Euler’s method is also known as Heun’s Formula aswell as Runge-Kutta 2 (RK2). It is also possible to verify that using Improved Euler’smethod to approximate the solution to y′(t) = f(t) with y(a) = 0 using ∆t gives the same

answer as using the trapezoid rule to integrate∫ t

af (also with ∆t).

114

Name:

Homework 5.2.

1. Use Improved Euler’s method to approximate the solution to the initial value problem:

dy

dt= 1 + y + t y(0) = −1,

using the stepsize ∆t = .25 to find an approximate value for y(1).

2. Use Improved Euler’s method to approximate the solution to the initial value problem:

dP

dt= .3

(1− P

1000

)P P (0) = 300

using the stepsize ∆t = .2 to find an approximate value for P (1).

3. Use Improved Euler’s method to approximate the solution to the initial value problem:

dy

dx=−yx

y(1) = 1

using the stepsize ∆x = .2 to find an approximate value for y(3).

4. Use Improved Euler’s method to approximate the solution to the initial value problem:

dy

dt= ty −√y y(0) = 1

using the stepsize ∆t = .1 to find an approximate value for y(2).

5. Use Improved Euler’s method to approximate the solution to the initial value problem:

dy

dx= cos(x) y(1) = 0

using the stepsize ∆x = .1 to find an approximate value for y(3). Numerically approx-

imate the integral

∫ 3

1

cos(x) dx using the trapezoid rule with ∆x = .1. Compare these

two answers.

115

3. Runge-Kutta Method

So far, things are making sense, but you may notice that Vensim does not have a way toswitch to Improved Euler’s Method. This is because we can do much better.

In the same way that Simpson’s rule was developed as an improvement over the trapezoidand midpoint rule, the Runge-Kutta method is an improvement over the Improved Euler’sMethod. The Improved Euler’s Method samples the value of the slope field at two points andaverages them for a value to use as the slope. The Runge-Kutta method samples the valueof the slope field at four points (each end and twice in the middle) and takes a weightedaverage (making the middle twice as valuable as the ends) of the associated rises for thevalue to use as the slope. See Figure 6

Initialize t0 and P0

Initialize NumberOfStepsfor n going from 1 to NumberOfSteps do the following:

tn = t0 + n∆t(23)

∂1 = f(tn−1, Pn−1)∆t(24)

∂2 = f(tn−1 +∆t

2, Pn−1 +

∂1

2)∆t(25)

∂3 = f(tn−1 +∆t

2, Pn−1 +

∂2

2)∆t(26)

∂4 = f(tn, Pn−1 + ∂3)∆t(27)

∆Pn =∂1 + 2∂2 + 2∂3 + ∂4

6(28)

Pn = Pn−1 + ∆Pn(29)

Each of your ∂j terms is an approximation for ∆P . The first term, (24), is good-old Euler’smethod. The second two terms, (25) and (26), are a type of Midpoint Rule. The lastterm, (27), is more like a Right Hand sum term. Since Runge-Kutta is much more accurate,simulations can usually have larger step sizes than the other two methods, but each iterationwill be computationally slower because on each step, Runge-Kutta has to compute f fourtimes instead of one or two times. Runge-Kutta appears complicated, but it is an algorithmand is not meant to be calculated by hand, but programmed into a computer or calculator.However, it is useful to try the calculation yourself before trusting your computer.

116

0.1 0.2 0.3 0.4 0.5 0.6 0.7

0.2

0.4

0.6

Figure 6. Runge Kutta Method

For example, if we use the Runge-Kutta method to approximate the solution to P ′(t) =t2 − P 2 with P (1) = 2 and ∆t = 0.1, the first step proceeds as:

∂1 = f(1, 2)∆t = (12 − 22) ∗ 0.1 = −.3∂2 = f(1 + .1/2, 2 + (−.3)/2)∆t = (1.052 − 1.852) ∗ 0.1 = −.232

∂3 = f(1 + .1/2, 2 + (−.232)/2)∆t = (1.052 − 1.8842) ∗ 0.1 = −0.245

∂4 = f(1 + 1, 2 + (−0.245))∆t = (1.12 − 1.7552) ∗ 0.1 = −0.187

t1 = t0 + ∆t = 1.1

P1 = y0 +∂1 + 2∂2 + 2∂3 + ∂4

6= 2 +

(−0.3) + 2(−.232) + 2(−.245) + (−.187)

6= 1.760

Additional steps yield

n Pn tn ∂1 ∂2 ∂3 ∂4 ∆Pn

1 1.760 1.1 -0.1887 -0.1452 -0.1525 -0.1144 -0.14972 1.6102 1.2 -0.1153 -0.0848 -0.0895 -0.0622 -0.08773 1.5225 1.3 -0.0628 -0.0401 -0.0435 -0.0227 -0.04214 1.4804 1.4 -0.0232 -0.0055 -0.0081 0.0082 -0.00705 1.4734 1.5 – – – – –

And we conclude that y(1.5) ≈ 1.4734.In some settings Runge-Kutta is referred to as RK4 because it uses four estimates for

the rise. It is also possible to verify that using Runge-Kutta to approximate the solution toy′(t) = f(t) with y(a) = 0 using ∆t gives the same answer as using the Simpson’s rule to

integrate∫ t

af (also with ∆t).

117

This page intentionally left blank.

Name:

Homework 5.3.

1. Use the Runge-Kutta method to approximate the solution to the initial value problem:

dy

dt= 1 + y + t y(0) = −1,

using the stepsize ∆t = .25 to find an approximate value for y(1).

2. Use the Runge-Kutta method to approximate the solution to the initial value problem:

dP

dt= .3

(1− P

1000

)P P (0) = 300

using the stepsize ∆t = .2 to find an approximate value for P (1).

3. Use the Runge-Kutta method to approximate the solution to the initial value problem:

dy

dx=−yx

y(1) = 1

using the stepsize ∆x = .2 to find an approximate value for y(3).

4. Use the Runge-Kutta method to approximate the solution to the initial value problem:

dy

dt= ty −√y y(0) = 1

using the stepsize ∆t = .1 to find an approximate value for y(2).

5. Use the Runge-Kutta method to approximate the solution to the initial value problem:

dy

dx= cos(x) y(1) = 0

using the stepsize ∆x = .1 to find an approximate value for y(3). Numerically approxi-

mate the integral

∫ 3

1

cos(x) dx using Simpson’s rule with ∆x = .1. Compare these two

answers.

119

Chapter 5 Review

Big Ideas.

• Trapezoid, Midpoint and Simpson’s Rules• Weighted average• Improved Euler’s method for estimating solutions of Differential Equations• Runge-Kutta method for estimating solutions of Differential Equations

At this point you should be able to.

• Approximate the area under a curve using the trapezoid, midpoint and Simpson’srules by hand and using a computer.• Explain the difference between an average and a weighted average.• Use improved Euler’s method to estimate the solution of a differential equation with

initial value both by hand and using a computer.• (If included) Use Runge-Kutta method to estimate the solution of a differential

equation with initial value both by hand and using a computer.

To prepare for assessment on this chapter, write with your own questions for each ofthe above tasks. If there is time, have everyone in your team do the same thing and thenattempt to solve each other’s question.

120

CHAPTER 6

Systems of Differential Equations

We considered second order differential equations as a system of first order differentialequations when we were working on some of the Physics problems, but it turns out thatsystems of differential equation are much more powerful than just a way of getting aroundtechnicalities with differential equations. We use systems in a variety of ways, but the twomost common uses are having one population flowing into another, like population flowingthrough a series of lakes, and having different, interacting populations, like deer and the carsthat hit them.

1. Interacting Species

The previous population model for logistic growth is used as an effective model for asingle population, but as we know, populations are not isolated in the environment. Toimprove our species population model, we consider multiple populations with interactionbetween them. Each population left in isolation will have a model described by the logisticmodel:

dP

dt= kP

(1− P

L

)Model: 6.1. For any two populations, the combined equations create a system of differentialequations which accounts not only for the individual populations, but also takes the interactionof the populations under consideration.

dP1

dt= k1P1

(1− P1

L1

)+ interaction

dP2

dt= k2P2

(1− P2

L2

)+ interaction

The interaction term is based on the number of times the two species come into contact.We make the assumption that the number of interactions between the two species will beproportional to the product of the size of each species; that is, the interaction term will be ofthe form kP1P2. Notice that the proportionality constant for population 1 will have units of1/population 2/time so that when we multiply by the product of the two populations we areleft with units of population 1/time.

Interactions between two populations come in three flavors: those that benefit bothspecies, those that hurt both species, and those which benefit one species while hurtingthe other. It is worth mentioning that in traditional textbooks, most species interactionmodeling is still done with a simple, exponential growth model rather than logistic growth.We can jump straight to logistic growth because we use computational tools to do much ofthe analysis for us.

Predator-Prey. For our first example, consider the predator-prey relationship betweentwo species. In this case, the interaction has a positive effect for one species, the predator,and a negative effect on the other species, the prey. If the predators are wolves, denotedW (t), and the prey are rabbits, denoted R(t), we get the differential equations:

dW

dt= 0.02W

(1− W

5

)+ .0003RW(30)

dR

dt= 0.1R

(1− R

3000

)− .004RW(31)

Let us see what we can learn from studying the model. First, if we look at (30) and let R = 0we see our familiar logistic differential equation and we can observe that the maximumpopulation of wolves in the absence of rabbits is 5. When R > 0, the last term in thedifferential equation is positive and adds to the growth of the wolf population. This willallow our wolf population to exceed 5 in the presence of rabbits. Similarly, by studying (31),the maximum population of rabbits in the absence of wolves is 5000 and because the sign on

122

the term that contains W is negative, the presence of wolves is harmful to the population ofrabbits.

This leads to a flow diagram given by Figure 1.

Rabbits

rabbit births rabbit deaths

maximumrabbit

populationrabbit

birth rate

rabbit inter-action effect

Wolves

wolf births

maximum wolfpopulation

wolf birth ratewolf inter-

action effect

Figure 1. Predator Prey Model with Wolves and Rabbits

Notice that in Figure 1, we have two box variables, but we do not have flow from one boxvariable into another like we did in 3.7. Instead, the flow rates are influenced by the size ofthe box variables.

The wolf birth rate is given by 0.02 wolves per year per wolf (so the units are just 1/year);the rabbit birth rate is 0.1 per year. The maximum wolf population is 5 wolves; the maximumrabbit population is 3000 rabbits. The wolf interaction effect is .0003 wolves per year perwolf per rabbit (so the units are 1/rabbit/year); the rabbit interaction effect is −.004 perrabbit per year.

Graphing Populations. When we graph the rabbit and wolf populations against time,we get two oscillating populations whose peaks are shifted from each other. First the rabbitpopulation grows quickly and peaks before dying off. When the rabbit population peaks,the wolf population grows very quickly, but does not peak until the rabbit population hasbeen going down. This suggests an interaction between the two populations that might bebetter studied with a different type of graph.

We will put the rabbit population on the horizontal axis and the wolf population on thevertical axis. Then, for each calculated time, t, we plot the point (R(t),W (t)). This typeof graph is called a parametric plot . We could have done the same thing any time we havemultiple variables that depend on one parameter, in this case t. With initial conditions of3000 rabbits and 2 wolves (assuming that a mating pair of wolves are introduced to a stable

123

population of rabbits), the given system of equations yields the graph in Figure 2, showingwolf population and rabbit population varying together with time.

500 1,000 1,500 2,000 2,500 3,000

30

60

90

Figure 2. Phase Portrait for Wolves and Rabbits over time

Pay attention to the labels on the axis of Figure 2. This is a different way of looking atthe interactions between species. Rather than having an axis for time, the phase portraitallows us to investigate the influence of the size of one population on the other. Initially thepopulations starts in the lower right with 3000 rabbits and 2 wolves. The rabbit populationdecreases while the wolf population rises, causing the graph to move left and up. Eventuallythe rabbit population gets too low to support the growth in the wolf population and thewolf population decreases. After a long time (over 100 years) the population stabilizes at anequilibrium (in this case 23 wolves and 240 rabbits).

Equilibria. As with the Harvesting model, it is possible to determine the equilibriumsolutions algebraically using only the differential equations. The equilibrium solutions occurwhen the populations stay constant, that is, both the derivatives are zero. By taking the twodifferential equations and setting each rate of change equal to zero we obtain the followingsystem of equations

dW

dt= 0 = 0.02W

(1− W

5

)+ .0003RW

dR

dt= 0 = 0.1R

(1− R

3000

)− .004RW

124

These simplify to

0 = W (0.02

(1− W

5

)+ .0003R)

0 = R(0.1

(1− R

3000

)− .004W )

or, by multiplying both sides of equations by some convenient constants

0 = W (200− 40W + 3R)

0 = R(3000−R− 120W )

Notice, it is not enough to set these equations equal to each other, they must both be zeroas well. There are four ways for both equations to be satisfied.

Table 1. Equilibrium Solutions for Predator/Prey

1. W = 0 and R = 02. 200− 40W + 3R = 0 and R = 03. W = 0 and 3000−R− 120W = 04. 200− 40W + 3R = 0 and 3000−R− 120W = 0

Each of these equation pairs must be solved separately. They yield the equilibrium solutions:1. W = 0, R = 0, 2. W = 5, R = 0, 3. W = 0, R = 3000, and 4. W = 23, R = 240.The first equilibrium consists of no wolves or rabbits and is considered uninteresting. Thesecond and third equilibrium solutions consist of one population in the absence of the otherachieving its maximum sustainable population, perhaps more interesting, but previouslystudied. The final equilibrium is where both populations have reached steady state popula-tions in the presence of the other and this is the “new” solution.

125

This page intentionally left blank.

Name:

Homework 6.1.

1. For the following system of differential equations, identify the predator and the prey andfind all equilibrium solutions.

dA

dt= .1A

(1− A

100

)+ .0002AB

dB

dt= .3B

(1− B

500

)− .002AB

2. For the following system of differential equations, identify the predator and the prey andfind all equilibrium solutions.

dA

dt= .3A

(1− A

300

)− .0005AB

dB

dt= .05B

(1− B

200

)+ .0005AB

3. It is possible to create a more complicated food chain using these same techniques. LetV (t) be the amount of vegetation, H(t) be the number of herbivores, and C(t) be thenumber of carnivores.

dC

dt= .01C

(1− C

5

)+ .02HC

dH

dt= .05H

(1− H

20

)+ .05HV − .03HC

dV

dt= .25V

(1− V

6000

)− .15HV

Determine the long term behavior for this model under a variety of initial conditions.

4. Consider the model with one predator and two prey, where W (t) represents the wolf pop-ulation, R(t) represents the rabbit population and D(t) represents the deer population.

dW

dt= .02W

(1− W

10

)+ .0005WR + .002WD

dR

dt= .1R

(1− R

2500

)− .003WR

dD

dt= .05D

(1− D

500

)− .004WD

Determine the long term behavior for this model under a variety of initial conditions.

127

5. The previous model fails to take into account the relative density of the prey. Whenrabbits are plentiful and deer are scarce, this model still represents wolves hunting deer.In order to account for the relative levels of the prey, we can adjust the model bymultiplying by the relative level of the (or percentage of total) prey as follows:

dW

dt= .02W

(1− W

10

)+ .0005WR

R

R +D+ .002WD

D

R +D

dR

dt= .1R

(1− R

2500

)− .003WR

R

R +D

dD

dt= .05D

(1− D

500

)− .004WD

D

R +D

Determine the long term behavior for this model under a variety of initial conditions.

128

2. Competition and Symbiosis

In addition to the Predator-Prey model for interaction populations, there are two otherexamples which are frequently modeled.

dP1

dt= k1P1

(1− P1

L1

)+ interaction

dP2

dt= k2P2

(1− P2

L2

)+ interaction

There is the case where both species have a negative effect on the other species, this is calledcompetition. Alternatively there is the case where both species have a positive effect onthe other species, this is called symbiosis.

For example, consider the model of two interacting species given by

dA

dt= .3A

(1− A

300

)− .005AB

dB

dt= .2B

(1− B

200

)− .003AB

This is a competitive system, because each species has a negative impact on the other species.Suppose, each species starts off with an initial population of 60. In that case, we get thegraph in Figure 3 of the two populations

Figure 3. Competition with initial conditions A = B = 60

Observe that population A survives while population B dies out. By comparison, if bothspecies start with an initial population of 50, we get a very different result. It is possible tocheck that when A = B = 50, both differential equations give values of dA/dt = dB/dt = 0so that an equilibrium occurs. So the populations will stay fixed for all time. However, this

129

is an unstable equilibrium, so that nearby values tend to drift away. An unstable equilibriumis much like balancing a ball at the top of a hill. As long as you don’t touch it, it will staythere, but if you place the ball not quite at the top, the ball rolls away from the sweet spotat the top of the hill. For different starting conditions, the long term behavior is different.Sometimes A dies out and B approaches a stable population of 200; sometimes B dies outand A approached a stable population of 300.

More generally, this is known as a negative feedback loop. Negative feedback loops arecommon in nature, although we usually only see the long-term results. When we have twotruly competing species, in the long term, only one wins. In practice, the species that is notdoing so well either moves out of the area or changes its ways so that it occupies a differentecological niche. Engineers often try to build negative-feedback loops into their designs todamp down resonances and other undesirable interactions.

Consider instead the example

dA

dt= .02A

(1− A

100

)+ .0002AB

dB

dt= .03B

(1− B

150

)+ .0001AB

This is a symbiosis model, since each species has a positive effect on the other species. Ifeach species starts off at their individual equilibrium, A = 100 and B = 150, each speciesgrows beyond what they could sustain in the absence of the other species.

Figure 4. Symbiosis with initial conditions A = 100 and B = 150

In Figure 4 observe that A approaches a limiting value of 500 while B approaches a limitingvalue of 400, each of which is larger than the corresponding individual equilibrium. In thisexample, the equilibrium is stable.

130

Symbiosis is a type of positive feedback loop. Without the logistic term, it is possible forpositive feedback models to quickly grow without bound. It used to be thought there were nota lot of examples of positive feedback loops in nature, but it was recently realized that manysexual traits are produced due to positive feedback. If the females mate more selectivelywith a male with a particular trait, that trait will become more and more pronounced in thepopulation.

131

This page intentionally left blank.

Name:

Homework 6.2.

1. For the following system of differential equations, determine the type ofspecies interaction and find all equilibrium solutions.

dA

dt= .1A

(1− A

100

)+ .0005AB

dB

dt= .05B

(1− B

150

)+ .0006AB

2. For the following system of differential equations, determine the type ofspecies interaction and find all equilibrium solutions.

dA

dt= .2A

(1− A

200

)− .0003AB

dB

dt= .1B

(1− B

400

)− .0003AB

133

3. Consider a lake of with an established population of native fish in whichan invasive species is accidentally introduced.

dN

dt= .1N

(1− N

3000

)− .0001NI

dI

dt= .15I

(1− I

3000

)− .00003NI

Assume an initial population of N(0) = 3000 and I(0) = 10. Determinethe long term behavior of these fish populations. How long does it takeuntil the invasive species outnumbers the native species?

Fifty years after the introduction of the invasive species, it is observedthat the native species is in danger. In response, harvesting of the non-native species is begun. How many of the invasive species must be har-vested each year (beginning in the fiftieth year) in order to save the nativespecies?

Another type of competition modeling is that which occurs in warfare.Consider a conflict between two armies of x and y soldiers respectively. F.W. Lanchester assumed that if both armies were fighting a conventionalbattle within sight of one another, the rate at which soldiers in one armyare being put out of action (killed or wounded) is proportional to theamount of fire the other army can produce, which is again, proportionalto the size of that army. Thus, if there are no reinforcements, we cancreate a simple system of differential equations that model the size ofeach army:

(32)dxdt = −aydydt = −bx

where a, b > 0.4. You can use the system of differential equations to solve for a single dif-

ferential equation that does not involve time using the formulady

dx=

dydtdxdt

.

(a) Write a differential equation involving dydx and the constants of attri-

tion, a and b.

134

(b) Using a computer algebra system like Maple or Wolfrahm Alpha,verify that solutions of your differential equation look like

ay2 − bx2 = C

for some constant C. This equation is called Lanchester’s square law.The value of C depends on the sizes of the two armies.

5. Near the end of World War II a fierce battle took place between US andJapanese troops over the island of Iwo Jima, off the coast of Japan. ApplyLanchester’s analysis to the battle with x representing the number of UStroops and y the number of Japanese troops.(a) Analysis of the information available gives us an estimate that a =

0.05 and b = 0.01. Ignoring reinforcements, write a differential equa-tion describing the battle.

(b) Assuming that the initial strength of the US forces was 54,000 andthat of the Japanese was 21,500, what outcome is predicted by themodel?

(c) Assuming that the Japanese fought without surrendering until theyhad all been killed, as was the case, how many US troops does thismodel predict would be left when the battle ended?

(d) Would knowing that the US in fact had 19,000 reinforcements, whilethe Japanese had none, alter the outcome predicted?

135

3. S - I - R Model

A model for disease transmission requires dividing the population into three distinctgroups: the susceptibles, the infected and the recovered. Individuals who have not yetgotten sick are part of the susceptible group, S(t). Individuals with the disease are part ofthe infected group, I(t). Individuals who have recovered from the disease and are assumedto non longer be susceptible (either due to immunity or death) are part of the recoveredgroup, R(t).

Model: 6.2. The model for disease transmission is based on the number of interactionsbetween infected individuals and susceptible individuals. As individuals get sick, they movefrom the susceptible group to the infected group. At the same time, individuals in the infectedgroup recovered from the disease at a rate proportional to the number of individuals who areinfected. (See Figure 5)

Figure 5. Basic S - I - R Model

We can write this as a system of differential equations

dS

dt= −rSI r >0

dI

dt= rSI − aI a >0

dR

dt= aI

Observe that dS/dt+dI/dt+dR/dt = 0 so that the population remains constant. The termr is the transmission constant and it represents how virulent the disease is. The term a isthe recovery constant. This can be shown to be a = 1/d where d is the average number ofdays it takes to recover from the disease.

Consider the example of flu transmission at a small liberal arts college. Assume thatS(0) = 1800, that is the entire population is susceptible, and I(0) = 1, that is a single infectedstudent comes to campus. Assume 10 days recovery time for the flu and let r = .0008.

Observe in Figure 6 that the number of susceptibles starts high and drops as individualsget sick. In response the number of infected individuals rise. Over time the sick individualsrecover, so that the number of infected goes down and the number of recovered rises. Even-tually, the disease runs its course and everyone has gotten sick and recovered, so that thenumber of recovered approaches the size of the entire population.

136

Figure 6. Graphs for flu transmission through population

137

This page intentionally left blank.

Name:

Homework 6.3.

1. Consider a population of size 5000, in which a single infected individualis introduced. Assume the disease lasts one week on average and thetransmission constant is .00007. After the disease has run its course,what percentage of the population has gotten sick and recovered? Whenare the most people sick? When are people getting sick the fastest?

2. Consider a strain of the flu with average recovery time of 10 days and atransmission rate of .0008 in introduced into a population of size 2000.Re-create the S-I-R model for this disease.

Suppose received a flu vaccine was an option. Create a new groupcalled the vaccinated (denoted V (t)), where on the first day of the modelup to 50 individuals can be removed from the susceptible pool and placedin the vaccinated pool. Additionally assume that the immunity from thevaccine is not permanent, and lasts on average 100 days. This gives theequation

dV

dt= minS, 50 − .01V

with appropriate changes made in the equation for dS/dt. Determine howmany people get sick in this model?

3. Consider a strain of the flu with average recovery time of 10 days and atransmission rate of .0007 in introduced into a population of size 6000.Re-create the S-I-R model for this disease.

Suppose there is an attempt to quarantine infected individuals. Thatis, infected individuals are moved into a separate pool (denoted Q(t))so that they do not interact with susceptible individuals. Assume thatquarantined individuals recover at the same rate as infected individualsleft in the general population.

Create a model with a 50% quarantine rate. How does the course ofthe disease change? Repeat the model with a 75% quarantine rate. Howdoes the course of the disease change? How high does the quarantinerate need to get before there is significant change in the behavior of thedisease moving through the population?

139

4. Malaria

Malaria is another infectious disease with a different transmission model.

Model: 6.3. Humans with malaria do not directly infect other humans. Human catchmalaria if they are bitten by an infected mosquito, called a vector in Biology. Similarly,mosquitoes with malaria do not give malaria to other mosquitoes, rather mosquitoes catchmalaria by biting an infected human.

This gives a kind of S − I − R model with two interacting species. At first glance themodel looks like Figure 7.

Figure 7. Initial Malaria Model

However, the lifespan of a mosquito is so short that they do not recover from malaria.For this model to be useful it needs to account for the multiple generations of mosquitoes.In nature the female mosquito lives for an average of one to two weeks. As new mosquitoesare born, they are malaria free, so they are added to the susceptible mosquito population. Ifwe denote the susceptible mosquitoes as SM , infected mosquitoes as IM , susceptible humansas SH , infected humans as IH and recovered humans as RH , we get the following set ofdifferential equations.

dSH

dt= −rHSHIM

dIHdt

= rHSHIM − dHIH − aIHdRH

dt= aIH

dSM

dt= b(SM + IM)− dMSM − rMSMIH

dIMdt

= rMSMIH − dMIM

Here dH is the death rate for humans and dM is the death rate for mosquitoes. The term rHis the likelihood of a bite occurring between an infected mosquito and a susceptible humanand the disease being transmitted. The term rM is the similar term for mosquitoes. Thebirth rate for mosquitoes is b, which is multiplied by the total number of mosquitoes. Finally,a is the recovery rate for malaria, which is quite small. The modified diagram is given inFigure 8.

140

Figure 8. Improved Malaria Model

We can set some initial values. Let SH(0) = 1000, IH(0) = 1, RH(0) = 0, SM(0) = 1000,IM(0) = 0. Additionally set dM = .1, dH = .002, rH = .002, rM = .002, b = .1 and a = .005.This results in the following graphs:

Figure 9. Malaria Model for 100 days

Figure 9 is for the first 100 days, while Figure 10 is for the first 1000 days. Observe that inthe first few days of the outbreak, the number of susceptible humans drops to near zero, whilethe number of infected human rises quickly. Similarly, the number of infected mosquitoes alsorises quickly and the number of susceptible mosquitoes drops, but the number of susceptible

141

mosquitoes does not approach zero, because new susceptible mosquitoes are constantly beingborn. The number of recovered immune humans starts to grow slowly. In the long run of thedisease, the number of susceptible humans stays near zero, and the infected humans becomerecovered and immune. Once the number of infected humans drops low enough, the numberof infected mosquitoes also drops until the epidemic runs its course and there are no moreinfected humans or mosquitoes. Also observe that the final population of recovered humansis significantly lower that the starting population.

Figure 10. Malaria Model for 1000 days

142

Name:

Homework 6.4.

1. Reproduce the malaria model where SH(0) = 1000, IH(0) = 1, RH(0) = 0,SM(0) = 100, IM(0) = 0, dM = .1, dH = .002, rH = .002, rM = .002,b = .1 and a = .005. What is the final population of humans left afterthe epidemic has run its course? How is this different from the model inthe text? What happens if SM(0) = 10?

2. How does this model change if mosquito nettings are widely used to de-cease the incidence of mosquito bites? Reproduce the modified model anddescribe the long term behavior.

3. How does this model change if insecticides in still water are widely usedto decease the birth rate of mosquitoes? Reproduce the modified modeland describe the long term behavior.

4. How does this model change if genetically modified male mosquitoes arereleased? The mosquitoes are modified in such a way that any femaleeggs do not survive to adulthood. Reproduce the modified model anddescribe the long term behavior.

5. How does this model change if genetically modified male mosquitoes arereleased? The mosquitoes are modified in such a way that any femaleeggs do not survive to adulthood. However, there are sill male and femalemosquitoes drifting in from neighboring areas. Reproduce the modifiedmodel and describe the long term behavior.

143

Chapter 6 Review

Big Ideas.

• Basic models of species interaction– Competition– Predator-Prey– Symbiosis– Equilibrium solutions of species interaction

• Phase portrait graphs• Epidemiology

– S-I-R Model– Quarantine– Disease with animal vectors

At this point you should be able to.

• Model a set of interacting species• Identify the type of species interaction from a set of differential equations and sample

graphs of solutions.• Find equilibrium solutions for interacting species if existent.• Graph interacting species as a phase portrait.• Model an infectious disease.

To prepare for assessment on this chapter, write with your own questions for each ofthe above tasks. If there is time, have everyone in your team do the same thing and thenattempt to solve each other’s question.

144

CHAPTER 7

Sequences and Series

1. Sequences

It may come as a big surprise to you, but for most of recorded history, students ofmathematics did not spend their time learning about calculus or learning the backgroundneeded to learn about calculus. At its most basic, mathematics is learning how to recognizeand manipulate patterns. The first place to recognize patterns is in the study of ordered listsof numbers. Such ordered lists are called sequences. You are familiar with many sequences,although you may not want to admit it. Most students who have passed through secondgrade recognize the following sequence, so we will use it as our basic example:

2, 4, 6, 8, 10, 12, . . .

Although we could list the even natural numbers in many ways, generally we order them asabove. So, by an ordered list, we mean that 6 comes immediately before 8 and immediatelyafter 4. Also, there is not a biggest even number, which is why we put the three dots at theend of the line to indicate that we could keep going, but we would run out of paper beforewe ran out of numbers.

Formulas for Sequences. We will use an to denote the nth number in the sequence.For our example, a0 = 2, a1 = 4, a3 = 6 and so on. We would like to be able to write oursequence as compactly as possible. This is where the recognition of patterns comes in.

1 2 3 4 5 6 · · · n2 4 6 8 10 12 · · · 2n

We can say an = 2n. Now, there is not a unique way of writing a sequence, so when you areworking your homework, do not stress if your answer does not match the key.

Here is a different, but also correct way of writing our sequence called an inductivedefinition. Since a1 = 2 and a2 = 4, we can calculate that a2 = a1 + 2. Similarly, a2 = 4and a3 = 6, we calculate that a3 = a2 + 2. Given what we know about our sequence, wecan say that an+1 = an + 2. This isn’t quite enough information to uniquely identify oursequence because it is also is true for the sequence 1, 3, 5, 7, 9, . . . , so we need to include theinformation, a1 = 2.

an+1 = an + 2 and a1 = 2

Convergence. Probably the most important question mathematicians ask about se-quences is whether or not they converge and if they do, what does the sequence converge to.A sequence converges if it eventually gets close to a number, L, called the limit, and nevergoes away from that number. There is a very specific definition of convergence, but at thebeginning, this is close enough to help you get the idea. Our original sequence, 2n does notconverge. It keeps getting bigger and bigger and does not head to a particular number. Wewould say that this sequence diverges to infinity So, we need a new example. Consider thesequence, an = 1

n. If we write it out longhand, we get

1,1

2,1

3,1

4,1

5, . . . .

Notice that each term in the sequence is smaller than the previous one, an+1 < an, and theyare all positive, an > 0. This sequence converges to zero. Each term is bigger than zero, but

146

as n increases, each an gets closer and closer to zero. We say

limn→∞

1

n= 0.

When you take Advanced Calculus, you will figure out how to prove that the limit must beexactly zero, but in this class it is acceptable to trust your instincts. One theorem you needto know is:

Theorem 7.1. If an is a sequence with limn→∞ an = A and bn is a sequence with limn→∞ bn =B, then an + bn is a sequence with limn→∞ an + bn = A+B.

Consider the sequence

rn = (1− 1

n), 0,

1

2,2

3,3

4, . . . .

This sequence converges to a limit of 1. The easiest way to see this is that we can create rnout of an by rn = 1− an. Now by Theorem 7.1,

limn→∞

rn = limn→∞

(1− 1

n) = lim

n→∞1− lim

n→∞

1

n= 1.

Now, consider the sequence

rn = (−1)n(1− 1

n), 0,

1

2,−2

3,3

4,−4

5. . . .

This sequence does not converge. Half of it appears to converge to 1 and the other halfappears to converge to -1 and these halves are woven together so that we don’t end up withone or the other at the end. The sequence isn’t diverging, that is heading off towards infinityor negative infinity, but it isn’t heading towards one particular limit.

Technical Definition of Limit. This section is for the curious and is optional.

Definition. Let an be a sequence of real numbers. The sequence converges to a limit of Lif, for every positive real number ε > 0 there is a positive integer N , which can depend on ε,where, if n > N , |an − L| < ε.

To prove that limn→∞1n

= 0, we let an = 1n

and L = 0. Given a positive, real number,

ε, we need to find an integer N so that if n > N , 1n< ε. Think about the number 1

ε. We

know 1ε

is also a positive number. Choose an integer N which is bigger than 1ε. Now, for all

n > N ,

N >1

ε1

N< ε

n > N

1

n<

1

N< ε

and we are finished.

147

Theorem 7.2. Real, bounded, monotonic sequences converge. Let an be a sequence. anis real if every an is a real number. A sequence is bounded if there exists a real number,M where |an| < M for every n. A sequence is monotonic if it is either always increasing,an+1 ≥ an or always decreasing, an+1 ≤ an.

For example, let an = 12n

. an is bounded by 1 and is decreasing (because an+1 is half ofan). Therefore an is a convergent sequence. In fact, it converges to 0.

148

Name:

Homework 7.1. For Problems 1 - 4, find the first five terms of the sequence from theformula for an, n ≥ 1.

1. 2n + 1

2.2n

2n+ 1

3. (−1)n+1

(1

2

)n−1

4. n+ (−1)n 4

For Problems 5-8, find a formula for an, n ≥ 1.

5. 4, 8, 16, 32, 64, . . .6. 2, 5, 10, 17, 26, . . .

7. 1, −3, 5, −7, 9, . . .8. 1/3, 2/5, 3/7, 4/9, 5/11, . . .

Do the sequences in Problems 9-20 converge or diverge? If a sequence converges, find itslimit.

9. (0.2)n

10. (−0.3)n

11.2n

2n

12.(−1)n

n13. cos(πn)

14.2n+ (−1)n5

4n− (−1)n3

15. 2n

16. 3 + e−2n

17.n

10+

10

n

18.2n+ 1

n

19.sinn

n

20.2n

n3

21. (a) Let an be the number of ancestors a person has n generations ago. What is a1? a2?Find a formula for an.

(b) For which n is an greater than 6.7 billion, the current world population? What doesthat tell you about your ancestors?

149

2. Series

A series is the sum of a sequence. So, if you have the sequence 1, 1/2, 1/4, 1/8, 1/16, . . . ,then you can turn this into a series by adding all of the terms together,

1 + 1/2 + 1/4 + 1/8 + 1/16 + · · · =∞∑n=0

1

2n.

This is like if you stand two feet from a wall and first walk half-way to the wall (1 foot),and then half-way to the wall (1/2 foot) and then half-way to the wall (1/4 foot), and soon, then the series would be the total distance you walk. You will never get to the wall in afinite number of steps, but if you can think about taking an infinite number of steps, yourdestination is the wall. With series, we ask the same question we do of sequences, when weadd all of these terms together, do we get to a finite value, or not.

Let an be our sequence, for example an = 12n

. We are going to form a new sequence of

partial sums, Sk =∑k

n=0 an, where we add up the first k terms of our sequence:

S1 =1∑

n=0

1

2n=1 +

1

2=

3

2

S2 =2∑

n=0

1

2n=1 +

1

2+

1

4=

7

4

S3 =3∑

n=0

1

2n=1 +

1

2+

1

4+

1

8=

15

8

Sk =k∑

n=0

1

2n=1 +

1

2+

1

4+

1

8+ · · · 1

2k=2− 1

2k

Our series converges if the sequence of partial sums converges. If this is true, the series isequal to the limit of the sequence of partial sums. In our example,

lim k →∞Sk = limk→∞

2− 1

2k= 2

the sequence of partial sums converges to 2. Thus,

∞∑n=0

1

2n= 2.

Convergence of Series. There are three tests for convergence of series that we aregoing to use in this class. The first one will only give you negative results, but it is worthchecking because it doesn’t take long. The second and third can tell you if a series convergesor diverges. The second one is easy to explain and hard to do and the last is a little bit morecomplicated to explain, but easier in practice.

nth Term Test: First, if we are looking at the series∑∞

n=0 an, there is no way thisseries can add up to a finite value unless limn→∞ an = 0. This is because we areadding up an infinite number of things. If, for example, each of these is bigger than

150

14, then we would be adding up an infinite number of 1

4which is going to be infinity.

Comparison Test: The next test is called the comparison test. Basically, what thistest says is that if you know one sequence converges, and each term in your firstsequences bigger than the corresponding term in the second sequence, then yoursecond sequence is going to also converge. Conversely, if your first sequence divergesand each term of your first sequence is smaller than the corresponding term in thesecond sequence, then the second sequence also diverges. Mathematically we say:Suppose that 0 ≤ an ≤ bn for all n.• If

∑bn converges, then

∑an converges.

• If∑an diverges, then

∑bn diverges.

Ratio Test: The last test is called the ratio test. Essentially which we are doing, iscomparing our series with a geometric series because we know about convergence ofgeometric series. The test, hides this comparison in a simple formula. For a series∑an, suppose that the sequence of ratios |an+1|/|an| has a limit:

limn→∞

∣∣∣∣an+1

an

∣∣∣∣ = L.

• If L < 1, then∑an converges.

• If L > 1, or if L is infinite, then∑an diverges.

• If L = 1, the test does not tell us anything about the convergence of∑an.

Factorial Function. When mathematicians work with series, we often use a few func-tions which haven’t shown up yet in the class. We use these functions because mathematicallythey are interesting, but also they give us better examples for homework. So, you need toknow about the factorial function, n!. It is defined as n! = n(n− 1)(n− 2) · · · (3)(2)(1) if nis not 0. 0! = 1 by definition.

The factorial function’s most basic use (except as a nasty example) is that n! tells youhow many ways you can arrange n distinct objects when order matters. For example, if youhave three runners, there are 3! = 6 ways that they could come in first, second, third in arace.

Example: Consider the series,∑∞

n=01n!

. We will use the ratio test to discover whether

or not the series converges. Let an = 1n!

.∣∣∣∣an+1

an

∣∣∣∣ =

∣∣∣∣∣1

(n+1)!

1n!

∣∣∣∣∣=

n!

(n+ 1)!

=(n)(n− 1)(n− 2) · · · (2)(1)

(n+ 1)(n)(n− 1)(n− 2) · · · (2)(1)

=1

n+ 1

L = limn→∞

∣∣∣∣an+1

an

∣∣∣∣ = limn→∞

1

n+ 1= 0

151

Since L = 0 < 1, by the ratio test, the series converges. The ratio test does not tellus what the series converges to, but other mathematics tells us this series adds tothe number e.

152

Name:

Homework 7.2. Use the comparison test to confirm the statements in Problems 1 to 3

1.∞∑n=4

1

ndiverges, so

∞∑n=4

1

n− 3diverges. 2.

∞∑n=1

1

n2converges, so

∞∑n=1

1

n2 + 2con-

verges.

3.∞∑n=1

1

n2converges, so

∞∑n=1

e−n

n2converges.

Use the ratio test to decide if the series in Problems 4 to 7 converge or diverge.

4.∞∑n=1

1

(2n)!

5.∞∑n=1

(2n)!

n!(n+ 1)!

6.∞∑n=1

1

nen

7.∞∑n=1

(n!)2

(2n)!

Determine which of the series in Problems 8 to 13 converge.

8.∞∑n=1

(0.1)n

n!

9.∞∑n=1

e−n

10.∞∑n=1

(n− 1)!

n2

11.∞∑n=1

sinn

n2

12.∞∑n=1

cos(nπ)

8n

13.∞∑n=2

en

lnn2

153

3. Power Series

A power series is a series – function. In particular, power series are written in a specificform. A power series about x = x0 looks like:

a0 + a1(x− x0) + a2(x− x0)2 + a3(x− x0)3 + a4(x− x0)4 + · · ·

Where an and x0 are constants. For any fixed x, the power series∑an(x−x0)n is a series of

numbers just like those we have considered previously. A power series may converge for somevalues of x and not for others. An important question about power series is, for what valuesof x does the series converge? The range of these values is called the interval of convergence.Sometimes we also refer to the radius of convergence which is, the radius around x0 thepower series converges.

Example: For example, consider the power series

∞∑n=0

xn

2n.

We see that if we evaluate this power series at x = 1, we get∞∑n=0

1

2n, which is a

geometric series where r = 1/2 < 1, and therefore converges. On the other hand, if

we evaluate this power series at x = 3, we get∞∑n=0

(3

2

)n

, which is also a geometric

series, but this time r = 3/2 > 1, so the series diverges. This tells us is that 1 isin the intervals convergence while 3 is not. As you can imagine, we do not want todo this calculation for every value x. Instead we will use a convergence test, likethe ratio test from the previous section to calculate the convergence or divergenceof our power series for any value of x.

To use the ratio test, let an = xn

2n.∣∣∣∣an+1

an

∣∣∣∣ =

∣∣∣∣∣ xn+1

2n+1

xn

2n

∣∣∣∣∣=

∣∣∣∣xn+1

2n+1

2n

xn

∣∣∣∣=

2n

2n+1

∣∣∣∣xn+1

xn

∣∣∣∣=

1

2|x|

L = limn→∞

∣∣∣∣an+1

an

∣∣∣∣ = limn→∞

1

2|x| = 1

2|x|

Our series converges when L = 12|x| < 1, or when |x| < 2. The radius of convergence

of our power series is 2.

154

Power Series Expansions for Functions. Mathematicians use power series to solvedifferential equations and approximate functions. There are power series approximations forall of your favorite transcendental functions including trigonometric functions and exponen-tial functions. It is these power series that your computer uses to compute values because itis much easier for a computer to add subtract multiply and divide which has all the powerseries asks of the computer. Mathematicians also use much more sophisticated power seriesto improve their understanding of the decimal expansion of transcendental numbers like eand π.

Function Power Series

ex∞∑n=0

xn

n!

cosx∞∑n=0

(−1)2n x2n

(2n)!

sinx∞∑n=0

(−1)2n+1 x2n+1

(2n+ 1)!

11−x

∞∑n=0

xn

155

This page intentionally left blank.

Name:

Homework 7.3. Find an expression for the general term of the series below. Give thestarting value of the index (n or k for example).

1. (x− 1)3 − (x− 1)5

2!+

(x− 1)7

4!− (x− 1)9

6!+ · · ·

2. px+p(p− 1)

2!x2 +

p(p− 1)(p− 2)

3!x3 + · · ·

3.1

2x+

1 · 322 · 2!

x2 +1 · 3 · 523 · 3!

x3 + · · ·

Use the ratio test to find the radius of convergence of the power series below.

4.∞∑n=0

(5x)n

5.∞∑n=0

n3xn

6.∞∑n=1

2n(x− 1)n

n

7. x+ 4x2 + 9x3 + 16x4 + 25x5 + · · ·8. x− x2

4+x3

9− x4

16+ · · ·

9. 1 + 2x+4x2

2!+

8x3

3!+

16x4

4!+ · · ·

Find the interval of convergence (this means you have to check the endpoints to see if theyconverge or not).

10.∞∑n=0

xn

3n

11.∞∑n=0

n2x2n

22n

157

Chapter 7 Review

Big Ideas.

• Finite and infinite sequences– Convergence, divergence, and non-convergence of sequences– Formulas for terms of sequences

• Finite and infinite series– Convergence, divergence, and non-convergence of series– Comparison Test– Ratio Test– Geometric series– Power series

At this point you should be able to.

• List the first several terms of a sequence if given the formula.• Find a formula for the terms of a sequence if given first several terms.• Identify when a sequence converges to a finite number.• List the first several terms of a series if given the formula.• Find a formula for the terms of a series if given first several terms.• Use the comparison test to tell if a series converges when given a companion series.• Use the ratio test to tell if a series converges.• Use the ratio test to find the radius of convergence of a power series.

To prepare for assessment on this chapter, write with your own questions for each ofthe above tasks. If there is time, have everyone in your team do the same thing and thenattempt to solve each other’s question.

158

CHAPTER 8

Projects

1. Electrical Circuits

A basic electrical circuit consists of three primary components: resistors, inductors andcapacitors. A power supply is applied to the circuit causing electrons to flow through thecircuit. The rate at which electrons flow through the components is called current. Current isdenoted as I and is measured in Amperes (denoted A). The electrons flow due to a differencein electrical charge. This difference in electrical potential is called voltage. Voltage is denotedas V and measured in volts (also denoted V ). It is helpful to remember that current isalways measured as flowing through an object, while voltage is measured across an object(by comparing the difference in potential on either side of the object).

For each type of component there is a special relation between the current flowing throughand the voltage drop across the component. A resistor has resistance, denoted R, which ismeasured in ohms (denoted Ω). The current and voltage of a resistor obey Ohm’s Law,

V = IR,

where V is measured in volts, I is measured in amperes and R is measured in ohms.By comparison, an inductor has inductance, denoted L, which is measured in henrys

(denoted H). The inductor is traditionally a coil of wire which, when electricity is runthrough it, produces a magnetic field. When the current changes, the inductor resists thechange, causing a voltage drop. The current and voltage of an inductor obey the equation:

V =dI

dtL,

where V is measured in volts, I is measured in amperes, t is measured in seconds and L ismeasured in henrys.

Finally, a capacitor has capacitance, denoted C, which is measured in farads (denotedF ). A capacitor traditionally consists of two metal plates which are close together, but nottouching. Electrons do not flow through a capacitor under a constant voltage potential,however when the voltage across a capacitor changes there is an induced current from themagnetic potential between the two plates. The current and voltage of a capacitor obey theequation:

dV

dtC = I,

where V is measured in volts, t is measured in seconds, I is measured in amperes and C ismeasured in farads.

There are two other important rules for determining the behavior of an electrical circuit,Kirchhoff’s Voltage and Current laws.

Model: 8.1. Kirchhoff’s voltage law states that the sum of the voltage drops around a closedloop is zero. Equivalently, the voltage drop between two points in a circuit is independent ofthe path taken, so that two different paths between the same two points must have the samevoltage drop.

Kirchhoff’s current law states that the total current flowing into any point must equal thetotal current flowing out. So if there is a split where one path leads to two or more paths,the sum of the current in must equal the sum of the current flowing out.

160

Consider the circuit in Figure 1, where L = 500H, C = 1mF = .001F , R = 1KΩ =1000Ω and E = 20 sin(t) (E is the power source). Let VR be the voltage drop across theresistor, VL be the voltage drop across the inductor and VC be the voltage drop across thecapacitor. Similarly let IR be the current flow through the resistor, IL be the current flowthrough the inductor and IV be the current flow through the capacitor.

By Kirchhoff’s voltage law VC = VR and E = VL + VC . By Kirchhoff’s current law

IL = IC + IR.

For each component, we obtain a relation

VR = IRR VL =dILdtL

dVCdt

C = IC

This gives six equations and six unknowns, IL, IR, IC , VL, VR, VC . To clarify, be sure tomanipulate your equations so that the unknowns are on the left. In this example the sixequations become:

dILdt

= VL/L VL = E − VCIR = VR/R VR = VC

IC = IL − IRdVCdt

= IC/C

Then this system of differential equations is represented by a flow diagram as seen in Figure2

After the simulation is run with the numbers given, the resulting currents can be seenin Figure 3. Observe that IL is the sum of the other two currents, IR and IL. Observe thatthere is a phase shift between the different currents and they are not all running in the samedirection at the same time. The difference in time between peaks (measured here in radians)is referred to as the phase shift.

Projects.

Project #1 For the circuit shown in Figure 4, where E = 20 sin(t), R = 1kΩ, C = 2mF andL = 300H, create the model and determine the difference between the peaks ofIR and IC .

Figure 1. Sample RLC Circuit

161

Figure 2. Sample RLC Circuit

Figure 3. Graph of Currents

Figure 4. Circuit for Project #1

162

Project #2 For the circuit shown in Figure 5, where E = 30 sin(t), R1 = 3kΩ, R2 = 500Ω,R3 = 10kΩ, C = 50µF = .00005F and L = 750H, create the model anddetermine the difference between the peaks of IL and IC .

Figure 5. Circuit for Project #2

163

2. Rocket Motion

A rocket being launched into air converts its fuel mass into thrust as flies higher intothe air. As the mass is converted into thrust, the mass decreases. The system of differentialequations describing the motion of a rocket will include the previous equations of free-fall aswell as an added equation describing the decreasing mass of the rocket fuel.

Previously, the mass of our object in motion was assumed to be constant. In this casewe will divide the mass into two pieces:

Total Mass = Rocket Mass + Fuel Mass

Where the Rocket Mass is the mass of the rocket itself, which is assumed constant, and theFuel Mass is decreasing. For simplicity, we will assume the Fuel Mass decreases at a constantrate, called the Burn Rate (standard units are kilograms per second). The Fuel Mass willcontinue to decrease at this constant rate until it reaches zero. The time when the Fuel Massis consumed will be called the Thrust Duration. This gives us the differential equation forthe Fuel Mass:

dFuel Mass

dt=

Burn Rate if t < Thrust Duration

0 else

The initial condition of this differential equation is generally called the Propellant Weight.The amount of thrust which each unit of mass produces is dependent on the type of fuel,

and we will refer to this quantity as the Fuel Productivity. This results in the followingrelation:

Thrust = Burn Rate × Fuel Productivity

The units for Thrust are generally in Newtons (N) and the units for Burn Rate are kilogramsper second (kg

s), so the units used for Fuel Productivity will be Newton - seconds per kilogram

(N·skg

).

In our example, we will not be modeling large interstellar rockets. Instead, we willbe considering small model rockets. These rocket engines have the advantage of havingdetailed descriptions of their capabilities readily available, including the Thrust Durationand Propellant Weight. These statistics also include the Total Impulse provided by therocket in units of Newton - seconds. This characterized the total amount of thrust theengine will provide over the life of the engine. In order to use the statistics given to createthe model described above, we use the following two equations:

Burn Rate =Propellant Weight

Thrust Duration

Fuel Productivity =Total Impulse

Propellant Weight

Another advantage of considering small rockets is that the force of gravity may be assumedto be constant. As objects get farther from Earth, the force of gravity has a diminishedeffect. For large scale rockets, this effect should be considered, but can be ignored for thisexample.

164

The component of this system of differential equations describing the mass of the rocketbeing converted into fuel can be summarized in Diagram 6.2.1. Using the values of Total Im-pulse, Propellant Weight and Thrust Duration and the equations above, this model describeshow a rocket converts Fuel Mass into Thrust.

These quantities of Total Mass and Thrust can be used in our model for free fall motion.The rocket is moving quickly and approaching a terminal velocity, so the Newtonian modelfor air resistance is appropriate in this instance. The equation for Total Force is the sameas before, with Thrust added in:

Total Force = Weight + Air Resistance + Thrust

The only other difference of note is that the quantity of Mass has been replaced with TotalMass to reflect that fact that this includes the Fuel Mass (which is decreasing) as well as theRocket Mass. See Diagram 6.2.2.

Projects.

Project #1 Use the following values to produce a model describing the motion of the rocket:• Total Impulse = 10 Newton - seconds• Propellant Weight = 12.5 grams (remember to convert to kilograms)• Rocket Mass = 20 grams• Thrust Duration = 1.6 seconds• Cross-sectional Area = 1 square centimeters (convert to square meters)

Starting from the ground with no initial velocity and the standard value forgravity, determine the rocket’s maximum height and maximum velocity. Alsodetermine how long the rocket stays in flight and the speed at which the rockethits the ground.

You may notice that this rocket hits the ground with substantial force, whichwill surely destroy your model rocket (which you, no doubt, decorated with great

165

care). Fortunately, model rockets are fitted with parachutes so that the rocketmay be gently returned undamaged to the earth. The model rocket’s statisticsalso include a term called Time Delay. After the rocket burns through all itsfuel there is a small delay and then an ejection charge is activated to release theparachute. The Time Delay is the amount of time between when the fuel runsout and the parachute is released.

Project #2 Repeat Project #1 with the addition of a parachute. Use the following additionvalues:• Time Delay = 4 seconds• Cross-sectional Area of Parachute = 150 square centimeters

Again determine the rocket’s maximum height and maximum velocity. Alsodetermine how long the rocket stays in flight and the speed at which the rockethits the ground.

Many larger rockets have multiple stages, in which one engine is completelyused up and then dropped to the earth (without a parachute) after which asecond engine fuels the rocket for the rest of the flight. The first stage is calleda booster rocket and does not have a time delay. Instead it leads directly intothe next stage and falls off when the next stage starts firing.

Project #3 Create a model for a multi-stage rocket. Assume:• Total Impulse Booster = 10 Newton - seconds• Propellant Weight Booster = 11 grams• Thrust Duration Booster = 0.8 seconds• Booster Rocket Mass = 18 grams (this will be dropped when the booster

rocket is done)• Total Impulse Upper Stage = 10 Newton - seconds

166

• Propellant Weight Upper Stage = 12.5 grams• Thrust Duration Booster = 1.6 seconds• Upper Stage Rocket Mass = 24 grams• Time Delay = 7 seconds• Cross-sectional Area = 1 square centimeters• Cross-sectional Area of Parachute = 150 square centimetersDetermine the rocket’s height and velocity when the booster rocket runs

out of fuel. Determine the rocket’s maximum height and maximum velocity.Determine how long the rocket stays in flight and the speed at which the rockethits the ground.

The formula for gravitational attraction between two objects with masses m1

and m2 (measured in kilograms) at a distance of r meters apart is given by:

F =Gm1m2

r2

where G is the universal gravitational constant of 6.673 × 10−11. The mass ofthe Earth is approximately 5.974 × 1024 kilograms and the radius of the Earthis approximately 6.376× 106 meters. In our original model we assumed that theforce of gravity was constant, due to the fact that the maximum height of ourrocket was small compared to the radius of the Earth.

Project #4 Adjust the model for the flight of the rocket to account for the fact that theforce of gravity is dependent on the distance between the the two objects. Re-peat Project #2 and determine the change in the rocket’s maximum height andmaximum velocity under these new assumptions.

167

3. Hot Air Balloons

A hot air balloon floats by means of buoyancy. By burning its fuel (usually propane)it heats the air in the envelope. The heated air has a lower density than the surroundingair and therefore a lower mass. The pressure of the air outside the envelope of the balloonpushes the balloon up as it tries to fill in the area occupied by the balloon.

By computing the weight of the air in the balloon envelope

Weight = Density of Inside Air× Volume of Envelope×Gravity

and the weight of the air which is trying to occupy the space the balloon occupies

Weight = Density of Outside Air× Volume of Envelope×Gravity

we can combine these two equations to give the buoyant force of the balloon:

Buoyancy = (Density of Outside Air−Density of Inside Air)× Volume×Gravity

In this case where the density of the balloon envelope is lower than the density of thesurrounding air, the buoyancy force will be exerted in the upward direction.

In this case the relevant equation to the buoyancy is the Ideal Gas Law

PV = nRT

where P is pressure, V is volume, n is the number of moles, R is the ideal gas constantand T is the Temperature in Kelvin. The number of moles is proportional to the numberof molecules, from which we can determine the mass of the balloon’s envelope. Because theballoon’s envelope is open at the bottom, there is no build-up of pressure inside the balloon.For this reason the pressure inside the balloon’s envelope is the same as the pressure outside.Instead it is the density of air inside the envelope which changes as the air inside is heated.

The density of air is proportional ton

V, the number of moles divided by the volume. By

the Ideal Gas Law, this is also proportional toP

RT, where P is air pressure, T is temperature

and R is the ideal gas constant for air. The value of P will vary depending on the altitudeof the balloon and the value of R will vary depending on the humidity of the air, but for themoment we will treat them as simple constants. This gives us the relation:

Density of Inside Air =Air Pressure

Rs × Envelope Temperature

where Rs is the specific gas constant (the ideal gas constant multiplied by the molecularmass). Similarly:

Density of Outside Air =Air Pressure

Rs ×Outside Temperature

The means by which the hot air balloon operator manages altitude is by controlling thetemperature of the air inside the envelope. Burning propane adds heat; while at the sametime, the envelope is cooling according to Newton’s Law of Heating and Cooling. This givesthe relation:

d Inside Temperature

dt= Propane Heat + k(Outside Temperature− Inside Temperature)

168

where k is a suitably chosen positive Insulation Constant. This assures that when theInside Temperature is greater that the Outside Temperature, the Inside Temperature willbe cooling.

The Propane Heat will be controlled by the operator. In practice this is dependent on avariety of factors as the operator tries to find winds heading in the correct direction to movethe balloon in the desired direction. For our model, we will assume the Propane Heat is afunction of Height, so that it turns on when the Height is too low and turns off when theAltitude is too high.

Buoyancy is an addition force which will be added to the standard model for free fallmotion. The hot air balloon is large enough that the Newtonian model for air resistanceis appropriate in this instance. The equation for Total Force is the same as before, withBuoyancy added in:

Total Force = Weight + Air Resistance + Buoyancy

169

Because propane is a light fuel, we will assume the mass of the balloon basket to be constant.The impact of burning fuel will not significantly affect the weight of the balloon basket, andcan be ignored.

Projects.

Project #1 Use the following values to produce a model describing the motion of the hotair balloon:• Volume = 2500 cubic meters• Outside Temperature = 15 degrees Celsius (convert to Kelvin)• Air Pressure = 101 325 Newton per square meter• Specific Gas Constant = 325 Newton - meter per kilogram - Kelvin• Insulation Constant = .001 per second• Cross-Sectional Area = 250 square meters• Mass = 500 kilograms

Assume the basket starts on the ground with initial position and velocity of zero.Adjust your force equation, so that when the basket is resting on the ground thetotal force is zero (so that your balloon does not fall through the ground whilethe balloon envelope is heating). Let the Propane Heat be 2 degrees Celsius persecond, as long as the Height is below 1000 meters and the Inside Temperatureis below 120 degrees Celsius. Assume the starting Inside Temperature is 40degrees Celsius (so that the balloon is just about ready to lift off).

Determine how hot the Inside Temperature is when the the balloon lifts off.How long do the burners stay on during the initial ascent? How high does theballoon go during the initial ascent? For how long after the burners have turnedoff does the balloon continue to rise? When do the burners come back on forthe second burn? How low does the balloon get during the second burn? Howhigh does it get after the second burn?

170

4. Pendulums

Consider a mass, denoted m, at the end of a pendulum of length l. As is typical, themass of the pendulum will be ignored, and our model will focus solely on understandingthe motion of the mass alone moving back and forth. Let θ(t) be the angle between thependulum on the vertical line straight down from the fulcrum of the pendulum.

Because the mass is constrained by the pendulum, any force along the pendulum willnegated by the tension of the pendulum. For this reason, one can focus only on the com-ponent of gravity which acts tangent to the circular arc of motion. The component of thisforce tangent to the arc of the circle is −mg sin(θ).

Figure 6. Basic Pendulum

This movement is at the end of the pendulum, so one must account for the length of thependulum. If the angle changes by ∆θ the arc-length along the circle changes by l∆θ (aslong as θ is measured in radians). Because a is the acceleration along the circular arc (andacceleration is the second derivative of position), a = lθ′′. Therefore:

Force = ma = −mg sin(θ) = mld2θ

dt2or

d2θ

dt2= −g

lsin(θ)

Projects.

Project #1 For a pendulum with length 20 cm and mass of 200 mg, build the simulation anddetermine the period of oscillation when the pendulum is started at an angle ofπ/6. Assume that gravity is 9.81 m/s2. What is the period of oscillation whenthe pendulum is started at an angle of π/4?

Project #2 Introduce air resistance into the pendulum model.

171

5. Chronic Wasting Disease in Deer

According to the state of Iowa:

Chronic wasting disease (CWD) is a fatal, neurological disease of farmedand wild deer and elk. The disease has been identified in wild and cap-tive mule deer, white-tailed deer and North American elk, and in captiveblack-tailed deer. CWD is a progressive, fatal, degenerative disease. Clin-ical signs in affected animals include loss of body condition, behavioralchanges, excessive salivation, increased drinking and urination, depression,and eventual death. CWD is always fatal. There is no known treatment,vaccine, or live animal test for CWD.

The first cases of CWD were diagnosed in 1981 in Colorado and 1985 in Wyoming. Overthe years, diseased animals have been found in more and more regions spreading out fromthese states. The disease has been found recently in wild deer in northwest Nebraska and infarmed elk in South Dakota. Currently, the Iowa Department of Agriculture monitors deerharvested in Iowa to make sure the disease is not occurring in the Iowa herds.

For this model, we want to study what happens in a classic predator-prey model whena proportion of the prey, in this case the deer, have a disease. This model is inspired by APredator-Prey Model with Infected Prey [1]. In this paper, the authors claim that we wouldnot be having such a spread of CWD if we had more natural deer predators in the wildbecause the predators would consume the sick prey before they had a chance to spread theirdisease very far.

Make the assumption that having the disease will, in some way, slow down the prey sothat it is easier for the predator to catch them. Make the further assumption that the diseasewill not infect the predator.

Projects.

Project #1 Create a combination SID - Predator/Prey model for deer, CWD infected deerand wolves. Remember that deer do not recover from CWD, so they wouldtransition to Death (D) rather than Recovered (R). At first, create a total deerauxiliary variable from your SID model to your predation model.

Project #2 Create a sub-model for the interaction term between the wolves and the deer sothat infected deer are more likely to be caught. Recall, the original interactionterm was pretty simple and was just proportional to the product of the predatorand the prey. You may want to consider a term which takes into account theproportion of the deer herd which is infected.

Project #3 What happens to the proportion of your deer herd that is infected? One hy-pothesis is that the predation should keep the percentage of the herd which isinfected low because these deer are more vulnerable to predation. Write yourown explanation of why you think the numbers work out as they do.

Project #4 What happens to the size of the wolf population? One hypothesis is that theinfected prey will be beneficial for the predator species because there is moreeasy food available.

172

6. BioAccumulation

Starting in the mid 1970’s the government started issuing warnings about eating particu-lar fish and too much fish in general. The reason for these warnings was bioaccumulation ofmercury in predator fish. The way Bioaccumulation works is that plants absorb the mercuryslowly as they grow. Then, a small, vegetarian fish comes by and eats the plant, ingestingall the mercury at once. This is generally not so bad because there is a relatively smallamount of mercury in the plant. However, the fish has a hard time eliminating the mercuryby a biological process, so it gets stored in the fatty layer of the fish. This is known as themercury load. Next, a bigger, carnivorous fish swims by and eats our little fish along with itsmercury load. There is a lot more mercury in one little fish than in the plant, but it is onlyone small fish. However, the process repeats itself in a chain of carnivorous fish terminatingwith a fisherman.

Projects.

Project #1 Your project is to build a model of bioaccumulation.• Create a submodel of mercury accumulation in the plant.• Create a submodel of mercury accumulation from plant to vegetarian fish.• Create a submodel of mercury accumulation from one prey fish to a predator

fish.• Research E.P.A. recommended mercury levels in water and in products for

human consumption.• Put your submodels together and figure out how many levels of predation

it takes for the mercury levels in the largest fish to exceed E.P.A. recom-mendations.• Write a complete report from abstract to bibliography on bioaccumulation

in predatory fish.

173

7. Pan Water Cycle

This model, derived from information found at [2], will help to simulate the cycle ofwater over oceans on a much smaller level. Consider a pan filled with water covered with alid. After time, some of the water will evaporate, then condense on the lid of the pan andfall back into the water.

Forming the model. There are three box variables in the model: water in pan,

water in air, water on lid . Water can move between each of these box variables through

evaporation, condensation, and precipitation (falling from the lid). Additionally, the systemis not completely air-tight, so water can also leak out of the system when it is vaporized.

Projects.

Project #1 Assume that the rate of evaporation is proportional to the water temperature,the rate of condensation is proportional to the amount of water in the air, andthe rate of precipitation is proportional to the amount of water on the lid. Startwith an air-tight model. Set the parameters of the model to reasonable values,justifying why these values are reasonable, and run the model.(a) What is the effect of doubling the rate of condensation? Of precipitation?(b) Does your system have an equilibrium solution? Is it stable or unstable?(c) What are some of the realistic and unrealistic parts of the model and how

would you improve it?Project #2 Now, assume your system is not air-tight and a small amount of water leaks out

due to a vapor leak. The rate that water leaves the system will be proportionalto the amount of water in the air.(a) What is the effect of doubling the rate of condensation? Of precipitation?

174

(b) Does your system have an equilibrium solution? Is it stable or unstable?(c) What are some of the realistic and unrealistic parts of the model and how

would you improve it?

175

8. Rumor Mill

This model, derived from information found at [2], represents the spread of a rumor ata college. When a rumor is started, it is assumed that everyone is gullible enough to believeit. Gullible people who hear the rumor begin to spread it in turn, but only up to a point.Eventually, they come to their senses and are no longer susceptible to that rumor.

The box variables of this model are the three populations Gullibles , Rumor Mongerers ,

and Loyalists . These populations interact much like susceptible, sick, and healthy people

in a disease model. Rumor mongerers can “infect” gullibles with the rumor, turning theminto rumor mongerers, but they can also eventually recover and turn into loyalists.

For the simple model, assume gullibles become rumor mongerers at a rate proportionalto the product of the two populations1 and that rumor mongerers become loyalists at a rateproportional to the number of rumor mongerers.

Projects.

Project #1 Initially, there will be 1 rumor mongerer and everyone else will be gullible.(a) What happens to the populations as time goes by? Is there an equilibrium

solution? Is it stable or unstable?(b) What happens when you change your proportionality constants?

Project #2 Modify your project to make it more applicable to modern communication. Con-sider adding one of the following effects”: Television, the student newspaper,Facebook, Twitter, eavesdropping in the coffee shop or the cafeteria.

1This is because it takes an interaction between the two populations for the rumor to spread.

176

Some advice on Projects:

• Presentations should include an introduction, the differential equations used, a pic-ture of the VenSim model, all relevant graphs and the conclusion.• Reports should include, at a minimum, an introduction, the differential equations

used, a picture of the VenSim model, all relevant graphs, the conclusion, an appendixwith all formulas used in the VenSim model, and an appendix with a bibliographyif appropriate.• No figure, table, or graph should be included in the report without at least one

sentence addressed to the importance of the included image.• Be sure to include your journal article in the bibliography, as well as any other

sources used.• The presentation and report should demonstrate the amount of work spent on the

project.

APPENDIX A

Mathematical Model Report

Title of Mathematical ModelAuthors (include all authors in alphabetical order of last name)

The abstract is a one paragraph summary of the report. It should include a clear statement of theproblem, the essentials of the method of solution, and the conclusions of the study. An abstract

without conclusions is useless.

1. Statement of Problem

This is the area where you “set the scene” for the reader. Assume the audience isintelligent, but not aware of the situation. Clearly explain the problem and the objectivesof the study. This is also the place to restate or clarify the question if you have modified theoriginal problem to something solvable.

2. Model Design

Data Collection. This is optional, but should be included when data is used. Whocollected the data? Was statistical sampling used and, if so, how was the sample selected?How was the data used? The data should be presented in tables or graphs. Such figuresshould contain titles, sources, and labels for columns and axis.

Model Creation. The amount of detail in this section varies, but should always includea statement of simplifying assumptions and the rationale behind them. Define variables andgive units. Identify dependent and independent variables and the relationships among them.Clearly labeled diagrams of the relationships among variables and sub-models are usuallyvery helpful in understanding the model. Do not include any diagrams without a discussionof why they are included.

3. Model Solution

In this section, the team describes the techniques for solving the problem and the solution.Care should be taken to give as much detail as necessary for the audience to understand thematerial without becoming mired in technical details. Appendices may contain more detail,such as source code of programs and additional information about the solutions of equations.What did the team learn about the area of study and how did they solve any problems thatoccurred. This can often require multiple methods of presentation: explanations, graphs,charts, and/or comparisons of results with earlier studies, models, or different methods usedin this study. Make sure that you do not have any orphaned information. A chart of graphwithout discussion of its importance and implications is confusing and just takes up space.

179

4. Results and Conclusions

The team should include results, interpretations, implications, recommendations, andconclusions of the model’s solution. Compare the results with available real world data ifpossible. The team needs to look critically at its work and note strengths and limitations (ifany) of the work. If possible, note how assumptions made in the creation of the model arerelated to the conclusions. This is also the place to note suggestions for additional study ofthis or related problems.

5. Appendices

Formulas, Data, Code. In the appendices, you should include all relevant formulas,tables of data, source code, etc. This is where you put the “kitchen sink” of your model.One of your classmates should be able to take this information and completely replicate yourmodel.

Bibliography. Your bibliography also belongs as one of your appendices. You shouldinclude all sources including textbooks and web sources.

180

APPENDIX B

Vensim Tutorials

181

1. Vensim Tutorial 1

We can use the software Vensim R© PLE from Ventana Systems, Inc. (http://www.vensim.com/ )to model dynamic systems. Dynamic systems are usually very complex, having many com-ponents with involved relationships. For example, we can use Vensim R© PLE to model thecompetition among different species for limited resources or the chemical reactions of enzymekinetics.

To understand the material of this tutorial sufficiently, we recommend that you do ev-erything that is requested. While working through the tutorial, make sure your team cananswer the Quick Review Questions.

In the first tutorial on Vensim R© PLE , we consider an example on unconstrained growth.In this example, the rate of change of the population is equal to 10% of the number ofindividuals in the population, and the initial population is 100 individuals. Thus, we havethe following differential equation, or equation involving a derivative:

dP

dt= 0.1P, P0 = 100

Start running the software. Then, select New from the File menu. A Model Settingspopup menu appears. Usually, when starting a new model, we change some of the valuesin this window. However, until we have had time to consider some of Vensim R© PLE ’sfeatures, accept the default settings by clicking OK. A window appears as in Figure 1. Inthis window, we can construct a diagram model with equations.

Figure 1. Vensim R© PLE Window

The most important icons for building a model, the sketch tools, appear towards theleft, below the main tool bar, and immediately above the large, currently blank, Build(Sketch) Window. Table 3.1.1 lists the sketch tools, and the following sections describe themeanings of these model building blocks.

182

Building Block Icon Meaning

Box Variable or Stock noun, something that accumulates. These will be thevariables in your differential equations.

Rate or Flow verb, activity that changes magnitude of stock. Thesewill be the formulas from your differential equation.

Variable or Converter converts, stores equation or constant, does not accumu-late

Arrow or Connector transmits inputs and information

Box Variable or Stock. In Vensim R© PLE terminology, a box variable or stockis a noun and represents something that accumulates. Some examples of box variables arepopulation, radioactivity, enzyme concentration, self-esteem, and money. At any instant, themagnitudes of the box variables give us a snapshot of the system. Every time you have adifferential equation, you will need a box variable and a flow.

Click on the Box Variable to insert a stock object within the window. Next, click inthe center of the window. Without clicking again, type the name of the stock, population.The contents of the window should be similar to Figure 2. To change the name later, clickonce on the stock with the box variable icon and type the new name and press RETURN orENTER.

Figure 2. Contents of window after insertion of stock, or Box Variable, calledpopulation

Under the File menu, select Save (or ctrl-s on a PC or command-s on a Macintosh) orclick the Save icon on the main toolbar to save your work to a flashdrive or Nascar. Use a

183

meaningful name for the file, such as “Vensim for Tutorial 1.” Save your work frequently.Thus, if there is a power interruption, you will not lose much of your work. Also, sometimesif you make a mistake, it is easier to close the file without saving and open the recently savedversion.

184

Rate or Flow. While a stock is a noun in the language of Vensim R© PLE , a rate orflow is a verb. A rate is an activity that changes magnitude of stock. Some examples ofsuch activities are births in a population, decay of radioactivity, formation of an enzyme,improvement of self-esteem, or growth of money. In your differential equation, it is oftenthe derivative. The flow is the rate of change of your box variable. The rate (flow) iconrepresents a directed pipe with a valve.

Click on the flow icon. Click a couple of inches to the left of the stock; and then withoutdragging, click the stock so that a rectangle with a cursor appears. Type its name, growth,in the rectangle and press RETURN or ENTER. The diagram should appear similar toFigure 3 with the flow beginning in a cloud, the ether, which in this example is a source.The cloud is a place holder. If you want, think of it as the creator of your universe. If youhave two clouds, you missed the box variable and will need to delete this flow and try again.

Figure 3. Diagram after addition of growth rate (flow)

Question: Drag the population stock around the right of the screen.What happens to the diagram?

If moving the population stock does not result in the flow arrow moving, too, but revealsanother cloud, you need to delete the flow and create another that attaches to the boxvariable.

We can change the direction of flow from being only into population to being into andout of this reservoir so that population can increase or decrease. Thus, we are changing theflow from a uniflow having one direction to a biflow going in two directions. To change thedirection, we first select the hand tool. Then, on the small circle to the left of the valvefor growth, right click with a Windows computer or ctrl-click with a Macintosh computer.Should we wish to allow values to flow in both directions through the arrow, we click the topleft checkbox for Arrowhead and then OK in the popup menu. In this case, the flow wouldappear as in Figure 4 with arrowheads at both ends representing the possibilities of additionto and removal from the population.

If you changed the flow to be a biflow, restore the arrow to be uniflow. Save your work.

185

Figure 4. Biflow for growth

186

Variable-Auxiliary/Constant or Converter. We can use an auxiliary/constantvariable or converter to modify an activity. A variable can store an equation or a constant.For example, with the population model a variable might store the constant growth rate,say 10% = 0.1.

As an example for radioactive decay, radioactive substance bismuth-210 decays to ra-dioactive substance polonium-210. With A representing the amount of bismuth-210 and Bthe amount of polonium-210, the ratio B/A is significant in the model of decay. A convertercan store this ratio.

Select the Variable-Auxiliary/Constant icon, ( ), no box. Click below and to theleft of the flow name, growth. Name the converter growth rate. Blanks are permissible. Thediagram should appear similar to Figure 5.

Figure 5. Diagram after insertion of converter growth rate

187

Arrow or Connector. An arrow or connector transmits an input or an output. Forexample, in a population model, a connector can transmit the growth rate value from thegrowth rate auxiliary/constant variable (converter) to the growth flow.

In a radioactive decay model, connectors from the bismuth-210 (A) stock and from thepolonium-210 (B) stock to a converter for the ratio of B over A transmit the respectiveamounts of radioactivity for use by the converter.

In the population model, both the growth rate and the current population affect thecurrent growth. For example, if the growth rate is higher, so is the growth. Moreover, alarger population exhibits a greater change in population. We indicate these relationshipsby connecting the growth rate converter (variable) and the population stock (box variable) tothe flow growth. After selecting the connector icon, click growth rate and then growth. Theresulting diagram is as in Figure 6a. Without selecting another tool, we can use the sametool again. Connect population to growth as in Figure 6b by clicking population, clickingbelow and between population and growth to create an arch, and then growth. Small circlesindicate anchors that we can drag to create arches. Save your work.

Figure 6. Connectors drawn to growth flow

Question: For the connector from the stock to the flow, select the handtool and then click on the small circle on the arrow and drag it around.What happens to the arrow?

Question: What happens to the arrow as you drag box variable populationaround the screen?

Delete. To remove a component from the diagram, we use the delete tool ( ) orCut from the File menu. Using the delete key does not completely eliminate the item fromthe model. Select the delete icon, which is the second-to-the-last icon on the right in thesketch toolbar.

Question: With the delete tool, click on population to remove the vari-able. What is eliminated?

When we remove an item with delete tool, the process eliminates the item and all con-nected connectors and flows. Restore the model to its previous form by closing the currentdocument without saving and reopening the document. If a component is missing, recreatethe model to appear as in Figure 6.

188

Equations and Initial Values. We are now ready to enter equations and initial values.population. To begin defining an initial population, click on the equation tool (y = x2

), which is next-to-the last icon on the right of the sketch tools toolbar. The three itemsthat can have values or equations (population, growth, and growth rate) turn black. Clickthe population variable, and view a popup menu as in Figure 7. For an initial population of100 bacteria, type 100 at the location of the cursor in the Initial Value text box. Click theCheck Syntax button at the bottom left of the panel. In the Errors: box immediately abovethe button, Vensim R© PLE responds Equation OK.

Figure 7. Popup menu after clicking the equation icon and population

The dropdown menu for Units: lists several alternatives, including Dmnl for dimen-sionless, which we should use when a value has no units. Because the appropriate unit forpopulation is not in the list, we type bacteria after Units:.

The boxes and text of the equation panel (Figure 7) indicate that population is theintegral (INTEG) of growth and the initial value of population is 100 bacteria. Hence,Vensim is saying the following, where time (t) goes from a to b:

P =

∫ b

a

growth dt

We do not need to understand integration to use Vensim R© PLE . As we discuss in detailin the section on “Unconstrained Growth,” in computer simulation terms, the statement isequivalent to the following:

189

new population = old population + change in population

= old population + growth ∗ dt= old population + growth over 1 unit ∗ length of time step

To complete input for population, click OK on the bottom left of the panel.growth rate.

Question: To establish the growth rate as 10% = 0.1, first, click thevariable (converter) growth rate with the equation tool. What precedes thetext box containing the cursor? [Hint: before it said “INTEG =”]

growth rate is an auxillary, or helper, variable. We use this to store the growth constant,10%, so we know where to find it if we decide to play around with modifying this constant.Type 0.1 in the text box. In the Units: text box, type 1/Hour, and click OK. Notice thatafter entering a growth rate and an initial population, the diagram elements no longer appearblack.

We often employ replacement of blanks with underscores in the text to avoid confusionwith component names. Thus, growth rate is equivalent to growth rate in this tutorial andthe text.

growth. Unlike growth rate, the flow growth is not a constant; but the growth in thepopulation changes with time as the population changes. For our example, at any instant,the rate of change in the population, or growth, is 10% (growth rate) of the current population(population). In calculus terminology, the instantaneous rate of change of population is thederivative of population with respect to time t, so that we have the following formula:

d(population)

dt= growth rate ∗ population

= 0.1 ∗ population

Clicking on growth, we see a popup menu as in Figure 8.

Question: The submenu Variable of the Popup menu for growth (Figure8) lists the items that have connectors to growth, namely population andgrowth rate. We include these variables in the formula for growth. For ourexample, this instantaneous rate of change of population is (0.1)(popula-tion) bacteria per hour. Using * for multiplication and clicking on the ap-propriate variables in Choose Initial Variable, enter the formula for growth.What is the resulting formula?

For the units, type bacteria/Hour. Click OK.

Verify Model. We can verify that our units are consistent from the Model menu byselecting Units Check. Unfortunately, Vensim R© PLE indicates that we have one error.

An inconsistency in the time units between Hour and Month exists. The problemarises from the fact that Vensim R© PLE uses a default unit of Month for time. To overridethe default, from the Model menu we select Settings.... In the resulting Model Settingspopup menu, we change the Units for Time to be Hours. This change should correct theinconsistent units, so click OK.

190

Figure 8. Popup menu for growth

Question: After making the change of units, perform a units check fromthe Model menu. Give the displayed message.

For this example, let us also change the length of the simulation and the time betweensteps of the simulation. Once more, select Settings... from the Model menu. In the ModelSettings popup menu, leave the INITIAL TIME as 0 Hours, but change the FINAL TIMEto be 12 Hours so that the simulation does not run as long. Also, in the dropdown menu forTIME STEP, select 0.125. Thus, calculations for the simulation will be every 0.125 Hoursinstead of every hour. Usually, a smaller TIME STEP generates more accurate results butcauses the simulation to take longer. Click OK.

Clicking the document icon ( ) to the left side of the Build Window reveals the formulas,which Equation Set 1 displays. We established values for the FINAL TIME (12), INITIALTIME (0), TIME STEP (0.125), and units for time (Hour) in Model Settings popup menu.Using the equation tool, we set a value for growth rate (0.1), its unit (1/Hour), an initialvalue for population (100), its unit (bacteria), and the equation for growth (growth rate *population).

Save your work and continue saving frequently.

Comments. Documenting our work is extremely important. We want other people tobe able to understand the model as quickly as possible. Moreover, we can very easily forgetwhat we intended just a few days or hours ago. We may have several very similar versions ofthe same model that we need to distinguish one from another. We do not want to waste ourown or someone else’s time by having to dig deeply into the different levels and equations tounderstand the model.

191

FINAL TIME = 12Units: HourThe final time for the simulation.

growth=growth rate*population

Units: bacteria/Hour

growth rate=0.1

Units: 1/Hour

INITIAL TIME = 0Units: HourThe initial time for the simulation.

population= INTEG (growth,100)

Units: bacteria

SAVEPER =TIME STEP

Units: Hour [0,?]The frequency with which output is stored.

TIME STEP = 0.125Units: Hour [0,?]The time step for the simulation.

Table 1. Formulas

Question: To enter a comment, click the comment icon ( ), whichis the fourth icon from the right on the sketch toolbar, to get a text box.What is the shape of the resulting cursor?

Click towards the top middle of the Build Window to insert the text box. Type “Uncon-strained Growth Population Model,” your name(s), the date, and an explanation that themodel is for growth of a population with no limiting factors. Press RETURN, ENTER, orOK. Drag on the small circle, called a handle, at the right bottom corner to resize the textbox.

192

Run Simulation. To generate a simulation dataset that we can display and graph, we

click the Run a Simulation icon ( ), which appears as green arrow immediately to theright of the text box containing Current. A display of the times appears as the simulationprogresses. When complete, the name of the resulting dataset is Current, the name in thetext box. We can change the simulation setup, such as the TIME STEP or length of thesimulation, and generate another dataset using a different name.

Question: How many time units does the simulation run?

Click Yes to run the simulation again and overwrite the dataset.

Graphs. The Graph icon ( ) appears as a picture of two small graphs to the middle,left of the Build Window. After clicking this icon, a graph popup window of populationversus Time appears immediately (see Figure 9). Adjust the placement of the graph bydragging on its title bar. Drag on an edge to change the size of the graph popup window.

Figure 9. Graph of population versus Time

Question: About how many time units does it take for the initial popu-lation to double?

Question: Click outside of the graph popup window. What happens?

To redisplay output, such as a graph or table that no longer appears because we clicked

outside its window, click the Output Windows - show/circulate icon ( ), which is thesecond icon from the right on the main (top) toolbar. We can close an output window sothat show/circulate does not reactivate the display by clicking the horizontal bar on the topleft of the window or clicking the X on the top right of the window.

193

Frequently, we want more control over a graphical display, such as designating a title orhaving more than one plot appear on the same graph. To do so, click on the control panel

icon ( ) in the far right of the main toolbar. Click on the Graphs tab on the right, top ofthe resulting Control Panel so that the panel appears as in Figure 10

Figure 10. Control Panel

To start a new graph, click the New button towards the right, bottom of the controlpanel. A graphics panel (Figure 11) appears that enables us to specify a number of graphcharacteristics. For the title, type “Growth and Population” in the Title text box. UnderVariable on the left bottom, click the Sel button and select growth in the popup menu.Repeat the process, selecting population, for the variable in the next row. Click OK toreturn to the control panel.

Question: .

a. What name appears in the large control panel text box?b. How is this name related to the title of the graph?

To view the graph, which appears in Figure 12, click the Display button on the leftbottom of the control panel. Because the graphs of growth and population have the sameshape and the scales are different, the two graphs appear on top of each other. To show thegraphs on the same scale, return to the control panel and click Modify . In the resultinggraphics panel, click on the Scale checkbox between and to the left of the variables growthand population. So that your name appears on the graph, place your name in parenthesesat the end of the title. Click OK and then Display in the control panel.

Question: Describe the differences in the current graph, which employsthe same scale for both variables, and the graph of Figure 12.

194

Figure 11. Graphics Panel

Figure 12. Graph of growth and population using different scales

195

Tables. We start generating a table in the same way we did graphs by clicking onthe control panel icon on the right of the main toolbar. From the control panel, we candevelop a new table or modify an existing one. For this example, select the graph’s title,Growth and Population, and click Copy . The resulting panel has a copy of the informationto create a graph of growth and population. Click the As Table... button in the middlebottom of the control panel to see the table panel , Figure 13. In the Table Nametext box on the top left, change the name of the table from Growth and Population 0 toGrowth and Population Table. Click the Running down check box in the Time sectionon the right so that the time values appear in a column down the page. Click OK. Theresulting table appears as in Table 2.

Figure 13. Table panel

Question: Give the last row of the table.

Question: In the control panel after selecting Modify for Growth and Population Table,make the following changes: Have Time go from 5 to 10; have the CellWidth of the First column be 20 and of the Rest be 14; and in the TableContent window drag to have growth appear after population. Describe thefirst and last two lines of simulated data in the resulting table.

Copy the table into your file where you are answering Quick Review Questions.

Input/Output Tools. We can change initial values and constants in the model byselecting the equation tool and then clicking the desired variable. For a visual display, click

the Input Output Object icon ( ) to the right of the sketch tools. Click in the modelwork area to place the object. Immediately, the Input Output Object Settings panelappears (see Figure 14). Click Constant and select growth rate. Have values range from 0

to 0.2. After clicking OK, we see a slider bar for growth rate. The Sim Setup icon ( )to the left of the dataset name activates the slider bar.

Question: After clicking SET, Give the appearance of each of the follow-ing:

196

Table 2. Table of growth and population

Figure 14. Input Output Object Settings panel

a. The slider barb. growth rate

Type or drag to obtain 0.09 as an alternative value for growth rate. Change the nameof the to Current09. Click the Run a Simulation icon to the right of the dataset name torun a simulation with the new value for growth rate. Click the Run a Simulation icon again.To end the setup without running a simulation and return growth rate to its default value,

click the STOP icon ( ) to the left of the dataset name. Copy the model diagram and theequations viewed to your answers file by clicking Doc on the left. You have already printeda graph and table. Save and Quit Vensim R© PLE .

197

2. Vensim R© PLE Tutorial 2

Introduction. This project will consist of learning how to use some of Vensim R© PLE ’smore advanced features to modify the standard logistic growth model. After clicking on theequations tool (y = x2) and a box, flow or auxiliary variable, we can enter an equation intothat component of a Vensim R© PLE model. Clicking on the Functions tab towards the middleof the resulting popup menu, we discover a list of built-in functions. The More tab to theright reveals additional relational and logical operators. In this tutorial, we consider severalof these functions and operators that enable us to effectively model many more situations.Table 3 lists many of the Vensim R© PLE functions, operators, and types along with theirformats and meanings. Some of these do not appear as selections in the Functions or Moremenus, but we can still type them into equations. Documentation that comes with VensimR© PLE explains all the functions and features.

ABS(n) |n|, absolute value nl1 :AND: l2 Logical AND of l1 and l2, where l1 and l2 are logical

expressionsCOS(r) cos(r), where r is an angle in radiansEXP(x) ex

IF THEN ELSE(l, s1, s2) If l is true, s1 is executed; if l is false, s2 is returnedINITIAL(x) Initial value of xINTEGER(x) Integer part (before decimal) of xLOG(x, b) logb(x), logarithm to the base b of xLN(x) ln(x), natural logarithm of xMAX(x1, x2) Maximum of x1 and x2

MEAN(x1, x2) Arithmetic mean of x1 and x2

MIN(x1, x2) Minimum of x1 and x2

MODULO(m,n) Integer remainder when m is divided by n:NOT:l Logical negation of l, where l is a logical expressionl1 :OR: l2 Logical OR of l1 and l2, where l1and l2 are logical expres-

sionsPULSE TRAIN(s, d, i, e) Pulse of amount 1.0 delivered at time s and at every

time interval of length i afterwards until time e; eachpulse lasts for duration d

SIN(r) sin(r), where r is an angle in radiansSQRT(x) Square root of xSTEP(h, t) One-time change of height h at time tTAN(a) tan(a), where a is an angle in radians

Table 3. Some Vensim R© PLE functions, operators, and types

Problems.

(1) In this problem, we want to compare Vensim R© PLE ’s estimation of the solutionto our differential equation and the analytic solution. Use Vensim R© PLE to create

198

Final Time Final time for simulationInitial Time Initial time for simulationSaveper Length of time between saves of simulated data; should

be multiple of Time StepTime Model simulation’s current timeTime Step Time increment

[h]

Table 4. Some Vensim R© PLE constants

a model for:P ′ = .2P P (0) = 200

You may want to create an auxiliary variable for the initial population because lateron we are going to change that. Create a new auxiliary variable called analyticalpopulation and enter the equation for 200e0.20t. In order to do this, you will need touse one of the shadow variables (listed in the toolbar as < var > for time. Run yoursimulation and plot both population and analytical population on the same graph.

(2) The relative error is defined as

∣∣∣∣correct− resultcorrect

∣∣∣∣. Make a variable with the name

relative error. Make sure this is connected to both population and analytical pop-ulation. This allows you to keep track of the percentage difference between thenumerical solution and the analytical solution.

(3) Use Vensim R© PLE to create a model for:

P ′ = .2P (1− P

500)− 20 P (0) = 200

Observe the long term behavior.(4) Modify the model so that P (0) = 100. If you run the model, Vensim R© PLE will have

an overflow error, due to the population becoming unbounded and negative. Adjustthe growth formula using the‘IF THEN ELSE’ function, so that if the populationbecome less than zero the growth will equal zero. The IF THEN ELSE function takesthree inputs. The first is a logical statement, in your case probably, population < 0.The second is what should happen if your logical statement is true, in this case, 0.The last statement is what should happen if your logical statement is false. Here,you have two choices. If you left your growth function on the outside of the IFTHEN ELSE function, you can put a 1 here and multiply your growth function byyour IF THEN ELSE function. Otherwise, you can put your growth function in thethird spot. Your choice. So, your function might look like(

growth rate ∗ population ∗(

1− population

500

)− 20

)∗IF THEN ELSE(population < 0, 0, 1)

(5) Suppose we wish to illustrate a periodic growth whose rate is 5% at the beginningof the year, increases to 10% by the beginning of April, is 0% six months later,and returns to 5% with the new year. To model such periodicity, we can employthe trigonometric function sine or cosine, which are SIN and COS, respectively, inVensim R© PLE . Modify the model so that the growth rate is as suggested insteadof 0.2. For those of you who are scratching your heads and trying to remember your

199

trignometric functions from a long time ago, you can use the SIN (or COS) functionsto create a periodic function with a certain amplitude, A, period, P , frequency shift,φ, and off-set, O by using the function

A sin(2πt

P− φ) +O.

With Vensim R© PLE , you will need a numerical approximation for π = 3.14159.(6) Keeping the P (0) = 100 initial condition, modify the model so that the harvesting

(subtracting the 20) only occurs every other year. You will need to use the ‘PULSETRAIN’ function, so that the harvesting turns on and off. The PULSE TRAINfunction takes four inputs: start , duration , repeattime , end . The functionreturns 1, starting at time start, and lasting for interval duration and then repeatsthis pattern every repeattime time; 0 is returned at all other times. If the value ofrepeattime is smaller than duration then 1 will be returned between start and end.If duration is less than or equal to TIME STEP the pulses will only last one TIMESTEP.

(7) Keeping the P (0) = 100 initial condition and the every other year harvesting, modifythe model so that the carrying capacity increases by one each year. In order to dothis, you will need to use one of the shadow variables (listed in the toolbar as< var > for time.

200

Index

nth term test, 151

absorption fraction, 70acceleration, 80air resistance, 89algebraic representation, 11ambient temperature, 52assumptions, 42

bioaccumulation, 173birth rate, 46bounded, 148brainstorming, 42buoyancy, 168

capacitor, 160carrying capacity, 58Chronic Wasting Disease, 172circuit, 160clarifying assumption, 4comparison test, 151competition, 129concave down, 19concave up, 19condensation, 174constant, 42converge, 69, 146cross sectional area, 89current, 160

death rate, 46dependent variable, 43derivative, 14difference quotient, 14differential equation, 24discontinuity, 18disease, 136displacement, 92diverge, 146doubling time, 49drag force, 89drugs, 68

electrical circuit, 160electron, 160Epidemiology, 136equilibrium solution, 27Euler’s Method, 82, 112evaporation, 174

factorial, 151five minute model, 42force, 80fuel productivity, 164fulcrum, 171function, 11fundamental theorem of calculus, 37

geometric series, 69graphical representation, 11gravitational acceleration, 80gravity, 80

half-life, 49halflife, 68Heun’s Formula, 113Hooke’s Law, 92

ideal gas law, 168improved Euler’s method, 112independent variable, 43inductor, 160inflection point, 19influenza, 136initial value problem, 24instantaneous, 14interval of convergence, 154

kidneys, 68Kirchoff’s Voltage Law, 160

limit, 69, 146linear, 10Logistic Growth Model, 58

magnetic field, 160

201

Malaria, 140mass, 80midpoint rule, 107minimum therapeutic concentration, 71minimum toxic concentration, 71modeling, 42monotonic, 148mosquito, 140Multiple Doses, 68

negative, 10negative feedback loop, 130Newton, 80Newton’s Law of Heating and Cooling, 52Newton’s law of heating and cooling, 52, 168nullcline, 27

Ohm’s Law, 160

pan water cycle, 174parachute, 166parametric plot, 123partial sums, 150peaks and troughs, 71pendulum, 171phase portrait, 124phase shift, 161population growth, 46position, 80positive, 10positive feedback loop, 131power series, 154precipitation, 174predator-prey, 122

quantify, 3

radius of convergence, 154ratio test, 151relative difference, 58relative error, 32relative growth rate, 49resistor, 160rocket fuel, 164rocket stage, 166rumor, 176Runge-Kutta 2, 113Runge-Kutta method, 116

secant line, 15sequence, 69, 146series, 69, 150simplifying assumption, 4Simpson’s Rule, 110

slope, 10slope field, 25, 55slope-intercept form, 10slope-point form, 11spring, 92stable, 27stomach, 74symbiosis, 129system of differential equations, 81

tabular representation, 11tangent line, 15, 110thrust, 164toxic dose, 70trapezoid rule, 107

units, 4universal gravitational constant, 167unstable, 27unstable equilibrium, 130

variable, 3, 42vector, 80, 140velocity, 80, 81verbal representation, 11

weight, 80, 90weighted average, 110

202

Bibliography

[1] Herbert W. Hethcote, Wendi Wang, Litao Han, and Zhien Ma. A predator-prey model with infectedprey. Theoretical Population Biology, 66(3):259 – 268, 2004.

[2] Shodor. Vensim models for ncsi talk on simulation and modeling by shodor. http://www.shodor.org/talks/ncsi/vensim/, December 2012.

203