 In terms of announcements, I just want to remind you that the final is two weeks from today. At night, kind of late, 8.15, it's two and a half hours long, but we have two and a half hours allocated, which means that if you take the train and go far, life kind of sucks because it's very late. The locations are different, so you should not be in the same place where you took the midterms. Sections, well, the sections for this lecture, plus recitation two. So that's the recitation for the char. Who said A-ton? Yeah, A-ton. Patricio White, not many, yes they shot. Patricio A-ton and Robert are in the Union Auditorium and the other ones are in Earth Space. Okay, also, you should do your course evaluations. You probably got an email saying, please do that. They closed them on the last day of classes, so you need to do them before Monday. It's really useful information for us to know, to have your comments about the course, so I would encourage you to do that. Something like 10 people have done it so far, which is not a big response, so maybe the rest of you will do it sometime this week. I think you have two for this class, one for the recitation and one for the lecture. Yeah? Yeah. Yeah? Well, okay, so what does that mean? It means that everything from the first day has a chance of being on the exam, but slightly more of the problems will be on stuff since the last day. That's the stuff, Taylor series and this differential equation stuff. There will be a few more, slightly, so polar stuff is on the last exam that could still possibly be on the final. So something like, let's say, half of the exam, maybe 40% of the exam, slight tilt towards the differential equations and Taylor series stuff. The other two thirds of the course will also be represented. What are your questions? So, we still have some material to get through, so we should do that. If you remember, we were talking about these predator-prane equations, so I didn't write this name before. So this is Luck and Volterra, and after two people studied this in the early 20th century. Yeah, in the early 20th century, which the model that we're talking about, we have two populations. And even though it's a predator-prane model, these techniques also apply in economics and also, in fact, I'll say towards the end of the class if I get to it also in physics. But the differential equations that we're looking at here, we have two variables. So, let's say we have some rabbits who are written by, say, honor of teeth is their population, and some foxes called f of teeth. Last time they were big O's written with a W, but I got too confused, so they're just foxes. It's easier. And the rabbits have the property that they grow, not K, it's A. Let's call it a little A. In the absence of foxes, their population is a K. I want to call it A. Sorry, I want to call it A. In the absence of foxes, they grow exponentially, and the foxes, in the absence of rabbits, well, they have nothing to eat, so their population will die off exponentially. So again, remember the reason the growth rate is proportional to the amount present, for the foxes, the rate at which they die off is proportional to the amount of foxes they grow. But, of course, the foxes eat the rabbits, so when they encounter a rabbit, then they get to have more foxes, so it shouldn't be, oh well, too bad. So the boost to their population is proportional to the encounters that they have with the rabbits, which is proportional to the product. So when foxes eat rabbits, they get some kind of boost, but, of course, when foxes eat rabbits, it's not nice to eat rabbits, although once in a while they get away. So there are these four constants, A, B, C, and D, and here, in the way this is written, everything's positive, but we'll change it to be not positive soon. And so this is the model, and just the way it's written is just the way you would think of it. They would grow naturally in the absence of foxes, but meeting a fox causes them their population to decrease. And similarly, the foxes would naturally die off in the absence of rabbits, but meeting a rabbit causes them to survive and reproduce. And so notice that here we have two, so we have a system of two differential equations. And in fact, typically, well, not typically, but very often differential equations describe more than one thing. We have systems of equations. And so we want to use some of the ideas that we've already had to, that we've already covered, to understand the system. And one thing that we can see right away, and put it up there, notice that if R is zero, we understand what happens, or if W equals zero, we understand. So we know what happens when the rabbit population is zero. If R equals zero, then the R doesn't change. But you can't read the word to understand. So if R equals zero, we know what happens. So if there's no rabbits, then the rabbit population, well, if there's no rabbits, they don't magically appear, and the fox population grows exponentially. I just see there, or dies off exponentially, because they should call this something like that. So we understand everything that happens if the rabbit population is zero, and similarly, we understand everything that happens, and we know that if there's no foxes, there's always no foxes, and that the rabbits exponentially... So imagine that you put, why do they live exponentially? I mean, why don't they just all live for two months and then die? Well, so, I mean, that's probably what would happen. There was absolutely nothing from the foxes. The foxes eat each other. They're very hungry, so they eat each other, and they die off exponentially, because they eat each other. Yeah, sure. So that tells us, we can't really make a picture though we can, but so there's one other situation where we understand here, and if I rewrite this as... If I rewrite this as... r, I can be a-out, a-r times 1 minus b over a f, and if I factor the negative c out here, under plus, so it's minus, isn't it? 1 minus d over c r. So I just factored both sides of the equation, and here we can see one other situation when we know everything that happens. If the ratio of... If the number of foxes is a over b, and the number of rabbits is c over d, so for these numbers c and d, if f equals a over b and r equals c over d, then, well, if f is a over b, then dr dt is zero. So in this case, f of t is always a over b, and r of t is always c over d. So if I'm at this special value where the number of foxes is exactly a over b and the number of rabbits is exactly c over d, nothing changes. So I want to represent that graphically like this. I want to represent this graphically where the number of rabbits is c over d, nothing changes. So I want to represent that graphically like I did at the end of the last class. So here I'm going to make what's called the phase portrait. Also sometimes it's called the phase diagram where I'm going to put the number of rabbits here, and I'm going to put the number... I want to do it a little further over, sorry. I'm going to put the number of rabbits here and the number of foxes here. I'm going to suppress time. So I'm going to think of looking at the ratio of foxes, the relationship between foxes and rabbits. So we know what happens when there's no foxes. If you have no foxes, I mean no rabbits, you stay with no rabbits and the population of the foxes declines. If you have... if you have nothing, no rabbits, no foxes, then you have to wait a very long time for them to spontaneously generate so it just stays with no rabbits, no foxes. If you have a few rabbits, then you get lots more rabbits, and then you get more and more and more. And then we also have this special value here when f is a over b that if you start with that ratio, you keep that ratio. And now we want to figure out how to analyze what goes on suppose I have a population. Do you want me to use actual numbers here? Last time I got no mostly. Now I'm getting trash. Okay, how many people want me to use actual values for ABC? How many people are happy with ABC? Sorry people with actual numbers. Just imagine a is one, e is two, c is three, so it's like two to one, they want a to c. Sorry. Okay, so let's just imagine now suppose I had... so let's figure c over d just for talking's sake, c is twice d, so this is two. And that a is twice b, so this is two. So suppose I have an equal population of rabbits and foxes, but not too many of either ones. So I'm starting here where both populations are positive, but kind of small. I have 100 rabbits and 100 foxes. Well, yeah. So I'm starting here where I have a small number of rabbits and a small number of foxes. What will happen? Well, we can figure it out by looking at there's going to be some curve here and we don't know whether what will happen is the fox rate will grow and the rabbit rate will both grow or maybe they'll die off or maybe the rabbits will just grow. So it's very unlikely that if we have some, both of them will shrink. So what we want to look at is let's imagine that there's some curve here representing the evolution of f over r, representing the evolution of the ratio of foxes to rabbits. Then what will happen here? Well, we'll have some tangent curve, some tangent line here and the tangent to this by the chain rule. So we imagine that there's some function I don't know, y which is f of t Well, there's some function y of t which depends on y which describes both f and r. What will happen? What will be the tangent here? The chain rule the slope here is going to be the change in f divided by the change in r. So df dr let's just call that df dr at least for a little while the number of foxes is controlled exactly by the number of rabbits then the tangent line is just going to be the ratio of the two slopes here. We can figure out what's going to happen. We can plot a direction field here just by looking at the right-hand side here and the right-hand side here we can see what the slopes are going to be. So in this region what is so if if so I guess let me bring it up so if f is less than a over b and r is less than c over d then what do we know about df dr dt and dr dt? Look at this equation here and f is less than a over b so what does that tell us about this? Does anybody have a clue what I'm talking about? Imagine a over b is 2 so I have this equation that equation everything is positive a b c d everything is positive oh yeah that's what I meant oh I see I swapped so suppose that f is less than 2 what do I know about dr dt f is less than 2 and bigger than 0 r is some number what do I know about r and dr dt? yeah well it's not interesting it's positive so r is increasing right so if f is small but positive r is whatever it is then r is increasing right so that says in this case here dr dt is bigger than 0 yeah I'm sorry okay so when f is small they're supposed to be the same so my question is when we're here is df dt positive I mean dr dt is it positive or negative? and when we're here we're in this region f is small and r is small so if f is small this is positive and if r is small well this is positive so that makes it negative so here in this region r prime is positive and f prime is negative what about if we're in this region here where f is still small so f is small so r prime is positive but now r is big so f is small and r is big well if f is small and r is big when f is small this is still negative but now r is big so this becomes negative too so I have negative times positive times negative which gives me positive if we're in this region here so now let's come back to here f is small but I'm sorry r is small but f is big so if r is small then that tells me that df dt is now negative yes f is big which means that this dr dt is still negative and the last case obviously if f is if r is big then f prime is positive and if f is also big then r prime is negative so I was planning to do it here but I guess I'll run this picture here so what is that telling us that's telling us that if we look in this plane which is divided into four bits r prime is in here r prime is positive f prime is negative that means that things are going like that at this point right here is where f prime transitions from negative to positive so it goes straight across and in this region things go up and at this point is where r prime is transitioning from positive to negative so things continue to go up and then they go this way and we get something that looks like that so what is this doing this is describing so if we take a particular solution and we let it run we get something that looks like that this is a depiction of how the fox population varies with the rabbit population so let's look at this now in terms of just what happens to the foxes in terms of time now I'm going to put time here and I'm going to put the number of foxes here if I start today here at this point and I let time run maybe I can do this then the number of foxes decreases then it increases back then it continues to increase then it decreases well ok I ran out of space but we see an oscillation here in the number of foxes as you trace out this curve the ratio of foxes to rabbits goes around this circle this is just the projection of this circle in this way but with the time component so for this initial condition it increases then it increases and increases then it decreases we can do the same thing if I draw it down here I'll just draw it down here if we look at the rabbit population the same business is going to happen except that we're starting here where the rabbits will initially increase right horizontal motion is motion of rabbits is up for rabbits and vertical motion is foxes so here if we start at this same initial condition right there then we initially have some number of rabbits time increases the rabbits increase but then they start to tail off and then they decrease and somehow I'm off a little bit so the minimum of foxes occurs while the rabbits in the middle of the rabbits increasing the maximum of rabbits is the maximum of foxes occurs when the rabbits change so we have something like that so I'm not lining them up very well these peaks are not occurring right I'm sorry we start with the minimum of rabbits here then we go a quarter a quarter of a loop the foxes are at their minimum but the rabbits are somewhere in the middle so that's here then we go another bit more the fox population is now in its middle that's here but the rabbit population has now achieved its max so that's here and then we go another quarter turn the rabbits are in the middle and the foxes have achieved the max and so what we get is a pair like a sign we get a pair of oscillating curves where one is a quarter period behind the other do you see how to transform from this to this used about this you are okay can you voice the confusion so this circle so what is the process here we look at these equations actually you can't we can't solve these equations we can't write a formula for this solution but we can understand how it behaves by looking at some a direction field where we notice that the direction field has zeros there and there and then start applying an analysis about which way things evolve by looking at just what happens to these two things are they positive, are they negative, are they big are they small this gives us a bunch of vectors they go around like that so we can do something just like Euler's method you can put this on a computer and easily apply it but remember this represents I'm not giving you time I'm only giving you the number of foxes the number of rabbits and we can see that if the number of foxes is a little bit smaller than some number and the number of rabbits is a little bit smaller than some other number the rabbits will decrease while the foxes increase right and then if the rabbit population gets even bigger the foxes will begin to increase because it's easy for them to find food but the rabbits will continue to increase but then when there's too many foxes the foxes are very happy when there's a lot of rabbits and a lot of foxes the foxes are very happy but a lot of rabbits get eaten and they get eaten enough that there's not enough rabbits to support the foxes and so then both populations die off that's what this circle is representing the circle is representing the number of rabbits and the number of foxes you should think of this as a movie where we just plot and this point moves around on a circle we have a cyclic pattern of the population it oscillates around something with a green state if we prefer we can just ignore the foxes entirely oops we can just ignore say the rabbits entirely and look at the population of foxes and we see something that looks like all sorts of like a sine curve and if we ignore the foxes entirely and just look at the rabbits we see the population of rabbits does the same kind of thing so now in this particular model with the chosen A, B, C and D you always get these oscillatory patterns but as I said this is not all that we would look at is justice in many applications I mean how many people have done these base coordinates in say physics zero people really okay they use this in physics all the time they also use it in biology and in chemistry and in lots of things you're looking at here we're looking at instead of something that varies with time we're looking at the ratio of two concentrations we can certainly set this up to describe a chemical equation that oscillates where this is the concentration of one chemical and this is the concentration of another chemical you can certainly imagine and if we tweak this thing a little bit suppose that this is not how they evolve instead so suppose that we know that well actually before I do that notice that the signs of these numbers A, B, C and D tell you whether the predator who's the predator and who's the predator when I write down an equation like dx dt is 3x times 1 plus 4xy dy dt is let's make that negative 2, 2 of y times 1 minus 1 half x y we should be able to read off from this who's the predator and who's the predator if we multiply this out oops this supposed to be minus 3 if we multiply this out then we can see these things the x's whatever they are tend to die off in the absence of y's but when y's are around it gives them a boost and the y things are happily are very happy when there's no x's they grow but in the presence of the x's they die so this is the predator so just from the equations we can figure out what, by looking at the sign of how the various states are affected now you can imagine that maybe we want to tweak this a little bit maybe instead of being maybe the predators are not carnivores they're omnivores so they can live just fine without the prey around but but they also eat that so that would change this sign we would still have a predator prey situation but these predators now become omnivores they eat the prey but they also eat the grass so if we change this to a plus we still have a predator prey situation but the behavior is quite different that would reverse the arrows here in the vertical direction so things would behave differently we can also imagine that maybe we have two species that are mutually beneficial what would change if we had two species which evolved which reproduced merrily on their own but in the presence of each other they're mutually beneficial then both of the signs would be net positive also if we have a species on the other then both of the signs would be negative so we have all these variations here another thing that we could throw into the mix is imagine that instead of being growing exponentially they compete for resources so there's limited resources how would we modify this equation so suppose I have a situation where there's two species and there's two species one of them preys on the other so I think aphids and many boats work this way I think they compete for the resources but the lay bones meet with aphids so in this case they both compete for the resources which is like the flowers and so on but the ladybugs eat the aphids so we have limited resources so we want something like how do the aphids grow in the absence of ladybugs there's a limited amount of food for them so what kind of model do we have to describe that so we might use a logistic model here to say that in the absence of anything what letters do we use here I don't even remember k, a 1-a over m so in the absence of any ladybugs we would have something like that just so that I let's call it k1 and m1 so this system has a carrying capacity with a certain number of aphids and in the absence of ladybugs that's how it behaves and similarly the ladybugs in the absence of aphids they can get by oops not b, l they would have some kind of logistic model the ladybugs eat the aphids so they get a boost some other number every time they meet so we would have something like this and similarly these guys would get some they would get eaten so there would be some harm to them so this would give us a different kind of a picture here this would give us something let me just try and draw not go through all the details so of course there's none of anything to get a fixed point here but if we look at the aphid population wants to grow to some certain amount but then it has a carrying capacity here of m1 and similarly the ladybug population wants to grow to some certain amount but then there's a carrying capacity here of m2 and above that they would tend to die off so it's a much more complicated system and if these things are appropriate there's some solution here and we have a much more complicated behavior we might see something like so they would both grow but they're limited and maybe they'll spiral in like that we might see other things too so depending on all of these numbers we might see lots of varieties here so let me just forget about the equations and just think about the setup for a few minutes so suppose that I have a solution in the phase plane that looks like that and let's just call these x's and y's what does this tell me that the graph of y of t looks like so only one person in the room who has a clue so it's going to limit on this value so here to start with a low value of y's they increase and they increase until they reach this height and then they decrease actually until they go rapidly until they get to this height here and then they begin to increase again but they don't increase quite as much they only get this high and then they decrease a little less and then it's a little hard to tell so again imagine we're traversing this and this is telling us what's happening to the height we're ignoring the horizontal component and only looking at the height but thinking of traversing this curve and as we traverse this curve you go up and down then up and down and you go up and down less and less so whatever kind of graph goes on for the x's is a little delay between the bumps now what else have we seen that looks like this it was just about a week ago yeah spring exactly there's no accident that this looks kind of like what we saw in the spring equation in fact this is where you see this in physics all the time if I have a differential equation a second order linear differential equation I can turn it into something like this by a little trick I can say let's suppose that y is the derivative of x there's no x here this is a function of t introduce a new variable x if you imagine that y is representing the position then x is the velocity and if I let y prime be x then this equation the second derivative is the derivative of x the acceleration is the derivative of velocity so if y prime is x then this equation becomes x prime plus bx plus cy equals zero and then I can solve for x prime here of course it's upside down like this so now I have a system of two equations depending on x and y in some sense very similar to what we're doing we're in a praise situation where I have two equations their derivatives depend on their values on their joint values so I have the derivative of x is some function of x and y and the derivative of y is some function of x and y and I can make a phase picture for such a thing and depending on what happens to b and c this exactly tells us whether we see a picture it goes spiraling around spiraling in goes off in two directions so exactly the kind but here we can solve them explicitly so this sort of thing where people make these kinds of how many of you are engineers how many of you are physics how many of you are other stuff let's try to see how many of you expect to take more physics so they do this kind of thing in physics all the time where they make what's called phase portrait let's say for the spring season so if I write down this equation or the spring can I put the velocity here and I put and the kind of spring that we saw it goes down and up like that would have something where so say this is position zero so it would have something where we would see a solution like that and this is describing exactly the motion of the spring the kind of spring that we see there's no friction corresponds to something that just goes around the velocity so when the spring notice that when we have a spring it's going then the position is changing and when it's at the bottom the velocity is zero when it's at the top the velocity is zero so when the position is at its max or it's mid the velocity is zero so it's exactly this kind of situation and also the other situations correspond to different pictures in the phase coordinate so this stuff with the phase coordinates of the second order equations is not an exam there's no homework on it but if you do more physics you will see it for sure okay so one more announcement there's going to be one additional web assign homework there will be another one due after the class ends it's about five or six problems it's on this predator prey stuff and the remaining classes I'm just going to start with you covered all the material