1
00:00:01,224 --> 00:00:03,992
A smaller delta t makes Euler's method
2
00:00:03,992 --> 00:00:07,776
more accurate, and we can see why:
3
00:00:07,776 --> 00:00:10,022
The reason Euler's method isn't accurate
4
00:00:10,022 --> 00:00:12,654
is that we're pretending that a constantly changing rate
5
00:00:12,654 --> 00:00:15,817
is actually constant over some time interval.
6
00:00:15,817 --> 00:00:20,776
Over a time interval of 2 minutes, that rate might change quite a bit,
7
00:00:20,776 --> 00:00:24,562
but the rate will change less if the time interval is smaller.
8
00:00:24,562 --> 00:00:28,256
So, if the time interval is 1 minute, instead of 2,
9
00:00:28,256 --> 00:00:32,822
the bit of make-believe, where we pretend that
10
00:00:32,822 --> 00:00:36,692
the rate isn't changing, will be closer to reality,
11
00:00:36,692 --> 00:00:41,938
and I can illustrate that on this next plot.
12
00:00:41,938 --> 00:00:45,570
So, I won't go through all the numerics of this,
13
00:00:45,570 --> 00:00:49,024
but here is Euler's method
14
00:00:49,024 --> 00:00:51,398
for 2 different delta t's.
15
00:00:51,398 --> 00:00:57,541
So, first, the squares, which we've already seen,
16
00:00:57,541 --> 00:01:00,016
we calculated those before,
17
00:01:00,016 --> 00:01:04,085
that's Euler's method with a delta t of 2,
18
00:01:04,085 --> 00:01:06,537
where we're pretending that a constantly changing rate
19
00:01:06,537 --> 00:01:08,903
is actually constant for a whole two minutes.
20
00:01:08,903 --> 00:01:14,941
Delta T of 1, that's the triangles with the dash, and not dotted line.
21
00:01:14,941 --> 00:01:19,408
a little hard to see, but the key thing is it's between these two
22
00:01:19,408 --> 00:01:23,074
- it's closer to the exact solution which is the solid curve.
23
00:01:23,074 --> 00:01:28,236
It's closer because the ignoring of the problem is a less bad thing to do,
24
00:01:28,236 --> 00:01:31,302
- we're pretending now that a continually changing rate
25
00:01:31,302 --> 00:01:35,398
is only constant for 1 minute, instead of 2, so it's not as much of a lie,
26
00:01:35,398 --> 00:01:38,864
and by now you can probably guess
27
00:01:38,864 --> 00:01:42,176
how we could make this better and better and better
28
00:01:42,176 --> 00:01:45,572
- we would let delta t get smaller and smaller and smaller,
29
00:01:45,572 --> 00:01:48,735
and then we would see that the Euler method
30
00:01:48,735 --> 00:01:53,836
would be exactly on top of this line.
31
00:01:56,112 --> 00:01:59,096
Now that we've seen part of a particular example
32
00:01:59,096 --> 00:02:02,736
let me talk about Euler's method a bit more generally.
33
00:02:02,736 --> 00:02:07,366
Euler's method applies to differential equations of this form.
34
00:02:07,366 --> 00:02:09,983
A differential equation is a dynamical system,
35
00:02:09,983 --> 00:02:12,990
a rule for how something changes in time.
36
00:02:12,990 --> 00:02:15,318
What makes differential equations a little bit tricky
37
00:02:15,318 --> 00:02:17,935
is that the rule is indirect.
38
00:02:17,935 --> 00:02:20,077
This tells us how the derivative changes
39
00:02:20,077 --> 00:02:24,317
and we're interested in how the quantity X itself changes.
40
00:02:24,317 --> 00:02:27,262
Euler's method is just a way to go from this
41
00:02:27,262 --> 00:02:34,332
indirect information derivative, to the direct information about X
42
00:02:37,256 --> 00:02:41,931
So Euler's method converts this indirect rule,
43
00:02:41,931 --> 00:02:45,408
the differential equation - indirect rule involving the derivative
44
00:02:45,408 --> 00:02:49,896
- the rate of change, and it converts that in to values for X.
45
00:02:49,896 --> 00:02:54,102
It does so, by pretending that this rate of change
46
00:02:54,102 --> 00:02:57,827
is constant over a time interval.
47
00:03:01,566 --> 00:03:05,991
So, Euler's method does this conversion by pretending that the derivative,
48
00:03:05,991 --> 00:03:09,067
which is constantly changing, is actually constant
49
00:03:09,067 --> 00:03:11,776
over some time interval delta t.
50
00:03:11,776 --> 00:03:14,242
This bit of make-believe gets better
51
00:03:14,242 --> 00:03:19,259
closer to the true value, as delta t gets smaller.
52
00:03:24,859 --> 00:03:30,245
So, as delta t, our time interval over which were pretending the rate isn't changing,
53
00:03:30,245 --> 00:03:33,070
as delta t gets closer and closer to 0,
54
00:03:33,070 --> 00:03:36,936
this Euler pretending will get less and less wrong,
55
00:03:36,936 --> 00:03:40,175
and in this way, Euler's method, a solution obtained
56
00:03:40,175 --> 00:03:45,232
from Euler's method, will get closer and closer to the true answer.
57
00:03:48,679 --> 00:03:53,343
So, as delta t gets closer and closer to 0,
58
00:03:53,343 --> 00:03:55,898
a solution obtained by Euler's method will get
59
00:03:55,898 --> 00:03:59,176
closer and closer to the exact solution.
60
00:03:59,176 --> 00:04:01,899
So, Euler's method is a computational way of
61
00:04:01,899 --> 00:04:04,324
finding a solution to a differential equation.
62
00:04:04,324 --> 00:04:06,817
It requires doing a computation,
63
00:04:06,817 --> 00:04:10,071
and you can see that as delta t gets smaller and smaller
64
00:04:10,071 --> 00:04:13,232
the computational will get longer and longer.
65
00:04:13,232 --> 00:04:15,858
- we'll need to do more and more steps to get anywhere,
66
00:04:15,858 --> 00:04:20,465
so these are almost always done on a computer.
67
00:04:20,465 --> 00:04:24,290
So, this is an algorithmic solution to differential equations.
68
00:04:24,290 --> 00:04:26,058
It's a procedure, it's well-defined,
69
00:04:26,058 --> 00:04:29,936
for well-defined differential equations, it's guaranteed
70
00:04:29,936 --> 00:04:31,852
to converge to the exact solution.
71
00:04:31,852 --> 00:04:34,987
So, Euler's method is very general,
72
00:04:34,987 --> 00:04:39,242
it almost always works, and I think it gets at
73
00:04:39,242 --> 00:04:41,566
the core idea of a differential equation:
74
00:04:41,566 --> 00:04:44,100
a differential equation is a dynamical system,
75
00:04:44,100 --> 00:04:47,064
a rule for how something changes.
76
00:04:47,064 --> 00:04:50,649
The rule is a little bit indirect, because it is in terms of the derivative,
77
00:04:50,649 --> 00:04:54,052
the rate of change of this quantity X, and not X itself
78
00:04:54,052 --> 00:04:56,905
but Euler's method is a little bit of a trick
79
00:04:56,905 --> 00:05:00,654
that converts this indirect information about the derivative
80
00:05:00,654 --> 00:05:05,980
into direct information about values for X