1
00:00:00 --> 00:00:01
2
00:00:01 --> 00:00:02
The following content is
provided under a Creative
3
00:00:02 --> 00:00:03
Commons license.
4
00:00:03 --> 00:00:06
Your support will help MIT
OpenCourseWare continue to
5
00:00:06 --> 00:00:09
offer high-quality educational
resources for free.
6
00:00:09 --> 00:00:12
To make a donation, or to view
additional materials from
7
00:00:12 --> 00:00:16
hundreds of MIT courses, if
visit MIT OpenCourseWare
8
00:00:16 --> 00:00:20
at ocw.mit.edu.
9
00:00:20 --> 00:00:23
PROFESSOR STRANG: So this
is review session number
10
00:00:23 --> 00:00:26
five, I guess it is.
11
00:00:26 --> 00:00:31
And it comes before an exam
next Tuesday, and actually
12
00:00:31 --> 00:00:38
there'll be a further review
session number six on Monday,
13
00:00:38 --> 00:00:40
right before the exam.
14
00:00:40 --> 00:00:48
So maybe today we would,
there's a homework problem set
15
00:00:48 --> 00:00:56
on Chapter 2, mostly the
oscillating masses and springs
16
00:00:56 --> 00:01:08
and today's lecture that you
see traces of, networks.
17
00:01:08 --> 00:01:12
And masses and springs
also this Saturday case.
18
00:01:12 --> 00:01:15
So I'm open as always
to questions.
19
00:01:15 --> 00:01:17
Yes please, thank you?
20
00:01:17 --> 00:01:19
AUDIENCE: 2.2 number 6.
21
00:01:19 --> 00:01:24
PROFESSOR STRANG:
2.2, number six.
22
00:01:24 --> 00:01:24
OK.
23
00:01:24 --> 00:01:25
Yeah.
24
00:01:25 --> 00:01:31
So this is, and of course
you understand that, so
25
00:01:31 --> 00:01:34
I'm happy, that's a good
question to discuss.
26
00:01:34 --> 00:01:37
And maybe number seven
people well have
27
00:01:37 --> 00:01:40
something to say about.
28
00:01:40 --> 00:01:42
Good.
29
00:01:42 --> 00:01:47
So that just fine, so let me
start right in on those.
30
00:01:47 --> 00:01:53
So, number six is the fact, I
mean everybody understands that
31
00:01:53 --> 00:01:57
when energy is conserved,
that's an important thing.
32
00:01:57 --> 00:02:02
And so the question is first
when is energy conserved in
33
00:02:02 --> 00:02:03
the differential equations?
34
00:02:03 --> 00:02:05
In the equation we're
trying to solve?
35
00:02:05 --> 00:02:11
And if it is, then we want to
know, we would like to choose
36
00:02:11 --> 00:02:15
difference methods that
also conserve energy.
37
00:02:15 --> 00:02:20
They may not be exactly right,
they may not be exactly at a
38
00:02:20 --> 00:02:25
right point on this circle, if
we're in that model problem,
39
00:02:25 --> 00:02:28
but still on the circle.
40
00:02:28 --> 00:02:32
So, and the point is that the
trapezoidal method does stay on
41
00:02:32 --> 00:02:34
the circle, and of course the
differential equation
42
00:02:34 --> 00:02:36
stays on the circle.
43
00:02:36 --> 00:02:42
Can I, so, and I put quite a
bit into this problem six.
44
00:02:42 --> 00:02:51
So this is 2.2.6, and and
let me try say something
45
00:02:51 --> 00:02:53
about that, OK.
46
00:02:53 --> 00:02:57
So, first of all, there's the
continuous problem. du/dt=Au.
47
00:02:59 --> 00:03:01
When does that conserve energy?
48
00:03:01 --> 00:03:06
And then there's the discrete
problem, which we know that
49
00:03:06 --> 00:03:11
Euler's doesn't conserve
energy, because we've seen it,
50
00:03:11 --> 00:03:13
the computer shows
you right away.
51
00:03:13 --> 00:03:19
It spirals up from the circle,
it spirals in, or forward
52
00:03:19 --> 00:03:20
and backward, or whatever.
53
00:03:20 --> 00:03:22
But trapezoidal method,
is that the one that
54
00:03:22 --> 00:03:24
turns out to be well?
55
00:03:24 --> 00:03:29
OK, so it refers to equation 24
as the trapezoidal method, and
56
00:03:29 --> 00:03:32
let me try to follow
that notation.
57
00:03:32 --> 00:03:45
Yep. the trapezoidal
method is this one.
58
00:03:45 --> 00:03:48
Did we get music there for
the trapezoidal method?
59
00:03:48 --> 00:03:49
OK.
60
00:03:49 --> 00:03:50
U_(n+1)=(I+A*delta t/2)U_n.
61
00:03:50 --> 00:03:58
62
00:03:58 --> 00:04:01
OK.
63
00:04:01 --> 00:04:02
Right.
64
00:04:02 --> 00:04:03
OK.
65
00:04:03 --> 00:04:09
So that, and actually problem
seven, if you maybe want to
66
00:04:09 --> 00:04:15
discuss too, is the question of
how accurate this is compared
67
00:04:15 --> 00:04:16
to the differential equation.
68
00:04:16 --> 00:04:22
Everybody should see that this
really came from the original
69
00:04:22 --> 00:04:28
way to look at this was
(U_(n+1)-U_n)/delta t, that
70
00:04:28 --> 00:04:33
approximated the derivative
equals A and then I'm taking
71
00:04:33 --> 00:04:41
half at U, at the new time
and half at the old time.
72
00:04:41 --> 00:04:43
So it's got that centering.
73
00:04:43 --> 00:04:48
That we suspect will give us
a little extra accuracy.
74
00:04:48 --> 00:04:55
OK. so two questions then, one
was the stability, so problem
75
00:04:55 --> 00:05:07
six was the energy conserved,
and problem 2.2.7, if I
76
00:05:07 --> 00:05:12
anticipated, is the
order of accuracy.
77
00:05:12 --> 00:05:18
So these are both topics that
are extremely important in
78
00:05:18 --> 00:05:23
choosing a difference method.
79
00:05:23 --> 00:05:28
We would like to know first
when is energy conserved there?
80
00:05:28 --> 00:05:31
What differential equations
have conserved energy?
81
00:05:31 --> 00:05:35
Physically we kind of
can see them coming.
82
00:05:35 --> 00:05:42
If a physical universe is not
being somehow, lots of physical
83
00:05:42 --> 00:05:47
problems we see those masses
and springs oscillating, say
84
00:05:47 --> 00:05:51
OK, nothing's coming in from
outside, how could energy there
85
00:05:51 --> 00:05:57
would be the sum of the kinetic
energy of the masses, and the
86
00:05:57 --> 00:05:59
potential energy
in the springs.
87
00:05:59 --> 00:06:05
So energy passes between
kinetic when the mass is
88
00:06:05 --> 00:06:11
zooming past equilibrium, and
potential energy when the mass
89
00:06:11 --> 00:06:16
is stretching the spring
so we've got two cases.
90
00:06:16 --> 00:06:19
And we would hope, and this
trapezoidal method comes
91
00:06:19 --> 00:06:22
through, that energy
is conserved.
92
00:06:22 --> 00:06:27
So can I just begin
with this one?
93
00:06:27 --> 00:06:30
Maybe I always ought to say,
because you guys are also
94
00:06:30 --> 00:06:37
thinking about the quiz.
95
00:06:37 --> 00:06:41
So, for example, this question
about how to find the order of
96
00:06:41 --> 00:06:48
accuracy, I'll speak about
that. but let me just say
97
00:06:48 --> 00:06:52
that's not something that we've
done in enough detail that I
98
00:06:52 --> 00:06:55
would expect you to be quick on
the quiz and just be
99
00:06:55 --> 00:06:59
able to do it out.
100
00:06:59 --> 00:07:05
I'll try to choose questions
on the exam that you really
101
00:07:05 --> 00:07:07
have had more practice with.
102
00:07:07 --> 00:07:10
But this is certainly
important, so it was that
103
00:07:10 --> 00:07:13
definitely right to
put on the homework.
104
00:07:13 --> 00:07:14
And this is important.
105
00:07:14 --> 00:07:20
OK, so let me tackle this one.
106
00:07:20 --> 00:07:23
First the differential
equation.
107
00:07:23 --> 00:07:29
So by energy here I'm meaning
just the length of u squared.
108
00:07:29 --> 00:07:35
So now I'm looking at
energy conserved, OK.
109
00:07:35 --> 00:07:39
So I'm hoping energy conserved
would mean that the derivative
110
00:07:39 --> 00:07:44
of u squared was zero.
111
00:07:44 --> 00:07:48
That what conserving
energy would mean.
112
00:07:48 --> 00:07:52
And my question is which
differential equations,
113
00:07:52 --> 00:07:57
what's the condition
on A, in other words?
114
00:07:57 --> 00:08:02
How would I recognize from this
matrix A that I have this
115
00:08:02 --> 00:08:04
interesting property?
116
00:08:04 --> 00:08:04
OK.
117
00:08:04 --> 00:08:09
So, let me just show
you what I would do.
118
00:08:09 --> 00:08:15
Another way to write u
squared is u transposed u.
119
00:08:15 --> 00:08:19
These are vectors, of course.
120
00:08:19 --> 00:08:23
So what's the derivative
of u transpose u?
121
00:08:23 --> 00:08:26
My equation is telling me what
the derivative of u is here,
122
00:08:26 --> 00:08:28
I've got the thing squared.
123
00:08:28 --> 00:08:31
OK.
124
00:08:31 --> 00:08:34
I have a product here, right?
125
00:08:34 --> 00:08:36
I've u's times u's.
126
00:08:36 --> 00:08:40
So I'm going to use the
standard, they happen to be
127
00:08:40 --> 00:08:44
vectors, so if I want to use
like freshman calculus I'd have
128
00:08:44 --> 00:08:48
to get down to the scalar to
get down to the numbers, but I
129
00:08:48 --> 00:08:51
absolutely could do that and
just follow them along,
130
00:08:51 --> 00:08:55
component by component, or I
could try to do it a vector,
131
00:08:55 --> 00:08:57
with a whole column at a time.
132
00:08:57 --> 00:09:01
And let me try that.
133
00:09:01 --> 00:09:04
It's going to be the
product rule, right?
134
00:09:04 --> 00:09:12
In some form I'll have this guy
times the derivative of this
135
00:09:12 --> 00:09:16
plus the derivative, I'll keep
them in order, the derivative
136
00:09:16 --> 00:09:20
of this thing, times this guy.
137
00:09:20 --> 00:09:22
Right?
138
00:09:22 --> 00:09:23
That's the product rule.
139
00:09:23 --> 00:09:26
OK, now what do I know here?
140
00:09:26 --> 00:09:29
I know that the
du/dt is Au, right?
141
00:09:29 --> 00:09:34
So this is u transposed Au.
142
00:09:34 --> 00:09:41
And I know du, is that
dt meant to be dt?
143
00:09:41 --> 00:09:46
So du/dt Au, again.
144
00:09:46 --> 00:09:49
Look, this isn't difficult.
145
00:09:49 --> 00:09:54
It's Au transpose u.
146
00:09:54 --> 00:09:59
And the question is,
when is this zero, OK?
147
00:09:59 --> 00:10:03
So those were the two terms
from the product rule, and
148
00:10:03 --> 00:10:05
notice they're not
exactly the same.
149
00:10:05 --> 00:10:11
This is u transpose Au,
and what's this guy? u
150
00:10:11 --> 00:10:14
transpose A transpose u.
151
00:10:14 --> 00:10:20
So if I put them together, I
have u transpose times the A
152
00:10:20 --> 00:10:24
and the A transpose times u.
153
00:10:24 --> 00:10:29
And I'm hoping that this will
be zero, for all the solutions
154
00:10:29 --> 00:10:31
that I've come up with.
155
00:10:31 --> 00:10:38
So the condition is simply that
A plus A, we want that to be
156
00:10:38 --> 00:10:42
the zero matrix, A
plus A transpose.
157
00:10:42 --> 00:10:46
In other words, if A
transpose is minus A,
158
00:10:46 --> 00:10:49
that's the good one.
159
00:10:49 --> 00:10:52
If A transpose is minus A,
this is zero, that's zero,
160
00:10:52 --> 00:10:55
that's zero, that's zero,
energy's conserved.
161
00:10:55 --> 00:11:01
So the energy is conserved
when A transpose is minus A.
162
00:11:01 --> 00:11:08
It's for the anti-symmetric
A's that energy is conserved.
163
00:11:08 --> 00:11:12
And of course this
all makes sense.
164
00:11:12 --> 00:11:17
What are the special solutions
to that differential equation?
165
00:11:17 --> 00:11:22
The special solutions to this
equation are e to the, just,
166
00:11:22 --> 00:11:29
this is connecting now with
things that really are basic.
167
00:11:29 --> 00:11:35
The special solutions, the pure
eigen solutions, the ones that
168
00:11:35 --> 00:11:41
follow their own paths, are
the e^(lambda*t)x's, right?
169
00:11:41 --> 00:11:46
Where x is an eigenvector of A,
and lambda's an eigenvalue.
170
00:11:46 --> 00:11:50
Those are the guys and we
expect to have n of them, and
171
00:11:50 --> 00:11:53
we expect a combination of
those to give us the general
172
00:11:53 --> 00:11:56
solution and to match the
boundary conditions.
173
00:11:56 --> 00:12:00
So these are the, these n of
these guys with n different
174
00:12:00 --> 00:12:04
eigenvectors and their
eigenvalues are the heart
175
00:12:04 --> 00:12:08
of problems like this.
176
00:12:08 --> 00:12:13
And of course that's the
additional homework problem
177
00:12:13 --> 00:12:19
that wasn't in the book but I
added as an additional problem
178
00:12:19 --> 00:12:22
was exactly that, to get
you to practice with these
179
00:12:22 --> 00:12:24
eigenvectors and eigenvalues.
180
00:12:24 --> 00:12:29
OK, now, what's the deal, I
want to connect this energy
181
00:12:29 --> 00:12:32
conserving with this
picture of solutions.
182
00:12:32 --> 00:12:38
When would this keep
the same energy?
183
00:12:38 --> 00:12:46
When would this have constant
energy, constant length?
184
00:12:46 --> 00:12:50
The length would be constant,
since x is certainly, that's an
185
00:12:50 --> 00:12:52
eigenvector, whatever it is.
186
00:12:52 --> 00:12:54
This is what's changing.
187
00:12:54 --> 00:12:58
And now I want to know when
does the length not change?
188
00:12:58 --> 00:13:02
Well, the test would be that
this number should have
189
00:13:02 --> 00:13:07
absolute value one, right?
190
00:13:07 --> 00:13:13
If this keeps absolute value
one, then in the eigenvalue
191
00:13:13 --> 00:13:16
picture I have energy
staying the same.
192
00:13:16 --> 00:13:17
OK?
193
00:13:17 --> 00:13:22
Now, when will this
have magnitude one?
194
00:13:22 --> 00:13:25
Time is running along,
this is either the lambda
195
00:13:25 --> 00:13:28
t, so which lambdas?
196
00:13:28 --> 00:13:32
Zero, certainly, but
now there's more, you
197
00:13:32 --> 00:13:33
gotta know the others.
198
00:13:33 --> 00:13:38
What other lambdas will have,
what other lambdas give me
199
00:13:38 --> 00:13:43
this thing stays on the unit
circle, absolute value one?
200
00:13:43 --> 00:13:48
Key question you must
know. lambda could be?
201
00:13:48 --> 00:13:52
Imaginary. lambda could be
imaginary; right, lambda could
202
00:13:52 --> 00:13:54
be imaginary. e^(i*omega*t).
203
00:13:54 --> 00:13:59
204
00:13:59 --> 00:14:02
That's just like basic fact
about complex numbers, that if
205
00:14:02 --> 00:14:07
lambda's imaginary we would
have cosine of something t plus
206
00:14:07 --> 00:14:10
i times the sign of something
t, cos squared plus sine
207
00:14:10 --> 00:14:13
squared being one, we'd
be on the unit circle.
208
00:14:13 --> 00:14:18
So from this picture we
would want the lambdas
209
00:14:18 --> 00:14:20
to be pure imaginary.
210
00:14:20 --> 00:14:25
And now a little next step,
what we'd like for
211
00:14:25 --> 00:14:33
eigenvectors, because the real
solution will not be just one
212
00:14:33 --> 00:14:37
of these guys but
a combination.
213
00:14:37 --> 00:14:41
So when we have a combination
each one is doing its thing,
214
00:14:41 --> 00:14:49
each one better have lambda
imaginary but more than that,
215
00:14:49 --> 00:14:51
we would want the x's
to be perpendicular.
216
00:14:51 --> 00:14:57
Because if the x's interact,
then this guy, one of these,
217
00:14:57 --> 00:15:00
you will say there's only one
there, but I'm thinking
218
00:15:00 --> 00:15:02
of n of them there.
219
00:15:02 --> 00:15:04
A combination of
say, two of them.
220
00:15:04 --> 00:15:08
Suppose I have an
e^(lambda*1t)*x_1, and an
221
00:15:08 --> 00:15:13
e^(lambda*2t)*x_2, when
does that conserve energy?
222
00:15:13 --> 00:15:20
Well, each one will, but the
combination will be fine if
223
00:15:20 --> 00:15:22
the x's are perpendicular.
224
00:15:22 --> 00:15:26
Because if I have perpendicular
vectors, then the length of the
225
00:15:26 --> 00:15:30
whole combination by Pythagoras
is just one squared and the
226
00:15:30 --> 00:15:34
other squared and each of
those pieces is constant.
227
00:15:34 --> 00:15:36
Let me say what I'm
trying to say.
228
00:15:36 --> 00:15:41
That the eigenvalue, eigen
function picture also tells
229
00:15:41 --> 00:15:45
us that we would like
imaginary eigenvalues and
230
00:15:45 --> 00:15:48
perpendicular eigenvectors.
231
00:15:48 --> 00:15:51
And that is exactly what
you get from A transpose
232
00:15:51 --> 00:15:53
equal minus A.
233
00:15:53 --> 00:15:58
So A transpose equal minus
A is exactly, matrices
234
00:15:58 --> 00:16:03
anti-symmetric matrices, have
perpendicular eigenvectors,
235
00:16:03 --> 00:16:09
just like symmetric, but the
eigenvalues are pure imaginary.
236
00:16:09 --> 00:16:11
Instead of all being real,
they're all pure imaginary.
237
00:16:11 --> 00:16:16
In other words, that answer and
the discussion here came to
238
00:16:16 --> 00:16:21
the same conclusion, that a
should be anti-symmetric.
239
00:16:21 --> 00:16:22
OK.
240
00:16:22 --> 00:16:30
Now let me look at, is that OK,
so that's a discussion which
241
00:16:30 --> 00:16:33
is worth knowing about
differential equations.
242
00:16:33 --> 00:16:35
When is energy conserved.
243
00:16:35 --> 00:16:38
Now I want to do, or the
problem asks me to do, what
244
00:16:38 --> 00:16:40
about this difference equation?
245
00:16:40 --> 00:16:43
When is energy conserved there?
246
00:16:43 --> 00:16:51
And I believe it will be, this
is the requirement for the
247
00:16:51 --> 00:16:56
differential equation to be OK,
to conserve energy and so I'm
248
00:16:56 --> 00:16:59
going to expect, I'm going
to need that in this one.
249
00:16:59 --> 00:17:04
And is that enough? if I have
this A transpose equal minus A,
250
00:17:04 --> 00:17:08
anti-symmetric, it was good for
this, does it also
251
00:17:08 --> 00:17:10
do the job here?
252
00:17:10 --> 00:17:16
Is this trapezoidal method
just cool so that it will
253
00:17:16 --> 00:17:18
conserve energy, too.
254
00:17:18 --> 00:17:21
And the answer, I think, is
yes, and the problem was to
255
00:17:21 --> 00:17:24
prove it, or to see why.
256
00:17:24 --> 00:17:28
So what do I now want?
257
00:17:28 --> 00:17:30
If you don't mind my racing,
I'm now going to look
258
00:17:30 --> 00:17:35
at the discrete guide.
259
00:17:35 --> 00:17:39
So now I'm looking at
when is U_(n+1) squared
260
00:17:39 --> 00:17:43
equal U_n squared?
261
00:17:43 --> 00:17:46
That's what I mean by
conserving energy in
262
00:17:46 --> 00:17:47
the discrete case.
263
00:17:47 --> 00:17:50
At every step, same energy.
264
00:17:50 --> 00:17:53
So now I want to look at the
energy in U_(n+1) compared to
265
00:17:53 --> 00:17:59
the energy in U_n, and I want
to see that this holds.
266
00:17:59 --> 00:18:08
Probably, there's some
smart way to do that.
267
00:18:08 --> 00:18:12
Now we're down to just
the math questions.
268
00:18:12 --> 00:18:16
Math is always looking for
some, you just sort of do
269
00:18:16 --> 00:18:21
the right thing, you stand
back and poof it works.
270
00:18:21 --> 00:18:23
OK, so what's the right thing?
271
00:18:23 --> 00:18:28
Hopefully I have helped you and
me by saying what would be
272
00:18:28 --> 00:18:30
a good idea to do here.
273
00:18:30 --> 00:18:35
Can I just look?
274
00:18:35 --> 00:18:41
OK, it say, oh, does
it say what to do?
275
00:18:41 --> 00:18:42
Yeah.
276
00:18:42 --> 00:18:45
It says multiply
by U_(n+1)+U_n.
277
00:18:45 --> 00:18:48
278
00:18:48 --> 00:18:53
Take the dotted product,
that's interesting.
279
00:18:53 --> 00:18:55
Take the dot product,
so why did that work?
280
00:18:55 --> 00:18:59
Take the dot product of both
sides with U_(n+1)-U_n.
281
00:18:59 --> 00:19:02
282
00:19:02 --> 00:19:06
Did anybody succeed
with this idea?
283
00:19:06 --> 00:19:07
But that's the idea.
284
00:19:07 --> 00:19:11
And hopefully we'll
get it to work.
285
00:19:11 --> 00:19:17
That if I multiply both sides
by U_n+U_n, maybe better
286
00:19:17 --> 00:19:20
if I look at it this way.
287
00:19:20 --> 00:19:23
I'm sort of OK to
do it that way.
288
00:19:23 --> 00:19:25
Suppose I multiply both sides.
289
00:19:25 --> 00:19:30
So now I'm following on this
idea, That equation I've
290
00:19:30 --> 00:19:34
rewritten here and without
practice I don't know which one
291
00:19:34 --> 00:19:36
is the good one to start with.
292
00:19:36 --> 00:19:41
But I'm pretty OK with
starting with this one.
293
00:19:41 --> 00:19:43
So what's my idea?
294
00:19:43 --> 00:19:47
That's my equation, now I'm
going to multiply both sides
295
00:19:47 --> 00:19:51
by U_(n+1)+U_n transpose.
296
00:19:51 --> 00:19:54
Now I don't have room to
do it, unfortunately.
297
00:19:54 --> 00:20:00
I want to stick in here U_(n+
with a plus sign in there, and
298
00:20:00 --> 00:20:03
of course I have to do
the same thing here.
299
00:20:03 --> 00:20:08
OK. are you OK, do you
see what I'm doing?
300
00:20:08 --> 00:20:10
I want to show that this
equation, which is the same
301
00:20:10 --> 00:20:16
as this equation, has
this property which is a
302
00:20:16 --> 00:20:18
copy of this property.
303
00:20:18 --> 00:20:21
Here would be another
way to do it.
304
00:20:21 --> 00:20:26
We could do it, the way we're
going to do it now sort of
305
00:20:26 --> 00:20:30
compares with the way we
started with the derivative
306
00:20:30 --> 00:20:31
of the norm squared.
307
00:20:31 --> 00:20:35
I could also ask the same
question by following
308
00:20:35 --> 00:20:37
eigenvectors.
309
00:20:37 --> 00:20:40
I could also ask the same
question by following
310
00:20:40 --> 00:20:41
eigenvectors.
311
00:20:41 --> 00:20:51
I'm guessing that here the
eigenvalues U_(n+1) is, you
312
00:20:51 --> 00:20:53
see I could do it both ways.
313
00:20:53 --> 00:20:56
Maybe having just done
eigenvectors let me do
314
00:20:56 --> 00:20:57
this one by eigenvectors.
315
00:20:57 --> 00:21:04
So an eigenvector of A, when
it's x itself, is, what
316
00:21:04 --> 00:21:06
happens to an eigenvector.
317
00:21:06 --> 00:21:12
Suppose U_0 is an eigenvector
x of A, What's U_1?
318
00:21:12 --> 00:21:15
Yeah, you really should
see this question.
319
00:21:15 --> 00:21:26
So U_0 is the eigenvector
x, then what is U_1?
320
00:21:26 --> 00:21:28
Let me just write it here.
321
00:21:28 --> 00:21:30
Ax equaling lambda*x.
322
00:21:31 --> 00:21:37
So these are the eigenvalues of
A, and we've learned that
323
00:21:37 --> 00:21:42
they're pure imaginary in this
case when we're ready to go,
324
00:21:42 --> 00:21:48
and now I'd like to know that
we get the good thing here.
325
00:21:48 --> 00:21:53
OK, so if U_n is an
eigenvector, what is U_(n+1)?
326
00:21:55 --> 00:22:02
OK, so can I just do that,
U_(n+1) is, so what do I
327
00:22:02 --> 00:22:10
have on that right hand
side? x and what is Ax?
328
00:22:10 --> 00:22:12
It's lambda, right?
329
00:22:12 --> 00:22:13
It's lambda*x.
330
00:22:14 --> 00:22:24
So all this is one plus lambda
delta t on two x but now I've
331
00:22:24 --> 00:22:30
also got to bring this guy
over here, it's inverse.
332
00:22:30 --> 00:22:33
And see what that does.
333
00:22:33 --> 00:22:37
Now it's the inverse, so it's
going to have the same
334
00:22:37 --> 00:22:41
eigenvector and the
eigenvalue's going to go in the
335
00:22:41 --> 00:22:50
denominator and it'll be one
minus lambda delta t over two.
336
00:22:50 --> 00:22:52
OK, so that's U_(n+1).
337
00:22:53 --> 00:22:56
Do you see what's
happening here?
338
00:22:56 --> 00:23:02
The eigenvector x, if we start
with that eigenvector x, we
339
00:23:02 --> 00:23:04
come out with a multiple of x.
340
00:23:04 --> 00:23:06
And this is the multiple.
341
00:23:06 --> 00:23:12
So each find a different step
multiplies by a number just the
342
00:23:12 --> 00:23:16
way each, in the continuous
case we were multiplying by
343
00:23:16 --> 00:23:21
either the lambda t and in the
discrete step by step case
344
00:23:21 --> 00:23:24
we're multiplying
by that number.
345
00:23:24 --> 00:23:29
Actually, this is why problem
seven is important, because if
346
00:23:29 --> 00:23:34
we want to know how accurate
the comparison is I want to
347
00:23:34 --> 00:23:39
compare either the lambda
t with that number.
348
00:23:39 --> 00:23:47
So problem six is asking a
question about that ratio.
349
00:23:47 --> 00:23:50
And problem seven is asking
another question about
350
00:23:50 --> 00:23:51
that very same ratio.
351
00:23:51 --> 00:23:54
Now what's the question
for problem six?
352
00:23:54 --> 00:24:08
When will this vector have the
same length this x was U_n.
353
00:24:08 --> 00:24:14
So I started with the U_n, I
multiplied by this number to
354
00:24:14 --> 00:24:19
get U_(n+1), when do they
have the same length?
355
00:24:19 --> 00:24:27
When that number has
absolute value one.
356
00:24:27 --> 00:24:31
So if I'm watching
eigenvectors, this guy had
357
00:24:31 --> 00:24:35
absolute value one because
lambda was imaginary.
358
00:24:35 --> 00:24:38
Now, what about this guy?
lambda's still that
359
00:24:38 --> 00:24:40
same lambda, imaginary.
360
00:24:40 --> 00:24:44
What can you tell me about one
plus, so lambda is some i,
361
00:24:44 --> 00:24:50
omega, delta t over two and
down here I have one minus i
362
00:24:50 --> 00:24:54
omega, that's the lambda
delta t over two.
363
00:24:54 --> 00:25:00
I believe that that does
have absolute value one.
364
00:25:00 --> 00:25:02
Anybody tell me why?
365
00:25:02 --> 00:25:09
So this is checking that
energy is conserved
366
00:25:09 --> 00:25:11
for each eigenvector.
367
00:25:11 --> 00:25:15
The energy, because the
eigenvector is multiplied by
368
00:25:15 --> 00:25:19
that number and that's some
number, it's some complex
369
00:25:19 --> 00:25:22
number, but I believe it has
absolute value one and I
370
00:25:22 --> 00:25:24
believe you can tell me why.
371
00:25:24 --> 00:25:25
Yep.
372
00:25:25 --> 00:25:28
Because they're
complex conjugates.
373
00:25:28 --> 00:25:31
This numerator and the
denominator are complex
374
00:25:31 --> 00:25:38
conjugates, in the complex
plane here's the one, and I go
375
00:25:38 --> 00:25:44
up and either the i omega delta
t over two, or on this one I
376
00:25:44 --> 00:25:48
go down by, but those
lengths are the same.
377
00:25:48 --> 00:25:52
That numerator, the length of
the numerator is that guy, the
378
00:25:52 --> 00:25:56
length of the denominator is
this guy, and their
379
00:25:56 --> 00:25:58
ratio is one.
380
00:25:58 --> 00:26:01
So I think that this
gives us the point
381
00:26:01 --> 00:26:04
about complex numbers.
382
00:26:04 --> 00:26:11
That a complex number and its
conjugate automatically have
383
00:26:11 --> 00:26:14
ratio of magnitude one.
384
00:26:14 --> 00:26:17
You see the difference
between Euler's method.
385
00:26:17 --> 00:26:25
So Euler's method, so forward
Euler Forward Euler would not
386
00:26:25 --> 00:26:31
have had this stuff
on the left side.
387
00:26:31 --> 00:26:33
It would all have been
on the right hand side.
388
00:26:33 --> 00:26:36
Forward Euler would have
been about i plus A
389
00:26:36 --> 00:26:40
delta t. delta t A.
390
00:26:40 --> 00:26:42
And what are its eigenvalues?
391
00:26:42 --> 00:26:48
One plus i omega
delta t, right?
392
00:26:48 --> 00:26:56
With no, we're not dividing by
anybody. this part is up top
393
00:26:56 --> 00:26:59
too, so it's one plus
i omega delta t.
394
00:26:59 --> 00:27:02
Now, does that have
absolute value one?
395
00:27:02 --> 00:27:05
Well, you know from the way I'm
asking the question, what can
396
00:27:05 --> 00:27:08
you tell me about the absolute
value of the forward
397
00:27:08 --> 00:27:11
Euler growth factor?
398
00:27:11 --> 00:27:13
Greater than one.
399
00:27:13 --> 00:27:17
Because this is the one, and
this is the i omega delta t,
400
00:27:17 --> 00:27:19
maybe went up twice as far.
401
00:27:19 --> 00:27:21
And there was nobody
to divide by.
402
00:27:21 --> 00:27:24
It's bigger than one,
so it blows up.
403
00:27:24 --> 00:27:30
And the backward Euler had only
the one over one minus i omega
404
00:27:30 --> 00:27:37
delta t, so the backward was
like this, one over it.
405
00:27:37 --> 00:27:37
And lesson one.
406
00:27:37 --> 00:27:41
But this balance has absolute
value of equal one.
407
00:27:41 --> 00:27:47
So, OK, that's the sort of
heart of what's going on.
408
00:27:47 --> 00:27:54
Can I, before I tackle the
question using the hint there,
409
00:27:54 --> 00:27:58
which would take me on
another blackboard, can I
410
00:27:58 --> 00:28:00
discuss question seven?
411
00:28:00 --> 00:28:02
Were you going to ask
me about number seven?
412
00:28:02 --> 00:28:02
AUDIENCE: Yeah, I was.
413
00:28:02 --> 00:28:03
PROFESSOR STRANG: You were?
414
00:28:03 --> 00:28:03
OK.
415
00:28:03 --> 00:28:04
Alright.
416
00:28:04 --> 00:28:07
We get the answer.
417
00:28:07 --> 00:28:12
So, question seven is
about the accuracy.
418
00:28:12 --> 00:28:18
So here's the correct number,
this is my e^(i*omega*t),
419
00:28:18 --> 00:28:24
that's the correct number that
I should be multiplying by.
420
00:28:24 --> 00:28:30
And the actual number that I'm
multiplying by is that much.
421
00:28:30 --> 00:28:34
Or, in the forward Euler
case, it's that one.
422
00:28:34 --> 00:28:40
And so I'm comparing
the one step accuracy.
423
00:28:40 --> 00:28:44
So let me compare
one step accuracy.
424
00:28:44 --> 00:28:49
So this is the topic now,
of order of accuracy.
425
00:28:49 --> 00:28:52
This is question seven.
426
00:28:52 --> 00:29:01
And it amounts to comparing
the, so what is one delta t
427
00:29:01 --> 00:29:03
step in the continuous case?
428
00:29:03 --> 00:29:08
So how much does the
eigenvector x, what does it
429
00:29:08 --> 00:29:12
get multiplied by if I
take a delta t step in the
430
00:29:12 --> 00:29:14
differential equation?
431
00:29:14 --> 00:29:18
So this is the exact delta t
step, what the find a
432
00:29:18 --> 00:29:22
difference won't get exactly
right so the exact
433
00:29:22 --> 00:29:26
step delta t?
434
00:29:26 --> 00:29:36
The differential equation, and
of course I'm always looking at
435
00:29:36 --> 00:29:46
Ax=lambda*x, the differential
equation multiplies x by what?
436
00:29:46 --> 00:29:54
What's the exact growth factor,
you could say, if my equation
437
00:29:54 --> 00:29:59
is du/dt=Au, that's the
differential equation, and I'm
438
00:29:59 --> 00:30:04
supposing that I'm on an
eigenvector x, so that the
439
00:30:04 --> 00:30:10
solution is e^(i*omega*t),
or e^(i*lambda*x).
440
00:30:12 --> 00:30:19
Now, what happened
over a delta t step?
441
00:30:19 --> 00:30:23
This is the answer like running
along for all time, all I'm
442
00:30:23 --> 00:30:30
asking you to do is if the step
is delta t, what's that number?
443
00:30:30 --> 00:30:33
I mean that number is telling
us how much it grew in that
444
00:30:33 --> 00:30:37
delta t step, and of course
it's e^(i*omega*t).
445
00:30:37 --> 00:30:41
446
00:30:41 --> 00:30:44
That's the exact growth
factor, that's G_exact.
447
00:30:44 --> 00:30:48
448
00:30:48 --> 00:30:51
In one time step, the
eigenvector gets multiplied by
449
00:30:51 --> 00:30:55
that, because that's the amount
of time that elapsed.
450
00:30:55 --> 00:31:02
And what's the approximate
growth, the growth factor from
451
00:31:02 --> 00:31:06
trapezoidal is just what
we wrote down here.
452
00:31:06 --> 00:31:14
One plus lambda delta t,
maybe I'll stay with lambda
453
00:31:14 --> 00:31:19
rather than i omega.
454
00:31:19 --> 00:31:23
Just use the lambda delta t,
and this was one plus delta t
455
00:31:23 --> 00:31:33
over two. lambda divided by one
minus delta t over two lambda.
456
00:31:33 --> 00:31:42
So question seven just says
compare that with that.
457
00:31:42 --> 00:31:48
Thinking of delta t as a small
time step, if delta t is zero,
458
00:31:48 --> 00:31:52
then of course either the zero
is one, if delta t is zero I
459
00:31:52 --> 00:31:55
get one here, they're correct
if delta t is zero,
460
00:31:55 --> 00:31:59
that's no big deal.
461
00:31:59 --> 00:32:09
How do I understand what
happens for small delta t?
462
00:32:09 --> 00:32:14
I'm comparing this exponential
for a small delta t with this
463
00:32:14 --> 00:32:15
guy for a small delta t.
464
00:32:15 --> 00:32:19
How do you make comparisons
for a small delta t?
465
00:32:19 --> 00:32:22
Well, that's what Taylor
series is all about.
466
00:32:22 --> 00:32:24
Let's do the Taylor series.
467
00:32:24 --> 00:32:27
What's the series for
the exponential?
468
00:32:27 --> 00:32:32
If delta t is small, I have e
to some little number, tell
469
00:32:32 --> 00:32:40
me, start me out on
the exponential.
470
00:32:40 --> 00:32:49
One, thanks, one plus, lambda
delta t plus, this is the
471
00:32:49 --> 00:32:52
exponential series, there are
only two series in this world
472
00:32:52 --> 00:32:54
that are worth knowing.
473
00:32:54 --> 00:32:55
Really, that's literally true.
474
00:32:55 --> 00:33:00
In calculus you study all these
infinite series, there are two
475
00:33:00 --> 00:33:02
that are important, that
are worth remembering
476
00:33:02 --> 00:33:04
long after calculus.
477
00:33:04 --> 00:33:09
And either the x, either the
whatever because one of them.
478
00:33:09 --> 00:33:13
OK, what's the next term?
479
00:33:13 --> 00:33:18
Over two, lambda delta t
squared over two, and then
480
00:33:18 --> 00:33:22
there's a cube guy if you don't
mind telling me what's the
481
00:33:22 --> 00:33:25
denominator in that one?
482
00:33:25 --> 00:33:26
It's three factorial six.
483
00:33:26 --> 00:33:27
Good.
484
00:33:27 --> 00:33:28
And onward.
485
00:33:28 --> 00:33:29
OK.
486
00:33:29 --> 00:33:32
So that's one of the series
that everybody should know.
487
00:33:32 --> 00:33:37
OK, how we going to
deal with this guy?
488
00:33:37 --> 00:33:40
We want to expand that,
so what's my goal?
489
00:33:40 --> 00:33:45
I want you to expand that in
powers of lambda delta t
490
00:33:45 --> 00:33:46
and compare with this.
491
00:33:46 --> 00:33:51
And see where, they aren't
going to be equal, right?
492
00:33:51 --> 00:33:54
At some point they're
going to be different.
493
00:33:54 --> 00:33:57
But at least they should
start out equal.
494
00:33:57 --> 00:34:03
So so here's the heart
of problem seven.
495
00:34:03 --> 00:34:08
How do I expand this
in powers of delta t?
496
00:34:08 --> 00:34:11
Do you mind if I just, this is
just a number let me put it
497
00:34:11 --> 00:34:19
times one over, so this is
times one minus delta t over
498
00:34:19 --> 00:34:23
two, lambda inward, right?
499
00:34:23 --> 00:34:25
I just bring that
up as a number.
500
00:34:25 --> 00:34:32
So it's this guy times
one over this guy.
501
00:34:32 --> 00:34:34
What do I do?
502
00:34:34 --> 00:34:46
This is, here's the moment
when the math tools get used.
503
00:34:46 --> 00:34:52
And I'm well aware that it's
like years since you did
504
00:34:52 --> 00:34:59
calculus or series or whatever,
and those tools get rusty.
505
00:34:59 --> 00:35:02
And the point is that they're
really genuine tools
506
00:35:02 --> 00:35:05
that we can now use.
507
00:35:05 --> 00:35:08
So what do you think?
508
00:35:08 --> 00:35:11
This is the problem one, this
is the one coming from the
509
00:35:11 --> 00:35:13
denominator; this is 1/(1-x).
510
00:35:13 --> 00:35:15
511
00:35:15 --> 00:35:19
So I have a 1/(1-x) deal.
512
00:35:19 --> 00:35:24
And what's the series for that?
513
00:35:24 --> 00:35:27
I said there were two series
worth remembering, and sure
514
00:35:27 --> 00:35:30
enough the exponential was
one of them and now we're
515
00:35:30 --> 00:35:32
ready for the other one.
516
00:35:32 --> 00:35:35
What's the series for that guy?
517
00:35:35 --> 00:35:39
1+x, good start.
518
00:35:39 --> 00:35:45
Plus x squared.
519
00:35:45 --> 00:35:49
Right, x squared plus
x cubed and so on.
520
00:35:49 --> 00:35:51
Real simple.
521
00:35:51 --> 00:35:54
It's all the same stuff
with no factorials.
522
00:35:54 --> 00:35:57
Those are the two
series to know.
523
00:35:57 --> 00:36:00
The exponential series and
the geometric series.
524
00:36:00 --> 00:36:03
Right, that's the
geometric series.
525
00:36:03 --> 00:36:07
OK, so that's what I've
got out of this stuff.
526
00:36:07 --> 00:36:08
Can I write it below?
527
00:36:08 --> 00:36:12
I have one plus delta
t over two lambda.
528
00:36:12 --> 00:36:16
Let me just call that x for
the moment. delta t over
529
00:36:16 --> 00:36:17
two lambda is my x.
530
00:36:17 --> 00:36:22
One plus x, and this is
1/(1-x), which you just told me
531
00:36:22 --> 00:36:29
is one plus x plus x squared
plus x cubed and so on.
532
00:36:29 --> 00:36:33
And now I've got to do
that multiplication.
533
00:36:33 --> 00:36:40
OK, x is, remember this is
x, I'm just saving space.
534
00:36:40 --> 00:36:43
Can you multiply those guys?
535
00:36:43 --> 00:36:47
So that's one plus x times
a lot of stuff here.
536
00:36:47 --> 00:36:49
What do I have all together?
537
00:36:49 --> 00:36:53
Well, the one, what's
the next term?
538
00:36:53 --> 00:36:54
Two x's?
539
00:36:54 --> 00:36:57
Everybody spots the
two x's there?
540
00:36:57 --> 00:37:02
And then the next term, you
have to get these terms
541
00:37:02 --> 00:37:05
right because we plan to
compare with this guy
542
00:37:05 --> 00:37:07
and see how many we get.
543
00:37:07 --> 00:37:10
How many x squareds
are in there?
544
00:37:10 --> 00:37:12
Is it two?
545
00:37:12 --> 00:37:13
Looks like two.
546
00:37:13 --> 00:37:14
Two x squareds.
547
00:37:14 --> 00:37:16
And two x cubes, and so on.
548
00:37:16 --> 00:37:18
Yeah, that looks right, OK.
549
00:37:18 --> 00:37:22
Now I'm ready, what
am I ready for?
550
00:37:22 --> 00:37:26
I'm ready to say what
x is, x is this delta
551
00:37:26 --> 00:37:28
t over two lambda.
552
00:37:28 --> 00:37:29
So what have I got here, one?
553
00:37:29 --> 00:37:32
What is this guy now?
554
00:37:32 --> 00:37:37
Two x's is delta t lambda.
555
00:37:37 --> 00:37:39
Is this good?
556
00:37:39 --> 00:37:40
Yes, right?
557
00:37:40 --> 00:37:41
We're pleased.
558
00:37:41 --> 00:37:47
Because the two x is the, two
of these is delta t lambda and
559
00:37:47 --> 00:37:49
that's what we wanted to match.
560
00:37:49 --> 00:37:52
Absolutely. delta t
lambda, lambda delta t.
561
00:37:52 --> 00:37:54
Now let's keep going.
562
00:37:54 --> 00:37:58
By the way if this first term
hadn't matched we would
563
00:37:58 --> 00:38:00
be extremely surprised.
564
00:38:00 --> 00:38:06
Because that first matching is
only saying that my difference
565
00:38:06 --> 00:38:12
equation is quite consistent,
it's a reasonable creation out
566
00:38:12 --> 00:38:14
of the differential equation.
567
00:38:14 --> 00:38:16
And we knew that.
568
00:38:16 --> 00:38:19
The question is how much
further are we going to get?
569
00:38:19 --> 00:38:21
Euler will not get any further.
570
00:38:21 --> 00:38:24
With Euler the next
ones will fail.
571
00:38:24 --> 00:38:27
But I think with trapezoidal
the next ones are
572
00:38:27 --> 00:38:28
going to work.
573
00:38:28 --> 00:38:31
Does it work?
574
00:38:31 --> 00:38:35
It's like we're holding
our breath, right?
575
00:38:35 --> 00:38:38
Two now, I'm going to put in x
squared and see about this
576
00:38:38 --> 00:38:45
term. x is what? x is this guy,
delta t over two lambda. delta
577
00:38:45 --> 00:38:49
t lambda over two squared.
578
00:38:49 --> 00:38:52
And now you get the fun.
579
00:38:52 --> 00:38:56
Because you're going to
compare this term with what?
580
00:38:56 --> 00:39:00
With this term.
581
00:39:00 --> 00:39:03
And are they the same?
582
00:39:03 --> 00:39:04
Yes.
583
00:39:04 --> 00:39:05
Yes.
584
00:39:05 --> 00:39:10
So that's the way, you see,
that you got the extra accuracy
585
00:39:10 --> 00:39:14
which Euler did not give you,
but that's why the trapezoidal
586
00:39:14 --> 00:39:17
rule is a is a second
order accurate method.
587
00:39:17 --> 00:39:29
OK, you may say that I went
overboard to say all that.
588
00:39:29 --> 00:39:31
You may say I didn't
ask that question.
589
00:39:31 --> 00:39:36
But it's the right question to
ask about order of accuracy,
590
00:39:36 --> 00:39:40
and it's what problem seven
was intending to bring.
591
00:39:40 --> 00:39:50
Maybe I called it h in problem
seven rather than x here.
592
00:39:50 --> 00:39:52
Well.
593
00:39:52 --> 00:39:55
Oh gosh, I realize I
I'm supposed to come
594
00:39:55 --> 00:39:57
back to this one.
595
00:39:57 --> 00:40:00
But some people might
have other problems that
596
00:40:00 --> 00:40:01
they're interested in.
597
00:40:01 --> 00:40:07
But let me, because time is
pushing along, and the solution
598
00:40:07 --> 00:40:11
to this one will post, let me
at least offer the possibility
599
00:40:11 --> 00:40:15
to ask me about something
completely not six or seven
600
00:40:15 --> 00:40:18
here but something entirely
different, like what's the
601
00:40:18 --> 00:40:20
first question on the
quiz or anything.
602
00:40:20 --> 00:40:32
And that, let me say I'll
hope to know by Tuesday.
603
00:40:32 --> 00:40:37
I love to teach, but making
up exams is serious work.
604
00:40:37 --> 00:40:39
Anyway.
605
00:40:39 --> 00:40:46
Let me open a board and open to
another question of any sort.
606
00:40:46 --> 00:40:50
Any place, Chapter 1,
Chapter 2, whatever.
607
00:40:50 --> 00:40:52
Is there anything?
608
00:40:52 --> 00:40:56
So I know that you're in the
middle of this homework.
609
00:40:56 --> 00:41:04
So I can say a little more here
about that number six if you
610
00:41:04 --> 00:41:07
want, but I wanted
to allow, yep.
611
00:41:07 --> 00:41:14
AUDIENCE: [INAUDIBLE].
612
00:41:14 --> 00:41:18
PROFESSOR STRANG: The A, from
today's lecture this was the
613
00:41:18 --> 00:41:22
incidence matrix, and this was
the a transpose a that's
614
00:41:22 --> 00:41:28
probably still on the
board somewhere.
615
00:41:28 --> 00:41:28
Yep.
616
00:41:28 --> 00:41:30
Yep.
617
00:41:30 --> 00:41:37
So this is the A, which you
should take in and be able to
618
00:41:37 --> 00:41:41
create if I gave you the graph,
and this is the A transpose A,
619
00:41:41 --> 00:41:44
so it's through today's
lecture, yeah.
620
00:41:44 --> 00:41:47
Next lecture I'll be talking
about the A transpose by
621
00:41:47 --> 00:41:50
itself, which involves
Kirchhoff's current
622
00:41:50 --> 00:41:52
law, it's beautiful.
623
00:41:52 --> 00:41:55
A transpose w equals zero.
624
00:41:55 --> 00:42:00
But I think this part was
straightforward enough to
625
00:42:00 --> 00:42:06
be able to add this to our
list of problems which
626
00:42:06 --> 00:42:08
fit the framework.
627
00:42:08 --> 00:42:11
So that's what that was about.
628
00:42:11 --> 00:42:15
It doesn't mean that this will
be on but it could be, right.
629
00:42:15 --> 00:42:17
OK, what else?
630
00:42:17 --> 00:42:21
You guys are patient, I
come on, yeah, thanks.
631
00:42:21 --> 00:42:21
AUDIENCE: [INAUDIBLE].
632
00:42:21 --> 00:42:21
PROFESSOR STRANG: Yep.
633
00:42:21 --> 00:42:25
AUDIENCE: This is only valid
when x is less than one?
634
00:42:25 --> 00:42:29
PROFESSOR STRANG: It's only
valid when x is less than one,
635
00:42:29 --> 00:42:33
so that's now the math point
that this expansion for
636
00:42:33 --> 00:42:37
e^(x) valid for all x's.
637
00:42:37 --> 00:42:38
Because you're dividing
by these bigger and
638
00:42:38 --> 00:42:40
bigger numbers.
639
00:42:40 --> 00:42:43
But this one is only
valid up to x=1.
640
00:42:44 --> 00:42:48
At x=1 we're getting one plus
one plus one, and we're getting
641
00:42:48 --> 00:42:52
one over one minus one, sort of
infinity matches infinity, but
642
00:42:52 --> 00:42:58
then if x goes up to two, yeah
what happens if x is two?
643
00:42:58 --> 00:43:03
It's sort of not good, but you
know mathematics, it's never
644
00:43:03 --> 00:43:05
completely crazy, right?
645
00:43:05 --> 00:43:06
If x is two, what
does this say?
646
00:43:06 --> 00:43:10
What have I got on
the left hand side?
647
00:43:10 --> 00:43:12
Negative one.
648
00:43:12 --> 00:43:15
And what have I got on
the right hand side?
649
00:43:15 --> 00:43:21
One plus two plus
four plus eight.
650
00:43:21 --> 00:43:26
I should not allow this to be
videotaped, but that's actually
651
00:43:26 --> 00:43:30
not so completely crazy.
652
00:43:30 --> 00:43:37
In some nutty way that could
still make some sense.
653
00:43:37 --> 00:43:39
That's certainly
will not be on the.
654
00:43:39 --> 00:43:44
So you're right that x should
be less than one, and of course
655
00:43:44 --> 00:43:48
it will be here because I'm
looking at little delta t's.
656
00:43:48 --> 00:43:53
Little, so my delta t, x was
this thing and my delta t, the
657
00:43:53 --> 00:43:58
time step was small and somehow
that tells me, actually
658
00:43:58 --> 00:44:01
this is a good indication.
659
00:44:01 --> 00:44:05
It gives me the units that
stability and things
660
00:44:05 --> 00:44:09
going right will depend
on lambda delta t.
661
00:44:09 --> 00:44:14
Will depend on lambda delta t,
that's the key parameter there.
662
00:44:14 --> 00:44:19
That's like the dimensionless
parameter that we're, or lambda
663
00:44:19 --> 00:44:21
delta t over two, or whatever.
664
00:44:21 --> 00:44:24
But lambda delta t is the key.
665
00:44:24 --> 00:44:26
And a highly important key.
666
00:44:26 --> 00:44:31
It tells us that as lambda gets
bigger, as the matrix has
667
00:44:31 --> 00:44:35
bigger eigenvalues, delta
t has got to get smaller.
668
00:44:35 --> 00:44:38
And I mentioned
stiff equations.
669
00:44:38 --> 00:44:42
Stiff equations are equations
where the eigenvalues
670
00:44:42 --> 00:44:46
lambda are out of scale.
671
00:44:46 --> 00:44:50
You know, you might have two
eigenvalues, one of size one
672
00:44:50 --> 00:44:53
and the other of size ten to
the fourth, because you've
673
00:44:53 --> 00:44:57
got two physical processes
going on at the same time.
674
00:44:57 --> 00:45:00
And those equations are tough,
because that ten to the fourth
675
00:45:00 --> 00:45:06
guy is forcing your delta
t to be really small.
676
00:45:06 --> 00:45:10
Whereas the action might, the
true, real solution might be
677
00:45:10 --> 00:45:12
controlled by the lambda=1 guy.
678
00:45:12 --> 00:45:16
So to follow this slow
evolution, you're having to
679
00:45:16 --> 00:45:20
take very small steps because
on top of that slow evolution
680
00:45:20 --> 00:45:24
with the lambda=1, there's some
very fast evolution maybe with
681
00:45:24 --> 00:45:27
lambda equal minus 10,000.
682
00:45:27 --> 00:45:32
Yeah, there's a lot
happening here.
683
00:45:32 --> 00:45:36
And always you have to
think OK, is there some
684
00:45:36 --> 00:45:39
way around that box.
685
00:45:39 --> 00:45:44
Because forward Euler would
not get you through.
686
00:45:44 --> 00:45:46
OK, thanks for that question,
you got another one?
687
00:45:46 --> 00:45:47
OK.
688
00:45:47 --> 00:45:49
AUDIENCE: So then if you
weren't using small enough
689
00:45:49 --> 00:45:51
time steps, [INAUDIBLE]?
690
00:45:51 --> 00:45:54
PROFESSOR STRANG: If you
weren't using small
691
00:45:54 --> 00:45:56
enough time steps, OK.
692
00:45:56 --> 00:45:59
For trapezoidal, let's say?
693
00:45:59 --> 00:46:02
AUDIENCE: I mean, that
expansion wouldn't hold if
694
00:46:02 --> 00:46:02
you were using a lambda--
695
00:46:02 --> 00:46:04
PROFESSOR STRANG: Well, the
expansion is really intended
696
00:46:04 --> 00:46:05
for a small delta t.
697
00:46:05 --> 00:46:06
Yeah.
698
00:46:06 --> 00:46:10
It's not intended, I never
added up the whole series.
699
00:46:10 --> 00:46:14
I just compared a couple of
terms to see how am I doing,
700
00:46:14 --> 00:46:19
and I got the extra term to
match from trapezoidal that
701
00:46:19 --> 00:46:22
I didn't get from Euler.
702
00:46:22 --> 00:46:26
So what's to say; if you
took delta t too big,
703
00:46:26 --> 00:46:31
what would happen in
the trapezoidal method?
704
00:46:31 --> 00:46:36
Well, you would stay on this
circle because the absolute
705
00:46:36 --> 00:46:39
value of this thing
is truly one.
706
00:46:39 --> 00:46:43
Even if lambda is enormous and
delta t is way too big, we
707
00:46:43 --> 00:46:49
still had complex conjugates
and their ratio was one.
708
00:46:49 --> 00:46:52
So we would not leave the
circle, at least in perfect
709
00:46:52 --> 00:46:54
arithmetic, as everybody says.
710
00:46:54 --> 00:46:57
If we didn't make any
round-off error, we would
711
00:46:57 --> 00:46:58
not leave the circle.
712
00:46:58 --> 00:47:02
But boy would we skip all over
the place on that circle.
713
00:47:02 --> 00:47:05
So if we took delta t
too big, we would be
714
00:47:05 --> 00:47:06
completely inaccurate.
715
00:47:06 --> 00:47:10
We wouldn't be unstable, for
trapezoidal, because it
716
00:47:10 --> 00:47:14
would stay on the circle,
but the phase would be
717
00:47:14 --> 00:47:16
completely wrong, yeah.
718
00:47:16 --> 00:47:19
So it would be a complex number
of absolute value one, but it
719
00:47:19 --> 00:47:28
would not be close to the
exact growth factor.
720
00:47:28 --> 00:47:30
Well, so many things to say.
721
00:47:30 --> 00:47:37
I realize that the course moves
along pretty quickly but this
722
00:47:37 --> 00:47:41
topic of numerical methods for
differential equations, that's
723
00:47:41 --> 00:47:44
a core part of 18.086.
724
00:47:44 --> 00:47:51
So I'm like anticipating here
in just a couple of days what
725
00:47:51 --> 00:47:55
really takes longer is the
stability and the accuracy
726
00:47:55 --> 00:48:05
and the best choices for
time-dependent problems.
727
00:48:05 --> 00:48:07
OK, always good questions.
728
00:48:07 --> 00:48:10
Anything else that's on
your mind of any sort?
729
00:48:10 --> 00:48:10
Yes, thanks.
730
00:48:10 --> 00:48:11
AUDIENCE: [INAUDIBLE].
731
00:48:11 --> 00:48:17
PROFESSOR STRANG: 114?
732
00:48:17 --> 00:48:21
AUDIENCE: There
is a figure 2.7.
733
00:48:21 --> 00:48:21
PROFESSOR STRANG: OK.
734
00:48:21 --> 00:48:21
OK.
735
00:48:21 --> 00:48:24
114 figure 2.7.
736
00:48:24 --> 00:48:26
Oh yes, OK.
737
00:48:26 --> 00:48:27
Oh yes.
738
00:48:27 --> 00:48:31
AUDIENCE: I figure it's about
how these shapes [INAUDIBLE].
739
00:48:31 --> 00:48:32
see.
740
00:48:32 --> 00:48:38
That has a bunch of figures, so
that in order to say for
741
00:48:38 --> 00:48:41
everybody who's not looking at
the book, those figures are
742
00:48:41 --> 00:48:44
about the problem we've
discussed here with a
743
00:48:44 --> 00:48:48
model problem, where
we're on a circle.
744
00:48:48 --> 00:48:52
So do I have space
to draw a circle?
745
00:48:52 --> 00:48:56
Well, let me just
make space here.
746
00:48:56 --> 00:49:00
OK, so page 114 has that
model problem that
747
00:49:00 --> 00:49:03
we've drawn before.
748
00:49:03 --> 00:49:08
There's the exact solution,
here's the phase plane; there's
749
00:49:08 --> 00:49:14
u and there's u', and the u was
cos(t), so the u' was minus
750
00:49:14 --> 00:49:16
sin(t), and we travel
around the circle.
751
00:49:16 --> 00:49:19
On the exact solution.
752
00:49:19 --> 00:49:22
Energy constant, u squared
stays one. u squared plus
753
00:49:22 --> 00:49:25
u prime squared stay one.
754
00:49:25 --> 00:49:30
Now which figure was it
you wanted me to look at?
755
00:49:30 --> 00:49:30
So.
756
00:49:30 --> 00:49:32
AUDIENCE: [INAUDIBLE]
757
00:49:32 --> 00:49:33
PROFESSOR STRANG:
Of any of them?
758
00:49:33 --> 00:49:35
AUDIENCE: Yeah.
759
00:49:35 --> 00:49:38
PROFESSOR STRANG:
OK, that's fine.
760
00:49:38 --> 00:49:39
Let's see.
761
00:49:39 --> 00:49:40
Is trapezoidal on that one?
762
00:49:40 --> 00:49:41
Yeah.
763
00:49:41 --> 00:49:43
Trapezoidal was the first one.
764
00:49:43 --> 00:49:48
OK, so figure 2.6 shows the
trapezoidal method moving
765
00:49:48 --> 00:49:50
around the circle.
766
00:49:50 --> 00:49:51
So what happens?
767
00:49:51 --> 00:49:55
Yeah, thanks, that's a
very suitable question.
768
00:49:55 --> 00:50:02
OK. and I took, in that figure
I took, how long does it take
769
00:50:02 --> 00:50:07
for the exact solution to get
exactly back where it started?
770
00:50:07 --> 00:50:09
At t equal what do I come back?
771
00:50:09 --> 00:50:12
AUDIENCE: 2pi.
772
00:50:12 --> 00:50:14
PROFESSOR STRANG: t
equal to 2pi, I'm right
773
00:50:14 --> 00:50:15
back where I was.
774
00:50:15 --> 00:50:16
Right?
775
00:50:16 --> 00:50:18
Cosine has period 2pi.
776
00:50:18 --> 00:50:26
OK, now a single step of
size 2pi would be really
777
00:50:26 --> 00:50:28
ridiculous, right?
778
00:50:28 --> 00:50:31
I mean, I want to now delta t.
779
00:50:31 --> 00:50:37
So in that figure I took delta
t to be 2pi divided by 32.
780
00:50:37 --> 00:50:43
So I'm taking delta t to be the
2pi that would bring me all the
781
00:50:43 --> 00:50:48
way around but I'm
dividing by 32.
782
00:50:48 --> 00:50:49
So, what does that mean?
783
00:50:49 --> 00:50:54
What what does the exact
solution do at those steps?
784
00:50:54 --> 00:50:56
32 steps?
785
00:50:56 --> 00:51:02
It goes on the circle, 32 equal
steps, 30, 360, 2pi divided by
786
00:51:02 --> 00:51:06
32 radians every time, comes
back exactly there,
787
00:51:06 --> 00:51:08
the exact solution.
788
00:51:08 --> 00:51:12
And right where I started.
789
00:51:12 --> 00:51:16
So it's like
following a planet.
790
00:51:16 --> 00:51:20
Now I do it by finding
out differences.
791
00:51:20 --> 00:51:22
So now I'm going to follow the
trapezoidal rule, just what
792
00:51:22 --> 00:51:24
we've been talking about.
793
00:51:24 --> 00:51:28
With that time step, and with
the equation, everybody
794
00:51:28 --> 00:51:33
remembers the equation was u,
u' equals, do you remember
795
00:51:33 --> 00:51:36
what the matrix was
in that equation?
796
00:51:36 --> 00:51:39
This is the derivative of
it and this is u, u'.
797
00:51:39 --> 00:51:44
Sorry to squeeze this in,
but what I'm, u' is u'.
798
00:51:45 --> 00:51:50
u'' is minus u.
799
00:51:50 --> 00:51:54
Now we know why that
matrix was good, right?
800
00:51:54 --> 00:51:55
Why is that?
801
00:51:55 --> 00:51:59
That's my matrix A,
why is it good?
802
00:51:59 --> 00:52:02
Because it's exactly, it fits.
803
00:52:02 --> 00:52:05
A transpose is minus A.
804
00:52:05 --> 00:52:06
It's anti-symmetric.
805
00:52:06 --> 00:52:08
Keeps me right on the circle.
806
00:52:08 --> 00:52:12
OK now, trapezoidal method
keeps me right on the
807
00:52:12 --> 00:52:14
circle, 32 steps.
808
00:52:14 --> 00:52:20
And so the picture just shows
where it goes after 32 steps.
809
00:52:20 --> 00:52:25
And 32, 32 does it
come back there?
810
00:52:25 --> 00:52:28
Well, not exactly, right?
811
00:52:28 --> 00:52:32
We don't expect to find
a different solution to
812
00:52:32 --> 00:52:37
be exactly in sync with
cos(t), the real one.
813
00:52:37 --> 00:52:38
But it's really close.
814
00:52:38 --> 00:52:44
I think in that figure I can
see that that's sort of a
815
00:52:44 --> 00:52:46
double point there, at 2pi.
816
00:52:46 --> 00:52:50
I put a little arrow
indicating small phase error.
817
00:52:50 --> 00:52:55
It misses by a little bit.
818
00:52:55 --> 00:53:01
And actually, roughly
what does it miss by?
819
00:53:01 --> 00:53:05
This was the point of the
order of accuracy stuff.
820
00:53:05 --> 00:53:09
Roughly what size is
that little error?
821
00:53:09 --> 00:53:12
That's what we did over here.
822
00:53:12 --> 00:53:18
The term that we got wrong
was a delta t cubed.
823
00:53:18 --> 00:53:21
At each step.
824
00:53:21 --> 00:53:23
Can I just tell you the answer?
825
00:53:23 --> 00:53:27
The error here is of
size delta t squared.
826
00:53:27 --> 00:53:30
Because over here we match
those series and we found the
827
00:53:30 --> 00:53:33
error was delta t cubed.
828
00:53:33 --> 00:53:35
That's in a single step.
829
00:53:35 --> 00:53:39
But now we've got one
over delta t steps, you
830
00:53:39 --> 00:53:40
see what I'm saying?
831
00:53:40 --> 00:53:46
That if the error was delta t
cubed per step, and I have one
832
00:53:46 --> 00:53:52
over delta t steps, to get
somewhere, or 2pi over delta
833
00:53:52 --> 00:53:56
t or whatever, then that
gives me delta t squared.
834
00:53:56 --> 00:54:00
So that little error there
is my error of size
835
00:54:00 --> 00:54:02
delta t squared.
836
00:54:02 --> 00:54:05
And that square tells me
I've got a good method.
837
00:54:05 --> 00:54:07
At least, decent.
838
00:54:07 --> 00:54:09
Second order accurate.
839
00:54:09 --> 00:54:16
And the trapezoidal rule is
sort of the natural one.
840
00:54:16 --> 00:54:21
Well, OK, so that's a full
hour mostly devoted to
841
00:54:21 --> 00:54:22
two or three things.
842
00:54:22 --> 00:54:26
Actually the eigenvectors
came into it.
843
00:54:26 --> 00:54:31
And the energy conservation
came into it, the stability
844
00:54:31 --> 00:54:34
matching series came into it.
845
00:54:34 --> 00:54:36
And the picture.
846
00:54:36 --> 00:54:44
OK, I'll see you Friday for
more about these guys, and then
847
00:54:44 --> 00:54:49
Monday evening please ask me
everything you want to
848
00:54:49 --> 00:54:50
on Monday evening.
849
00:54:50 --> 00:54:51
OK.
850
00:54:51 --> 00:54:53
Thank you.