WEBVTT

00:00:00.099 --> 00:00:02.182
The following content is
provided under a Creative

00:00:02.182 --> 00:00:03.610
Commons license.

00:00:03.610 --> 00:00:05.770
Your support will help
MIT OpenCourseWare

00:00:05.770 --> 00:00:09.547
continue to offer high-quality
educational resources for free.

00:00:09.547 --> 00:00:11.630
To make a donation or to
view additional materials

00:00:11.630 --> 00:00:15.160
from hundreds of MIT courses,
visit MIT OpenCourseWare

00:00:15.160 --> 00:00:21.130
at ocw.mit.edu.

00:00:21.130 --> 00:00:23.390
PROFESSOR STRANG: OK.

00:00:23.390 --> 00:00:27.400
Well, we had an election
since I saw you last.

00:00:27.400 --> 00:00:32.100
I hope you're happy
about the results.

00:00:32.100 --> 00:00:35.120
I'm very happy.

00:00:35.120 --> 00:00:36.480
Except one thing.

00:00:36.480 --> 00:00:40.750
There was a senator
who was in 18.085.

00:00:40.750 --> 00:00:42.520
And he lost his seat.

00:00:42.520 --> 00:00:48.290
So we don't have a senator
from 18.085 any more.

00:00:48.290 --> 00:00:51.070
It was Senator Sununu,
from New Hampshire.

00:00:51.070 --> 00:00:53.920
So he took 18.085.

00:00:53.920 --> 00:00:59.350
Actually, it was a
funny experience.

00:00:59.350 --> 00:01:02.770
So, some years ago I
had to go to Washington

00:01:02.770 --> 00:01:08.070
to testify before a
committee about increasing

00:01:08.070 --> 00:01:10.680
the funding for mathematics.

00:01:10.680 --> 00:01:13.920
So I was nervous, of
course, trying to remember

00:01:13.920 --> 00:01:15.060
what I'm going to say.

00:01:15.060 --> 00:01:18.720
More money is the
main point, but you

00:01:18.720 --> 00:01:22.090
have to say it more
delicately than that.

00:01:22.090 --> 00:01:28.230
And so I got in, a lot of
people were taking turns,

00:01:28.230 --> 00:01:30.660
you only get five
minutes to do it.

00:01:30.660 --> 00:01:34.130
And so I went and sat
down, waited for my turn.

00:01:34.130 --> 00:01:38.970
And here on the committee was
my student, Senator Sununu.

00:01:38.970 --> 00:01:42.760
Well at that time, I think,
Representative Sununu.

00:01:42.760 --> 00:01:45.890
So that was nice.

00:01:45.890 --> 00:01:48.630
He's a nice guy.

00:01:48.630 --> 00:01:52.870
Actually, the lobbyist who
kind of guided me there,

00:01:52.870 --> 00:01:57.020
and found the room for me and
sort of told me what to do,

00:01:57.020 --> 00:02:06.420
said I hope you gave him an
A. And the truth is I didn't.

00:02:06.420 --> 00:02:09.290
So I guess you guys
should all get As, just

00:02:09.290 --> 00:02:11.590
to be on the safe side.

00:02:11.590 --> 00:02:18.830
Or let me know if you're going
to be in the Senate anyway.

00:02:18.830 --> 00:02:20.210
So there you go.

00:02:20.210 --> 00:02:20.950
Anyway.

00:02:20.950 --> 00:02:24.810
So alright.

00:02:24.810 --> 00:02:28.280
But he wasn't great in 18.085.

00:02:28.280 --> 00:02:32.240
OK, so you know
what, this evening--

00:02:32.240 --> 00:02:34.540
I just called the
schedules office

00:02:34.540 --> 00:02:38.360
to confirm that it is
tonight, in 54-100.

00:02:38.360 --> 00:02:44.160
It's not a long, difficult
exam so see you at 7:30,

00:02:44.160 --> 00:02:50.160
or see you earlier at 4:00
for a review of everything

00:02:50.160 --> 00:02:52.800
that you want to ask about.

00:02:52.800 --> 00:02:55.970
So I won't try to do an
exam review this morning;

00:02:55.970 --> 00:03:00.480
we've got lots to do and
we're into November already.

00:03:00.480 --> 00:03:05.150
So I want to finish the
discussion of the fast Poisson

00:03:05.150 --> 00:03:05.650
solver.

00:03:05.650 --> 00:03:10.860
Because it's just a neat
idea which is so simple.

00:03:10.860 --> 00:03:13.560
Anytime you have a
nice square grid.

00:03:13.560 --> 00:03:15.530
I guess the message
is, anytime you

00:03:15.530 --> 00:03:19.480
have a nice square
or rectangular grid,

00:03:19.480 --> 00:03:23.860
you should be thinking, use the
fast Fourier transform somehow.

00:03:23.860 --> 00:03:27.920
And here it turns out
that the eigenvectors

00:03:27.920 --> 00:03:32.760
are, for this problem,
this K2D, so we're

00:03:32.760 --> 00:03:36.400
getting this matrix K2D.

00:03:36.400 --> 00:03:40.960
Which is of size N squared by
N squared, so a large matrix.

00:03:40.960 --> 00:03:47.350
But its eigenvectors
will be, well,

00:03:47.350 --> 00:03:49.690
actually they'll
be sine functions

00:03:49.690 --> 00:03:52.670
for the K2D, the fixed-fixed.

00:03:52.670 --> 00:03:57.470
And they would be cosine
functions for the B2D,

00:03:57.470 --> 00:03:58.900
free-free.

00:03:58.900 --> 00:04:02.950
And the point is the
fast Fourier transform

00:04:02.950 --> 00:04:05.560
does all those fast.

00:04:05.560 --> 00:04:08.020
I mean, the fast
Fourier transform

00:04:08.020 --> 00:04:11.160
is set up for the
complex exponentials

00:04:11.160 --> 00:04:15.000
as we'll see in a
couple of weeks.

00:04:15.000 --> 00:04:18.060
That's the most
important algorithm

00:04:18.060 --> 00:04:21.230
I could tell you about.

00:04:21.230 --> 00:04:26.040
After maybe Gaussian
elimination, I don't know.

00:04:26.040 --> 00:04:31.210
But my point here is that if
you can do complex exponentials

00:04:31.210 --> 00:04:35.660
fast, you can do sines fast,
you can do cosines fast,

00:04:35.660 --> 00:04:43.000
and the result will be
that instead of-- I did

00:04:43.000 --> 00:04:46.780
an operation count
when I did elimination

00:04:46.780 --> 00:04:49.950
in the order one, two,
three, four, five, six,

00:04:49.950 --> 00:04:53.790
ordered by along each row.

00:04:53.790 --> 00:04:56.570
That gave us a matrix that
I want to look at again,

00:04:56.570 --> 00:04:59.340
this K2D matrix.

00:04:59.340 --> 00:05:01.810
If I did elimination
as it stands,

00:05:01.810 --> 00:05:04.680
I think the count was N^4.

00:05:04.680 --> 00:05:10.320
I think the count
was, size N squared,

00:05:10.320 --> 00:05:15.420
I had N squared columns to work
on and I think each column took

00:05:15.420 --> 00:05:19.020
N squared steps,
so I was up to N^4.

00:05:19.020 --> 00:05:25.160
And that's manageable.

00:05:25.160 --> 00:05:28.990
2-D problems, you really
can use backslash.

00:05:28.990 --> 00:05:35.050
But for this particular
problem, using the FFT way,

00:05:35.050 --> 00:05:40.460
it comes down to N squared
log N. So that's way better.

00:05:40.460 --> 00:05:41.360
Way better.

00:05:41.360 --> 00:05:42.780
Big saving.

00:05:42.780 --> 00:05:46.840
In 1-D, you don't see a saving.

00:05:46.840 --> 00:05:51.240
But in 2-D it's a big saving,
and in 3-D an enormous saving.

00:05:51.240 --> 00:05:56.910
So a lot of people would like
to try to use the FFT also

00:05:56.910 --> 00:05:59.860
when the region isn't a square.

00:05:59.860 --> 00:06:02.950
You can imagine all the
thinking that goes into this.

00:06:02.950 --> 00:06:05.840
But we'll focus on the
one where it's a square.

00:06:05.840 --> 00:06:07.840
Oh, one thing more to add.

00:06:07.840 --> 00:06:11.410
I spoke about
reordering the unknowns.

00:06:11.410 --> 00:06:14.280
But you probably were wondering,
OK, what's that about because I

00:06:14.280 --> 00:06:16.900
only just referred to it.

00:06:16.900 --> 00:06:21.690
Let me suggest an
ordering and you

00:06:21.690 --> 00:06:24.460
can tell me what
the matrix K2D will

00:06:24.460 --> 00:06:26.330
look like in this ordering.

00:06:26.330 --> 00:06:30.330
I'll call it the
red-black ordering.

00:06:30.330 --> 00:06:32.790
I guess with the
election just behind us

00:06:32.790 --> 00:06:34.870
I could call it the
red-blue ordering.

00:06:34.870 --> 00:06:37.860
OK, red-blue ordering, OK.

00:06:37.860 --> 00:06:43.600
So the ordering, instead of
ordering it by-- Let me draw

00:06:43.600 --> 00:06:50.620
this again, I'll put in a
couple more, make N=4 here,

00:06:50.620 --> 00:06:54.630
so now I've got 16,
N squared is now 16.

00:06:54.630 --> 00:06:57.170
So here's the idea.

00:06:57.170 --> 00:07:03.550
The red-blue ordering
is like a checkerboard.

00:07:03.550 --> 00:07:05.820
The checkerboard ordering,
you could think of.

00:07:05.820 --> 00:07:09.550
This will be one, this'll
be two, this'll be three,

00:07:09.550 --> 00:07:13.950
this'll be four, five,
six, seven, eight.

00:07:13.950 --> 00:07:17.290
So I've numbered
from one to eight.

00:07:17.290 --> 00:07:21.130
And now 9 to 16 will
be the other guys.

00:07:21.130 --> 00:07:26.700
These will be 9, 10,
11, 12, 13, 14, 15, 16.

00:07:26.700 --> 00:07:33.050
So suppose I do that,
what K2D look like?

00:07:33.050 --> 00:07:36.500
Maybe you could,
it's a neat example.

00:07:36.500 --> 00:07:40.420
It gives us one more chance
to look at this matrix.

00:07:40.420 --> 00:07:44.640
So K2D is always going to
have fours on the diagonal.

00:07:44.640 --> 00:07:46.010
So I have 16 fours.

00:07:46.010 --> 00:07:51.180
Whatever order I take, the
equation at a typical point,

00:07:51.180 --> 00:07:55.320
like say this one, that's
point number one, two.

00:07:55.320 --> 00:07:58.370
That's point number three,
at a point number three

00:07:58.370 --> 00:08:02.360
I have my five point molecule
with a four in the middle.

00:08:02.360 --> 00:08:06.080
So it'd be a four in
this, on that position.

00:08:06.080 --> 00:08:11.230
And then I have the four guys
around it, the minus ones,

00:08:11.230 --> 00:08:13.650
and where will they
appear in the matrix?

00:08:13.650 --> 00:08:14.820
With this ordering.

00:08:14.820 --> 00:08:18.800
So you get to see the
point of an ordering.

00:08:18.800 --> 00:08:21.640
So this was point one,
point two, point three,

00:08:21.640 --> 00:08:24.760
I'm focusing on point three.

00:08:24.760 --> 00:08:28.410
It's got a four on the diagonal
and then it's got a minus one,

00:08:28.410 --> 00:08:30.220
a minus one, a minus
one, a minus one,

00:08:30.220 --> 00:08:32.670
where do they appear?

00:08:32.670 --> 00:08:34.810
Well, all those
guys are what color?

00:08:34.810 --> 00:08:36.620
They're all color blue.

00:08:36.620 --> 00:08:37.120
Right?

00:08:37.120 --> 00:08:38.700
All the neighbors
are colored blue.

00:08:38.700 --> 00:08:40.860
So I won't get to
them until I've

00:08:40.860 --> 00:08:42.880
gone through the
red, the eight reds,

00:08:42.880 --> 00:08:45.340
and then I come back to nine.

00:08:45.340 --> 00:08:49.180
Whatever, 11, 12, 13.

00:08:49.180 --> 00:08:53.360
The point is they'll
all be over here.

00:08:53.360 --> 00:09:02.930
So this is like, you see
that the only nodes that

00:09:02.930 --> 00:09:05.440
are next to a red
node are all blue.

00:09:05.440 --> 00:09:08.650
And the only nodes next
to a blue node are red.

00:09:08.650 --> 00:09:13.690
So this is filled in
a little bit, that's

00:09:13.690 --> 00:09:16.930
where I've sort of like
four diagonals of minus ones

00:09:16.930 --> 00:09:17.750
or something.

00:09:17.750 --> 00:09:19.540
But there you go.

00:09:19.540 --> 00:09:22.850
That gives you an idea of what
a different ordering could be.

00:09:22.850 --> 00:09:26.010
And you see what will
happen now with elimination?

00:09:26.010 --> 00:09:29.830
Elimination is completed
already on this stuff.

00:09:29.830 --> 00:09:32.940
So all the-- With
elimination you

00:09:32.940 --> 00:09:36.610
want to push the
non-zeroes way to the end.

00:09:36.610 --> 00:09:41.770
That's sort of like
the central idea is,

00:09:41.770 --> 00:09:43.520
it's kind of a greedy approach.

00:09:43.520 --> 00:09:45.820
Greedy algorithm.

00:09:45.820 --> 00:09:49.570
Use up zeroes while
the sun's shining.

00:09:49.570 --> 00:09:53.500
And then near the end,
where the problem is,

00:09:53.500 --> 00:09:56.570
elimination's reduced it
to a much smaller problem,

00:09:56.570 --> 00:09:58.240
then you've got some work to do.

00:09:58.240 --> 00:10:01.740
So that's what
would happen here.

00:10:01.740 --> 00:10:06.170
By the way there's a
movie, on the 18.086 page.

00:10:06.170 --> 00:10:09.390
I hope some of you guys
will consider taking 18.086.

00:10:09.390 --> 00:10:13.080
It's a smaller class,
people do projects

00:10:13.080 --> 00:10:16.920
like creating this
elimination movie.

00:10:16.920 --> 00:10:23.430
So that would be
math.mit.edu/18.086,

00:10:23.430 --> 00:10:30.000
and with the movie-- has a
movie of different orderings.

00:10:30.000 --> 00:10:32.980
That to try to figure out what's
the absolute best ordering

00:10:32.980 --> 00:10:35.960
with the absolute
least fill-in is,

00:10:35.960 --> 00:10:39.670
that's one of these NP-hard
combinatorial problems.

00:10:39.670 --> 00:10:47.690
But to get an ordering that's
much better than by rows

00:10:47.690 --> 00:10:53.490
is not only doable
but should be done.

00:10:53.490 --> 00:10:56.680
OK, so that's the
ordering for elimination.

00:10:56.680 --> 00:10:58.870
As this is for elimination.

00:10:58.870 --> 00:11:01.470
OK.

00:11:01.470 --> 00:11:03.960
So that's a whole
world of its own.

00:11:03.960 --> 00:11:07.310
Ordering the thing for
Gaussian elimination.

00:11:07.310 --> 00:11:15.850
My focus in this section 3.5, so
this is Section 3.5 of the book

00:11:15.850 --> 00:11:20.470
and then this is Section
3.6, which is our major one.

00:11:20.470 --> 00:11:21.770
That's our big deal.

00:11:21.770 --> 00:11:25.840
But my focus in
3.5 is first to try

00:11:25.840 --> 00:11:28.810
to see what the 2-D matrix is.

00:11:28.810 --> 00:11:30.690
I mean, a big part
of this course,

00:11:30.690 --> 00:11:34.280
I think, a big part of what I
can do for you, is to, like,

00:11:34.280 --> 00:11:36.480
get comfortable with matrices.

00:11:36.480 --> 00:11:39.080
Sort of see what do you look
at when you see a matrix?

00:11:39.080 --> 00:11:40.930
What's its shape?

00:11:40.930 --> 00:11:43.320
What are its properties?

00:11:43.320 --> 00:11:48.270
And so this K2D is our first
example of a 2-D matrix,

00:11:48.270 --> 00:11:50.370
and it's highly structured.

00:11:50.370 --> 00:11:54.110
The point is we'll
have K2D matrices out

00:11:54.110 --> 00:11:55.550
of finite elements.

00:11:55.550 --> 00:11:59.340
But the finite elements might
be, well, they could be those.

00:11:59.340 --> 00:12:01.930
This could be a finite
element picture.

00:12:01.930 --> 00:12:08.500
And then the finite element
matrix on such a regular mesh

00:12:08.500 --> 00:12:11.000
would be quite structured too.

00:12:11.000 --> 00:12:15.270
But if I cut them
all up into triangles

00:12:15.270 --> 00:12:17.780
and I have a curved
region and everything,

00:12:17.780 --> 00:12:23.380
an unstructured mesh, then I'll
still have the good properties,

00:12:23.380 --> 00:12:26.120
this will still be
symmetric positive definite,

00:12:26.120 --> 00:12:27.490
all the good stuff.

00:12:27.490 --> 00:12:31.440
But the FFT won't come in.

00:12:31.440 --> 00:12:38.050
OK, so now I want to take a look
again at this K2D matrix, OK?

00:12:38.050 --> 00:12:41.110
So one way to describe
the K2D matrix

00:12:41.110 --> 00:12:43.570
is the way I did last
time, to kind of write down

00:12:43.570 --> 00:12:46.310
the typical row, typical
row in the middle.

00:12:46.310 --> 00:12:50.230
It's got a four on the
diagonal and four minus ones.

00:12:50.230 --> 00:12:55.350
And here we've re-ordered it so
the four minus ones came off.

00:12:55.350 --> 00:12:56.400
Came much later.

00:12:56.400 --> 00:13:00.600
But either way, that's
what the matrix looks like.

00:13:00.600 --> 00:13:03.300
Let me go back to this ordering.

00:13:03.300 --> 00:13:09.560
And let's get 2-D, another
better, clearer look at K2D.

00:13:09.560 --> 00:13:22.270
I want to construct K2D
from K. Which is this K1D.

00:13:22.270 --> 00:13:26.680
I don't use that
name, but here it is.

00:13:26.680 --> 00:13:29.000
Let me just show it to you.

00:13:29.000 --> 00:13:32.030
OK, so let me take
the matrix that

00:13:32.030 --> 00:13:37.600
does the second differences
in the x direction.

00:13:37.600 --> 00:13:42.390
This'll be an N squared
by N squared matrix.

00:13:42.390 --> 00:13:45.620
And it'll take second
differences on every row.

00:13:45.620 --> 00:13:47.780
Let me just write
in what it'll be.

00:13:47.780 --> 00:13:50.120
It'll be K, it'll
be a block matrix.

00:13:50.120 --> 00:13:53.310
K, K, n blocks.

00:13:53.310 --> 00:13:55.040
Each n by n.

00:13:55.040 --> 00:13:59.560
You see that that will be
the second difference matrix?

00:13:59.560 --> 00:14:03.180
K takes the second
differences along a row.

00:14:03.180 --> 00:14:06.730
This K will take the second x
differences along the next row.

00:14:06.730 --> 00:14:09.700
Row by row, simple.

00:14:09.700 --> 00:14:11.970
So this is the u_xx part.

00:14:11.970 --> 00:14:18.940
Now what will the u_yy,
the second y derivative--

00:14:18.940 --> 00:14:23.460
That gives second differences
up the columns, right?

00:14:23.460 --> 00:14:26.640
So can I see what
that matrix will

00:14:26.640 --> 00:14:29.710
look like, second
differences up the columns?

00:14:29.710 --> 00:14:32.290
Well, I think it
will look like this.

00:14:32.290 --> 00:14:35.520
It will have twos
on the diagonal.

00:14:35.520 --> 00:14:39.980
2I, 2I, 2I, this is
second differences, right?

00:14:39.980 --> 00:14:43.020
Down to 2I.

00:14:43.020 --> 00:14:46.330
And next to it will be a minus
the identity-- Let me write it,

00:14:46.330 --> 00:14:48.800
and you see if you
think it looks good.

00:14:48.800 --> 00:14:50.670
So minus the identity.

00:14:50.670 --> 00:14:55.360
It's like a blown up K. Somehow.

00:14:55.360 --> 00:14:56.470
Right?

00:14:56.470 --> 00:15:02.480
I have, do you see, it's every
row has got a two and two minus

00:15:02.480 --> 00:15:03.690
ones.

00:15:03.690 --> 00:15:06.670
That's from the minus one
the two and the minus one

00:15:06.670 --> 00:15:08.840
in the vertical
second difference.

00:15:08.840 --> 00:15:13.350
But you see how the count, you
see how the numbering changed

00:15:13.350 --> 00:15:14.480
it from here?

00:15:14.480 --> 00:15:17.040
Here the neighbors were
right next to each other,

00:15:17.040 --> 00:15:19.030
because we're ordering by rows.

00:15:19.030 --> 00:15:23.320
Here I have to wait a whole
N to get the guy above.

00:15:23.320 --> 00:15:28.900
And I'm also N away
from the guy below.

00:15:28.900 --> 00:15:34.370
So this is the two, minus
one, minus one centered there,

00:15:34.370 --> 00:15:35.710
above and below.

00:15:35.710 --> 00:15:39.430
Do you see that?

00:15:39.430 --> 00:15:41.030
If you think about
it a little it's

00:15:41.030 --> 00:15:43.490
not sort of difficult to see.

00:15:43.490 --> 00:15:47.670
And I guess the thing
I want also to do,

00:15:47.670 --> 00:15:51.340
is to tell you that there's
a neat little MATLAB command,

00:15:51.340 --> 00:15:54.910
or neat math idea really, and
they just made a MATLAB command

00:15:54.910 --> 00:16:02.300
out of it, that produces this
matrix and this one out of K.

00:16:02.300 --> 00:16:03.550
Can I tell you what this is?

00:16:03.550 --> 00:16:12.230
It's something you don't see in
typical linear algebra courses.

00:16:12.230 --> 00:16:18.570
So I'm constructing
K2D from K1D by,

00:16:18.570 --> 00:16:20.990
this is called a
Kronecker product.

00:16:20.990 --> 00:16:26.660
It's named after a
guy, some dead German.

00:16:26.660 --> 00:16:33.050
Or sometimes called
tensor product.

00:16:33.050 --> 00:16:38.220
The point is, this is
always the simplest

00:16:38.220 --> 00:16:41.830
thing to do in two dimensions
or three dimensions, or so on.

00:16:41.830 --> 00:16:45.720
Is like product of
1-D things, like

00:16:45.720 --> 00:16:48.600
copy the 1-D idea both ways.

00:16:48.600 --> 00:16:50.650
That's all this thing is doing.

00:16:50.650 --> 00:16:53.440
Copying the one idea
in the x direction

00:16:53.440 --> 00:16:55.270
and in the y direction.

00:16:55.270 --> 00:17:00.350
So the MATLAB command,
I've got two pieces here.

00:17:00.350 --> 00:17:05.250
For this first piece it's
kron, named after Kronecker,

00:17:05.250 --> 00:17:08.320
of-- Now, let's see.

00:17:08.320 --> 00:17:10.950
I'm going to put
two N by N matrices,

00:17:10.950 --> 00:17:15.360
and Kronecker product is going
to be a matrix, a giant matrix,

00:17:15.360 --> 00:17:16.510
of size N squared.

00:17:16.510 --> 00:17:17.590
Like these.

00:17:17.590 --> 00:17:20.620
OK, so I want to write
the right thing in there.

00:17:20.620 --> 00:17:28.600
I think the right thing
is the identity and K. OK,

00:17:28.600 --> 00:17:31.870
and so I have to explain what
this tensor product, Kronecker

00:17:31.870 --> 00:17:32.840
product, is.

00:17:32.840 --> 00:17:38.900
And this guy happens to be
also a Kronecker product.

00:17:38.900 --> 00:17:46.800
But it's K and I. So I'm
just like mentioning here.

00:17:46.800 --> 00:17:51.960
That because if you have 2-D
problems and 3-D problems

00:17:51.960 --> 00:17:54.930
and they're on a nice square
grid so you can like just

00:17:54.930 --> 00:18:00.090
take products of things, this
is what you want to know about.

00:18:00.090 --> 00:18:00.860
OK.

00:18:00.860 --> 00:18:03.080
So what is this
Kronecker product?

00:18:03.080 --> 00:18:06.190
Kronecker product says
take the first matrix,

00:18:06.190 --> 00:18:13.360
I. It's N by N. Just N by
N, that's the identity.

00:18:13.360 --> 00:18:20.170
And now take this K and multiply
every one of those numbers,

00:18:20.170 --> 00:18:24.270
these are all numbers, let
me put more numbers in,

00:18:24.270 --> 00:18:26.750
so I've got 16 numbers.

00:18:26.750 --> 00:18:31.200
This is going to work
for this mesh that has

00:18:31.200 --> 00:18:33.280
four guys in each direction.

00:18:33.280 --> 00:18:35.340
And four directions.

00:18:35.340 --> 00:18:36.630
Four levels.

00:18:36.630 --> 00:18:40.840
So I is four by four,
and K is four by four

00:18:40.840 --> 00:18:46.160
and now, each number here
gets multiplied by K. So

00:18:46.160 --> 00:18:51.060
because of all those zeroes
I get just K, K, K, K. Which

00:18:51.060 --> 00:18:53.310
is exactly what I wanted.

00:18:53.310 --> 00:18:56.260
So that Kronecker product
just-- In one step

00:18:56.260 --> 00:18:58.680
you've created an N
squared by N squared matrix

00:18:58.680 --> 00:19:05.030
that you really would not want
to type in entry by entry.

00:19:05.030 --> 00:19:07.040
That would be a horrible idea.

00:19:07.040 --> 00:19:10.210
OK, and if I follow the
same principle here,

00:19:10.210 --> 00:19:12.910
I'll take the
Kronecker product here,

00:19:12.910 --> 00:19:17.250
as I start with a matrix
K, so I start with two,

00:19:17.250 --> 00:19:23.160
minus one, minus one; two, minus
one, minus one; two, minus one,

00:19:23.160 --> 00:19:25.190
minus one; two.

00:19:25.190 --> 00:19:30.420
That's my K, and now
what's the Kronecker idea?

00:19:30.420 --> 00:19:36.230
Each of those numbers gets
multiplied by this matrix.

00:19:36.230 --> 00:19:41.670
So that two becomes 2I, minus
one becomes minus I, minus one

00:19:41.670 --> 00:19:44.840
becomes minus I, it all clicks.

00:19:44.840 --> 00:19:53.260
And it's producing exactly the
u_yy part, the second part.

00:19:53.260 --> 00:19:58.380
So that's the good construction,
just to tell you about.

00:19:58.380 --> 00:20:03.230
And the beauty is, this
is just like cooked up,

00:20:03.230 --> 00:20:05.950
set up for separation
of variables.

00:20:05.950 --> 00:20:08.580
If I want to know
the eigenvalues

00:20:08.580 --> 00:20:15.020
and the eigenvectors
of this thing,

00:20:15.020 --> 00:20:18.650
I start by knowing the
eigenvalues and eigenvectors

00:20:18.650 --> 00:20:22.800
of K. Can you remind
me what those are?

00:20:22.800 --> 00:20:26.030
We should remember them.

00:20:26.030 --> 00:20:30.370
So, anybody remember
eigenvectors of K?

00:20:30.370 --> 00:20:34.020
Well, this is going
back to Section 1.5,

00:20:34.020 --> 00:20:35.710
way early in the semester.

00:20:35.710 --> 00:20:40.990
And there's a lot
of writing involved

00:20:40.990 --> 00:20:43.190
and I probably didn't do it all.

00:20:43.190 --> 00:20:47.050
But let me remind
you of the idea.

00:20:47.050 --> 00:20:50.670
We guessed those eigenvectors.

00:20:50.670 --> 00:20:52.690
And how did we guess them?

00:20:52.690 --> 00:20:57.220
We guessed them by comparing
this difference equation

00:20:57.220 --> 00:20:59.230
to the differential equation.

00:20:59.230 --> 00:21:01.970
So we're in 1-D now,
I'm just reminding you

00:21:01.970 --> 00:21:03.870
of what we did a long time ago.

00:21:03.870 --> 00:21:06.500
OK, so what did we do?

00:21:06.500 --> 00:21:10.270
I want to know the
eigenvectors of these guys.

00:21:10.270 --> 00:21:14.010
So I better know the
eigenvectors of the 1-D one

00:21:14.010 --> 00:21:14.510
first.

00:21:14.510 --> 00:21:17.610
OK, so what did we do in 1-D?

00:21:17.610 --> 00:21:22.610
We found the eigenvectors
of K by looking first

00:21:22.610 --> 00:21:28.550
at the differential equation
-u''=lambda*u with--

00:21:28.550 --> 00:21:34.009
And remember we're talking
about the fixed-fixed here.

00:21:34.009 --> 00:21:35.550
And anybody remember
the eigenvectors

00:21:35.550 --> 00:21:40.530
of this guy, eigenfunctions I
guess I should say for those?

00:21:40.530 --> 00:21:44.740
So sines and cosines
look good here, right?

00:21:44.740 --> 00:21:46.580
Because you take their
second derivative,

00:21:46.580 --> 00:21:48.360
it brings down the constant.

00:21:48.360 --> 00:21:52.990
And then do I want
sines or cosines?

00:21:52.990 --> 00:21:54.650
Looking at the
boundary conditions,

00:21:54.650 --> 00:21:56.250
that's going to
tell me everything.

00:21:56.250 --> 00:22:00.540
I want sines, cosines are wiped
out by this first condition

00:22:00.540 --> 00:22:02.400
that u(0) should be zero.

00:22:02.400 --> 00:22:07.260
And then the sine has to
come back to zero at one,

00:22:07.260 --> 00:22:16.430
so the eigenfunctions were u
equals the sine of something,

00:22:16.430 --> 00:22:17.940
I think.

00:22:17.940 --> 00:22:21.610
I want a multiple of
pi, right? pi*k*x.

00:22:24.520 --> 00:22:26.340
I think that would be right.

00:22:26.340 --> 00:22:30.400
Because at x=1, that's
come back to zero.

00:22:30.400 --> 00:22:35.030
And the eigenvalue lambda,
if I just plug that in, two

00:22:35.030 --> 00:22:38.310
derivatives bring
down pi*k twice.

00:22:38.310 --> 00:22:41.860
And with a minus, and
that cancels that minus.

00:22:41.860 --> 00:22:45.530
So the eigenvalues were
pi squared k squared.

00:22:45.530 --> 00:22:48.810
And that's the
beautiful construction

00:22:48.810 --> 00:22:53.630
for differential equations.

00:22:53.630 --> 00:22:56.330
And these eigenfunctions
are a complete set,

00:22:56.330 --> 00:22:57.730
it's all wonderful.

00:22:57.730 --> 00:23:03.401
So that's a model problem of
what classical applied math

00:23:03.401 --> 00:23:05.400
does for Bessel's equation,
Legendre's equation,

00:23:05.400 --> 00:23:09.790
a whole long list of things.

00:23:09.790 --> 00:23:13.120
Now, note all those
equations that I just

00:23:13.120 --> 00:23:15.820
mentioned would have
finite difference analogs.

00:23:15.820 --> 00:23:20.820
But to my knowledge, it's only
this one, this simplest, best

00:23:20.820 --> 00:23:24.150
one of all, we could call
it the Fourier equation

00:23:24.150 --> 00:23:26.170
if we needed a name for it.

00:23:26.170 --> 00:23:27.332
I just thought of that.

00:23:27.332 --> 00:23:28.290
That sounds good to me.

00:23:28.290 --> 00:23:29.630
Fourier equation.

00:23:29.630 --> 00:23:30.220
OK.

00:23:30.220 --> 00:23:33.280
So what's great
about this one is

00:23:33.280 --> 00:23:36.780
that the eigenvectors
in the matrix case

00:23:36.780 --> 00:23:41.420
are just found by
sampling these functions.

00:23:41.420 --> 00:23:44.360
You're right on the dot if you
just sample these functions.

00:23:44.360 --> 00:23:49.410
So, for K, the eigenvectors,
what do I call eigenvectors?

00:23:49.410 --> 00:23:53.650
Maybe y's, I think I
sometimes call them y.

00:23:53.650 --> 00:24:00.740
So a typical eigenvector
y would be a sine vector.

00:24:00.740 --> 00:24:08.080
I'm sampling it at, let's see,
can I use h for this step size?

00:24:08.080 --> 00:24:14.200
So h is 1/(n+1).

00:24:14.200 --> 00:24:18.460
As we saw in the
past. h is 1/(n+1).

00:24:18.460 --> 00:24:28.290
So a typical eigenvector would
sample this thing at h, 2h, 2h,

00:24:28.290 --> 00:24:32.200
2h, sin(2*pi*k*h), and
so on, dot dot dot dot.

00:24:32.200 --> 00:24:34.080
And that would be
an eigenvector.

00:24:34.080 --> 00:24:37.760
That would be the eigenvector
number k, actually.

00:24:37.760 --> 00:24:42.160
And do you see that that sort
of eigenvector is well set up.

00:24:42.160 --> 00:24:46.560
It's going to work because
it ends, where does it end?

00:24:46.560 --> 00:24:50.980
Who's the last person, the last
component of this eigenvector?

00:24:50.980 --> 00:24:57.030
It's sin(N*pi*k*h).

00:24:57.030 --> 00:25:00.950
Sorry about all the symbols, but
compared to most eigenvectors

00:25:00.950 --> 00:25:03.320
this is, like, the greatest.

00:25:03.320 --> 00:25:06.660
OK, now why do I like that?

00:25:06.660 --> 00:25:10.920
Because the pattern, what
would be the next one

00:25:10.920 --> 00:25:13.880
if there was an N plus first?

00:25:13.880 --> 00:25:18.230
If there was an N plus first
component, what would it be?

00:25:18.230 --> 00:25:23.650
What would be the
sine of (N+1)*pi*k*h?

00:25:23.650 --> 00:25:25.500
That's the golden question.

00:25:25.500 --> 00:25:29.740
What would be, I'm trying to say
that these have a nice pattern

00:25:29.740 --> 00:25:35.080
because the guy that's-- the
next person here would be

00:25:35.080 --> 00:25:40.040
sin((N+1)*pi*k*h),
which is what?

00:25:40.040 --> 00:25:42.120
So N+1 is in there.

00:25:42.120 --> 00:25:45.730
And h is in there, so what
do I get from those guys?

00:25:45.730 --> 00:25:53.940
The (N+1)h is just one, right?
(N+1)h carries me all the way

00:25:53.940 --> 00:25:55.900
to the end.

00:25:55.900 --> 00:25:58.485
That's a guy that's out,
it's not in our matrix

00:25:58.485 --> 00:26:00.610
because that's the part,
that's a known one, that's

00:26:00.610 --> 00:26:03.860
a zero in a fixed
boundary condition.

00:26:03.860 --> 00:26:09.630
So like, the next guy would
be sine (N+1)h, that's one.

00:26:09.630 --> 00:26:11.160
sin(pi*k).

00:26:11.160 --> 00:26:12.090
And what is sin(pi*k)?

00:26:14.810 --> 00:26:17.640
The sine of pi*k is always?

00:26:17.640 --> 00:26:18.420
Zero.

00:26:18.420 --> 00:26:22.310
So we're getting it
right, like, the guy that

00:26:22.310 --> 00:26:25.540
got knocked off following
this pattern will be zero.

00:26:25.540 --> 00:26:29.230
And what about the guy that
was knocked off of that end?

00:26:29.230 --> 00:26:31.670
If this was sin(2pi*k*h),
and sin(pi*k*h),

00:26:31.670 --> 00:26:35.580
this would be sin(0pi*k*h),
which would be?

00:26:35.580 --> 00:26:38.220
Also zero, sin(0).

00:26:38.220 --> 00:26:44.540
So, anyway you could check just
by, it takes a little patience

00:26:44.540 --> 00:26:50.270
with trig identities, if I
multiply K by that vector,

00:26:50.270 --> 00:26:53.840
the pattern keeps going, the
two minus one, minus one,

00:26:53.840 --> 00:26:56.990
you know at a typical point
I'm going to have two of these,

00:26:56.990 --> 00:26:59.860
minus one of these,
minus one of these.

00:26:59.860 --> 00:27:01.840
And it'll look good.

00:27:01.840 --> 00:27:05.590
And when I get to the end I'll
have two minus one of these.

00:27:05.590 --> 00:27:08.030
The pattern will still
hold, because the minus one

00:27:08.030 --> 00:27:10.430
of these I can say is there.

00:27:10.430 --> 00:27:13.080
But it is a zero, so it's OK.

00:27:13.080 --> 00:27:14.210
And similarly here.

00:27:14.210 --> 00:27:19.790
Anyway, the pattern's good
and the eigenvalue is?

00:27:19.790 --> 00:27:20.420
Something.

00:27:20.420 --> 00:27:22.700
OK, it has some formula.

00:27:22.700 --> 00:27:25.580
It's not going to
be exactly this guy.

00:27:25.580 --> 00:27:27.770
Because we're taking
differences of sines

00:27:27.770 --> 00:27:29.740
and not derivatives of sines.

00:27:29.740 --> 00:27:31.910
So it has some formula.

00:27:31.910 --> 00:27:35.352
Tell me what you would
know about lambda.

00:27:35.352 --> 00:27:37.060
I'm not going to ask
you for the formula,

00:27:37.060 --> 00:27:38.620
I'm going to write it down.

00:27:38.620 --> 00:27:42.380
Tell me, before I write it
down, or I'll write it down

00:27:42.380 --> 00:27:43.450
and then you can tell me.

00:27:43.450 --> 00:27:45.740
I have two on the
diagonal, so that's just

00:27:45.740 --> 00:27:47.120
going to give me a two.

00:27:47.120 --> 00:27:50.280
And then the guy on the left
and the guy on the right, two,

00:27:50.280 --> 00:27:54.180
two with minus ones
I think gives two,

00:27:54.180 --> 00:28:01.410
I think it turns out to
be a cosine of k-- a k has

00:28:01.410 --> 00:28:03.840
to be in there, a pi has
to be in there, and h.

00:28:03.840 --> 00:28:07.280
I think that'll be it.

00:28:07.280 --> 00:28:09.290
I think that's the eigenvalue.

00:28:09.290 --> 00:28:13.800
That's the k-th eigenvalue
to go with this eigenvector.

00:28:13.800 --> 00:28:16.570
What do you notice about
two minus two times

00:28:16.570 --> 00:28:19.440
the cosine of something?

00:28:19.440 --> 00:28:20.060
What is it?

00:28:20.060 --> 00:28:24.810
Positive, negative,
zero, what's up?

00:28:24.810 --> 00:28:28.280
Two minus to times
a cosine is always?

00:28:28.280 --> 00:28:29.690
Positive.

00:28:29.690 --> 00:28:34.120
What does that tell us about
K that we already knew?

00:28:34.120 --> 00:28:35.780
It's positive definite, right?

00:28:35.780 --> 00:28:38.650
All eigenvalues, here we
actually know what they all

00:28:38.650 --> 00:28:42.360
are, they're all positive.

00:28:42.360 --> 00:28:43.980
I'm never going
to get zero here.

00:28:43.980 --> 00:28:53.180
These k*pi*h's are not hitting
the ones where the cosine is

00:28:53.180 --> 00:28:57.230
one and, of course,
you can imagine.

00:28:57.230 --> 00:28:59.120
So I started this
sentence and realized

00:28:59.120 --> 00:29:02.280
I should add another sentence.

00:29:02.280 --> 00:29:04.870
These are all positive.

00:29:04.870 --> 00:29:05.860
We expected that.

00:29:05.860 --> 00:29:08.560
We knew that K was a
positive definite matrix.

00:29:08.560 --> 00:29:10.440
All its eigenvalues
are positive,

00:29:10.440 --> 00:29:13.650
and now we actually
know what they are.

00:29:13.650 --> 00:29:19.850
And if I had the matrix B
instead, for a free-free one?

00:29:19.850 --> 00:29:22.410
Then this formula would
change a little bit.

00:29:22.410 --> 00:29:28.070
And what would be different
about B, the free-free matrix?

00:29:28.070 --> 00:29:31.820
Its eigenvectors would
be maybe at half angles

00:29:31.820 --> 00:29:33.880
or some darned thing happens.

00:29:33.880 --> 00:29:36.780
And so we get something
slightly different here.

00:29:36.780 --> 00:29:40.430
Maybe h is 1/n for
that, I've forgotten.

00:29:40.430 --> 00:29:44.170
And what's the deal
with the free-free K?

00:29:44.170 --> 00:29:48.400
One of the eigenvalues is zero.

00:29:48.400 --> 00:29:53.690
The free-free is the positive
semi-definite example.

00:29:53.690 --> 00:30:00.340
OK, that was like a quick
review of stuff we did earlier.

00:30:00.340 --> 00:30:04.700
And so I'm coming back to
that early point in the book,

00:30:04.700 --> 00:30:11.820
because of this great fact
that my eigenvectors are sines.

00:30:11.820 --> 00:30:14.940
So the point is, my
eigenvectors being

00:30:14.940 --> 00:30:18.760
sines, that just lights
up a light saying

00:30:18.760 --> 00:30:21.170
use the fast Fourier transform.

00:30:21.170 --> 00:30:25.650
You've got a matrix
full of sine vectors.

00:30:25.650 --> 00:30:29.340
Your eigenvector matrix
is a sine transform.

00:30:29.340 --> 00:30:34.470
It's golden, so use it.

00:30:34.470 --> 00:30:38.440
So I'll just remember then
how, recall that-- So what are

00:30:38.440 --> 00:30:43.040
the eigenvectors in 2-D?

00:30:43.040 --> 00:30:47.900
First of all, so
let's go to 2-D.

00:30:47.900 --> 00:30:51.230
Let me do the
continuous one first.

00:30:51.230 --> 00:30:57.470
Yeah, -u_xx-u_yy=lambda*u.

00:30:57.470 --> 00:31:01.720
The eigenvalue problem for
Laplace's equation now in 2-D,

00:31:01.720 --> 00:31:05.340
and again I'm going to
make it on the square.

00:31:05.340 --> 00:31:07.610
The unit square.

00:31:07.610 --> 00:31:10.210
And I'm going to have
zero boundary conditions.

00:31:10.210 --> 00:31:13.830
Fixed-fixed.

00:31:13.830 --> 00:31:18.730
Anybody want to propose an
eigenfunction for the 2-D

00:31:18.730 --> 00:31:20.270
problem?

00:31:20.270 --> 00:31:23.810
So the 2-D one, the
whole idea is hey,

00:31:23.810 --> 00:31:27.620
this square is like a
product of intervals somehow.

00:31:27.620 --> 00:31:32.160
We know the answer
in each direction.

00:31:32.160 --> 00:31:38.950
What do you figure, what would
be a good eigenfunction u(x,y)?

00:31:38.950 --> 00:31:43.400
Or eigenfunction, yeah, u(x,y).

00:31:43.400 --> 00:31:46.610
For this problem?

00:31:46.610 --> 00:31:49.350
What do you think?

00:31:49.350 --> 00:31:55.040
This is like the-- The older
courses on applied math

00:31:55.040 --> 00:31:58.810
did this until you
were blue in the face.

00:31:58.810 --> 00:32:02.230
Because there wasn't
finite elements and good

00:32:02.230 --> 00:32:03.630
stuff at that time.

00:32:03.630 --> 00:32:07.190
It was exact formulas.

00:32:07.190 --> 00:32:09.710
You wondered about
exact eigenfunctions

00:32:09.710 --> 00:32:13.210
and for this problem
variables separate.

00:32:13.210 --> 00:32:20.390
And you get u(x) is the
product of sine, of this guy,

00:32:20.390 --> 00:32:27.020
sin(pi*k*x), times
the sine of pi*l*y.

00:32:30.300 --> 00:32:34.890
Well, once you have the idea
that it might look like that,

00:32:34.890 --> 00:32:37.530
you just plug it in to
see, does it really work?

00:32:37.530 --> 00:32:40.210
And what's the eigenvalue?

00:32:40.210 --> 00:32:42.600
So I claim that that's a
good eigenfunction function

00:32:42.600 --> 00:32:46.180
and I need, it's got
two indices, k and l,

00:32:46.180 --> 00:32:47.140
two frequencies.

00:32:47.140 --> 00:32:50.270
It's got an x frequency
and a y frequency.

00:32:50.270 --> 00:32:55.660
So I need double index. k and l
will go, yeah, all the way out

00:32:55.660 --> 00:32:57.990
to infinity in the
continuous problem.

00:32:57.990 --> 00:32:59.800
And what's the eigenvector?

00:32:59.800 --> 00:33:02.400
Can you plug this guy in?

00:33:02.400 --> 00:33:05.120
What happens when
you plug that in?

00:33:05.120 --> 00:33:11.420
Take the second x
derivative, what happens?

00:33:11.420 --> 00:33:14.430
A constant comes out
and what's the constant?

00:33:14.430 --> 00:33:17.140
pi squared k squared.

00:33:17.140 --> 00:33:19.750
Then plug it into that term.

00:33:19.750 --> 00:33:21.690
A constant comes out again.

00:33:21.690 --> 00:33:25.740
What's that constant?
pi squared l squared.

00:33:25.740 --> 00:33:27.380
They come out with
a minus and then

00:33:27.380 --> 00:33:31.280
you already built in the minus,
so that they've made it a plus.

00:33:31.280 --> 00:33:36.860
So the lambda_kl is just
pi squared k squared,

00:33:36.860 --> 00:33:41.830
plus pi squared l squared.

00:33:41.830 --> 00:33:45.300
You see how it's going?

00:33:45.300 --> 00:33:48.510
If we knew it in 1-D
now we get it in 2-D,

00:33:48.510 --> 00:33:50.820
practically for free.

00:33:50.820 --> 00:33:53.170
Just the idea of doing this.

00:33:53.170 --> 00:33:56.450
OK, and now I'm going to do
it for finite differences.

00:33:56.450 --> 00:34:04.180
So now I have K2D and I want to
ask you about its eigenvectors,

00:34:04.180 --> 00:34:05.870
and what do you think they are?

00:34:05.870 --> 00:34:08.290
Well, of course,
they're just like those.

00:34:08.290 --> 00:34:17.730
They're just, the eigenvectors,
shall I call them z_kl?

00:34:17.730 --> 00:34:19.660
So these will be
the eigenvectors.

00:34:19.660 --> 00:34:29.090
The eigenvectors z_kl will
be, their components-- I

00:34:29.090 --> 00:34:31.370
don't even know the
best way to write them.

00:34:31.370 --> 00:34:35.410
The trouble is this matrix
is of size N squared.

00:34:35.410 --> 00:34:38.160
Its eigenvectors have
got N squared components,

00:34:38.160 --> 00:34:39.120
and what are they?

00:34:39.120 --> 00:34:41.020
Just you could tell me in words.

00:34:41.020 --> 00:34:42.840
What do you figure
are going to be

00:34:42.840 --> 00:34:46.030
the components of the
eigenvectors in K2D

00:34:46.030 --> 00:34:51.630
when you know them in 1-D?

00:34:51.630 --> 00:34:54.350
Products, of course.

00:34:54.350 --> 00:35:00.330
This construction, however I
write it, is just like this.

00:35:00.330 --> 00:35:05.620
z_kl, a typical component,
typical components--

00:35:05.620 --> 00:35:12.520
So the components of the
eigenvectors are products

00:35:12.520 --> 00:35:25.450
of these guys, like sin(k*pi*h),
something like that.

00:35:25.450 --> 00:35:28.380
I've got indices that I
don't want to get into.

00:35:28.380 --> 00:35:30.860
Just damn it, I'll
just put that.

00:35:30.860 --> 00:35:34.450
Sine here or something, right.

00:35:34.450 --> 00:35:37.760
We could try to sort
out the indices,

00:35:37.760 --> 00:35:45.360
the truth is a kron
operation does it for us.

00:35:45.360 --> 00:35:50.390
So all I'm saying is we've
got an eigenvector with N

00:35:50.390 --> 00:35:53.260
components in the x direction.

00:35:53.260 --> 00:35:57.610
We've got another one with
index l, N components in the y

00:35:57.610 --> 00:35:58.360
direction.

00:35:58.360 --> 00:36:02.340
Multiply these N guys by these
N guys, you get N squared guys.

00:36:02.340 --> 00:36:04.650
Whatever order
you write them in.

00:36:04.650 --> 00:36:07.290
And that's the eigenvector.

00:36:07.290 --> 00:36:15.540
And then the eigenvalue is,
so the eigenvalue will be,

00:36:15.540 --> 00:36:16.700
well what do we got?

00:36:16.700 --> 00:36:26.540
We have a second x difference,
so it will be a 2-2cos(k*pi*h).

00:36:26.540 --> 00:36:29.360
From the xx term.

00:36:29.360 --> 00:36:38.540
And it'll plus the other term
will be a 2-2cos(l*pi*h).

00:36:38.540 --> 00:36:40.390
That's cool, yeah.

00:36:40.390 --> 00:36:47.070
I didn't get into writing the
details of the eigenvector,

00:36:47.070 --> 00:36:48.310
that's a mess.

00:36:48.310 --> 00:36:49.370
This is not a mess.

00:36:49.370 --> 00:36:51.290
This is nice.

00:36:51.290 --> 00:36:52.320
What do I see again?

00:36:52.320 --> 00:36:54.900
I see four coming
from the diagonal.

00:36:54.900 --> 00:36:59.410
I see two minus ones
coming from left and right.

00:36:59.410 --> 00:37:03.420
I see two minus ones
coming from up and below.

00:37:03.420 --> 00:37:07.400
And do I see a positive number?

00:37:07.400 --> 00:37:08.190
You bet.

00:37:08.190 --> 00:37:11.630
Right, this is positive,
this is positive.

00:37:11.630 --> 00:37:12.900
Sum is positive.

00:37:12.900 --> 00:37:17.320
The sum of two positive definite
matrices is positive definite.

00:37:17.320 --> 00:37:23.400
I know everything about K.
And the fast Fourier transform

00:37:23.400 --> 00:37:25.720
makes all those
calculations possible.

00:37:25.720 --> 00:37:30.090
So maybe I, just to
conclude this subject,

00:37:30.090 --> 00:37:34.340
would be to remind
you, how do you

00:37:34.340 --> 00:37:39.320
use the eigenvalues
and eigenvectors

00:37:39.320 --> 00:37:43.860
in solving the equation?

00:37:43.860 --> 00:37:46.200
I guess I'd better
put that on a board.

00:37:46.200 --> 00:37:48.960
But this is what
we did last time.

00:37:48.960 --> 00:37:58.130
So the final step would be
how do I solve (K2D)U=F?

00:37:58.130 --> 00:38:01.340
You remember, what
were the three steps?

00:38:01.340 --> 00:38:05.030
I do really want you to
learn those three steps.

00:38:05.030 --> 00:38:08.420
It's the way eigenvectors
and eigenvalues are used.

00:38:08.420 --> 00:38:10.960
It's the whole point
of finding them.

00:38:10.960 --> 00:38:16.850
The whole point of finding them
is to split this problem into N

00:38:16.850 --> 00:38:21.440
squared little 1-D problems,
where each eigenvector is just

00:38:21.440 --> 00:38:23.530
doing its own thing.

00:38:23.530 --> 00:38:24.630
So what do you do?

00:38:24.630 --> 00:38:30.460
You write F as a combination,
with some coefficients c_kl,

00:38:30.460 --> 00:38:33.690
of the eigenvectors y_kl.

00:38:33.690 --> 00:38:35.560
So these are vectors.

00:38:35.560 --> 00:38:38.700
Put an arrow over them
just to emphasize.

00:38:38.700 --> 00:38:39.770
Those are vectors.

00:38:39.770 --> 00:38:43.500
Then what's the answer,
let's skip the middle step

00:38:43.500 --> 00:38:44.850
which was so easy.

00:38:44.850 --> 00:38:46.110
Tell me the answer.

00:38:46.110 --> 00:38:49.760
Supposed the right-hand side is
a combination of eigenvectors.

00:38:49.760 --> 00:38:53.780
Then the left-hand
side, the answer,

00:38:53.780 --> 00:38:56.320
is also a combination
of eigenvectors.

00:38:56.320 --> 00:39:00.080
And just tell me, what
are the coefficients

00:39:00.080 --> 00:39:03.730
in that combination?

00:39:03.730 --> 00:39:10.390
This is like the whole idea
is on two simple lines here.

00:39:10.390 --> 00:39:14.570
The coefficient there is?

00:39:14.570 --> 00:39:18.710
What do I have? c_kl,
does that come in?

00:39:18.710 --> 00:39:22.840
Yes, because c_kl tells me
how much of this eigenvector

00:39:22.840 --> 00:39:24.980
is here.

00:39:24.980 --> 00:39:28.190
But now, what else
comes in? lambda_kl,

00:39:28.190 --> 00:39:30.480
and what do I do with that?

00:39:30.480 --> 00:39:35.290
Divide by it, because when I
multiply that'll multiply by it

00:39:35.290 --> 00:39:40.770
and bring back F.
So there you go.

00:39:40.770 --> 00:39:43.870
That's the-- This U is
a vector, of course.

00:39:43.870 --> 00:39:45.990
These are all vectors.

00:39:45.990 --> 00:39:51.710
2-D, we'll give them
an arrow, just as

00:39:51.710 --> 00:39:54.560
a reminder that these are
vectors with N squared

00:39:54.560 --> 00:39:55.220
components.

00:39:55.220 --> 00:39:57.500
They're giant
vectors, but the point

00:39:57.500 --> 00:40:02.000
is this y_kl, its N squared
components are just products,

00:40:02.000 --> 00:40:04.800
as we saw here, of
the 1-D problem.

00:40:04.800 --> 00:40:10.130
So the fast Fourier transform,
the 2-D fast Fourier transform

00:40:10.130 --> 00:40:11.840
just takes off.

00:40:11.840 --> 00:40:17.530
Takes off and gives you
this fantastic speed.

00:40:17.530 --> 00:40:20.200
So that's absolutely the right
way to solve the problem.

00:40:20.200 --> 00:40:23.260
And everybody sees that picture?

00:40:23.260 --> 00:40:25.190
Don't forget that picture.

00:40:25.190 --> 00:40:28.490
That's like a nice
part of this subject,

00:40:28.490 --> 00:40:34.390
is to get-- It's
formulas and not code.

00:40:34.390 --> 00:40:37.320
But it's easily
turned into code.

00:40:37.320 --> 00:40:41.720
Because the FFT and the sine
transform are all coded.

00:40:41.720 --> 00:40:44.170
Actually, Professor Johnson
in the Math Department,

00:40:44.170 --> 00:40:48.680
he created the best
FFT code there is.

00:40:48.680 --> 00:40:49.640
Do you know that?

00:40:49.640 --> 00:40:51.150
I'll just mention.

00:40:51.150 --> 00:40:59.080
His code is called FFTW, Fastest
Fourier Transform in the West,

00:40:59.080 --> 00:41:03.810
and the point is it's set up to
be fast on whatever computer,

00:41:03.810 --> 00:41:06.160
whatever architecture
you're using.

00:41:06.160 --> 00:41:07.990
It figures out what that is.

00:41:07.990 --> 00:41:11.130
And optimizes the code for that.

00:41:11.130 --> 00:41:13.460
And gives you the answer.

00:41:13.460 --> 00:41:14.960
OK.

00:41:14.960 --> 00:41:19.220
That's Part 2 complete,
of Section 3.5.

00:41:19.220 --> 00:41:22.530
I guess I'm hoping after
we get through the quiz,

00:41:22.530 --> 00:41:29.770
the next natural step would
be some MATLAB, right?

00:41:29.770 --> 00:41:36.480
We really should have some
MATLAB case of doing this.

00:41:36.480 --> 00:41:39.060
I haven't thought
of it, but I'll try.

00:41:39.060 --> 00:41:41.600
And some MATLAB for
finite elements.

00:41:41.600 --> 00:41:47.140
And there's a lot of
finite element code

00:41:47.140 --> 00:41:52.690
on the course page,
ready to download.

00:41:52.690 --> 00:41:55.130
But now we have
to understand it.

00:41:55.130 --> 00:41:57.930
Are you ready to tackle,
so in ten minutes

00:41:57.930 --> 00:42:02.860
we can get the central idea
of finite elements in 2-D,

00:42:02.860 --> 00:42:07.620
and then after the quiz, when
our minds are clear again,

00:42:07.620 --> 00:42:13.750
we'll do it properly Friday.

00:42:13.750 --> 00:42:17.170
This is asking you a
lot, but can I do it?

00:42:17.170 --> 00:42:22.840
Can I go to finite
elements in 2-D?

00:42:22.840 --> 00:42:25.420
OK.

00:42:25.420 --> 00:42:26.600
Oh, I have a choice.

00:42:26.600 --> 00:42:27.990
Big, big choice.

00:42:27.990 --> 00:42:31.040
I could use triangles, or quads.

00:42:31.040 --> 00:42:35.200
That picture, this picture would
naturally set up for quads.

00:42:35.200 --> 00:42:37.960
Let me start with triangles.

00:42:37.960 --> 00:42:46.450
So I have some region with
lots of triangles here.

00:42:46.450 --> 00:42:48.270
Got to have some
interior points,

00:42:48.270 --> 00:42:51.410
or I'm not going to
have any unknowns.

00:42:51.410 --> 00:42:56.090
Gosh, that's a big mesh
with very little unknown.

00:42:56.090 --> 00:43:01.410
Let me put in another few here.

00:43:01.410 --> 00:43:02.450
Have I got enough?

00:43:02.450 --> 00:43:06.440
Oops, that's not a triangle.

00:43:06.440 --> 00:43:07.470
How's that?

00:43:07.470 --> 00:43:10.320
Is that now a triangulation?

00:43:10.320 --> 00:43:14.380
So that's an unstructured
triangular mesh.

00:43:14.380 --> 00:43:16.310
Its quality is not too bad.

00:43:16.310 --> 00:43:25.900
The angles, some angles are
small but not very small.

00:43:25.900 --> 00:43:29.890
And they're not near-- That
angle's getting a little big

00:43:29.890 --> 00:43:32.980
too, it's getting toward
a 180 degrees which

00:43:32.980 --> 00:43:35.160
you have to stay away from.

00:43:35.160 --> 00:43:40.350
If it was a 180, the
triangle would squash in.

00:43:40.350 --> 00:43:42.650
So it's a bit
squashed, that one.

00:43:42.650 --> 00:43:44.290
This one's a little
long and narrow.

00:43:44.290 --> 00:43:45.980
But not bad.

00:43:45.980 --> 00:43:50.430
And you need a mesh generator
to generate a mesh like this.

00:43:50.430 --> 00:43:55.710
And I had a thesis student
just a few years ago

00:43:55.710 --> 00:43:59.290
who wrote a nice mesh
generator in MATLAB.

00:43:59.290 --> 00:44:01.490
So we get a mesh.

00:44:01.490 --> 00:44:04.170
OK.

00:44:04.170 --> 00:44:09.980
Now, do you remember
the finite element idea?

00:44:09.980 --> 00:44:13.460
Well, first you have
to use the weak form.

00:44:13.460 --> 00:44:17.750
Let's save the weak form
for first thing Friday.

00:44:17.750 --> 00:44:20.410
The weak form of Laplace.

00:44:20.410 --> 00:44:22.980
I need the weak form
of Laplace's equation.

00:44:22.980 --> 00:44:27.550
I'll just tell you what it is.

00:44:27.550 --> 00:44:30.540
We all have double integrals.

00:44:30.540 --> 00:44:32.050
Oh, Poisson.

00:44:32.050 --> 00:44:33.340
I'm making it Poisson.

00:44:33.340 --> 00:44:36.460
I want a right-hand side.

00:44:36.460 --> 00:44:41.020
Double integral,
this will be du/dx.

00:44:45.040 --> 00:44:47.910
d test function/dx.

00:44:47.910 --> 00:44:50.600
And now what's
changed in 2-D, I'll

00:44:50.600 --> 00:44:57.260
also have a du/dy dv/dy, dxdy.

00:44:57.260 --> 00:44:58.980
That's what I'll get.

00:44:58.980 --> 00:45:00.920
And on the right-hand
side I'll just

00:45:00.920 --> 00:45:07.490
have f, the load,
times the test. dxdy.

00:45:10.120 --> 00:45:13.090
Yeah I guess, I have to write
that down because that's

00:45:13.090 --> 00:45:15.540
our starting point.

00:45:15.540 --> 00:45:18.030
Do you remember the situation,
and of course that's

00:45:18.030 --> 00:45:24.570
on the exam this evening,
is remembering about

00:45:24.570 --> 00:45:28.890
the weak form in
1-D. So in 2-D I

00:45:28.890 --> 00:45:32.750
expect to see x's and y's,
my functions are functions

00:45:32.750 --> 00:45:34.230
of x and y.

00:45:34.230 --> 00:45:37.630
I have my, this is my solution.

00:45:37.630 --> 00:45:41.510
The v's are all
possible test functions,

00:45:41.510 --> 00:45:47.430
and this hold for every--
This is like the virtual work.

00:45:47.430 --> 00:45:50.420
You could call it the equation
of virtual work, if your

00:45:50.420 --> 00:45:53.150
were a little old-fashioned.

00:45:53.150 --> 00:45:55.840
Those v's are virtual
displacements,

00:45:55.840 --> 00:45:57.150
they're test functions.

00:45:57.150 --> 00:45:59.350
That's what it looks like.

00:45:59.350 --> 00:46:04.390
I'll come back to that
at the start of Friday.

00:46:04.390 --> 00:46:07.400
What's the finite element idea?

00:46:07.400 --> 00:46:10.540
Just as in 1-D, the
finite element idea

00:46:10.540 --> 00:46:13.450
is choose some trial
functions, right?

00:46:13.450 --> 00:46:15.850
Choose some trial functions.

00:46:15.850 --> 00:46:20.220
And our approximate guy is
going to be some combination

00:46:20.220 --> 00:46:22.200
of these trial functions.

00:46:22.200 --> 00:46:25.150
Some coefficient U_1
times the first trial

00:46:25.150 --> 00:46:35.560
function plus so on, plus U_n
times the n-th trial function.

00:46:35.560 --> 00:46:37.960
So this will be our--
And these will also

00:46:37.960 --> 00:46:39.600
be our test functions again.

00:46:39.600 --> 00:46:47.370
These will also be, the
phis are also the V's.

00:46:47.370 --> 00:46:49.310
I'll get an equation.

00:46:49.310 --> 00:46:52.190
By using n tests, by
using the weak form

00:46:52.190 --> 00:46:55.210
n times for these n functions.

00:46:55.210 --> 00:47:01.240
And so each equation comes--
V is one of the phis,

00:47:01.240 --> 00:47:03.590
U is this combination of phis.

00:47:03.590 --> 00:47:04.690
Plug it in.

00:47:04.690 --> 00:47:07.430
You get an equation.

00:47:07.430 --> 00:47:10.500
What do I got to do
in three minutes, is

00:47:10.500 --> 00:47:13.310
speak about the most
important point.

00:47:13.310 --> 00:47:14.490
The phis.

00:47:14.490 --> 00:47:17.360
Choosing the phis
is what matters.

00:47:17.360 --> 00:47:20.900
That's what made
finite elements win.

00:47:20.900 --> 00:47:26.160
The fact that I choose nice
simple functions, which

00:47:26.160 --> 00:47:31.730
are polynomials, little easy
polynomials on each element,

00:47:31.730 --> 00:47:33.590
on each triangle.

00:47:33.590 --> 00:47:35.680
And the ones I'm going
to speak about today

00:47:35.680 --> 00:47:37.750
are the linear ones.

00:47:37.750 --> 00:47:39.580
They're like hat
functions, right?

00:47:39.580 --> 00:47:43.070
But now we're in 2-D.
They're going to be pyramids.

00:47:43.070 --> 00:47:48.220
So if I take, this is
unknown number one.

00:47:48.220 --> 00:47:50.930
Unknown number one, it's
got its hat function.

00:47:50.930 --> 00:47:52.250
Pyramid function, sorry.

00:47:52.250 --> 00:47:53.480
Pyramid function.

00:47:53.480 --> 00:47:56.440
So its pyramid function
is a one there, right?

00:47:56.440 --> 00:48:01.740
The pyramid, top of the
pyramid is over that point.

00:48:01.740 --> 00:48:06.650
And it goes down to zero so
it's zero at all these points.

00:48:06.650 --> 00:48:08.810
Well, at all the other points.

00:48:08.810 --> 00:48:11.510
That's the one beauty
of finite elements,

00:48:11.510 --> 00:48:18.190
is that then this U, this
coefficient U_1 that we

00:48:18.190 --> 00:48:21.860
compute, will actually be our
approximation at this point.

00:48:21.860 --> 00:48:25.330
Because all the others
are zero at that point.

00:48:25.330 --> 00:48:27.840
So can you just,
this is all you have

00:48:27.840 --> 00:48:32.500
to do in the last 60 seconds
is visualize this function.

00:48:32.500 --> 00:48:33.250
Do you see it?

00:48:33.250 --> 00:48:35.700
Maybe tent would be
better than pyramid?

00:48:35.700 --> 00:48:36.790
Either one.

00:48:36.790 --> 00:48:39.680
What's the base of the pyramid?

00:48:39.680 --> 00:48:42.980
The base of the
pyramid, I'm thinking

00:48:42.980 --> 00:48:48.000
of the surface as a way to
visualize this function.

00:48:48.000 --> 00:48:53.090
It's a function that's one here,
it goes down to zero linearly.

00:48:53.090 --> 00:48:57.270
So these are linear
triangular elements.

00:48:57.270 --> 00:48:59.720
What's the base of the pyramid?

00:48:59.720 --> 00:49:03.730
Just this, right?

00:49:03.730 --> 00:49:05.950
That's the base.

00:49:05.950 --> 00:49:09.970
Because over in these
other triangles,

00:49:09.970 --> 00:49:11.720
nothing ever got off zero.

00:49:11.720 --> 00:49:13.030
Nothing got off the ground.

00:49:13.030 --> 00:49:15.070
It's zero, zero,
zero at all three.

00:49:15.070 --> 00:49:18.420
If I know it at all three
corners, I know it everywhere.

00:49:18.420 --> 00:49:22.030
For linear functions, it's
just a piece of flat roof.

00:49:22.030 --> 00:49:23.030
Piece of flat roof.

00:49:23.030 --> 00:49:25.960
So I have, how many pieces
have I got around this point?

00:49:25.960 --> 00:49:27.200
Oh, where is the point?

00:49:27.200 --> 00:49:32.880
I guess I've got one, two,
three, four, five, six, is it?

00:49:32.880 --> 00:49:37.870
It's a six, it's a pyramid with
six sloping faces sloping down

00:49:37.870 --> 00:49:41.630
to zero along the sides, right?

00:49:41.630 --> 00:49:47.480
So it's like a six-sided
teepee, six-sided tent.

00:49:47.480 --> 00:49:53.340
And here are the, the
rods that hold the tent up

00:49:53.340 --> 00:49:55.190
would be these six things.

00:49:55.190 --> 00:50:00.520
And then the six sides
would be six flat pieces.

00:50:00.520 --> 00:50:07.420
If you would see what I've tried
to draw there, that's phi_1.

00:50:07.420 --> 00:50:10.500
And you can imagine
that when I've got that,

00:50:10.500 --> 00:50:14.070
I can take the x derivative
and the y derivative.

00:50:14.070 --> 00:50:17.920
What will I know about the x
derivative and the y derivative

00:50:17.920 --> 00:50:20.120
in a typical triangle?

00:50:20.120 --> 00:50:26.000
If my function is in a typical
triangle, say in this triangle,

00:50:26.000 --> 00:50:28.510
my function looks like a+bx+cy.

00:50:31.970 --> 00:50:34.550
a+bx-- it's flat.

00:50:34.550 --> 00:50:35.760
It's linear.

00:50:35.760 --> 00:50:39.330
And these three numbers, a
and b, are decided by the fact

00:50:39.330 --> 00:50:42.520
that the function should be
one there, zero there, and zero

00:50:42.520 --> 00:50:43.590
there.

00:50:43.590 --> 00:50:45.540
Three facts about
the function, three

00:50:45.540 --> 00:50:49.240
coefficients to
match those facts.

00:50:49.240 --> 00:50:54.220
And what's the deal
on the x derivative?

00:50:54.220 --> 00:50:54.910
It's just b.

00:50:54.910 --> 00:50:56.470
It's a constant.

00:50:56.470 --> 00:50:58.910
The y derivative is
just c, a constant.

00:50:58.910 --> 00:51:04.470
So the integrals are easy and
the the whole finite element

00:51:04.470 --> 00:51:08.070
system just goes smoothly.

00:51:08.070 --> 00:51:12.280
So then what the finite
element system has to do,

00:51:12.280 --> 00:51:14.260
and we'll talk
about it Friday, is

00:51:14.260 --> 00:51:17.460
gotta keep track of which
triangles go to which nodes.

00:51:17.460 --> 00:51:20.760
How do you assemble, where
do these pieces go in?

00:51:20.760 --> 00:51:26.560
But every finite-- every element
matrix is going to be simple.

00:51:26.560 --> 00:51:27.810
OK.