00:00Hi guys, okay, so the
00:02next part of Euler's method
00:04is Euler's method for coupled
00:06systems. On a coupled system,
00:09it's essentially this with two,
00:11a couple of differential equations,
00:13dx, dt and dy, dt,
00:16where x and y are
00:17dependent, variables that are dependent
00:19on each other, and t
00:21is an independent variable. It
00:23is not dependent on anything,
00:25it's just time, time moves
00:26on, doesn't care about anything
00:27else.
00:28But x and y very
00:30much do care about each
00:31other. And in this situation,
00:34this is a common example
00:35that we use as the
00:37example I'm going to use
00:38is the predator prey model.
00:42And well, x is the
00:43population of rabbits. And y
00:45is the population of foxes.
00:47So obviously the foxes are
00:49the predators and the rabbits
00:50are the prey. And what
00:53happens is as the
00:56As the foxes eat the
00:59rabbits, so the foxes see
01:00the wrappers in our lovely
01:01lots of rabbits. Let's eat
01:02them. The population of rabbits
01:05decreases and the population of
01:08foxes increases because the foxes
01:10are getting lots of food.
01:12But as they eat lots
01:14and lots of rabbits and
01:16the population of rabbits decreases,
01:18there's not much food left
01:19because they've eaten all the
01:20rabbits. So the population of
01:22foxes starts to decrease
01:24because there's no food for
01:26them. And then as the
01:27population of foxes decreases, the
01:30population of rabbits, so it's
01:31the increase again because there's
01:32not that many foxes to
01:34kill them. And the whole
01:35thing just repeats. And the
01:41coupled system differential equations can
01:44model that very nicely. Okay,
01:47so this is our example.
01:49And you can see here
01:51within the differential equation
01:52This is the growth rate
01:55of rabbits. We subtract 0
01:57.01 y. So obviously, as
01:59y gets bigger, this dx
02:02dt decreases. And here, as
02:06x gets bigger, this dy
02:09dt increases. Because as I've
02:12said, as the rabbits, as
02:14x, which is the population
02:15of rabbits, increases, that's good
02:18for the foxes. The foxes
02:19are happy with that.
02:20the population stress to increase.
02:23Anyway, it says, right, we
02:26have an island, there's rabbits.
02:27Ecologists introduce a population of
02:30100 foxes to the island
02:31when the population grabs is
02:33a thousand. So there's a
02:34thousand rabbits and now 100
02:36foxes. Let X be the
02:38population of rabbits, why is
02:39the population of foxes teased
02:40the time in years? And
02:42these are the population growths
02:43of rabbits and foxes. Use
02:46orders method with a step
02:48sign
02:48of 0 .25 to find
02:50the populations of rabbits and
02:52foxes one year after the
02:54foxes were introduced. Okay. This
02:56is the order's method from
02:58the formal booklet. This is
02:59order's method for coupled systems.
03:01It's essentially the same thing,
03:04but we have an x
03:07and a y dependent on
03:09each other and this other
03:11independent variable t. So,
03:16What we want to get,
03:17what we want to do
03:18is find the next x
03:20and the next y. And
03:21we'll do the whole thing
03:22together. And it's a bit
03:23like, it's very like this,
03:25this example that we did
03:26in the previous video, but
03:28we're just going to do
03:28it twice essentially. But twice
03:31in the one go. So
03:33first, let's find these equations.
03:35The next x and the
03:37next y. So our next
03:40x are x and plus
03:42one is going to be
03:43our previous
03:44X, X of n plus
03:47H. Now H is the
03:48step length, which is 0
03:49.25. H times this, now
03:54this is f1, X, n,
03:56y, and t, and that
03:57looks quite complicated. That is
04:00just dx dt. And this
04:03is just dy dt. So
04:06dx dt is this here,
04:10but it's X, and I'm
04:11going to put n because
04:12it's the
04:12The x of n plus
04:141 is the previous n.
04:18And we're going to use
04:20it for the previous iteration.
04:22I feel like I'll explain
04:23that a bit more in
04:23a second. Times 2 minus
04:260 .01 yn. And our
04:31y of n plus 1
04:33is equal to yn plus
04:370 .25. That's the step
04:39length.
04:40n times 0 .0002 x
04:46n minus 0 .8 close
04:49bracket. Okay, and our T
04:52of n plus 1, our
04:53next T is just the
04:54T plus the H plus
04:55the step length. So we're
04:57gonna start with, let's start
04:59with the T. Our T
05:02is, our initial T is
05:04when T is 0. And
05:06then our next T is
05:080.
05:080 .25 because the t
05:10goes up in the step
05:11length, then 0 .5, 0
05:15.75, and 1. I'm going
05:18to stop at 1 because
05:19we're looking for the populations
05:20after 1 year. OK, fun.
05:25The next, sorry, the xn,
05:29this is our population of
05:31rabbits, at 0, it is
05:341 ,000 because that's
05:36the time as the start
05:38of this whole thing when
05:39the foxes were introduced, so
05:40we do a thousand rabbits.
05:42And our YN, our YN,
05:47is 100, is there was
05:49100 foxes. Okay, now we're
05:53gonna do this whole thing
05:55on the calculator. So definitely
05:57you want to get familiar
06:02with and able to use
06:03this spreadsheet, because this makes
06:04here.
06:04life quite easy. So this
06:07is actually going to be,
06:08let's call this t, this
06:10is xn, this is yn,
06:14and this just goes zero,
06:16zero point two five, zero
06:19point five, zero point seven
06:21five, and one. Our x
06:26of n, our initial x
06:28of n is a thousand,
06:30and our initial y of
06:31n is
06:33100. I mean this is
06:36the only tricky part of
06:37this whole question. You have
06:39to put what we have
06:42to write this in here.
06:45We have to write, let
06:47me just make sure we
06:48can see it. I have
06:49to write this, I can
06:54make that in smaller. I
06:55have to write this in
06:57here using like a sensor
07:01to Excel format. So I
07:03have to write equals, because
07:04I want this cell to
07:06equal, but I want it
07:07equal X of N, the
07:08previous X. So it's this
07:11X. So I can either
07:12click that, or I could
07:13just type B1, because this
07:15is cell B1. So it's
07:18B1 plus 0 .25 times
07:24B1 again. I'm just going
07:26to type B1 times
07:29Again, brackets two minus 0
07:32.01. And this time I
07:34want Yn, which is C1.
07:38So I'm going to do
07:39times C1. Close brackets, press
07:44Enter, and I get 1
07:46,250. Then this is, I
07:52put all of this in.
07:54So this is equal to,
07:56I'm going to
07:57go C1 plus 0 .25
08:02times C1 again times brackets
08:080 .002 times XN, which
08:16is B1 minus 0 .8
08:22closed brackets per center.
08:25So actually what's happened is
08:28after the first quarter of
08:30a year, the population of
08:34rabbits has actually increased in
08:35the population of foxes has
08:36decreased. So actually there's not
08:38enough, there's a thousand rabbits,
08:41but because there's a hundred
08:42foxes, there's just not enough
08:44rabbits for the foxes yet.
08:46So actually the population of
08:48foxes is decreasing. But as
08:51this decrease,
08:53and this increases, there's gonna
08:55come a point when the
08:57foxes are gonna go. All
08:58right guys, now there's enough
08:59rabbits, there's those are rabbits
09:00first. Let's start, let's start
09:03eating the rabbits and multiplying
09:05again. Okay, at this stage
09:08guys, you don't have to
09:09type that in over and
09:10over again, you can just
09:11drag this down and you
09:13can drag it down to
09:13where you wanna go, which
09:14is there. A nice function,
09:18because I know it's not
09:19as easy to do this
09:20on your calculator as it
09:21is
09:21me with my trackpad. If
09:24you press menu data and
09:27fill, then you just press
09:29down, down, down and press
09:31enter. And this just fills
09:33nicely automatically. So let's write
09:37out this first. It's 1,
09:402, 50, 1, 6, 0,
09:419. So 1, 2, 50,
09:441, 6, 0, 9.
09:49I'm just gonna round it
09:50guys 2 -1 -1 -9
09:51and 2 -8 -3 -6,
09:532 -1 -1 -9, 2
09:56-8 -3 -6. Actually, that's
10:022 -8 -3 -7 if
10:03we're gonna round that. That
10:04actually is important. And then
10:09I have 85, 73, 65,
10:1585, 73,
10:1765 and then 58 that's
10:23just rounded to the nearest
10:25Fox shall we say and
10:29now you may be thinking
10:31hang on the population of
10:32this is just increasing the
10:33population this is just decrease
10:34and it is they wanted
10:35us to stop after one
10:36year but let's just see
10:39what would have happened if
10:42we kept going so let's
10:44remove that down to here
10:45here and I move this
10:47down to here. So yeah,
10:50at this point you can
10:51see it takes a while
10:54but the so here at
11:02this point the population well
11:07the population of foxes starts
11:09to increase the population of
11:11rabbits still seems to be
11:13increasing here as well. Let's
11:16see if I go a
11:17little bit more. I want
11:22to see these rabbits start
11:23to decrease. Okay, so here
11:27now the foxes are start
11:28to the foxes start to
11:31increase a lot. And at
11:33this point, yeah, the rabbits
11:35are like they start to
11:36decrease. Anyway, okay, so
11:41That's basically it. You stop
11:44when when you says to
11:46stop and that's after one
11:46year. So it's here. So
11:48the question said find the
11:49population of rabbits and foxes
11:51after one year. So you
11:53you want to obviously clarify
11:55what's going here. Therefore after
11:58one year, after one year,
12:03population of, population of rabbits.
12:09is approximately because this is
12:13all approximately guys at 2837
12:17and Foxes is approximately 58.
12:29Okay, so that's that's it
12:31guys. That's the main main
12:32thing I wanted you to
12:34to get from this understand
12:37what's happening with pred
12:37predator prey models understand this
12:41this coupled system understand how
12:44to use the order's or
12:48there's equation or order's method
12:50equation in your from the
12:53formula booklet and apply it
12:54to this situation and then
12:56kind of most importantly and
12:58arguably the most difficult part
13:00of the of the question
13:01is to get this it's
13:04difficult I mean it's fine
13:05once once
13:06It's fine once you know
13:08how to do it to
13:09fill it in but in
13:10the middle of an exam
13:12high pressure situation With that
13:15really annoying calculator. Yeah, you
13:17can see that without practicing
13:18this a lot that could
13:20become problematic So I would
13:22recommend doing like about 10
13:24of these just to make
13:25sure you're really Yeah, no
13:28how to do it. Okay,
13:30that's it guys. I'll see
13:32you soon for the next
13:33video
13:34Thank you.