We'll talk about some other kinds of models today. We'll have time in lab to play with them and others.
There have been a few questions about distributions versus samples, so I'd like to take a couple of minutes to review that:
Unlike discrete random numbers, which only take on a few values, usually integers, continuous random numbers take on any real number in the range.
Let's start with the "Real, Uniform" RNG. Essentially, like the "Integer, Uniform," you give a min and a max and it generates a number in that range, but it can be any real number, so you can get fractional values as well. They are all equally likely.
This is all pretty intuitive, but when we start thinking about the probability of a number, things get strange. We'll talk more about this in a couple of weeks, but for now let's leave it intuitive: all the numbers in the range are equally likely.
To do: Using Extend, generate some "real, uniform" random numbers and do a histogram of them.
Birth rate models often look like this:
births = population * birth-rate
Q: This gives us exponential growth. Why?
Death is also often (not always) proportional to population:
deaths = population * deathRate
Here's a model that combines both:
What are some other models of death?
Isaac Newton's law of cooling is that the amount that something cools is proportional to the difference in temperature between the object and the outside environment.
cooling = -k ( temp - env )
The constant k depends on the object and can be experimentally determined.
Here's a problem from CSI: Suppose k for a dead body is 0.1438. The body is found at midnight with a temperature of 75 degrees in a motel room that is 60 degrees.
Q: At what time did the person die? Here's a model that does that:
Exponential decay curves are often found in nature (say, diffusion processes), anytime when change is proportional to the difference between two things. Keep an eye out for them.
I ran into a problem building the cooling model, and I want to share with you what I learned.
Population models are often combined with resources: the population consumes the resource. We might be interested in when the resource runs out, and different ways in which the amount of resource might affect
Let's look at a model like that. Play with it.
Q: When does the resource run out? Can you get it to last for 50 years?
One way that the birth rate might depend on the resource is as a threshold: births are normal until the resource drops below some minimum, then births are suspended. Thus:
Take some time to study this model. It introduces a new block: Select Input. Essentially, it chooses either its the upper or lower input, depending on whether the bottom input (T) is greater than the critical value (CV, a constant you set in the dialog box). If T < CV, the top input is chosen; if T >= CV, the bottom input is chosen. Read the documentation for more detail.
Q: When does the population start to decline? Why?
One way that death rate might depend on the resource is as direct function: the closer the resource to zero, the closer the death rate to 100 percent. A function like this might do the trick:
deathRate = 1-(currentResource/initialResource)
Finally, we can have the consumption depend on the amount remaining: as the resource gets more scarce, per capita consumption goes down. A model like the deathRate one would work. It needs to start at some desired rate of consumption, C, then decline towards zero as the resource goes to zero. For example:
consumeRate = C*(currentResource/initialResource)
Thus
Q: What is the eventual amount of resource? How could we get a model that uses up more of the resource?
As long as the resource continues to diminish, the population will always eventually die out. See if you can find a model where the population dies out at about the same time that the resource is exhausted.
Implement some way for the resource to be replenished. This can be a simple constant growth rate, or it can be proportional, or whatever you like. What is the long term stable value of the population and resource?
Very often, we want to run a model several times with different values of a parameter that we think matters. We want to see if the model is sensitive to that parameter.
Extend can help us do this sensitivity analysis. Do the following:
run outflow 1 0.18 2 0.23 3 0.28 4 0.33
The plotters give us a general feel for the results, but if we want actual numbers, one way is to get a report.
After the simulation runs, the report is automatically displayed. Notice how you can get the final value of the holding tank (the pollution in the lake) in each scenario.
If you have a simulation that includes randomness, there's little point in running it only once. That's like rolling a die only once: you can't learn very much about the probability of different outcomes rolling it once.
Add a histogram to the Lake Pollution model. Use the dialog box to specify that you want to collect values for each run not each time step. Collect data on the lake pollution. Use the "simulation setup" to specify 10 runs, and then run the simulation.
Add a "Generic Lib > Statistics > Mean & Variance" block to the Lake Model. Specify collecting data only for each run.
Because the growth is proportional to the current amount. This is exactly the same as compound interest.
Since he was 75 degrees at midnight, and 75 degrees is at about time = 6 hours after the body started cooling, they must've died at about 6:00pm.
The resource runs out after about 30 years. If you reduce the consumption rate to about 0.8, it will last at least 50 years. You could also reduce the birth rate or increase the death rate.
The population starts to decline at about 18 years, because the resource is below 50 percent and so the birth rate goes to zero. We're only seeing deaths at that point.
The eventual amount is 48,451. We could use up more by not having the birth rate, death rate and the consumption rate affected quite as much by the declining fraction of resource, so that the population wouldn't go down as quickly and so more resource would be used up. Some ideas:
consumeRate = C*sqrt(currentResource/initialResource)
Why? Because the sqrt keeps the fraction closer to 1 and so the consumption rate stays high.
deathRate = 1-sqrt(currentResource/initialResource)
Still, it's surprisingly hard.
This work is licensed under a Creative Commons
License |
|
|
|