# Mathematical Models

Jump to: navigation, search

# 1. Objectives

• To understand how a mathematical representation (mathematical model) of a science model is created
• To learn how to interpret the science meaning of a mathematical model
• To understand that science models and their mathematical representation have limitations
• To understand that some mathematical models do not have analytic solutions

# 2. Motivation

• Nearly every mathematical model of a system requires computation to determine the model's predictions of the future state of the system.
• You must understand how to interpret mathematical models in order to be able to determine if the results of a computation make sense.

# 3. Priming question

An example of a "science" model is

Every year you gain 1 pound

This has a mathematical representation of

W(next year) - W(this year) = 1

or, moving the second term to the right-hand side of the equation,

W(next year)                = W(this year) + 1

Write down the mathematical representation of the "science" model "Every year you lose 1 pound".

# 4. Notes

## 4.1. Introduction

A common way that science gets done (see Modeling_Introduction):

• "Domain Specialists" (e.g., biologists) come up with a statement about how a system works
• That is, they develop a conceptual representation of the system or a science model
• Example: Change in population from this year to the next is proportional to population this year
• The domain specialists collaborate with mathematicians to translate the statement into an equation that will give exact numbers
• That is, they develop a mathematical representation, or mathematical model that corresponds to the science model
• Example: P(next year) - P(this year) = aP(this year)
• The domain specialists and mathematicians work with computational scientists to implement the equations and explore the results using a computer
• That is, they develop a computational representation or computational model of the mathematical model
• These mathematical equations are written in a computer language (like Octave)
• Is the computer doing the calculation the right way? (Not all models are as simple as this example.)
• What if the proportionality constant a changes?
• What if we change it to use "next day" and "this day" instead of "next year" and "this year"?

## 4.2. Overview of examples

You have previously dealt with translating statements like this into equations: "The area of a square is 10."

The answer is A = 10.

In the following examples, we indicate change with a statement in parenthesis. For example, the area of a square doubles every minute translates to

A(next minute) = 2*A(this minute)

Without more information, we can't do anything else. In all of the following examples, we'll write equations like this that you could solve if you had more information. Later on, we'll use these equations along with additional information to compute.

## 4.3. Examples

• The following are many examples that illustrate
1. Translating a science model into a mathematical model
2. Interpreting the meaning of a mathematical model
• Once we understand this, we can go ahead and start translating the mathematical models into computer models and then using the computer models to compute something.

## 4.4. Example 1

• Model
Every year you gain 1 pound
• Mathematical representation:
W(next year)                = W(this year) + 1

or

W(next year) - W(this year) = 1
• Do you know how to use iteration to compute your weight over many years?
• We will come back to this later, but this is what we are working towards.

## 4.5. Example 2

• Model
Every year you lose 1 pound
• Mathematical representation:
W(next year)                = W(this year) -1

or

W(next year) - W(this year) = -1

## 4.6. Example 3

• Model
Every day you lose 1 pound
• Mathematical representation:
W(next day)            = W(today) - 1

or

W(next day) - W(today) = -1

## 4.7. Example 4

• Model
Every year your weight increases by 10%
• Mathematical representation:
W(next year)                = W(this year) + (0.1)*W(this year)

or

W(next year) - W(this year) = (0.1)*W(this year)

## 4.8. Example 5

• Model
Every year your weight increases by 10% plus 1 pound
• Mathematical representation:
W(next year) - W(this year) = (0.1)*W(this year) + 1

## 4.9. Example 6

• Model
Every year your weight decreases by 10% plus 1 pound
• Mathematical representation:
W(next year) - W(this year) = -(0.1)*W(this year) + 1

## 4.10. Example 7

• Model
Every year your bank account balance increases by 20%
• Mathematical representation:
B(next year)                = B(this year) + (0.2)*B(this year)

or

B(next year) - B(this year) = (0.2)*B(this year)

• Model
Every year your bank account balance increases by 20%. Every year you pay a fee of $100 to the bank. • Mathematical representation: B(next year) - B(this year) = (0.2)*B(this year) - 100 ## 4.12. Example 9 • Model Every year your bank account balance doubles • Mathematical representation: B(next year) = 2*B(this year) or B(next year) = B(this year) + B(this year) or B(next year) - B(this year) = B(this year) ## 4.13. Example 10 • Model Every year the population doubles • Mathematical representation: P(next year) = 2*P(this year) or P(next year) = P(this year) + P(this year) or P(next year) - P(this year) = P(this year) ## 4.14. Example 11 • Model The birth rate is 2% per year and nobody dies. • Mathematical representation: P(next year) = P(this year) + 0.02*P(this year) or P(next year) - P(this year) = 0.02*P(this year) ## 4.15. Example 12 • Model The death rate is 1% per year and no babies are born. • Mathematical representation: P(next year) = P(this year) - 0.01*P(this year) or P(next year) - P(this year) = -0.01*P(this year) ## 4.16. Example 13 • Model The birth rate per year is 2% and the death rate is 1% per year • Mathematical representation: P(next year) - P(this year) = 0.02*P(this year) - 0.01*P(this year) ## 4.17. Example 14 • Model The birth rate of rabbits is 10%. The death rate or rabbits is 0.02 times the number of rabbits multiplied by the number of foxes. • Mathematical representation: R(next year) - R(this year) = 0.10*R(this year) - 0.02*R(this year)*F(this year) ## 4.18. Example 15 • Model The death rate of foxes is 10%. The birth rate of foxes is 2% of the number of rabbits multiplied by the number of foxes. • Mathematical representation: F(next year) - F(this year) = -0.10*F(this year) + 0.02*R(this year)*F(this year) ## 4.19. Example 16 • Model The change in the number of people infected with a virus is 0.10 times the number of people infected times the number of people uninfected. • Mathematical representation: I(tomorrow) - I(today) = 0.10*I(today)*U(today) ## 4.20. Analytic Solutions • Most of the mathematical representations above have Analytic Solutions. • Roughly, this means that you don't really need iteration to find the answer. • For example, you could use iteration to figure out your weight 2 years from now given the model Every year I gain one pound • Mathematical representation: W(next year) - W(this year) = 1 or W(next year) = W(this year) + 1 ## 4.21. Analytic Solutions cont.  Running this program, which is a computational representation of the mathematical model, W(1) = 181; for i = [1,2] W(i+1) = W(i) + 1; end gives W(1) = 181 W(2) = 182 W(3) = 183 or W = [181,182,183]; • You probably noticed that you did not need iteration to solve this equation. • You could just say "If I am 181 pounds now, I'll be 183 pounds two years from now". In this case you are using the analytic formula W = 181+N, where N is the number of years from now. • Therefore, the stated mathematical model has an analytic solution and we can plug numbers into a single formula to get an answer. • Most science models do not have an analytic solution and iteration is required to get an answer. # 5. Questions ## 5.1. Mathematical Representation Write a mathematical representation of the following. Use the symbol T to represent temperature. The temperature of an object doubles every minute. ## 5.2. Mathematical Representation Write a mathematical representation of the following. Use the symbol T to represent temperature. The temperature of an object decreases by a factor of two every minute. ## 5.3. Mathematical Representation Write a mathematical representation of the following. Use the symbol I to indicate the number of infected people and U for uninfected. The change in the number of people infected with a virus is 0.10 times the number of people infected times the number of people uninfected. ## 5.4. Interest Suppose that you deposit$1000 in your account at the end of each year and that you started with $100 at the start of the first year. Would you rather use a bank that offered 5% interest per year computed using: B(next year) = B(this year) + 0.05*B(this year) + 1000 or a bank that offered (5/12) percent interest per month computed using: B(next month) = B(this month) + (0.05/12)*B(this month) + 1000/12 where next month/year is read as "at the start of next month/year" and this is read as "at the end of this month/year". Answer the following using only a pencil, paper, and a calculator. • For the first equation, write down the balance at the start of years one, two, and three. • For the second equation, write down the balance at the start of the the start of each month up to an including month 25. Write a computer program the does the above calculations. For both questions, a for loop must be used. Copy your code into your wiki page. ## 5.5. Population Eqn. Consider the equations P(next year) = P(this year) + 0.01*P(this year) P(next month) = P(this month) + (1/12)*0.01*P(this month) Assume the initial population is 100. 1. Write a program that uses the first equation to compute the population in year 10 and prints out its value. 2. Write a program that uses the second equation to compute the population in the first month of year 10 and prints out its value. 3. Write a program that uses the second equation to compute the population in the last month of year 10 and prints out its value. When your solutions for each of the above are copied onto the command line, only the requested value must be printed. As an example, the following program prints out only the last value of an array created using a for loop: for i = [1:5] A(i) = i; end A(5) ## 5.6. Population Growth Consider the following model of population Every year, population increases a value of 10% of the population in the previous year. However, if the predicted population is over 100, a disease outbreak instantly kills 80% of this predicted population value. For example, if the predicted population is 110, then the next year the population is 0.2*110. • Write a program that computes the population over a 40-year time span. Assume that the initial population is 20. (Hint: you can do this using an if statement.) # 6. Activities ## 6.1. Interest Suppose that you deposit$1000 in your account end of each year and that you started with \$100 at the start of the first year.

Would you rather have a bank that offered 5% interest per year like this:

B(next year) = B(this year) + 0.05*B(this year) + 1000

or a bank that offered (5/12) percent interest per month like this:

B(next month) = B(this month) + (0.05/12)*B(this month) + 1000/12

Answer the following without using a computer program (work it out using pencil, paper, and a calculator). Turn in your work on a sheet of paper at the start of class (or post an image of your work take with a digital camera or scanner).

• For the first equation, write down the balance at the start of year one and year two.
• For the second equation, write down the balance at the start of the the start of each month up to an including month 25.

## 6.2. Population Growth

Consider a science model of the population of dogs on an island:

The change in dog population (number of new puppies) from this year to the next is equal to the number of dogs that exist this year.
1. Plot population versus time for 6 years on a piece of paper (draw grid lines). Make one square width = one year. Assume that the initial population is 10 dogs.
2. The leader of the dog island declares that if the population is greater than 100 at the start of a year, then no more births are allowed during that year and 1/10th of the dogs must be "put down" at the end of that year. Plot (draw grid lines) the population for 10 years assuming the initial population was 10.

# 7. References

• An article on mathematical models [1]: "A mathematical model is an abstract model that uses mathematical language to describe the behaviour of a system."
• Some places define a computational model to be the same thing as a mathematical model: "A computational model is a mathematical model in computational science that requires extensive computational resources to study the behavior of a complex system by computer simulation." [2]. The distinction that I make is that a science model must be translated to a mathematical representation (equations) which then needs to be translated into a computer representation (a program). Computer programs can only approximate the solution to a mathematical representation. A mathematical representation is often an approximation to the science representation.
• On the importance of being able to translate a statement into equations [3]