WEBVTT

00:00:01.660 --> 00:00:05.650
The Euler's Method applet helps
us understand numerical methods

00:00:05.650 --> 00:00:10.360
for approximating solutions
to differential equations.

00:00:10.360 --> 00:00:12.130
I can choose the
differential equation

00:00:12.130 --> 00:00:14.440
using this pull
down menu, and I've

00:00:14.440 --> 00:00:17.680
selected the equation y
prime equals y squared

00:00:17.680 --> 00:00:24.130
minus x, the same equation that
we used in the isocline applet.

00:00:24.130 --> 00:00:28.090
The graphing window shows a
slope field, the slope field

00:00:28.090 --> 00:00:29.190
of this equation.

00:00:29.190 --> 00:00:31.670
And the value of the slope
field can be read off

00:00:31.670 --> 00:00:33.380
by rolling over the window.

00:00:33.380 --> 00:00:35.750
It's read off on the
right-hand side here. f

00:00:35.750 --> 00:00:41.830
of x, y is various values
depending on where I'm located.

00:00:41.830 --> 00:00:46.570
I've also chosen an initial
condition, initial value,

00:00:46.570 --> 00:00:54.220
of x equals-- x_0 is
zero, and y_0 is minus 1.

00:00:54.220 --> 00:00:59.570
I can see the actual solution
with that initial condition

00:00:59.570 --> 00:01:07.520
by pressing Actual from this
set of boxes and checking Start.

00:01:07.520 --> 00:01:10.450
Now a curve is drawn
on the graphing plane.

00:01:10.450 --> 00:01:13.050
This is the solution with
that initial condition.

00:01:13.050 --> 00:01:15.820
And a table of values shows
up in this left table.

00:01:18.480 --> 00:01:21.230
We can see that this is
one of the solutions which

00:01:21.230 --> 00:01:22.790
is sucked into the funnel.

00:01:22.790 --> 00:01:26.860
So we understand
the values of y of x

00:01:26.860 --> 00:01:29.330
quite well when x is large.

00:01:29.330 --> 00:01:33.240
But what if I want to
know the value of y of 1?

00:01:33.240 --> 00:01:35.410
According to the
table over here,

00:01:35.410 --> 00:01:39.100
the value is
approximately minus 0.83.

00:01:39.100 --> 00:01:42.340
But how do we know that?

00:01:42.340 --> 00:01:45.740
Euler's method is the
simplest numerical method.

00:01:45.740 --> 00:01:49.030
It uses the tangent
line approximation.

00:01:49.030 --> 00:02:00.150
If I set the step size to be
1, I can then click Start,

00:02:00.150 --> 00:02:04.600
and this will draw a tangent
line segment, with delta x

00:02:04.600 --> 00:02:07.720
equal to 1, starting at
my initial condition,

00:02:07.720 --> 00:02:11.020
and with slope given by the
slope field at that point.

00:02:11.020 --> 00:02:16.430
So the tangent line
approximation to y of 1

00:02:16.430 --> 00:02:20.200
is the value zero.

00:02:20.200 --> 00:02:22.820
Well, that's not very good.

00:02:22.820 --> 00:02:27.060
But I can improve things by
using a smaller step size.

00:02:27.060 --> 00:02:33.480
So let's go down to a step
size of 1/4, start again.

00:02:33.480 --> 00:02:37.300
Now I've drawn a
tangent line segment,

00:02:37.300 --> 00:02:40.410
but the horizontal
distance is only 1/4.

00:02:43.850 --> 00:02:45.840
Let's see if we can
see this more clearly

00:02:45.840 --> 00:02:48.130
by pressing the zoom key.

00:02:48.130 --> 00:02:50.630
This will zoom in on the same
picture that we had before.

00:02:53.560 --> 00:02:56.330
I can measure the slope
field at the end point

00:02:56.330 --> 00:02:58.700
of this green line segment.

00:02:58.700 --> 00:03:01.540
It seems to be about 0.32.

00:03:01.540 --> 00:03:05.570
And by pressing Next Step,
I can draw a line segment

00:03:05.570 --> 00:03:07.810
moving off with that slope.

00:03:07.810 --> 00:03:12.200
So this now, it produces a
polygon, the Euler polygon,

00:03:12.200 --> 00:03:14.860
which will stay closer
to the actual curve

00:03:14.860 --> 00:03:18.300
than the simple tangent
line approximation did.

00:03:18.300 --> 00:03:22.810
I can continue this process by
continuing to say Next Step.

00:03:22.810 --> 00:03:25.550
The table of values
appears on the left,

00:03:25.550 --> 00:03:28.500
and we discover that
the Euler approximation

00:03:28.500 --> 00:03:34.560
to y of 1 with step
size 1/4, is minus 0.75.

00:03:34.560 --> 00:03:38.070
Much better than the
earlier value we had.

00:03:38.070 --> 00:03:40.210
And I can improve
things still further

00:03:40.210 --> 00:03:42.660
by choosing a smaller step size.

00:03:42.660 --> 00:03:46.210
In fact, you get as close as
you want to the actual solution

00:03:46.210 --> 00:03:50.430
by selecting sufficiently
small step sizes.

00:03:50.430 --> 00:03:54.730
Let's do one more example
with step size of 1/8.

00:03:54.730 --> 00:04:00.170
Now I will click 8 times
to produce an Euler polygon

00:04:00.170 --> 00:04:02.130
with 8 segments.

00:04:02.130 --> 00:04:06.380
And I have an
estimate of minus 0.8.

00:04:06.380 --> 00:04:08.550
All of these estimates
are too large.

00:04:08.550 --> 00:04:10.610
All of these curves,
these polygons,

00:04:10.610 --> 00:04:14.560
lie above the actual
solution curve.

00:04:14.560 --> 00:04:16.270
Let's see if we can
see why this is.

00:04:19.360 --> 00:04:24.980
You'll notice that the slope
field is given by the formula

00:04:24.980 --> 00:04:26.780
y squared minus x.

00:04:26.780 --> 00:04:32.440
So as x increases, the slope
field decreases in value.

00:04:32.440 --> 00:04:36.170
So as we're moving out along
one of these Euler struts,

00:04:36.170 --> 00:04:39.030
the slope field is
decreasing under it.

00:04:39.030 --> 00:04:41.660
And that causes
the actual solution

00:04:41.660 --> 00:04:46.190
to fall below the Euler polygon.

00:04:46.190 --> 00:04:51.390
And that process will continue
as I iterate the Euler process.

00:04:51.390 --> 00:04:54.970
So the general rule is, if the
direction field is decreasing

00:04:54.970 --> 00:04:58.600
in the x-direction, you should
expect the actual solution

00:04:58.600 --> 00:05:01.410
to be less than
the Euler estimate.

00:05:01.410 --> 00:05:03.260
There are lots of
things that can go wrong

00:05:03.260 --> 00:05:05.340
in this kind of numerical work.

00:05:05.340 --> 00:05:08.610
To see one of
them, let's unzoom.

00:05:08.610 --> 00:05:16.800
Zoom back, clear the screen,
redraw the actual solution,

00:05:16.800 --> 00:05:20.320
and choose step size 1.

00:05:20.320 --> 00:05:22.930
Now instead of wanting
to compute y of 1,

00:05:22.930 --> 00:05:27.140
suppose that I wanted to compute
the value of the solution

00:05:27.140 --> 00:05:29.250
at x equals 6.

00:05:29.250 --> 00:05:32.742
Well if I try doing this
using step size of 1,

00:05:32.742 --> 00:05:33.700
let's see what happens.

00:05:33.700 --> 00:05:34.520
So I begin.

00:05:34.520 --> 00:05:36.460
I have the same
strut I had before.

00:05:36.460 --> 00:05:38.670
It's too large, but
now the slope field

00:05:38.670 --> 00:05:43.020
has a negative value so
that comes back down.

00:05:43.020 --> 00:05:44.620
Things are looking better.

00:05:44.620 --> 00:05:46.550
In the next step, I've overshot.

00:05:49.110 --> 00:05:52.690
And if I take another
step, then I've

00:05:52.690 --> 00:05:56.390
overshot again in the other
direction, more dramatically.

00:05:56.390 --> 00:05:58.980
And now the slope field
is even more negative.

00:05:58.980 --> 00:06:01.210
So when I take the
next step, I've

00:06:01.210 --> 00:06:04.330
overshot yet again,
more dramatically.

00:06:04.330 --> 00:06:10.550
And if I take the next step, now
my estimate for the solution,

00:06:10.550 --> 00:06:15.830
which is down here, at x
equals 6 is the value 7,

00:06:15.830 --> 00:06:19.500
this is in the range where
the slope field continues

00:06:19.500 --> 00:06:20.800
to increase forever.

00:06:20.800 --> 00:06:25.110
And so my estimated solution
will zoom off towards infinity,

00:06:25.110 --> 00:06:28.200
while the actual
curve is down here.

00:06:28.200 --> 00:06:30.940
I call this
catastrophic overshoot.

00:06:30.940 --> 00:06:32.970
It's just one of a number
of different things

00:06:32.970 --> 00:06:37.340
that can go wrong when you try
to use these numerical methods.