Home | I want to volunteer | List of Courses |  FAQs | Discussion (Chinese)

Differential Equations-2


1
00:00:00,910 --> 00:00:01,970
So the...

2
00:00:20,620 --> 00:00:22,920
The topic for today is...

3
00:00:29,160 --> 00:00:33,930
Today we are gonna talk..

4
00:00:34,210 --> 00:00:36,100
I'm postponing the linear equation to next time

5
00:00:36,320 --> 00:00:39,720
Instead, I think it's a good idea since

6
00:00:40,280 --> 00:00:45,750
In real life, most of the differential equations are solved by numerical methods

7
00:00:46,060 --> 00:00:48,960
to introduce you to those right away

8
00:00:49,270 --> 00:00:51,830
Even when you see the computer when you saw

9
00:00:52,090 --> 00:00:55,280
the computer screen, the solutions being drawn

10
00:00:55,500 --> 00:01:01,230
Of course that, what really was happening is that the computer was calculating the

11
00:01:01,380 --> 00:01:03,630
solutions numerically and plotting the points

12
00:01:04,110 --> 00:01:07,590
So this is the main way

13
00:01:07,870 --> 00:01:11,920
Numerically is the main way differential equations are actually solved

14
00:01:12,230 --> 00:01:14,010
There aren't any complexity at all

15
00:01:14,160 --> 00:01:17,310
Now, so the problem is an initial value problem

16
00:01:17,440 --> 00:01:22,630
Let's write a first order problem the way we talked about it on Wednesday

17
00:01:22,960 --> 00:01:28,730
And now I'll specifically add to that the starting point that you use

18
00:01:28,970 --> 00:01:31,250
when you did the computer experiments

19
00:01:31,440 --> 00:01:33,690
And I'll write the starting point this way

20
00:01:33,800 --> 00:01:37,800
the y of x zero should be y zero(See the picture)

21
00:01:37,930 --> 00:01:39,410
So this is the initial condition

22
00:01:39,480 --> 00:01:41,600
and this is the first-order differential equation

23
00:01:41,700 --> 00:01:44,000
And as you know, the two of them together

24
00:01:44,120 --> 00:01:49,450
are called an IVP-- an initial value problem

25
00:01:49,640 --> 00:01:51,400
Which means two things:

26
00:01:51,480 --> 00:01:54,370
the differential equation and the initial value

27
00:01:54,480 --> 00:01:58,150
that you want to start the solution at.

28
00:01:58,290 --> 00:02:08,720
OK. Now the method we're going to talk about

29
00:02:08,880 --> 00:02:15,130
The basic method of which many others are merely refinements in one way or another

30
00:02:15,240 --> 00:02:18,240
is called Euler's Method

31
00:02:25,570 --> 00:02:29,090
Euler who did of course everything in analysis

32
00:02:29,210 --> 00:02:35,040
didn't.. as far as I know didn't actually use it to compute solutions of differential equations

33
00:02:35,160 --> 00:02:37,010
His interest was theoretical

34
00:02:37,210 --> 00:02:40,920
He used it as a method of proving the existence theorem

35
00:02:41,090 --> 00:02:43,580
that proving the solutions existed

36
00:02:43,730 --> 00:02:49,110
But nowadays it's used to calculate the solutions numerically

37
00:02:49,270 --> 00:02:54,370
And the method is very simple to describe. It's so naive

38
00:02:54,500 --> 00:02:58,450
If you probably think that if you were living 300 years ago

39
00:02:58,600 --> 00:03:03,010
You would have discovered it and covered yourself with glory for all eternity

40
00:03:03,120 --> 00:03:07,870
So here is a starting point

41
00:03:08,030 --> 00:03:10,750
x zero y zero(See the picture)

42
00:03:10,960 --> 00:03:15,680
Now what information do we have

43
00:03:15,540 --> 00:03:21,370
I said point all we have is a little line element whose slope is given by f(x, y)

44
00:03:21,540 --> 00:03:24,780
So if I start the solution

45
00:03:25,620 --> 00:03:30,330
The only way the solution could possibly go would be of that direction

46
00:03:30,470 --> 00:03:32,630
Since I have no other information

47
00:03:32,810 --> 00:03:37,590
At least it has a correct direction at (X0, Y0)

48
00:03:37,720 --> 00:03:41,680
But of course it's not likely to have a correct direction anywhere else

49
00:03:41,770 --> 00:03:45,920
Now what you do then is choose a step size

50
00:03:46,020 --> 00:03:50,270
I'll draw just a few, er two steps for the method, that's I think good enough

51
00:03:50,360 --> 00:03:53,190
We choose a step size

52
00:03:53,280 --> 00:03:57,200
Uniform step size which is usually called "h"

53
00:03:57,310 --> 00:04:03,100
And you continue that solution, until you get to the next point

54
00:04:03,210 --> 00:04:07,170
Which will be X0 plus h, as I draw on the picture

55
00:04:07,270 --> 00:04:09,070
So we get to here

56
00:04:09,170 --> 00:04:11,410
We stop at that point

57
00:04:11,490 --> 00:04:15,940
And now you recalculate what the line element is here

58
00:04:16,000 --> 00:04:21,260
Suppose here the line element now through this point goes like that

59
00:04:21,340 --> 00:04:25,560
Well, than that's the new direction you that should start out with, going from here

60
00:04:25,640 --> 00:04:29,040
So the next step of process will carry you to here

61
00:04:29,150 --> 00:04:32,150
That's two steps of Euler's method

62
00:04:32,240 --> 00:04:36,390
Notice that it produces a broken-line approximation to the solution

63
00:04:36,510 --> 00:04:40,490
But in fact you only see that broken line

64
00:04:40,630 --> 00:04:46,200
if you are at a computer ,if you are looking at the computer visual, for example, which is...

65
00:04:46,330 --> 00:04:49,450
Whose purpose is to illustrate for you Euler's method

66
00:04:49,570 --> 00:04:52,050
In actually practice, what you see is

67
00:04:52,150 --> 00:04:56,930
The computer simply calculate this point, that point, that point

68
00:04:57,050 --> 00:04:58,880
And successive points

69
00:04:58,960 --> 00:05:04,330
And many programs will just automatically connect those points via smooth looking curve

70
00:05:04,430 --> 00:05:06,500
If, well, that's what you prefer to see

71
00:05:08,860 --> 00:05:11,830
Well, that's all there is to the method

72
00:05:11,980 --> 00:05:18,230
What we have to do now is derive the equations from the method

73
00:05:18,370 --> 00:05:20,440
And how we gonna do that

74
00:05:20,530 --> 00:05:27,010
Well, the essence of it is how to get from the n-th step to the to the n+1-th step

75
00:05:27,150 --> 00:05:32,140
So I'm gonna draw a picture just to illustrate that

76
00:05:32,250 --> 00:05:36,960
So now we are not at X0, but let's say we've already got to Xn, Yn

77
00:05:40,280 --> 00:05:42,040
How do I take the next step

78
00:05:43,090 --> 00:05:46,750
Well, I take the line element and it goes up like that

79
00:05:46,860 --> 00:05:49,940
Let's say that because the slope is...

80
00:05:50,010 --> 00:05:54,520
I'm going to call that slop A sub n( See the picture)

81
00:05:54,650 --> 00:06:00,040
Of course, the An is the value of the right hand side of the point (Xn, Yn)

82
00:06:00,130 --> 00:06:01,860
We'll need that equation

83
00:06:01,990 --> 00:06:05,980
But I think it will be a little clearer if I just give a capital letter at this point

84
00:06:06,100 --> 00:06:11,160
Now, this is the new point

85
00:06:11,250 --> 00:06:14,290
And all I want to know is what are its coordinates

86
00:06:14,360 --> 00:06:18,030
Well the Xn+1(See the picture) is there, the Yn+1(See the picture) is here

87
00:06:18,110 --> 00:06:22,590
Clearly I should draw this triangle, complete triangle

88
00:06:22,700 --> 00:06:25,520
This side of the triangle...

89
00:06:25,650 --> 00:06:31,290
The hypotenuse has slope An, this side of triangle has length h

90
00:06:31,430 --> 00:06:35,030
h is the step size. Perhaps I'd better indicate that..

91
00:06:35,140 --> 00:06:39,200
Actually put that up so that you know the word "Step size"(See the picture)

92
00:06:39,210 --> 00:06:42,110
It's a step size on the X-axis

93
00:06:42,190 --> 00:06:45,240
How far you have to go from each X to the next one

94
00:06:45,340 --> 00:06:49,680
What's this. Well, if that's slope

95
00:06:49,740 --> 00:06:56,800
As this slope An, this is h, then this must be h times An (See the picture)

96
00:06:56,920 --> 00:06:59,940
The length of that side

97
00:07:00,010 --> 00:07:05,600
In order that the ratio of the height to this width should be An

98
00:07:05,700 --> 00:07:08,080
and as to this method

99
00:07:08,150 --> 00:07:12,000
What's the... How do I get from...

100
00:07:12,100 --> 00:07:15,910
Clearly to get from Xn to Xn+1 I simply add h

101
00:07:16,040 --> 00:07:18,170
So that's a trivial part of it

102
00:07:18,230 --> 00:07:21,230
The interesting thing is how do I get the new Yn+1

103
00:07:21,330 --> 00:07:27,310
And so the best way to write it as the Yn+1 minus Yn (See the picture)

104
00:07:27,440 --> 00:07:33,430
Divided by h

105
00:07:33,490 --> 00:07:42,520
Well, sorry. Yn+1 minus Yn is this line the same as this line h times An (See the picture)

106
00:07:42,630 --> 00:07:46,250
So that's the way we write it

107
00:07:46,360 --> 00:07:53,550
Or, since the computer is interested in calculating Yn+1 itself

108
00:07:53,680 --> 00:07:56,010
Put this on the other side

109
00:07:56,080 --> 00:08:02,610
You take the old Yn, the previous one, and to it you add h times An

110
00:08:02,680 --> 00:08:05,080
And what could you tell is An?

111
00:08:05,190 --> 00:08:08,700
Well the computer has to be told that An is the value of that

112
00:08:08,760 --> 00:08:12,330
So now, with that, let's actually write the Euler program

113
00:08:12,380 --> 00:08:19,090
Not the program, but the Euler method equations. Let's just call it the Euler equations

114
00:08:19,210 --> 00:08:20,430
What will they be?

115
00:08:20,500 --> 00:08:27,590
First of all, the new X is the old X plus h

116
00:08:27,660 --> 00:08:37,980
The new Y is just what I've written there, the old Y plus h times a certain number An (See the picture)

117
00:08:38,080 --> 00:08:44,590
And finally, An has the value..; it's the slope of the line element here

118
00:08:44,740 --> 00:08:50,990
And therefore by definition that's f(function) of Xn and Yn (See the picture)

119
00:08:51,120 --> 00:08:55,490
So it's these three equations which define Euler's method

120
00:08:55,590 --> 00:08:59,770
If I assume 100, surely you must be...

121
00:08:59,870 --> 00:09:02,560
To add some point

122
00:09:02,650 --> 00:09:07,820
As an exercise in the term you want to calculate...

123
00:09:07,960 --> 00:09:12,550
To program the computer in C or whatever you use Java(Programing language) now I guess

124
00:09:12,650 --> 00:09:19,280
To do Euler's method, these will be the recurs of the equations that you would put in to do that

125
00:09:19,450 --> 00:09:28,320
OK, let's try an example then

126
00:09:31,770 --> 00:09:33,930
Through the good color for Euler, well purple

127
00:09:34,020 --> 00:09:37,580
I assume nobody can see purple, is that correct?

128
00:09:37,680 --> 00:09:41,390
Can anyone at the back of the room see that's purple?

129
00:09:41,420 --> 00:09:48,140
What? OK, sit closer

130
00:09:51,750 --> 00:09:54,890
So let's calculate the example

131
00:09:54,960 --> 00:10:00,080
I'll use a simple example, but it's not entirely trivial

132
00:10:00,160 --> 00:10:01,920
My example is going to be the equation...

133
00:10:02,020 --> 00:10:05,160
x square minus y square on the right hand side

134
00:10:05,240 --> 00:10:10,270
and let us start with y of  zero equals 1 ,let's say

135
00:10:10,340 --> 00:10:16,050
This is my initial value problem, that pair of equations

136
00:10:16,140 --> 00:10:20,650
and I have to specify a step size , so let's

137
00:10:20,710 --> 00:10:23,780
take the step size to be 0.1  

138
00:10:23,870 --> 00:10:28,520
You choose the step size as the computer does, we have to talk about

139
00:10:28,580 --> 00:10:30,220
that in a few minutes

140
00:10:30,290 --> 00:10:35,390
Now what you do ,well, I say this is the nontrivial equation

141
00:10:35,450 --> 00:10:40,090
because this equation as far as I know can not be solved

142
00:10:40,160 --> 00:10:41,680
in terms of elementary functions

143
00:10:41,730 --> 00:10:46,280
so this equation will be in fact a very good candidate for numerical

144
00:10:46,320 --> 00:10:48,370
or numerical  method like Euler's

145
00:10:48,430 --> 00:10:52,910
And you had to use it or maybe  we see other ways around I forget on your problem

146
00:10:52,960 --> 00:11:00,960
said, you drew a picture of the direction field and answer some questions about the isoclines

147
00:11:01,010 --> 00:11:02,820
How the solutions behave

148
00:11:02,880 --> 00:11:05,580
All right ,now main things I want you to get

149
00:11:05,660 --> 00:11:09,430
is, this is not just for Euler's, talking about Euler's equations

150
00:11:09,520 --> 00:11:15,490
but in general, for the calculation you have to do in this course is extremely important

151
00:11:15,580 --> 00:11:19,190
to be systematic, because if you are not systematic, you know

152
00:11:19,270 --> 00:11:21,920
if you just scribble, scribble, scribble, scribble, scribble

153
00:11:22,030 --> 00:11:26,660
You can do the work, but it comes impossible to find mistakes

154
00:11:26,730 --> 00:11:30,610
You must do the work in the form in which you can check

155
00:11:30,670 --> 00:11:32,510
in which it can be checked

156
00:11:32,600 --> 00:11:36,320
which you can look over it and find and try to see where mistakes are

157
00:11:36,400 --> 00:11:38,340
if in fact there are any

158
00:11:38,430 --> 00:11:42,630
So I strongly suggest

159
00:11:42,740 --> 00:11:44,950
this is not a suggestion, it's a command

160
00:11:45,080 --> 00:11:48,840
that you make a little table

161
00:11:48,890 --> 00:11:50,510
to do Euler's method by hand

162
00:11:50,580 --> 00:11:52,340
I don't ask you for a step or two

163
00:11:52,390 --> 00:11:56,210
This is that I am just  trying to make sure you have some idea of

164
00:11:56,260 --> 00:11:57,960
these equations and where they come from

165
00:11:58,030 --> 00:12:01,760
So first the value of n

166
00:12:01,830 --> 00:12:03,470
then the value of x (sub)n

167
00:12:03,560 --> 00:12:05,650
then the value of y(sub) n

168
00:12:05,750 --> 00:12:11,570
and then a couple of more columns which tell you  what to calculate

169
00:12:11,660 --> 00:12:13,370
or how to do the calculation

170
00:12:13,420 --> 00:12:16,110
You are going to need the values of the slope

171
00:12:16,200 --> 00:12:20,370
and it is probably a good idea also

172
00:12:20,420 --> 00:12:24,380
because otherwise you forget it to put in h An

173
00:12:24,490 --> 00:12:28,080
because that occurs in the formula

174
00:12:28,130 --> 00:12:29,630
All right ,let's start doing it

175
00:12:29,700 --> 00:12:31,650
well the first value of n is 0

176
00:12:31,700 --> 00:12:33,490
that is the starting point

177
00:12:33,530 --> 00:12:35,350
at the starting point

178
00:12:35,410 --> 00:12:36,280
x (sub) 0, y (sub) 0

179
00:12:36,340 --> 00:12:39,170
x has the value of 0

180
00:12:39,180 --> 00:12:40,840
and y has the value of 1

181
00:12:40,920 --> 00:12:44,840
so 0 and 1

182
00:12:44,900 --> 00:12:45,690
In other words

183
00:12:45,790 --> 00:12:48,670
I am starting, I am carrying out

184
00:12:48,740 --> 00:12:51,640
exactly what I drew pictorially

185
00:12:51,670 --> 00:12:55,200
or now I am doing it mathematically using a table

186
00:12:55,240 --> 00:12:57,610
and substituting into the formulas

187
00:12:57,650 --> 00:13:00,830
Ok, the next thing we have to calculate is An

188
00:13:00,900 --> 00:13:06,310
well, that's ,since An is the value of the right hand side

189
00:13:06,380 --> 00:13:07,650
at the point (0,1)

190
00:13:07,720 --> 00:13:08,940
you have to put that in

191
00:13:09,020 --> 00:13:10,040
the right handside

192
00:13:10,090 --> 00:13:12,840
is x square minus y square

193
00:13:13,380 --> 00:13:16,230
so it is 0 square minus 1 square

194
00:13:16,600 --> 00:13:20,310
the value of the slope there is -1, negative 1

195
00:13:20,890 --> 00:13:23,070
now I have to multiply that by h

196
00:13:23,290 --> 00:13:27,150
h is 0.1 , so it's minus, sorry negative

197
00:13:27,730 --> 00:13:29,000
I never learned that

198
00:13:30,800 --> 00:13:32,170
The way you learned to talk in the kindergarten

199
00:13:32,300 --> 00:13:35,650
is the way you learned to talk the rest of your life unfortunately

200
00:13:36,560 --> 00:13:40,520
In kindergarten we said minus, oh, sorry

201
00:13:40,850 --> 00:13:42,460
negative 0.1

202
00:13:48,600 --> 00:13:51,460
It is 1 now  what is the value of Xn  

203
00:13:51,560 --> 00:13:55,890
well to the old one I add 1/10

204
00:13:55,990 --> 00:13:57,150
what is the value of y

205
00:13:57,230 --> 00:14:00,520
Well at this point you have to do the calculation

206
00:14:00,600 --> 00:14:04,420
it is the old value of y to get this new value

207
00:14:04,520 --> 00:14:08,530
it is the old value plus this number  well that is

208
00:14:08,570 --> 00:14:15,440
this plus that number is 9/10

209
00:14:15,510 --> 00:14:19,770
An now I have to calculate the new slope of this point

210
00:14:19,850 --> 00:14:25,940
ok that is  0.1 squared minus 0.9 squared

211
00:14:25,940 --> 00:14:34,240
that's 0.01 minus 0.81 which makes -0.80

212
00:14:34,290 --> 00:14:38,060
I hope

213
00:14:38,140 --> 00:14:40,410
Check it on your calculators

214
00:14:40,510 --> 00:14:43,160
with the mouse and press the buttons

215
00:14:43,210 --> 00:14:47,060
And now multiply that by h

216
00:14:47,120 --> 00:14:51,490
and which means it is going to be -0.08

217
00:14:51,570 --> 00:14:55,140
perhaps with 0 after  

218
00:14:55,220 --> 00:14:57,500
I didnot tell you how many decimal places

219
00:14:57,570 --> 00:15:00,730
let 's carry it out to 2 decimal places

220
00:15:00,820 --> 00:15:04,620
I think that will be good enough

221
00:15:04,670 --> 00:15:06,300
and finally the last step

222
00:15:06,360 --> 00:15:11,110
2 here add 1 add another 0.1 so the value of x is now 0.2

223
00:15:11,170 --> 00:15:15,600
and finally what is the value of y, y I did not tell you where to start

224
00:15:15,680 --> 00:15:19,510
let's start at y of point let's start y at point 2

225
00:15:19,620 --> 00:15:23,960
because there is no more room on the blackboard

226
00:15:24,060 --> 00:15:29,280
seems like an excellence about approximately how big is that in other words

227
00:15:29,330 --> 00:15:41,520
Then this is going to be, this, the old y plus this number which seems to be

228
00:15:41,610 --> 00:15:52,430
0.82 to me, so the answer is ,the new value is 0.82

229
00:15:52,880 --> 00:15:56,650
Ok, well we got a number,  we did what we were supposed to do, we got a number

230
00:15:56,730 --> 00:15:59,320
next question, well, I will ask you  a few questions,

231
00:15:59,370 --> 00:16:04,300
of what the most basic thing as you know ,how right is this

232
00:16:04,370 --> 00:16:12,750
how can I answer such a  question if I have no explicit formula for that solution

233
00:16:12,860 --> 00:16:18,870
that is the basic problem with numerical calculation

234
00:16:18,950 --> 00:16:22,050
In other words, I have to wander around in the dark to some extent, and yet

235
00:16:22,130 --> 00:16:27,070
have some idea when I arrive the place that I wanna go

236
00:16:27,110 --> 00:16:29,580
well the first question I would like to answer

237
00:16:29,650 --> 00:16:32,050
the question it is : is it too high or too low

238
00:16:32,120 --> 00:16:36,650
it is Euler, sorry, he will forgive me in heaven

239
00:16:36,710 --> 00:16:39,500
I will use him by this , I mean

240
00:16:39,610 --> 00:16:43,050
is the result ,well, let me say something first and then

241
00:16:43,120 --> 00:16:44,410
I will criticize it

242
00:16:44,460 --> 00:16:51,600
Is Euler too high or too low?

243
00:16:51,690 --> 00:16:54,740
In other words , is the result of using Euler's method

244
00:16:54,830 --> 00:16:58,110
I mean ,is this number too high or too low

245
00:16:58,150 --> 00:17:00,890
is it higher than the right answer what it should be

246
00:17:00,970 --> 00:17:06,660
or is it lower than the right answer or got exactly right

247
00:17:06,740 --> 00:17:12,490
it is almost that were exactly right that is not an option

248
00:17:12,610 --> 00:17:14,850
How we answer that question

249
00:17:14,950 --> 00:17:17,020
Well let's answer geometrically

250
00:17:17,190 --> 00:17:25,600
If basicly, if the solution were a line ,were a straight line

251
00:17:25,650 --> 00:17:32,320
then the Euler's method  would be exactly right all the time

252
00:17:32,520 --> 00:17:35,520
but it is not a line, it is a curve ,well

253
00:17:35,600 --> 00:17:38,460
the critical question is

254
00:17:38,570 --> 00:17:41,440
is the curve , is the solution ,so here is the solution

255
00:17:41,550 --> 00:17:43,590
let's call it y1 of x

256
00:17:43,710 --> 00:17:46,460
let's say here with the starting point

257
00:17:46,500 --> 00:17:50,210
here the solution is convex

258
00:17:50,230 --> 00:17:57,000
and here the solution is concave

259
00:17:57,050 --> 00:18:00,600
right? convex up, concave down if you learn those words

260
00:18:00,710 --> 00:18:05,270
I think those by now I hope pretty well disappear from the curriculum

261
00:18:05,340 --> 00:18:10,330
call it if you have up to now what mathematicians call it convex is that, and the other one is concave

262
00:18:10,400 --> 00:18:16,910
Well how do the Euler's solutions look, well I just sketch  I think from this you can see

263
00:18:16,990 --> 00:18:22,220
already, when you start out on the Euler's solutions, it is gonna go like that,

264
00:18:22,310 --> 00:18:27,640
now you are too low, well let's suppose after that the line element here

265
00:18:27,730 --> 00:18:31,160
is approximately the same as what it is there

266
00:18:31,260 --> 00:18:35,110
you know roughly parallel after all they are not too far apart

267
00:18:35,190 --> 00:18:39,980
and the direction field  is gonna continue, the direction do not change drastically

268
00:18:40,070 --> 00:18:41,480
from one point to another  

269
00:18:41,550 --> 00:18:50,230
Well, then a little sort of ,but now you see it is still too low ,it is even lower as it pathetically try to follow

270
00:18:50,330 --> 00:18:54,720
it is loosing territory, and that is basically because the curve is convex

271
00:18:54,780 --> 00:18:59,080
Exactly the opposite would happen if the curve were concave, if the solution curve

272
00:18:59,150 --> 00:19:00,070
were concave.

273
00:19:00,130 --> 00:19:07,040
Now it is too high, and  it is not going to be able to correct that as long as the solution curve stays concave

274
00:19:07,100 --> 00:19:15,100
While, let's probably too optimistic, it is probably more like this.

275
00:19:15,230 --> 00:19:20,490
So in other words,  in this case, if the curve is convex, the Euler's (solution) is going to be too high

276
00:19:20,580 --> 00:19:23,390
oh, sorry, too low

277
00:19:27,970 --> 00:19:31,850
let's put E for Euler, how about that, Euler is too low

278
00:19:31,940 --> 00:19:36,370
If it is concave, then Euler is too high.

279
00:19:37,260 --> 00:19:39,740
Ok, that is great!

280
00:19:39,840 --> 00:19:45,700
There is just one little problem left, mainly

281
00:19:45,810 --> 00:19:47,030
If we do not have a formula for the solution

282
00:19:47,110 --> 00:19:50,240
and we do not have a computer this busy drawing the picture for us

283
00:19:50,390 --> 00:19:52,880
in which case we wouldn't need any of these anyway

284
00:19:52,950 --> 00:19:59,300
how will us possibly to tell it's convex or concave?

285
00:19:59,380 --> 00:20:04,950
Ah. Back to calculus. Calculus to the rescue

286
00:20:05,040 --> 00:20:07,290
When is a curve convex?

287
00:20:07,410 --> 00:20:14,620
A curve is convex when its second derivative is positive

288
00:20:14,690 --> 00:20:19,090
because to be convex means the first derivative is increasing all the time

289
00:20:19,180 --> 00:20:26,850
and therefore the second derivative, which is the derivative of the first derivative, should be positive

290
00:20:26,910 --> 00:20:32,570
Just the opposite here, the curve, the slope, the first derivative is decreasing all the time

291
00:20:32,660 --> 00:20:35,310
and therefore the second derivative is negative

292
00:20:35,420 --> 00:20:42,320
So all we have to do is to decide what the derivative, the second derivative of the solution is

293
00:20:42,390 --> 00:20:47,380
We should probably call the solution to y(x) a little to ?

294
00:20:47,510 --> 00:20:50,890
Y1 means the solution is started at this point

295
00:20:50,990 --> 00:20:57,830
So in fact probably it would've been better from the beginning to call that Y1 except there is no room

296
00:20:58,090 --> 00:21:03,460
Y1 let's say. That means the solution which started out at the point (0,1)

297
00:21:03,550 --> 00:21:05,660
So I'm still talking about the solution like that

298
00:21:05,780 --> 00:21:13,400
All right. So I wanna know if this (the second derivative) is positive at the starting point 0 or it's negative

299
00:21:13,490 --> 00:21:19,670
Now, again, how do you calculate the second derivative if you don't know what the solution is explicitly

300
00:21:19,760 --> 00:21:26,390
And the answer is you can do it from the differential equation itself

301
00:21:27,770 --> 00:21:32,490
How I do that? Well, easy, Y' equals X squared minus Y squared

302
00:21:32,590 --> 00:21:41,770
OK, that tells me how to calculate Y' if I know the value of X and Y, in other words, the point (0,1)

303
00:21:41,840 --> 00:21:45,310
What would be the value of Y''?

304
00:21:45,310 --> 00:21:47,100
Well, differentiate the equation.

305
00:21:47,170 --> 00:21:54,100
It's 2x-2yy'. Don't forget to use the chain rule

306
00:21:54,190 --> 00:22:00,820
So, if I want to calculate at (0,1)

307
00:22:02,200 --> 00:22:06,630
in other words my starting point is that curve convex or concave

308
00:22:06,720 --> 00:22:10,790
Well, lets calculate Y(0)=1

309
00:22:11,700 --> 00:22:15,930
OK, what's Y'(0), well, I don't have to repeat that calculation

310
00:22:16,000 --> 00:22:19,050
using this, I already calculated that it's -1

311
00:22:19,060 --> 00:22:23,600
Now the new thing is what's Y''(0)

312
00:22:23,670 --> 00:22:35,180
Well, it is this. I'll write it out. It's 2 times 0, minus 2 times Y which is 1

313
00:22:35,260 --> 00:22:40,590
times Y' which is -1

314
00:22:40,650 --> 00:22:45,490
You are to see we are pulling ourselves up on a bull's stripes which is impossible, but it is not impossible because we're doing it

315
00:22:45,570 --> 00:22:54,590
So what's the answer? 0 here... 2

316
00:22:54,690 --> 00:22:59,670
I've calculated without having the foggiest idea what the solution is or how it looks

317
00:22:59,750 --> 00:23:04,640
I've calculated that its second derivative at the starting point is 2

318
00:23:04,650 --> 00:23:08,810
therefore my solution is convex at the starting point

319
00:23:08,880 --> 00:23:14,950
and therefore this Euler approximation, if I don't carry it out too far, will be too low

320
00:23:15,010 --> 00:23:21,940
So, it's convex, Euler too low

321
00:23:27,630 --> 00:23:35,530
Now you could all hear(--------). What about this? You know, suppose it..

322
00:23:39,770 --> 00:23:49,690
So you go like this, then see, it catches up. Well, of course the curve changes from convex to concave

323
00:23:49,800 --> 00:23:56,630
Then it's really impossible to make any prediction at all. That's a difficulty

324
00:23:56,730 --> 00:24:01,760
So, all these analysis is only if you stay very nearby

325
00:24:02,060 --> 00:24:07,970
However, I wanted to show you, the main purpose in my mind was to show you

326
00:24:08,080 --> 00:24:17,240
how to use the differential equation itself to get information about the solutions

327
00:24:17,340 --> 00:24:21,510
without actually being able to calculate the solutions

328
00:24:23,100 --> 00:24:27,460
Now, so that's the method and that's how to find out something about it

329
00:24:27,540 --> 00:24:34,130
Now what I'd like to talk about is errors. How do I handle...

330
00:24:41,140 --> 00:24:45,370
So I mean that's now in a sense I've started the error in analysis

331
00:24:45,490 --> 00:24:50,750
In other words, the error, by definition, the error is this difference, e.

332
00:24:51,260 --> 00:24:58,430
So in other words, I'm asking here is the error positive

333
00:24:56,500 --> 00:25:01,590
as it would be... it depends on which way you measure. Usually you take this minus that

334
00:25:01,680 --> 00:25:07,680
So here the error would be considered positive and here it would be considered negative

335
00:25:07,730 --> 00:25:12,210
although I'm sure there is a book somewhere in the world which does the opposite

336
00:25:12,320 --> 00:25:22,960
Most ----------- producing answers which are too low or too high

337
00:25:23,050 --> 00:25:35,430
The question then is, naturally, this is not the world's best method

338
00:25:35,530 --> 00:25:39,760
It's not as bad as it seems. It's not the world's best method because

339
00:25:39,850 --> 00:25:47,790
that convexity and concavity means that you're automatically introducing a systematic error

340
00:25:47,870 --> 00:25:52,210
If you can project which way the error is going to be by just knowing whether the curve is convex or concave

341
00:25:52,290 --> 00:26:02,080
then.. it's not what you want, I mean, you want to at least have a chance of getting the right answer

342
00:26:02,150 --> 00:26:06,660
whereas this is telling you are definitely gonna get a wrong answer. All it tells you is

343
00:26:06,720 --> 00:26:10,770
and it's telling you because your answer is gotta be too high or too low

344
00:26:10,850 --> 00:26:12,920
We'd like a better chance of getting the right answer

345
00:26:13,010 --> 00:26:19,310
Now.. so the question is how do you get a better method

346
00:26:22,990 --> 00:26:26,690
A search for a better method

347
00:26:28,190 --> 00:26:43,650
Now, the first method which will occur, I'm sure, to anyone who looks at that picture, is look if you want the yellow line to follow the white one

348
00:26:43,660 --> 00:26:48,380
The right solutions more accurately, for heaven’s sake don’t take such big steps

349
00:26:48,460 --> 00:26:52,610
Take small steps and that will follow better. All right, let's draw a picture

350
00:26:54,470 --> 00:27:00,970
Excuse me.. My little box of treasure is here...

351
00:27:13,090 --> 00:27:23,550
So, use a smaller step size. And the picture roughly which is going to justify that will look like this

352
00:27:24,750 --> 00:27:34,230
If the solution curve looks like this, then with a big step size, I'm able to have something looking like that

353
00:27:34,350 --> 00:27:41,730
But if I take a smaller step size, suppose I halve the step size, how is it going to look like then?

354
00:27:41,790 --> 00:27:44,010
Well I'd better switch to a different color

355
00:27:44,080 --> 00:27:53,150
If I halve the step size, I'll get a littler goes like that, and now it's following closer

356
00:27:53,230 --> 00:28:00,070
Of course I'm stacking the depth(??) but see how close it follows

357
00:28:00,170 --> 00:28:03,870
I'm definitely not to be trusted on this, but...

358
00:28:03,940 --> 00:28:10,500
Ok, let do the opposite, make really big steps. Suppose instead of the yellow ones I use the green one, well, a doubled step size

359
00:28:10,560 --> 00:28:17,340
What would happen then? I've started up and I'll go all the way there. And now on my way up

360
00:28:17,420 --> 00:28:23,010
of course it has a little further to go but for some reason I'd stop there

361
00:28:23,060 --> 00:28:25,450
You can see I will be still lower

362
00:28:25,500 --> 00:28:30,090
In other words, the bigger the step size, the more the error

363
00:28:30,090 --> 00:28:37,320
And where's the error we're talking about? Well, the way to think of the error.. this is the error

364
00:28:41,530 --> 00:28:48,490
You can make it positive, negative or just put it automatically in absolute value--sign around here is not so important

365
00:28:48,580 --> 00:29:01,980
So in other words the conclusion is, that the error e, the difference between the true value that I should have gotten and the Euler value that the calculation produce

366
00:29:02,060 --> 00:29:14,110
The error e depends on the step size. Now, how does it depend on the step size?

367
00:29:14,160 --> 00:29:23,660
Well, it's impossible to give an exact formula but there is an approximate answer which is by and large true

368
00:29:23,690 --> 00:29:36,950
And the answer is.. So e is going to be a function of h. What function? Well "~" which means in other way we'd put quotation marks aroud what I say

369
00:29:37,870 --> 00:29:41,660
It's going to be a constant, some constant times h

370
00:29:42,990 --> 00:29:50,540
(Clap,Clap,"Don't be late.""You, pretty boy.")

371
00:29:57,410 --> 00:29:59,930
No body else take care

372
00:30:11,210 --> 00:30:17,430
It looks like this, and for this reason, it's called the first order

373
00:30:18,220 --> 00:30:21,210
the Euler is the first order method

374
00:30:21,500 --> 00:30:33,060
And now first order does not refer to the first order of the differential equation  

375
00:30:33,060 --> 00:30:38,190
it's that not use the word first, it's not the first order because y'=f(x,y)

376
00:30:38,270 --> 00:30:45,110
The first order means the fact the e-ch curves to the first power

377
00:30:45,180 --> 00:30:52,300
The way people usually state this is since the normal way of decreasing this step size, as you see

378
00:30:52,380 --> 00:30:58,330
is through your trying to use the computer visual or to deals with Euler's method which I highly recommend by the way

379
00:30:58,430 --> 00:31:02,110
so highly recommend it that you have to do it

380
00:31:02,200 --> 00:31:14,070
Ah is, is that the way to say since you count------ each new step halve the step size. That's the usual way to do it

381
00:31:14,170 --> 00:31:18,380
or if you halve the step size

382
00:31:23,810 --> 00:31:33,130
since this is constant, by halving the step size I halve the error, approximately

383
00:31:34,790 --> 00:31:37,140
Halve the step size, halve the error

384
00:31:37,270 --> 00:31:44,700
that tells you how the error varies with step size for Euler's method

385
00:31:44,780 --> 00:31:55,560
Ah, please understand that's what people say and please understand the grammatical construction

386
00:31:55,630 --> 00:32:02,160
Ah, since everyone in the math's department has a cold these days, except for me for the moment

387
00:32:02,220 --> 00:32:10,090
Ah, everyone goes around chancing this mantra ,this is totally irrelevant

388
00:32:10,190 --> 00:32:19,280
Ah, told mantra you know, physical starts a fever

389
00:32:19,360 --> 00:32:24,220
and if you ask what it means, they say it means, you know

390
00:32:24,270 --> 00:32:29,220
eat a lot if you have a cold and if you have a fever, don't eat very much

391
00:32:29,270 --> 00:32:31,820
which is not what it means at all

392
00:32:31,880 --> 00:32:43,260
Grammatically it's exactly the same construction as this. Halve this...what this means is if you halve the step size, you will halve the error

393
00:32:45,290 --> 00:32:48,110
And that's what the physical starts a fever means and remember this for the rest of your life

394
00:32:48,220 --> 00:32:51,520
If you feed a cold, if you eat too much when you have a cold

395
00:32:51,590 --> 00:32:56,150
you will get a fever and end up starting having a starve

396
00:32:56,220 --> 00:33:02,540
you starve yourself because, of course, nobody, when he has a fever, nobody feels like eating things, they don't eat anything

397
00:33:02,590 --> 00:33:08,920
All right, you got that? You got that. Good

398
00:33:08,920 --> 00:33:13,220
Good, there you go

399
00:33:13,820 --> 00:33:20,200
I want all of you to go home and tell that to your mothers

400
00:33:23,810 --> 00:33:26,580
Ah, you know, that's the way we always use to sit back, you know

401
00:33:26,920 --> 00:33:30,490
the grimmer ones spare the rod and spoil the child

402
00:33:30,570 --> 00:33:34,940
that does not means you should not hit your kid and

403
00:33:35,070 --> 00:33:42,060
that means, that means if you fail to hit your kid, ah he or she will be spoiled

404
00:33:42,140 --> 00:33:46,570
Whatever that means? So you don't want to do that

405
00:33:46,650 --> 00:33:58,090
I guess some mantra today will be...I don't know

406
00:33:58,160 --> 00:34:03,960
Ok, so the first line of the defense is simply to

407
00:34:04,020 --> 00:34:08,720
ah, keep halving the step size in Euler, what people do is

408
00:34:08,780 --> 00:34:12,290
if they don't want to use something better than Euler's method

409
00:34:12,350 --> 00:34:17,910
is you keep halving the step size until the curve doesn't seem to change any more

410
00:34:18,000 --> 00:34:21,500
and then you say, " Well, that must be the solution."

411
00:34:21,570 --> 00:34:30,860
And I ask you on the problem, say, how much would you could continue to have to halve the step size in order for that good thing to happen

412
00:34:30,940 --> 00:34:36,840
However there are more efficient methods, which get the results faster

413
00:34:36,890 --> 00:34:44,520
and so if that's our good method, let's call this our better, a still better method

414
00:34:44,560 --> 00:34:54,000
the better methods, aimed at being better, they keep the same idea as Euler's method, but they say,

415
00:34:54,060 --> 00:34:58,300
look, let's try to improve that slow Bn (bayAn)

416
00:34:58,370 --> 00:35:01,190
In other words, since the slow Bn (bay An)

417
00:35:01,270 --> 00:35:06,750
that we start with is guaranteed to be wrong if the curve is convex or concave

418
00:35:06,810 --> 00:35:12,700
can we somehow correct it, so that, for example instead of ,ah, immediately aiming there

419
00:35:12,760 --> 00:35:19,230
can we somehow aim it so that by luck we just, at the next step, just land this back on the curve again

420
00:35:19,300 --> 00:35:26,760
In other words we're still looking for the short path, a short cut path which by good luck will end up with us back on the curve again

421
00:35:26,850 --> 00:35:30,830
And all the improvements, the simple improvements on Euler's method

422
00:35:30,890 --> 00:35:36,440
that is, they are the most stable in a way to do, solve differential equations numerically

423
00:35:36,510 --> 00:35:39,520
aiming at finding a better slope

424
00:35:40,390 --> 00:35:51,890
So they find a better value for a, a better slope, find a better value, a better value than An

425
00:35:52,000 --> 00:35:54,440
Try to improve that slope that you've found

426
00:35:54,510 --> 00:35:58,400
Now once you have the idea you should look for a better slope

427
00:35:58,450 --> 00:36:02,680
ah, it's not very difficult to see what in fact you should try

428
00:36:02,770 --> 00:36:08,260
Again I think most of you would say: "Hey, I would have thought of that!"

429
00:36:08,330 --> 00:36:13,440
And you will be closer in time since these methods were only found about, maybe

430
00:36:13,510 --> 00:36:20,220
hundred, around turn of the last century is when I placed them

431
00:36:20,290 --> 00:36:24,750
mostly by some Germen mathematicians interested in solving equations numerically

432
00:36:24,820 --> 00:36:32,350
All right, so what is the better method? Our better slope? What should we look for in our better slope?

433
00:36:32,430 --> 00:36:37,070
Well, the simplest procedure is once again we're starting from there

434
00:36:37,150 --> 00:36:42,470
and the Euler's slope would be the same as the line element

435
00:36:42,520 --> 00:36:52,490
So it's a, the line element looks like this, and our yellow slope An and so we'll continue to call it An goes like that, gets to here

436
00:36:52,580 --> 00:36:57,560
Ok, now if we convex, the curve were convex, this would be too low

437
00:36:57,630 --> 00:37:01,620
and there for the next step, would be

438
00:37:01,700 --> 00:37:04,660
and I'm going to draw the next step in pinks(color)

439
00:37:04,720 --> 00:37:11,450
Well, now let's continue it now here, would be going up like that

440
00:37:11,530 --> 00:37:20,150
I call this Bn just because it's the next step of Euler's method that it could be called An

441
00:37:20,220 --> 00:37:21,550
Try with something like that, but this will do

442
00:37:21,600 --> 00:37:26,290
And now what you do is, let me put an arrow on it to indicate parallelness

443
00:37:26,360 --> 00:37:34,200
go back to the beginning, draw this parallel to Bn, so here is Bn again

444
00:37:34,270 --> 00:37:45,070
just a line of slope, that same slope, and now what you should use as a simplest improvement on Euler's method is take the average of these two

445
00:37:45,130 --> 00:37:48,990
because that's more likely to hit the curve than An will

446
00:37:49,070 --> 00:37:55,460
which is sure to be too low if the curve is convex. In other words, use this instead, use that

447
00:37:56,520 --> 00:38:00,490
So this is our better slope

448
00:38:04,730 --> 00:38:07,860
Ok, what we will call that slope would be what we call anything

449
00:38:07,930 --> 00:38:11,770
What are the equations for the Method B?

450
00:38:11,860 --> 00:38:21,350
Well, Xn+1 is done by adding the step size, so here is my step size just as it was before

451
00:38:21,440 --> 00:38:25,830
just as it was before, the new thing is how to get the new value of Y

452
00:38:25,900 --> 00:38:34,940
so Yn+1 should be the old Yn plus h times, not this crummy slope An

453
00:38:35,040 --> 00:38:38,280
but the better, the pink slope

454
00:38:38,380 --> 00:38:41,110
What's the formula for the pink's slope? Well, let's do it in two steps

455
00:38:41,160 --> 00:38:47,500
It's the average of An and Bn

456
00:38:47,590 --> 00:38:51,300
hey, but you didn't tell me, all right, tell me what Bn was

457
00:38:51,350 --> 00:38:54,800
So you now must tell the computer, oh, yes by the way

458
00:38:54,850 --> 00:38:58,100
you remember that An was what it always was

459
00:38:58,160 --> 00:39:00,520
the interesting thing is what is Bn

460
00:39:00,570 --> 00:39:08,010
Well, to get Bn, Bn is the slope of the line element at this new point

461
00:39:08,060 --> 00:39:09,360
And what I might get to call that new point?

462
00:39:09,420 --> 00:39:17,380
I don't want to call this Y value ,Yn+1, because that's it's this appears this is going to be Yn+1

463
00:39:17,460 --> 00:39:23,370
All this is a temporary value used to make another calculation

464
00:39:23,410 --> 00:39:28,860
which will then be combined with the previous calculations to get the right value

465
00:39:28,910 --> 00:39:33,280
Therefore, give it a temporary name

466
00:00:00,000 --> 00:39:42,320
that point we'll call it, it's not going be the final the real Yn+1, we'll call it Yn+1 twiddles, Yn+1 temporary

467
00:39:42,410 --> 00:39:44,450
Ah, and what 's the formula for?

468
00:39:44,540 --> 00:39:52,240
Well, it's just going to be what the Euler formula, original Euler formula, it's going to be Yn plus what you would have got if you calculated

469
00:39:52,310 --> 00:39:57,740
In other words, it's the point that the Euler's method produced

470
00:39:57,820 --> 00:40:02,020
ah ,but it's not finally the point that we want

471
00:40:02,100 --> 00:40:04,560
Now do I have to say anything else

472
00:40:04,620 --> 00:40:07,690
Um...yeah I didn't tell the computer what Bn was...

473
00:40:07,750 --> 00:40:18,670
O.K. Bn is the slope of the direction feel x the point n plus 1 and the computer knows what that is

474
00:40:18,730 --> 00:40:26,500
and this point yn+1 temporary  

475
00:40:27,570 --> 00:40:42,400
So you make a temporary choice of this, calculate that number and then go back and as we've corrected that value to this value by using this better slope

476
00:40:42,820 --> 00:40:47,140
Now, that's all there is to the method except that i didn't give you its name

477
00:40:47,210 --> 00:40:50,760
Well, it has three names, four names in fact

478
00:40:50,850 --> 00:40:53,980
Which one should I give you?

479
00:40:54,040 --> 00:40:56,580
Um...I don't care

480
00:40:56,660 --> 00:41:05,010
O.K. if you the shortest name is Heuns Method but nobody knows pronounce that correctly

481
00:41:05,090 --> 00:41:15,230
So Heun's method um...it's called also the improved Euler Method

482
00:41:15,330 --> 00:41:22,930
it's called Modified Euler ...very expressive word

483
00:41:23,030 --> 00:41:29,470
Modified Euler Method and it's also called RK2

484
00:41:29,560 --> 00:41:37,300
I'm sure you like that name best. It has a star war sort of sound to it

485
00:41:37,390 --> 00:41:40,640
RK stands for  Runge-Kutta

486
00:41:40,720 --> 00:41:48,080
and the reason for the 2 is not that it uses 2...well, it is that it uses 2 slopes

487
00:41:48,160 --> 00:41:52,460
but the real reason for the 2 is that...it's a second order method

488
00:41:52,550 --> 00:41:56,680
so let's...that's the most important to put down about it

489
00:41:56,740 --> 00:42:01,690
it's a second order method where the Euler's was only a first order method so this is a...

490
00:42:01,760 --> 00:42:06,980
so one is method or RK2. it's right it's the shortest thing to write

491
00:42:07,040 --> 00:42:25,280
it's the second order method meaning that the error varies with the step sides like sometimes it won't be the same with the constant of Euler's  method times h squared

492
00:42:25,420 --> 00:42:35,580
that's a big saving because it now means that if you have the step size, you are going to decrease the error by a facture one quater

493
00:42:35,650 --> 00:42:40,220
you will quarter the error

494
00:42:40,280 --> 00:42:44,070
now you say hey great why should anyone use anything else

495
00:42:44,130 --> 00:42:46,420
well, think a little second.

496
00:42:46,480 --> 00:42:51,590
the real thing we should determine how slowly one of these methods run is

497
00:42:51,680 --> 00:42:57,530
you look at the hardest step of the method and ask how long does the computer take

498
00:42:57,530 --> 00:42:59,380
how many of those hardest steps are there

499
00:42:59,450 --> 00:43:07,310
now the answer is the hardest step is always the evaluation of the slope, the evaluation of the function

500
00:43:07,400 --> 00:43:12,090
because you know the functions that are in common use are not  x2-y2

501
00:43:12,170 --> 00:43:18,080
they take half a page and have its coefficient, you know, 10 digital numbers

502
00:43:18,150 --> 00:43:24,890
whatever the guy, the engineers doing it, you know, whatever  they actually see was

503
00:43:25,000 --> 00:43:33,510
so the thing that controls how long a method runs is how many times the slope of the function must be evaluated

504
00:43:33,620 --> 00:43:37,470
for Euler, I only have to evaluate it once

505
00:43:37,580 --> 00:43:44,390
here I have to evaluate it twice

506
00:43:44,610 --> 00:43:52,390
now roughly speaking, the number of function evaluations, will, each will give you the exponent

507
00:43:52,480 --> 00:43:59,420
the method this called run a cut of 4th order will require four evaluations of slope

508
00:43:59,500 --> 00:44:03,360
but the accuracy will be like h to the 4th

509
00:44:03,430 --> 00:44:08,890
very accurate, you have to step size and it goes down by a factor 16

510
00:44:08,940 --> 00:44:14,590
Great, but you have to do it 4th, you have to evaluate the slope 4 times

511
00:44:14,690 --> 00:44:25,460
supposing instead you had halved 4 times this thing, in, what would you have done

512
00:44:25,460 --> 00:44:28,830
you would decrease it one 16th to what it was

513
00:44:28,910 --> 00:44:37,130
you still, you would increase the number of function's evaluations you needed to 4

514
00:44:37,190 --> 00:44:41,090
and you would decrease the error by 16th

515
00:44:41,170 --> 00:44:48,910
so in some sense it really doesn't matter whether use a very fancy method which require more function's evaluation

516
00:44:48,990 --> 00:44:52,640
that's true the error goes down faster which you having to do more work to get it

517
00:44:52,700 --> 00:44:56,500
so anyway nothing is free

518
00:44:56,570 --> 00:45:04,600
For I think I will skip that since I wouldn't ask you any questions about it

519
00:45:04,660 --> 00:45:07,560
But let me, I just mention early

520
00:45:07,620 --> 00:45:14,730
Because it's...See, standard. It uses 4 valuation. It's a standard method

521
00:45:14,810 --> 00:45:19,830
If you don't want do anything fancier, It's rather inefficient

522
00:45:19,880 --> 00:45:21,570
But it's very accurate

523
00:45:21,640 --> 00:45:25,670
Standard method, accurate

524
00:45:25,750 --> 00:45:29,480
And you see when you use the programs

525
00:45:29,570 --> 00:45:33,970
It's in fact, the program which is drawing those curves in numerical method

526
00:45:34,030 --> 00:45:40,070
which draws all those curves that you believe in, on the computer screen

527
00:45:40,120 --> 00:45:44,360
Is the RK4 method--the Runge-Kutta I should've given you names

528
00:45:44,440 --> 00:45:47,600
Runge-Kutta 4th order method

529
00:45:50,010 --> 00:45:52,340
Two mathematicians

530
00:45:52,450 --> 00:45:55,980
I believe both German mathematicians around the turn of the last century

531
00:45:56,050 --> 00:46:00,540
Runge-Kutta 4th order method

532
00:46:00,620 --> 00:46:08,080
Requires 4 slopes. Require you should calculate 4 slopes

533
00:46:08,140 --> 00:46:10,250
I won't, but I tell you what you do

534
00:46:10,310 --> 00:46:12,760
But it's procedure like that it's just a little more elaborate

535
00:46:12,800 --> 00:46:18,730
And you take 2 of these, you make up a weighted average for the super slope

536
00:46:18,800 --> 00:46:23,200
Use, weighted average. What should I divide that by?

537
00:46:23,270 --> 00:46:27,000
To get the right, 6

538
00:46:27,060 --> 00:46:30,430
Why 6? Well because all these number were the same

539
00:46:30,470 --> 00:46:34,800
I want to come out to be whatever that common value was

540
00:46:34,850 --> 00:46:37,030
You always must divide by...

541
00:46:37,080 --> 00:46:40,060
In the weighted average you must always divide by the sum of these coefficients

542
00:46:40,110 --> 00:46:45,240
So this is a super slope

543
00:46:45,300 --> 00:46:50,280
And if you plot that super slope into here

544
00:46:50,350 --> 00:46:54,410
You will be using the Runge-Kutta method in getting the best possible result

545
00:46:54,470 --> 00:46:57,920
Now I want to spend the last 3 minutes talking about

546
00:46:58,000 --> 00:47:03,720
Pitfalls in numerical computation in general

547
00:47:03,790 --> 00:47:09,250
One pitfall I'm leaving you on the homework to discover for yourself

548
00:47:09,330 --> 00:47:11,300
Don't worry, it won't cost you any grief

549
00:47:11,350 --> 00:47:16,970
Just... It'll just destroy your face in these things for the rest of your life

550
00:47:17,080 --> 00:47:19,040
Which is probably a good thing

551
00:47:19,140 --> 00:47:24,200
So pitfalls

552
00:47:24,320 --> 00:47:30,520
Number 1: You'll find

553
00:47:30,640 --> 00:47:34,090
Let me talk instead briefly about number 2

554
00:47:34,200 --> 00:47:36,490
Which I'm not giving you an exercise in

555
00:47:36,580 --> 00:47:41,890
Number 2 is illustrated by the following equation

556
00:47:42,010 --> 00:47:44,510
What could be simpler?

557
00:47:44,600 --> 00:47:48,670
This is a very bad equation to try to solve numerically

558
00:47:48,750 --> 00:47:53,150
Now why? Well because if I separate variables

559
00:47:53,220 --> 00:47:57,050
Ur why don't I save a little time? I'll just tell you what the solution is, OK?

560
00:47:57,130 --> 00:48:00,480
You'll obviously separate variable, maybe can do it within your head

561
00:48:01,410 --> 00:48:04,610
The solution will be. The solution will have an arbitrary constant

562
00:48:04,690 --> 00:48:10,370
And they won't very complicated, they will be 1/(C-X)

563
00:48:10,430 --> 00:48:14,240
C is an arbitrary constant, and as you give different value you should get (different solutions)

564
00:48:14,320 --> 00:48:16,010
And what were those guys look like?

565
00:48:16,080 --> 00:48:23,020
OK, so here I am. I start out at point 1. And I start out...

566
00:48:23,100 --> 00:48:27,080
I tell the computer compute for me the value of the solution at 1

567
00:48:27,150 --> 00:48:31,210
Starting off at 1, and it computes a little while

568
00:48:31,300 --> 00:48:34,480
But the solution... How does this curve actually look?

569
00:48:34,550 --> 00:48:40,960
So in other words suppose I say that Y(0) =1, find me Y(2)

570
00:48:41,040 --> 00:48:46,170
In other words, take a nice small step size, use Runge-Kutta 4th order method

571
00:48:46,260 --> 00:48:48,470
Calculate a little bit, and tell me...

572
00:48:48,550 --> 00:48:51,930
I just want to know what Y(2) is

573
00:48:51,930 --> 00:48:53,290
Well, what is Y(2)?

574
00:48:53,350 --> 00:48:55,750
Oh no, unfortunately how does that curve look?

575
00:48:55,810 --> 00:49:01,110
The curve looks like this

576
00:49:01,190 --> 00:49:04,810
As that point drop to infinity, in a manner of speaking

577
00:49:04,890 --> 00:49:09,390
And then sort to come up again like that

578
00:49:09,470 --> 00:49:11,200
It should come back again like that

579
00:49:11,260 --> 00:49:14,270
What is the value of Y? This is point 1

580
00:49:14,350 --> 00:49:18,720
What is the value of Y(2)? Is it here? Is it this?

581
00:49:18,790 --> 00:49:23,990
Well, I don't know. But I do know that the computer will not find it

582
00:49:24,060 --> 00:49:28,360
The computer will solve this along, and get lost in eternity, in infinity

583
00:49:28,430 --> 00:49:34,900
And see no reason whatever y(x) should start again on this branch of the curve

584
00:49:34,960 --> 00:49:39,480
OK, well, we should... How we predict that's going to happen somehow

585
00:49:39,550 --> 00:49:41,810
You know avoid what I should...

586
00:49:41,870 --> 00:49:48,820
You know, the whole difficulty is.. This is called a singular point

587
00:49:48,900 --> 00:49:53,950
This solution has a singularity, in other words a place where goes to infinity

588
00:49:54,030 --> 00:49:57,250
Will become discontinuous, maybe as a jump discontinuity

589
00:49:57,310 --> 00:50:04,650
It has a singularity at X=C. This in particular I add X=1 here

590
00:50:04,750 --> 00:50:08,990
But from the differential equation there is... Where is that C?

591
00:50:09,070 --> 00:50:10,600
There is no way of predicting it

592
00:50:10,670 --> 00:50:17,370
Each solution, in other words, to the differential equation, has it's own private singularity

593
00:50:17,450 --> 00:50:21,140
Which only it knows about and where it's going to blow up

594
00:50:21,210 --> 00:50:25,580
And there is no way to tell from the differential equation, where that's going to be

595
00:50:25,660 --> 00:50:30,850
That's one of the things that make numerical calculation difficult

596
00:50:30,950 --> 00:50:36,550
When you can not predict where things are going to go bad in advance



Last Modified 10/26/05 1:17 AM

Hide Tools