The first concept to understand in dynamics and chaos is iteration, that is doing something again and again. For example, let's think about population growth. Population growth is an iterative process since reproduction happens over and over again. We are going to be looking at a extremely simple model of population growth called SimplePopulationGrowth.nlogo As usual this is available on the course materials page for website. Let's open it up. In this model, when we click setup, it starts off with a single individual, making up our population. The birth rate is 2 which means that at every time step, this little bunny will produce two offspring and die. So if we click reproduce you can see that happening. There are the two offspring. Now the next time step, each one of these bunnies produces two offspring and dies and so on and so on and very quickly the world starts to fill up with more and more of these bunnies. The model shows us two plots the top one here gives us the population overtime so at every time step the population is doubling you can see that goes up quickly. It also gives us another plot, another way of looking at this in which we plot last year's population with this year's population, if we think of a year as each time step represents a year. If last year's population is 100 this year's population will be 200 you could see that here and if it's 300 last year, it will be 600 this year and so you can see we get a straight line this couldn't be simpler. Because it is so simple I'm gonna show you how to turn this into a mathematical model so let's close netlogo here, let's put this aside and let's write down some equations. First some terminology. Let's call a population n little n - this is the population. Now let's label the initial population n_0 In our model n_0 was equal to 1 there was only one individual so we can similarly label n_1 equals the population at year 1 and so on. For us that was 2 because our initial one bunny had two bunnies and then died. More generally, we can label the population at year t as n_t We also had a value for the birth rate which was the number of offspring produced each year We noticed that n_1 was equal to the birthrate times n_0, right? So we had 1 at the beginning and we multiply that by 2 to get two offspring. Similarly n_2 equals the birthrate times n_1 We can generalize that to say that n_t+1 that is the population at year t+1 is the birth rate times the population at the previous year n_t. so this is our model. The iterative part comes from the fact that we always take the last year's population and use it to calculate the next year's population and then in the year after that we would take this new population and use it to calculate the following year's population and so on and that's called an iteration. This is called exponential population growth and we can see that as follows: Let's write down a table (up here) of the population growth We will write down here the year and here we write down n_t So it is the year t and n_t so when we have year 0 we remember this was 1 and this is for birth rate equals 2 At year 1 we had 2, at year 2 we had 4 because we doubling these each year at year 3 we had 8 and so on I hope you are seing a pattern here because at year t we see that our population is to 2 raise to the t power so 2 to the 1, 2 to the 2, 2 to the 3 2 to the t This is called an exponential function because we have this exponent t and that causes the population to grow very very fast. Of course, this is completely unrealistic it is uncontrolled population growth and of course, in the real world, there are limits to growth. A population will run out of resources, it will run out of food or space in which to grow. But we just for now will assume there is no limit to growth. And now let's look again at the netlogo version of this model. So remember here we have our world filling up with bunnies, we have our plot of population versus time but now we can plot this year's population versus last year's population. Now this one here population versus time is an exponential function that was that function that had the 2 raised to the t power in it. That is what an exponential function looks like but if we plot this year's population versus last year's population, we get a linear function. We could put a little note on it to remind ourselves what the function was and note the function n_t+1 equals birthrate times n_t. For those of you who vaguely remember algebra, algebra 1 even, this is the equation of a line. We have Y equals slope times X. So here is our y-axis, our slope is the birthrate that's 2. This just shows that every time we look at X we double it to get Y. Well this is a linear equation and the reason it is linear is because this is in essence a linear system. If we look at this year's population versus last year's population. We have talked in Unit 1 about the notion of nonlinear versus linear. Linear comes about because there is no interactions among these bunnies: you just have reproduction and the bunnies are going along all independent of each other, and independence in that sense, in a system, yields linearity, linear growth. OK now it is time for a quiz. Now suppose the birthrate goes up to 3. We will let the initial population n_0 be 1 bunny again. The question is: what is the population at time 4?