WEBVTT

00:00:00.030 --> 00:00:02.330
The following content is
provided under a Creative

00:00:02.330 --> 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.960
continue to offer high quality
educational research for free.

00:00:09.960 --> 00:00:12.590
To make a donation, or to
view additional materials

00:00:12.590 --> 00:00:16.900
from hundreds of MIT courses,
visit MIT OpenCourseWare

00:00:16.900 --> 00:00:19.290
at ocw.mit.edu.

00:00:19.290 --> 00:00:24.110
PROFESSOR STRANG: I'm
open for questions

00:00:24.110 --> 00:00:27.560
as always on every
aspect, or comments

00:00:27.560 --> 00:00:30.020
on every aspect of the course.

00:00:30.020 --> 00:00:33.030
Yeah?

00:00:33.030 --> 00:00:52.720
The MATLAB problem, yes.

00:00:52.720 --> 00:00:55.170
I better remember what
that MATLAB problem is.

00:00:55.170 --> 00:01:04.130
So it's solving the equation
-u''+Vu' equal some delta

00:01:04.130 --> 00:01:09.540
function halfway along?

00:01:09.540 --> 00:01:17.170
And I chose boundary
conditions like those

00:01:17.170 --> 00:01:24.180
so that this gets replaced by a
matrix K over delta x squared.

00:01:24.180 --> 00:01:30.020
And this term is V times
some centered difference.

00:01:30.020 --> 00:01:33.780
I don't know whether I should
use C. We called C, earlier

00:01:33.780 --> 00:01:36.010
in the book, C was a circulant.

00:01:36.010 --> 00:01:40.630
This is a centered first
difference over delta x

00:01:40.630 --> 00:01:46.920
equal right-hand side.

00:01:46.920 --> 00:01:59.400
All that multiplies the
discrete solution u.

00:01:59.400 --> 00:02:01.460
I didn't get that very
well for the camera.

00:02:01.460 --> 00:02:03.820
Maybe I'll say it again.

00:02:03.820 --> 00:02:09.250
We have the second difference
that corresponds to -u''.

00:02:09.250 --> 00:02:12.550
And V times the first difference
that corresponds to Vu'.

00:02:12.550 --> 00:02:18.810
And then, the problem is--

00:02:18.810 --> 00:02:23.670
So the physical problem is,
what happens as V gets larger?

00:02:23.670 --> 00:02:25.510
V grows.

00:02:25.510 --> 00:02:31.510
How does the solution
change as V increases?

00:02:31.510 --> 00:02:34.700
So it's a very
practical problem.

00:02:34.700 --> 00:02:39.440
The V measures the importance
of this convection,

00:02:39.440 --> 00:02:43.490
the velocity of the fluid.

00:02:43.490 --> 00:02:56.810
Then n, which is, well maybe
delta x is 1/(n+1), maybe.

00:02:56.810 --> 00:03:02.340
So that we would have n
interior points and we know

00:03:02.340 --> 00:03:06.620
the boundary values.

00:03:06.620 --> 00:03:14.080
So the question is how do we
interpret this increasing n?

00:03:14.080 --> 00:03:17.500
I guess we expect more
and more accuracy, right?

00:03:17.500 --> 00:03:21.380
As n increases, delta
x getting smaller.

00:03:21.380 --> 00:03:27.430
Our idea is that this should
be a better and better

00:03:27.430 --> 00:03:33.960
approximation to the
differential equation.

00:03:33.960 --> 00:03:38.640
The question about the
eigenvalues of this matrix,

00:03:38.640 --> 00:03:44.580
I don't know exactly the answer.

00:03:44.580 --> 00:03:49.020
So the eigenvalues, did you
discover that the eigenvalues

00:03:49.020 --> 00:03:50.520
suddenly, they change?

00:03:50.520 --> 00:03:56.060
They're real for small
values of V and n.

00:03:56.060 --> 00:04:02.290
But then there's some point
at which they become complex.

00:04:02.290 --> 00:04:09.390
And a point that involves both
V and delta x actually, V and n.

00:04:09.390 --> 00:04:12.680
It's kind of interesting.

00:04:12.680 --> 00:04:22.330
I guess at this moment,
interesting is the key word.

00:04:22.330 --> 00:04:24.590
So what is the
physics going on here?

00:04:24.590 --> 00:04:35.960
So I have a 1-D flow
and it's blocked

00:04:35.960 --> 00:04:38.380
by these boundary
conditions are sort

00:04:38.380 --> 00:04:42.120
of blocking it at both ends.

00:04:42.120 --> 00:04:43.920
And I'm looking
for a steady state.

00:04:43.920 --> 00:04:47.800
And I'm feeding in
this source here.

00:04:47.800 --> 00:04:54.040
So I'm feeding in a
source halfway along.

00:04:54.040 --> 00:04:55.920
So I think that would be right.

00:04:55.920 --> 00:05:01.430
Now what's going
to happen roughly?

00:05:01.430 --> 00:05:05.240
This term is, I think,
flowing to the right.

00:05:05.240 --> 00:05:11.850
So it's going to carry, suppose
this was smoke or particles

00:05:11.850 --> 00:05:13.280
or whatever.

00:05:13.280 --> 00:05:16.310
This is like an
environmental differential

00:05:16.310 --> 00:05:19.310
equation or a chemical
engineering equation.

00:05:19.310 --> 00:05:22.820
Just oh, and more and
more applications.

00:05:22.820 --> 00:05:30.720
So I think of it as this term
is carrying the flow with it.

00:05:30.720 --> 00:05:31.400
Like, that way.

00:05:31.400 --> 00:05:38.010
So I'm expecting your solutions
to be larger on this side.

00:05:38.010 --> 00:05:43.200
And how do we get any
action at all on the left?

00:05:43.200 --> 00:05:46.900
That comes from the diffusion.

00:05:46.900 --> 00:05:52.800
The particles, when they enter,
get carried away, and faster

00:05:52.800 --> 00:05:54.750
and faster as V increases.

00:05:54.750 --> 00:05:57.660
But at the same
time they diffuse,

00:05:57.660 --> 00:05:59.290
they bounce back and forth.

00:05:59.290 --> 00:06:04.540
And some bit of
it goes this way.

00:06:04.540 --> 00:06:06.520
But not a lot.

00:06:06.520 --> 00:06:11.240
I'm guessing that the solution
would have a profile that

00:06:11.240 --> 00:06:13.010
would be kind of small.

00:06:13.010 --> 00:06:16.140
And then there's whatever jump
there has to be here, and then

00:06:16.140 --> 00:06:18.380
larger there.

00:06:18.380 --> 00:06:25.630
Oh, but then I have
to get it to zero.

00:06:25.630 --> 00:06:27.330
It's a strange situation.

00:06:27.330 --> 00:06:31.340
And maybe I'll take this
chance to mention it.

00:06:31.340 --> 00:06:38.790
What happens as V gets
really, really large?

00:06:38.790 --> 00:06:43.540
You could say okay, as
V gets extremely large,

00:06:43.540 --> 00:06:45.080
forget that term.

00:06:45.080 --> 00:06:47.070
This is the important term.

00:06:47.070 --> 00:06:49.510
Vu' equals that.

00:06:49.510 --> 00:06:52.030
Which we could easily solve.

00:06:52.030 --> 00:06:58.260
But this equation
with just this term

00:06:58.260 --> 00:07:00.130
is only first order, right?

00:07:00.130 --> 00:07:01.950
It only has a first derivative.

00:07:01.950 --> 00:07:04.000
And how many boundary
conditions would we

00:07:04.000 --> 00:07:08.080
expect to have if I gave
you, if this wasn't here

00:07:08.080 --> 00:07:11.480
and I gave you just a
first order equation?

00:07:11.480 --> 00:07:12.580
One.

00:07:12.580 --> 00:07:14.610
And we've got two.

00:07:14.610 --> 00:07:16.160
Which we're imposing.

00:07:16.160 --> 00:07:19.710
So this sort of
limit as V increases,

00:07:19.710 --> 00:07:24.300
it produces something
called a boundary layer.

00:07:24.300 --> 00:07:31.410
The solution is forced
to satisfy these boundary

00:07:31.410 --> 00:07:31.960
conditions.

00:07:31.960 --> 00:07:34.210
One of them, it's
quite happy about.

00:07:34.210 --> 00:07:36.720
The other one, it didn't
really want to satisfy.

00:07:36.720 --> 00:07:41.280
It only satisfied them
because, I had two

00:07:41.280 --> 00:07:42.950
originally with this part.

00:07:42.950 --> 00:07:47.330
But as this takes
over, the struggle

00:07:47.330 --> 00:07:50.150
to satisfy that second boundary
condition that it really

00:07:50.150 --> 00:07:52.940
doesn't want to
satisfy is resolved

00:07:52.940 --> 00:07:56.080
by something, a
layer that just makes

00:07:56.080 --> 00:08:00.870
a sort of exponential correction
at the boundary to get

00:08:00.870 --> 00:08:03.030
to where it's supposed to go.

00:08:03.030 --> 00:08:03.860
So, anyway.

00:08:03.860 --> 00:08:08.850
This is a model problem
that has boundary layers.

00:08:08.850 --> 00:08:13.940
Those are terrifically
important in aerodynamics,

00:08:13.940 --> 00:08:17.790
you have layers around
the actual aircraft.

00:08:17.790 --> 00:08:22.980
So lots of physics and
computational science

00:08:22.980 --> 00:08:28.430
is hiding in this
type of example.

00:08:28.430 --> 00:08:29.880
So those are a few words.

00:08:29.880 --> 00:08:34.790
But not an answer
to your question.

00:08:34.790 --> 00:08:38.950
I guess I'm happy if
you, for example, let

00:08:38.950 --> 00:08:43.450
me know where the eigenvalues
change from real to complex.

00:08:43.450 --> 00:08:46.040
I mean, it happens,
but you can probably,

00:08:46.040 --> 00:08:47.840
if you look at the
matrix, you can

00:08:47.840 --> 00:08:58.720
see what happens at the point
where that change takes place.

00:08:58.720 --> 00:08:59.720
That's some comments.

00:08:59.720 --> 00:09:05.140
And with the MATLAB, pure
MATLAB part, I guess I'm hoping,

00:09:05.140 --> 00:09:09.430
and the graders are hoping,
that by providing a code

00:09:09.430 --> 00:09:15.160
we'll get a pretty
systematic set of answers

00:09:15.160 --> 00:09:23.390
for the requested V equal,
what was it, 3 and 12 maybe,

00:09:23.390 --> 00:09:24.310
or something.

00:09:24.310 --> 00:09:26.330
And the requested n, delta x's.

00:09:29.080 --> 00:09:31.510
So I'm hoping that
everybody's graph

00:09:31.510 --> 00:09:36.620
is going to look pretty
similar for those requests.

00:09:36.620 --> 00:09:42.190
And then if you could do a
little exploration yourself

00:09:42.190 --> 00:09:47.430
and make that a fifth
page, or really less

00:09:47.430 --> 00:09:53.080
than a page, about take
V larger, take n larger,

00:09:53.080 --> 00:09:54.790
what happens?

00:09:54.790 --> 00:09:57.740
I'm very happy.

00:09:57.740 --> 00:09:59.720
Or any direction.

00:09:59.720 --> 00:10:03.480
I mean, just think of
it as a mini-project

00:10:03.480 --> 00:10:08.060
to do the requested
ones and then

00:10:08.060 --> 00:10:15.280
to do a little experimentation.

00:10:15.280 --> 00:10:22.010
I'll just be interested
about anything you observe.

00:10:22.010 --> 00:10:28.480
So there's no right
answer to that part.

00:10:28.480 --> 00:10:33.030
Is that any help
with the MATLAB?

00:10:33.030 --> 00:10:37.820
Let me just say, since
you showed up today,

00:10:37.820 --> 00:10:40.940
if you have trouble
with the MATLAB

00:10:40.940 --> 00:10:46.330
and you need Peter's
help at noon Friday

00:10:46.330 --> 00:10:50.740
it would be okay to turn in
the MATLAB later on Friday.

00:10:50.740 --> 00:10:52.730
I shouldn't say that.

00:10:52.730 --> 00:10:55.580
But I just did.

00:10:55.580 --> 00:10:57.520
So there you are.

00:10:57.520 --> 00:11:00.490
Right.

00:11:00.490 --> 00:11:06.450
I mean, this course,
as you've begun to see,

00:11:06.450 --> 00:11:10.280
I know that you have lots
of demands on your time.

00:11:10.280 --> 00:11:13.610
And sometimes you
have job interviews.

00:11:13.610 --> 00:11:14.910
All sorts of stuff.

00:11:14.910 --> 00:11:17.320
Conferences that
you have to go to.

00:11:17.320 --> 00:11:19.210
We deal with that.

00:11:19.210 --> 00:11:25.260
So just give me the
homeworks as soon as you can.

00:11:25.260 --> 00:11:29.990
If you're ready Friday at
class time, that's perfect.

00:11:29.990 --> 00:11:38.120
If are stuck on
MATLAB and you want

00:11:38.120 --> 00:11:41.740
to go to Peter's discussion,
which follows the Friday

00:11:41.740 --> 00:11:45.120
class in here, that's fine too.

00:11:45.120 --> 00:11:48.190
So that's some thoughts
about the MATLAB

00:11:48.190 --> 00:11:53.200
and it's partly open-ended.

00:11:53.200 --> 00:11:57.030
What about lots of other
things in this course?

00:11:57.030 --> 00:11:59.210
Homework came in.

00:11:59.210 --> 00:12:00.200
How was the homework?

00:12:00.200 --> 00:12:02.540
Maybe I just take
this chance to ask.

00:12:02.540 --> 00:12:05.020
Was it a reasonable length?

00:12:05.020 --> 00:12:07.270
The homework three, the pset?

00:12:09.940 --> 00:12:15.070
Not too bad?

00:12:15.070 --> 00:12:21.000
I will be able to post solutions
because several people are

00:12:21.000 --> 00:12:28.240
contributing typed
solutions that could go

00:12:28.240 --> 00:12:36.360
on on the
math.mit.edu/cse website.

00:12:36.360 --> 00:12:39.520
Or they could also
go on our 18.085

00:12:39.520 --> 00:12:41.350
website for this semester.

00:12:41.350 --> 00:12:42.630
Good.

00:12:42.630 --> 00:12:44.490
Okay, help me out
with some questions.

00:12:44.490 --> 00:12:58.150
Thanks.

00:12:58.150 --> 00:13:01.400
So the question is
about element matrices.

00:13:01.400 --> 00:13:12.450
In lecture 8, I guess it was,
where we were assembling this,

00:13:12.450 --> 00:13:16.970
I used the word that's used
by finite element people,

00:13:16.970 --> 00:13:21.710
we were assembling K.
And one way to do it

00:13:21.710 --> 00:13:26.120
was to multiply
the three matrices.

00:13:26.120 --> 00:13:30.060
But that's not how
it's actually done.

00:13:30.060 --> 00:13:35.860
It's actually assembled
out of small matrices.

00:13:35.860 --> 00:13:39.910
Maybe small K would
be the right--

00:13:39.910 --> 00:13:43.700
So this would be a K_element.

00:13:43.700 --> 00:13:47.580
Out of smaller element matrices.

00:13:47.580 --> 00:13:51.360
So for example, what's
the element matrix for,

00:13:51.360 --> 00:13:56.770
one for each spring in this
particular problem of springs

00:13:56.770 --> 00:13:57.770
and masses.

00:13:57.770 --> 00:14:03.660
So let me draw some springs,
some masses, some springs,

00:14:03.660 --> 00:14:06.470
another mass, more
springs, fixed,

00:14:06.470 --> 00:14:10.460
not fixed, whatever,
maybe fixed-free

00:14:10.460 --> 00:14:12.140
the way I've drawn it there.

00:14:12.140 --> 00:14:16.940
So here's a spring with
spring constant c_2.

00:14:16.940 --> 00:14:22.240
And we could look
at the contribution

00:14:22.240 --> 00:14:29.160
to the whole matrix coming
from this piece of the problem.

00:14:29.160 --> 00:14:32.570
This was actually, the
finite element method

00:14:32.570 --> 00:14:36.560
has a wonderful
history of people,

00:14:36.560 --> 00:14:38.890
and it had different
names way back,

00:14:38.890 --> 00:14:44.710
of people seeing the
structure as broken in pieces

00:14:44.710 --> 00:14:47.520
and then connected together.

00:14:47.520 --> 00:14:50.970
And then what did a
typical piece look like?

00:14:50.970 --> 00:14:56.180
So a typical piece
there, well, you

00:14:56.180 --> 00:14:59.290
let me just write down what
this matrix is going to be.

00:14:59.290 --> 00:15:03.750
The little element matrix
is coming from spring two.

00:15:03.750 --> 00:15:06.790
So this would be,
like element two will

00:15:06.790 --> 00:15:10.260
be, it'll have a c_2 outside.

00:15:10.260 --> 00:15:12.630
I'll put the c_2 outside.

00:15:12.630 --> 00:15:18.530
And then inside will
be a little, this guy.

00:15:18.530 --> 00:15:23.710
And we can talk more
about why it's that one.

00:15:23.710 --> 00:15:30.800
But just to have the element
matrix there on the board.

00:15:30.800 --> 00:15:38.540
So my claim is that this is
a small piece of the big K.

00:15:38.540 --> 00:15:45.280
So the big K matrix, what's the
size of the big K, of K itself?

00:15:45.280 --> 00:15:48.080
Three by three in this
case, yeah, three masses.

00:15:48.080 --> 00:15:50.780
So it'll be three by three.

00:15:50.780 --> 00:15:56.650
So I'm thinking that
this spring which

00:15:56.650 --> 00:16:03.340
connects mass one to mass two,
so it's only going to be like,

00:16:03.340 --> 00:16:07.930
a two by two piece, a little
local piece, you could say,

00:16:07.930 --> 00:16:13.050
that that little
K fits in this--

00:16:13.050 --> 00:16:20.430
is assembled into the-- I
better call it K_2, right?

00:16:20.430 --> 00:16:26.230
So it's a little K that sits
up in this two by two block

00:16:26.230 --> 00:16:29.540
and doesn't contribute
to the rest.

00:16:29.540 --> 00:16:32.170
Then let's just draw
the rest of the picture.

00:16:32.170 --> 00:16:35.380
So this would produce
an element matrix

00:16:35.380 --> 00:16:39.010
that looks just the same,
that's the beauty of this.

00:16:39.010 --> 00:16:43.260
That all the elements, apart
from change in the spring

00:16:43.260 --> 00:16:44.760
constant, look the same.

00:16:44.760 --> 00:16:49.170
So there'd be a little K_3.

00:16:49.170 --> 00:16:51.430
And where will it go?

00:16:51.430 --> 00:16:55.170
This is the whole
core to the point.

00:16:55.170 --> 00:16:57.690
It'll go to the lower right.

00:16:57.690 --> 00:17:00.910
Down here?

00:17:00.910 --> 00:17:02.820
Overlapping, overlapping.

00:17:02.820 --> 00:17:09.350
Because this mass is attached
to that spring and to that one.

00:17:09.350 --> 00:17:12.760
So these little element
matrices, they overlap.

00:17:12.760 --> 00:17:18.610
And you just need, if you
can imagine the code that's

00:17:18.610 --> 00:17:22.480
going to do this, you
need a list of springs

00:17:22.480 --> 00:17:25.140
and a list of masses and
a list of the connections

00:17:25.140 --> 00:17:26.150
between them.

00:17:26.150 --> 00:17:29.990
And it'll sit in here
because it's two by two.

00:17:29.990 --> 00:17:32.500
So that's two by two,
that's two by two

00:17:32.500 --> 00:17:38.980
and in this overlap entry will
be a c_2 from the upper box.

00:17:38.980 --> 00:17:43.850
It'll be a c_2+c_3 as
we discovered by direct

00:17:43.850 --> 00:17:45.310
multiplication.

00:17:45.310 --> 00:17:47.640
So that's that spring.

00:17:47.640 --> 00:17:51.280
Now what about
this first spring?

00:17:51.280 --> 00:17:54.290
So there's a little K_1.

00:17:54.290 --> 00:17:57.970
Now K_1 should look
the same as this.

00:17:57.970 --> 00:17:59.480
Except what?

00:17:59.480 --> 00:18:04.300
So it's going to be a difference
with this spring because?

00:18:04.300 --> 00:18:09.330
Because of this fixed end.

00:18:09.330 --> 00:18:12.320
There's no mass zero.

00:18:12.320 --> 00:18:17.830
K_1 would normally sit up
here, but actually it's

00:18:17.830 --> 00:18:21.190
only going to be one by one.

00:18:21.190 --> 00:18:30.210
So the K_1 little element matrix
would look like c_1[1, -1; -1,

00:18:30.210 --> 00:18:31.010
1].

00:18:31.010 --> 00:18:34.670
And then the boundary
conditions knock those out.

00:18:34.670 --> 00:18:39.390
And an interesting point
if you're writing big code

00:18:39.390 --> 00:18:40.870
you have to decide.

00:18:40.870 --> 00:18:46.240
Do I, as I create K_1,
this little element matrix,

00:18:46.240 --> 00:18:49.550
do I pay attention to
the boundary conditions?

00:18:49.550 --> 00:18:53.970
And then K_1 would just
be that single number

00:18:53.970 --> 00:18:56.350
c_1 which would sit there.

00:18:56.350 --> 00:19:01.940
So up there will be c_1
from the K_1 matrix and c_2

00:19:01.940 --> 00:19:05.170
from the k_2 matrix.

00:19:05.170 --> 00:19:08.690
That's the entry there.

00:19:08.690 --> 00:19:12.190
And then, as I say, in
coding finite elements, which

00:19:12.190 --> 00:19:17.080
you guys may do at some
point, there's a question.

00:19:17.080 --> 00:19:18.020
What's sufficient?

00:19:18.020 --> 00:19:23.350
Shall I pay attention
to the boundary

00:19:23.350 --> 00:19:25.810
in creating these
element matrices

00:19:25.810 --> 00:19:27.690
or shall I do it later?

00:19:27.690 --> 00:19:31.900
And the rule seems
to be, do it later.

00:19:31.900 --> 00:19:36.860
So what gets created
in finite elements

00:19:36.860 --> 00:19:43.200
is a, in our language would
be a, free-free matrix.

00:19:43.200 --> 00:19:55.440
It's a matrix where even this
spring has a two by two piece.

00:19:55.440 --> 00:20:01.440
So what's the problem
with the free-free matrix?

00:20:01.440 --> 00:20:05.400
The free-free matrices,
those with no supports,

00:20:05.400 --> 00:20:08.300
those matrices will be singular.

00:20:08.300 --> 00:20:10.000
Right, singular.

00:20:10.000 --> 00:20:13.350
Because the vector
of all ones, if you

00:20:13.350 --> 00:20:17.130
multiply the K, the
free-free matrix

00:20:17.130 --> 00:20:20.140
times the vector of
all ones, you get zero.

00:20:20.140 --> 00:20:23.520
The whole thing could shift.

00:20:23.520 --> 00:20:28.080
And will have other rigid
motions in two dimensions.

00:20:28.080 --> 00:20:31.050
Let's just think ahead here.

00:20:31.050 --> 00:20:36.550
What are the rigid motions,
the null space of K,

00:20:36.550 --> 00:20:41.030
you could say, for a
two-dimensional truss.

00:20:41.030 --> 00:20:44.320
So I've got a bunch
of bars and springs.

00:20:44.320 --> 00:20:46.160
Think of a mattress.

00:20:46.160 --> 00:20:47.775
I'm in two
dimensions, a mattress

00:20:47.775 --> 00:20:54.470
is a bunch of springs
connected in a 2-D grid.

00:20:54.470 --> 00:20:58.810
And say it's free at both ends.

00:20:58.810 --> 00:21:00.850
So what can I do to a mattress?

00:21:00.850 --> 00:21:01.580
Oh, my gosh!

00:21:01.580 --> 00:21:05.680
I didn't expect that
to be on videotape.

00:21:05.680 --> 00:21:06.870
So it's in the plane.

00:21:06.870 --> 00:21:09.380
We're in 2-D here.

00:21:09.380 --> 00:21:13.630
What can I do if there are
no boundary conditions?

00:21:13.630 --> 00:21:15.740
Well I can shift
it to the right.

00:21:15.740 --> 00:21:16.240
Right?

00:21:16.240 --> 00:21:18.040
That's our [1, 1, 1, 1, 1].

00:21:18.040 --> 00:21:20.360
What else can I do?

00:21:20.360 --> 00:21:21.760
I can rotate.

00:21:21.760 --> 00:21:23.340
And I can shift
it the other way.

00:21:23.340 --> 00:21:29.140
So there would be three rigid
motions for the 2-D problem.

00:21:29.140 --> 00:21:33.420
Two translations and a rotation.

00:21:33.420 --> 00:21:35.460
And when you get up
to three dimensions,

00:21:35.460 --> 00:21:40.250
do you want to guess
what's the number in 3-D?

00:21:40.250 --> 00:21:41.110
Six.

00:21:41.110 --> 00:21:42.240
Number is six.

00:21:42.240 --> 00:21:46.580
Three translations and
rotations around three axes.

00:21:46.580 --> 00:21:54.010
So those, either one rigid
motion or three rigid motions

00:21:54.010 --> 00:21:58.410
or six rigid
motions have to get,

00:21:58.410 --> 00:21:59.970
the boundary
conditions eventually

00:21:59.970 --> 00:22:05.020
have to remove those, have
to knock out rows and columns

00:22:05.020 --> 00:22:05.780
and remove them.

00:22:05.780 --> 00:22:13.150
But my point was just that
quite efficient to do it later.

00:22:13.150 --> 00:22:15.820
The picture is so clear here.

00:22:15.820 --> 00:22:18.026
So the actual
matrix would be four

00:22:18.026 --> 00:22:20.900
by four, the unreduced matrix.

00:22:20.900 --> 00:22:27.500
And then when we
fix node zero there,

00:22:27.500 --> 00:22:30.560
that would knock out that part
and leave the three by three

00:22:30.560 --> 00:22:31.630
that we want.

00:22:31.630 --> 00:22:38.250
So this is just discussion of
how to think of this matrix K.

00:22:38.250 --> 00:22:42.220
So the direct way
to think of it was

00:22:42.220 --> 00:22:46.840
as a product of big matrices.

00:22:46.840 --> 00:22:53.000
But in reality it's assembled
from these element pieces.

00:22:53.000 --> 00:22:56.870
And of course, our goal in
talking about finite elements

00:22:56.870 --> 00:23:00.430
will be to see that.

00:23:00.430 --> 00:23:04.620
It'll come up again, of course.

00:23:04.620 --> 00:23:11.150
Your good question led me there,
but did I answer the question?

00:23:11.150 --> 00:23:14.970
And maybe the way I
mentioned it in class was

00:23:14.970 --> 00:23:19.890
to notice that these guys,
these element matrices

00:23:19.890 --> 00:23:22.770
can be thought of this way.

00:23:22.770 --> 00:23:26.450
It is matrix multiplication,
but done differently.

00:23:26.450 --> 00:23:30.820
It's a column of this
matrix times the number

00:23:30.820 --> 00:23:33.650
c here times a row of this.

00:23:33.650 --> 00:23:38.260
So it's matrix multiplication,
columns times rows.

00:23:38.260 --> 00:23:49.060
So you can multiply AB,
columns of A times rows of B

00:23:49.060 --> 00:23:55.090
and then add over,
from one to n.

00:23:55.090 --> 00:24:01.340
So column of A times
row of B. So a column,

00:24:01.340 --> 00:24:03.350
then, is a vector like this.

00:24:03.350 --> 00:24:10.590
A row is a vector like that.

00:24:10.590 --> 00:24:15.700
And the result is
a full size matrix,

00:24:15.700 --> 00:24:18.880
but if the column
is concentrated

00:24:18.880 --> 00:24:21.690
at a couple of nodes
and the row is,

00:24:21.690 --> 00:24:28.630
then it will have zeroes
everywhere except at that.

00:24:28.630 --> 00:24:34.230
This is the element matrix,
with the C included.

00:24:34.230 --> 00:24:41.010
That would be the element matrix
already blown up to full size

00:24:41.010 --> 00:24:43.590
by adding zeroes elsewhere.

00:24:43.590 --> 00:24:49.040
So, I mean the heart
of the element matrix

00:24:49.040 --> 00:24:51.490
is where the action
is on that spring.

00:24:51.490 --> 00:24:55.020
And then, when we
assemble it, of course,

00:24:55.020 --> 00:24:59.090
it doesn't contribute
down there.

00:24:59.090 --> 00:25:03.850
So the technology of finite
elements is quite interesting

00:25:03.850 --> 00:25:05.160
and it fits.

00:25:05.160 --> 00:25:11.360
It's a beautiful way to
see the discrete problem.

00:25:11.360 --> 00:25:15.770
Ready for another
question of any sort.

00:25:15.770 --> 00:25:22.930
Thank you, good.

00:25:22.930 --> 00:25:25.090
Yeah, sorry, it got
onto the problem set.

00:25:25.090 --> 00:25:29.430
And then I thought--
let me write those words

00:25:29.430 --> 00:25:34.500
down first, singular
value decomposition.

00:25:34.500 --> 00:25:40.230
Well I won't write
all those words.

00:25:40.230 --> 00:25:42.620
That's a wonderful thing.

00:25:42.620 --> 00:25:45.410
It's a highlight of
matrix theory except

00:25:45.410 --> 00:25:47.150
for the length of its name.

00:25:47.150 --> 00:25:53.360
So SVD is what
everybody calls it.

00:25:53.360 --> 00:25:57.250
It's only like, every
year now people appreciate

00:25:57.250 --> 00:26:00.140
more and more the
importance of this SVD,

00:26:00.140 --> 00:26:02.910
this singular value
decomposition.

00:26:02.910 --> 00:26:09.030
So shall I say a few
words about it now?

00:26:09.030 --> 00:26:14.500
Just a few.

00:26:14.500 --> 00:26:18.690
So it's Section 1.7 of the book.

00:26:18.690 --> 00:26:26.710
And my thought was, hey we've
done so much matrix theory

00:26:26.710 --> 00:26:29.790
including eigenvalues and
positive definiteness,

00:26:29.790 --> 00:26:32.700
let's get on and use it.

00:26:32.700 --> 00:26:36.260
And then I can come
back to the SVD

00:26:36.260 --> 00:26:40.190
in a sort of lighter moment.

00:26:40.190 --> 00:26:42.100
Because I'm not
thinking you will

00:26:42.100 --> 00:26:44.600
be responsible for the SVD.

00:26:44.600 --> 00:26:46.680
Eigenvalues I hope
you're understanding.

00:26:46.680 --> 00:26:49.950
Positive definite I hope
you're understanding.

00:26:49.950 --> 00:26:52.990
That's heart of
the course stuff.

00:26:52.990 --> 00:26:58.360
But SVD is a key idea
in linear algebra,

00:26:58.360 --> 00:27:01.050
but we can't do everything.

00:27:01.050 --> 00:27:06.770
But we can say what it is.

00:27:06.770 --> 00:27:08.990
What's the first point?

00:27:08.990 --> 00:27:11.200
The first point is
that every matrix,

00:27:11.200 --> 00:27:14.910
even a rectangular matrix,
has got a singular value

00:27:14.910 --> 00:27:15.770
decomposition.

00:27:15.770 --> 00:27:23.200
So the matrix A can be m by n.

00:27:23.200 --> 00:27:26.260
I wouldn't speak
about the eigenvalues

00:27:26.260 --> 00:27:29.200
of a rectangular matrix.

00:27:29.200 --> 00:27:31.610
Because if I multiply,
you remember,

00:27:31.610 --> 00:27:34.230
the eigenvalue equation
wouldn't make sense.

00:27:34.230 --> 00:27:39.920
Ax=lambda*x is no good
if A is rectangular.

00:27:39.920 --> 00:27:40.730
Right?

00:27:40.730 --> 00:27:44.720
The input would be of
length n and the output

00:27:44.720 --> 00:27:50.250
would be of length m
and this wouldn't work.

00:27:50.250 --> 00:27:54.820
So eigenvectors are
not what I'm after.

00:27:54.820 --> 00:27:58.660
But somehow the
goal of eigenvectors

00:27:58.660 --> 00:28:00.180
was to diagonalize.

00:28:00.180 --> 00:28:04.670
The goal of eigenvectors was to
find these special directions

00:28:04.670 --> 00:28:09.440
in which the matrix A
just acted like a number.

00:28:09.440 --> 00:28:16.330
And then, as we saw today in the
part that partly still up here,

00:28:16.330 --> 00:28:19.050
we could solve equations
by eigenvectors

00:28:19.050 --> 00:28:26.890
by looking for these,
following these special guys.

00:28:26.890 --> 00:28:29.720
What do we do for a
rectangular matrix?

00:28:29.720 --> 00:28:31.130
What replaces this?

00:28:31.130 --> 00:28:36.380
So this is now not good.

00:28:36.380 --> 00:28:40.960
The idea is simply we
need two sets of vectors.

00:28:40.960 --> 00:28:48.910
We need some v's and some u's.

00:28:48.910 --> 00:28:52.860
So that's the central
equation of the SVD.

00:28:52.860 --> 00:28:56.900
Now what can we get?

00:28:56.900 --> 00:29:01.130
So now we have more freedom
because we're getting a bunch

00:29:01.130 --> 00:29:05.640
of v's that have,
these guys are in R^n.

00:29:05.640 --> 00:29:07.070
They have length n, right?

00:29:07.070 --> 00:29:10.840
To multiply A times
v, and the output

00:29:10.840 --> 00:29:17.620
is-- so there're
n of these, n v's,

00:29:17.620 --> 00:29:19.900
we're in n-dimensional space.

00:29:19.900 --> 00:29:22.449
So those are called
singular vectors.

00:29:22.449 --> 00:29:24.990
They're called right singular
vectors because they're sitting

00:29:24.990 --> 00:29:28.050
to the right of
A. And these guys,

00:29:28.050 --> 00:29:35.360
these outputs will be in-- these
are v's in R^n, n dimensions.

00:29:35.360 --> 00:29:41.890
I have m of these, m u's
in m-dimensional space.

00:29:41.890 --> 00:29:45.020
And these things are
numbers, of course.

00:29:45.020 --> 00:29:50.190
And actually, they're all
greater or equal to zero.

00:29:50.190 --> 00:29:53.650
So we can get, by
allowing ourselves

00:29:53.650 --> 00:29:59.640
the freedom of
two, right singular

00:29:59.640 --> 00:30:02.960
vectors and left singular
vectors, we can get a lot more,

00:30:02.960 --> 00:30:06.870
and we can get,
here's the punch line.

00:30:06.870 --> 00:30:13.040
We can get the v's to be
orthogonal, orthonormal.

00:30:13.040 --> 00:30:19.030
Just like the eigenvectors
of a symmetric matrix,

00:30:19.030 --> 00:30:21.800
we can get these
v's, these singular

00:30:21.800 --> 00:30:24.640
vectors to be
perpendicular to each other

00:30:24.640 --> 00:30:28.810
and we can get the u's to be
perpendicular to each other.

00:30:28.810 --> 00:30:34.200
What we can't, what we're not
shooting for is the v's to be

00:30:34.200 --> 00:30:36.340
the same as the u's.

00:30:36.340 --> 00:30:38.340
They're not even
in the same space

00:30:38.340 --> 00:30:41.700
now, if the matrix
A is rectangular.

00:30:41.700 --> 00:30:46.920
And even if the matrix A is
square but not symmetric,

00:30:46.920 --> 00:30:49.580
we wouldn't get this
perpendicularity.

00:30:49.580 --> 00:30:57.580
But we get it in the SVD by
having different v's and u's.

00:30:57.580 --> 00:31:02.550
Here's my picture
of linear algebra.

00:31:02.550 --> 00:31:10.470
This is the big picture
of linear algebra.

00:31:10.470 --> 00:31:12.650
This over here is
n-dimensional space.

00:31:12.650 --> 00:31:17.600
We have v's.

00:31:17.600 --> 00:31:19.920
Think of that as
n-dimensional space.

00:31:19.920 --> 00:31:21.910
That's kind of a puny picture.

00:31:21.910 --> 00:31:29.510
But when I multiply by
A, I take a vector here,

00:31:29.510 --> 00:31:33.490
I multiply by A. So
let me just do that.

00:31:33.490 --> 00:31:38.140
I multiply by A, I take a
vector v, well, I already put v,

00:31:38.140 --> 00:31:43.200
I take Av and I get
something over here.

00:31:43.200 --> 00:31:51.330
And this will be
the space of u's.

00:31:51.330 --> 00:31:53.730
Now I have to ask you one
thing about linear algebra

00:31:53.730 --> 00:31:56.560
that I keep hammering away.

00:31:56.560 --> 00:32:04.310
If I take any vector and
multiply by A, What do I get?

00:32:04.310 --> 00:32:11.570
If I take any vector
v, like [1,  2].

00:32:11.570 --> 00:32:16.850
Here's A, say
[3, 6; 4, 7; 5, 8].

00:32:16.850 --> 00:32:20.520
So that's A times
v. What can you

00:32:20.520 --> 00:32:24.550
tell me about A times v that
goes a little deeper than just

00:32:24.550 --> 00:32:26.890
telling me the numbers?

00:32:26.890 --> 00:32:33.930
It's a linear combination
of the columns.

00:32:33.930 --> 00:32:36.880
These are the outputs, the Av's.

00:32:36.880 --> 00:32:40.030
So this space is called
the column space.

00:32:40.030 --> 00:32:43.020
It's all combinations
of the columns.

00:32:43.020 --> 00:32:50.530
These are all combinations
of the columns.

00:32:50.530 --> 00:32:52.130
That's the column space.

00:32:52.130 --> 00:32:56.010
It's a bunch of vectors.

00:32:56.010 --> 00:33:04.720
So the point is that these u's,
that I have like, a fantastic

00:33:04.720 --> 00:33:06.990
choice of axes.

00:33:06.990 --> 00:33:10.760
A linear algebra person
would use the word, bases.

00:33:10.760 --> 00:33:13.640
But geometrically
I'm saying they're

00:33:13.640 --> 00:33:17.310
fantastic axes in these spaces.

00:33:17.310 --> 00:33:23.290
So that if I choose the
right axes in the two spaces,

00:33:23.290 --> 00:33:28.900
then one axis will go to that
one when I multiply by A.

00:33:28.900 --> 00:33:30.440
The next one will
go to that one.

00:33:30.440 --> 00:33:32.370
The third will go to that one.

00:33:32.370 --> 00:33:37.920
It just could not be better.

00:33:37.920 --> 00:33:43.530
And that's the statement.

00:33:43.530 --> 00:33:46.610
Now maybe I'll just say a
word about where it's used

00:33:46.610 --> 00:33:51.600
or why it's useful.

00:33:51.600 --> 00:33:58.310
Oh, in so many applications.

00:33:58.310 --> 00:34:02.970
Well most of you
are not biologists.

00:34:02.970 --> 00:34:04.680
And I'm not certainly.

00:34:04.680 --> 00:34:09.750
But we know that there's a lot
of interesting math these days

00:34:09.750 --> 00:34:15.870
in a lot of interesting
experiments with genes.

00:34:15.870 --> 00:34:20.680
So what happens?

00:34:20.680 --> 00:34:24.210
So we've got about
40 people here.

00:34:24.210 --> 00:34:34.960
And we measure the,
well, we get data.

00:34:34.960 --> 00:34:36.990
That's what I'm
really going to say.

00:34:36.990 --> 00:34:40.200
Somehow we got a giant
amount of data. right?.

00:34:40.200 --> 00:34:41.520
Probably 40 columns.

00:34:41.520 --> 00:34:46.490
Everybody here is entitled
to be a column of the matrix.

00:34:46.490 --> 00:34:51.600
And the entries will be
like, have you got TB,

00:34:51.600 --> 00:34:55.110
what height, all this stuff.

00:34:55.110 --> 00:34:57.970
So you got enormous
amount of data.

00:34:57.970 --> 00:35:02.180
And the question is, what's
important in that data.

00:35:02.180 --> 00:35:05.850
You've got a million
entries in a giant matrix

00:35:05.850 --> 00:35:08.590
and you want to extract
the important thing.

00:35:08.590 --> 00:35:11.410
Well, it's the SVD that does it.

00:35:11.410 --> 00:35:14.230
You take that giant
matrix of data,

00:35:14.230 --> 00:35:19.080
you find the v's and
the sigmas and the u's.

00:35:19.080 --> 00:35:28.720
And then the largest sigmas are
the most important information,

00:35:28.720 --> 00:35:31.580
if things are scaled,
and statistics

00:35:31.580 --> 00:35:34.450
is coming into this also.

00:35:34.450 --> 00:35:43.200
I could a give sensible, much
more mathematical discussion

00:35:43.200 --> 00:35:47.890
of-- One word, one
name it goes under

00:35:47.890 --> 00:35:52.120
is principal component analysis.

00:35:52.120 --> 00:35:56.220
That's a standard tool
for statisticians looking

00:35:56.220 --> 00:35:58.140
at giant amounts of data.

00:35:58.140 --> 00:36:01.080
Is to find the
principal components

00:36:01.080 --> 00:36:04.960
and those will come
from these eigenvectors.

00:36:04.960 --> 00:36:12.080
Well your question about the
SVD set off that discussion.

00:36:12.080 --> 00:36:15.460
I'll only add a couple of words.

00:36:15.460 --> 00:36:22.870
These v's and these u's
are actually eigenvectors.

00:36:22.870 --> 00:36:28.140
But they're not eigenvectors
of A. v's happen

00:36:28.140 --> 00:36:31.730
to be the eigenvectors
of A transpose A.

00:36:31.730 --> 00:36:35.650
And the u's happen to be
eigenvectors of A, A transpose.

00:36:35.650 --> 00:36:40.860
And the linear
algebra comes together

00:36:40.860 --> 00:36:45.200
to give you this key equation.

00:36:45.200 --> 00:36:47.880
And of course, you
and I know that if I'm

00:36:47.880 --> 00:36:52.870
looking at the eigenvectors
v of A transpose A,

00:36:52.870 --> 00:36:56.900
A transpose A is a
symmetric matrix.

00:36:56.900 --> 00:36:58.480
In fact, positive definite.

00:36:58.480 --> 00:37:01.800
So that the eigenvectors
will be orthogonal,

00:37:01.800 --> 00:37:03.740
the eigenvalues
will be positive.

00:37:03.740 --> 00:37:07.580
And then this one is coming
from the eigenvectors of A A

00:37:07.580 --> 00:37:12.360
transpose, which is different.

00:37:12.360 --> 00:37:15.460
So if the matrix A
happened to be square,

00:37:15.460 --> 00:37:18.260
happened to be symmetric,
happened to be positive

00:37:18.260 --> 00:37:21.450
definite, this would
just be Ax=lambda*x.

00:37:21.450 --> 00:37:24.300
I didn't have to cross it out.

00:37:24.300 --> 00:37:26.710
I'll use K for that.

00:37:26.710 --> 00:37:30.840
So if the matrix A was one
of our favorite matrices,

00:37:30.840 --> 00:37:34.860
was a K, that would be the
case in which the SVD is

00:37:34.860 --> 00:37:37.820
no different from eigenvalues.

00:37:37.820 --> 00:37:40.840
The v's are the same
as the u's, the sigmas

00:37:40.840 --> 00:37:46.460
are the same as the
lambdas, all fine.

00:37:46.460 --> 00:37:49.180
This is sort of the
way to get the beauty

00:37:49.180 --> 00:37:54.200
of positive definite symmetric
matrices when the matrix itself

00:37:54.200 --> 00:37:56.560
that you start with
isn't even square.

00:37:56.560 --> 00:38:00.890
Like this one.

00:38:00.890 --> 00:38:02.620
More than I wanted
to say, more than you

00:38:02.620 --> 00:38:04.220
wanted to hear about the SVD.

00:38:06.950 --> 00:38:08.130
What else?

00:38:08.130 --> 00:38:17.030
Yes, thank you.

00:38:17.030 --> 00:38:19.140
More about, sure.

00:38:19.140 --> 00:38:20.330
Let me repeat the question.

00:38:20.330 --> 00:38:23.330
So this refers to this
morning's lecture,

00:38:23.330 --> 00:38:32.580
lecture 9 about
time-dependent problems.

00:38:32.580 --> 00:38:35.080
And the point was that
when I have a differential

00:38:35.080 --> 00:38:38.860
equation in time there're
lots of ways to replace it

00:38:38.860 --> 00:38:45.560
by difference equations.

00:38:45.560 --> 00:38:49.820
So let's take the
equation du/dt,

00:38:49.820 --> 00:38:55.860
let's make it first order,
is some function of u, often,

00:38:55.860 --> 00:38:57.150
and t.

00:38:57.150 --> 00:39:02.420
That would be a first order.

00:39:02.420 --> 00:39:07.340
Yeah, it's going to look at
when I write that much down.

00:39:07.340 --> 00:39:09.700
What have I got?

00:39:09.700 --> 00:39:14.560
I've got a first order
differential equation.

00:39:14.560 --> 00:39:17.220
Is it linear?

00:39:17.220 --> 00:39:18.120
No.

00:39:18.120 --> 00:39:23.150
I'm allowing some, this
function of u could be sin(u).

00:39:23.150 --> 00:39:25.190
It could be u to
the tenth power.

00:39:25.190 --> 00:39:28.460
It could be e to the u.

00:39:28.460 --> 00:39:32.060
So this is how
equations really come.

00:39:32.060 --> 00:39:35.530
The linear ones are the model
problems that we can solve.

00:39:35.530 --> 00:39:40.610
This is how linear
equations really come.

00:39:40.610 --> 00:39:43.320
Euler thought of,
let's give Euler credit

00:39:43.320 --> 00:39:51.630
here, so forward Euler
and backward Euler.

00:39:51.630 --> 00:39:58.900
And the point will be
that this guy is explicit.

00:39:58.900 --> 00:40:01.420
So can I write that word so
I don't forget to write it?

00:40:01.420 --> 00:40:02.870
Explicit.

00:40:02.870 --> 00:40:04.980
And that this guy
will be implicit.

00:40:04.980 --> 00:40:10.190
And this is a big distinction.

00:40:10.190 --> 00:40:12.340
And we'll see it.

00:40:12.340 --> 00:40:20.290
So this says u_(n+1)-u_n
over delta t is the value

00:40:20.290 --> 00:40:33.090
of the slope at the
start of the step.

00:40:33.090 --> 00:40:36.450
So that's the most
important, most basic,

00:40:36.450 --> 00:40:38.540
first thing you would think of.

00:40:38.540 --> 00:40:40.550
It replaces this by this.

00:40:40.550 --> 00:40:45.690
You start with u_0, and
from this you get u_1.

00:40:45.690 --> 00:40:49.250
And then you know u_1 and
from this you get u_2.

00:40:49.250 --> 00:40:55.790
And the point is at every step
this equation is telling you

00:40:55.790 --> 00:40:58.130
what u_1 is from u_0.

00:40:58.130 --> 00:41:00.860
You just move u_0
over to that side.

00:41:00.860 --> 00:41:04.920
You've only got stuff you
know and then you know u_1.

00:41:04.920 --> 00:41:07.740
Contrast that with
backward Euler.

00:41:07.740 --> 00:41:15.055
So that's u_(n+1)-u_n over delta
t is f at-- Now what am I going

00:41:15.055 --> 00:41:18.190
to put there?

00:41:18.190 --> 00:41:24.920
I'm going to put the end,
the point we don't know yet.

00:41:24.920 --> 00:41:32.040
So it's the slope at u_(n+1)
and the time that goes with it,

00:41:32.040 --> 00:41:34.250
t_(n+1).

00:41:34.250 --> 00:41:40.140
t_n is just a shorthand
for n*delta t.

00:41:40.140 --> 00:41:43.460
n steps forward in
time got us to t_n.

00:41:43.460 --> 00:41:45.650
This is one more step.

00:41:45.650 --> 00:41:52.560
Now why is this called implicit?

00:41:52.560 --> 00:41:57.470
How do I find
u_(n+1) out of this?

00:41:57.470 --> 00:41:59.480
I've got to solve for it.

00:41:59.480 --> 00:42:01.740
It's much more expensive.

00:42:01.740 --> 00:42:04.390
Because it'll be probably
a non-linear system of

00:42:04.390 --> 00:42:07.280
equations to solve.

00:42:07.280 --> 00:42:09.520
We'll take a little
time on that.

00:42:09.520 --> 00:42:12.110
But of course, there's
one outstanding method

00:42:12.110 --> 00:42:16.020
to solve a system of
non-linear equations

00:42:16.020 --> 00:42:18.190
and that's called
Newton's method.

00:42:18.190 --> 00:42:20.120
So Newton is coming in.

00:42:20.120 --> 00:42:26.440
Newton's method is sort of
the first, the good way,

00:42:26.440 --> 00:42:31.600
if you can do it, to solve.

00:42:31.600 --> 00:42:37.020
Well when I say solve, I mean
set up an iteration which,

00:42:37.020 --> 00:42:43.660
after maybe three loops or
five loops will be accurate

00:42:43.660 --> 00:42:47.870
to enough digits that you can
say, okay, that's u_(n+1).

00:42:47.870 --> 00:42:49.970
On to the next step.

00:42:49.970 --> 00:42:53.100
Then the next step will
have the same equation

00:42:53.100 --> 00:42:57.220
but with n up one.

00:42:57.220 --> 00:43:00.190
So it'd be u_(n+2)-u_(n+1).

00:43:00.190 --> 00:43:05.220
So you see the extra work
here, but it's more stable.

00:43:05.220 --> 00:43:08.000
The way this one
spiraled out, this one

00:43:08.000 --> 00:43:12.620
spiraled in in
the model problem.

00:43:12.620 --> 00:43:16.650
I hope you look at
that Section 2.2 which

00:43:16.650 --> 00:43:21.380
was about the model problem
that we discussed today.

00:43:21.380 --> 00:43:22.950
There's more to say.

00:43:22.950 --> 00:43:29.710
I mean, this is the central
problem of time-dependent,

00:43:29.710 --> 00:43:34.430
evolving initial value problems.

00:43:34.430 --> 00:43:37.330
You're sort of marching forward.

00:43:37.330 --> 00:43:41.830
But here, each step of the
march takes an inner loop

00:43:41.830 --> 00:43:49.600
which has to work hard to solve,
to find, where you march to.

00:43:49.600 --> 00:43:52.210
Is that a help,
to indicate what?

00:43:52.210 --> 00:43:59.040
Because this is a very
fundamental difference.

00:43:59.040 --> 00:44:05.250
And Chapter 6 of the book
develops higher order methods.

00:44:05.250 --> 00:44:08.540
These are both first order,
first order accurate.

00:44:08.540 --> 00:44:14.430
The error that you're making
is of the order of delta t.

00:44:14.430 --> 00:44:16.220
That's not great, right?

00:44:16.220 --> 00:44:18.270
Because you would
have to take many,

00:44:18.270 --> 00:44:24.810
many small steps to
have a reasonable error.

00:44:24.810 --> 00:44:26.960
So these higher
order methods allow

00:44:26.960 --> 00:44:32.400
you to get to a great
answer with bigger steps.

00:44:32.400 --> 00:44:35.390
A lot of thinking
has gone into that

00:44:35.390 --> 00:44:43.230
and somehow it's a
pretty basic problem.

00:44:43.230 --> 00:44:49.210
Just to mention
for MATLAB, ode45

00:44:49.210 --> 00:44:56.070
is maybe the workhorse code to
solve this type of a problem.

00:44:56.070 --> 00:45:01.040
And the method is not Euler.

00:45:01.040 --> 00:45:04.390
That would not be good enough.

00:45:04.390 --> 00:45:07.450
It's called Runge-Kutta.

00:45:07.450 --> 00:45:10.350
Two guys, Runge and
Kutta, figured out

00:45:10.350 --> 00:45:14.020
a formula that got up to
fourth order accurate.

00:45:14.020 --> 00:45:17.980
So that's the thing.

00:45:17.980 --> 00:45:22.530
And then if we looked
further about this subject

00:45:22.530 --> 00:45:24.620
we would distinguish
some equations

00:45:24.620 --> 00:45:27.100
that are called stiff.

00:45:27.100 --> 00:45:29.590
So I'll just write
that word down.

00:45:29.590 --> 00:45:38.470
Some equations, the iteration
is particularly difficult.

00:45:38.470 --> 00:45:40.520
You have two time scales.

00:45:40.520 --> 00:45:43.150
Maybe you've got things
happening on a slow scale

00:45:43.150 --> 00:45:44.350
and a high scale.

00:45:44.350 --> 00:45:49.700
Multi-scale computations,
that's where the subject is now.

00:45:49.700 --> 00:45:55.660
And so there would be separate
codes with an S in their names

00:45:55.660 --> 00:46:02.920
suitable for these tougher
problems, stiff equation.

00:46:02.920 --> 00:46:07.880
I guess one thing you sometimes
get in the review session

00:46:07.880 --> 00:46:17.560
is a look outside the scope
of what I can cover and ask

00:46:17.560 --> 00:46:20.640
homework problems about.

00:46:20.640 --> 00:46:29.130
I'm sure hoping that you're
assembling the elements

00:46:29.130 --> 00:46:32.630
of computational science here.

00:46:32.630 --> 00:46:34.670
First, what are the questions?

00:46:34.670 --> 00:46:35.960
What are some answers?

00:46:35.960 --> 00:46:38.970
What are the issues?

00:46:38.970 --> 00:46:44.410
What do you have to balance
to make a good decision?

00:46:44.410 --> 00:46:47.090
Time for another
question if we like.

00:46:47.090 --> 00:46:50.800
Yeah, thank you.

00:46:50.800 --> 00:47:05.400
Stability, yeah, right.

00:47:05.400 --> 00:47:10.430
This here?

00:47:10.430 --> 00:47:12.460
First, if we want
a matrix then this

00:47:12.460 --> 00:47:15.500
has to be a vector of unknowns.

00:47:15.500 --> 00:47:19.260
I'm thinking now of a system
of, this is n equations.

00:47:19.260 --> 00:47:23.650
I've got u is a vector
with n components.

00:47:23.650 --> 00:47:25.860
I've got n equations here.

00:47:25.860 --> 00:47:29.840
The notation, I can put
a little arrow over it

00:47:29.840 --> 00:47:32.740
just to remind myself.

00:47:32.740 --> 00:47:38.510
And if I want to get to a matrix
I better do the linear case.

00:47:38.510 --> 00:47:48.050
So I'll do the linear case.

00:47:48.050 --> 00:47:51.450
The big picture is
that the new values

00:47:51.450 --> 00:47:54.030
come from the old values.

00:47:54.030 --> 00:47:56.160
There has to be a
matrix multiplier.

00:47:56.160 --> 00:48:01.450
Anytime we have
a linear process.

00:48:01.450 --> 00:48:06.270
So the new values come from
old values by some linear map.

00:48:06.270 --> 00:48:12.260
A matrix is doing it.

00:48:12.260 --> 00:48:14.050
So there's a sort
of growth matrix.

00:48:14.050 --> 00:48:17.750
Can I just put down
some letters here?

00:48:17.750 --> 00:48:22.110
I won't be able to give
you a complete answer.

00:48:22.110 --> 00:48:25.930
But this'll do it.

00:48:25.930 --> 00:48:34.550
So u_(n+1) is some
matrix times u_n.

00:48:34.550 --> 00:48:38.540
That's what I wrote down this
morning for a special case.

00:48:38.540 --> 00:48:44.540
It's gotta look like that
for a linear problem.

00:48:44.540 --> 00:48:48.480
And let's suppose that we have
this nice situation as today

00:48:48.480 --> 00:48:51.930
where it's the same
G at every step.

00:48:51.930 --> 00:48:58.170
So the problem is not
changing in time, it's linear,

00:48:58.170 --> 00:48:59.340
it's all good.

00:48:59.340 --> 00:49:03.680
What is the solution after
n times steps compared

00:49:03.680 --> 00:49:06.690
to the start?

00:49:06.690 --> 00:49:12.760
So give me a simple formula
for the solution to this step,

00:49:12.760 --> 00:49:15.350
step, step equation.

00:49:15.350 --> 00:49:19.280
If I started at
initial value u_0

00:49:19.280 --> 00:49:24.150
and I looked to see, well what
matrix gets me over n steps,

00:49:24.150 --> 00:49:25.840
what do I write there?

00:49:25.840 --> 00:49:30.110
G to the n, right, G to the n.

00:49:30.110 --> 00:49:36.090
So now comes the question.

00:49:36.090 --> 00:49:38.270
The stability question
is whether-- do

00:49:38.270 --> 00:49:41.700
the powers of G to the nth grow?

00:49:41.700 --> 00:49:43.820
And here's the point.

00:49:43.820 --> 00:49:48.150
That the continuous problem
that this came from,

00:49:48.150 --> 00:49:52.610
it's got its own growth
or decay or oscillation.

00:49:52.610 --> 00:49:56.890
This guy, the discrete
one, has got its.

00:49:56.890 --> 00:50:01.000
They're going to be
close for a step or two.

00:50:01.000 --> 00:50:05.310
For one or two
steps I'm expecting

00:50:05.310 --> 00:50:08.980
that this is a reasonable
consistent approximation

00:50:08.980 --> 00:50:10.500
to my problem.

00:50:10.500 --> 00:50:14.560
But after I take
a thousand steps,

00:50:14.560 --> 00:50:22.030
this one could still be close
or it could have exploded.

00:50:22.030 --> 00:50:26.350
And that's the stability thing.

00:50:26.350 --> 00:50:32.710
The choice of the difference
method can be be stable or not.

00:50:32.710 --> 00:50:36.840
And it's going to be the
eigenvalues of G that

00:50:36.840 --> 00:50:38.630
are the best guide.

00:50:38.630 --> 00:50:45.930
So in the end people compute
the eigenvalues of the growth

00:50:45.930 --> 00:51:10.330
matrix and look to see are
they bigger than one or not.

00:51:10.330 --> 00:51:13.660
Let's close with that example
because that's a good example.

00:51:13.660 --> 00:51:18.040
So it fits this, but not quite,
because it wasn't completely

00:51:18.040 --> 00:51:20.260
forward or completely backward.

00:51:20.260 --> 00:51:23.290
And let's just write down what
it was in that model problem

00:51:23.290 --> 00:51:26.300
and find the matrix.

00:51:26.300 --> 00:51:29.120
So can you remind me
what I wrote today?

00:51:29.120 --> 00:51:41.320
So u, was it u first? u_(n+1)
was u_n + delta t*v_n, right?

00:51:41.320 --> 00:51:46.950
And then the new velocity
was the old velocity and it

00:51:46.950 --> 00:51:50.590
should be minus
delta t times the u.

00:51:50.590 --> 00:51:55.390
Because our equation is, these
are representing the equation--

00:51:55.390 --> 00:51:59.200
u'=v is the first one.

00:51:59.200 --> 00:52:01.740
v'=-u is my second equation.

00:52:01.740 --> 00:52:03.550
So and then the
point was I could

00:52:03.550 --> 00:52:10.260
take that because I know it
already, I could take it there.

00:52:10.260 --> 00:52:14.800
Where is the matrix here?

00:52:14.800 --> 00:52:20.640
I want to find the growth
matrix that tells me now--

00:52:20.640 --> 00:52:29.330
My growth matrix, of course--
This is [u n, v n] and this is

00:52:29.330 --> 00:52:31.780
[u (n+1), v (n+1)].

00:52:31.780 --> 00:52:34.550
And this is a two by two matrix.

00:52:34.550 --> 00:52:38.170
And I hope we can read it off.

00:52:38.170 --> 00:52:40.810
Or find it anyway.

00:52:40.810 --> 00:52:45.780
Because that's the key.

00:52:45.780 --> 00:52:49.280
How could we get a matrix
out of these two equations?

00:52:49.280 --> 00:52:51.200
Let me just ask
you to look at them

00:52:51.200 --> 00:52:58.520
and think what are
we going to do.

00:52:58.520 --> 00:53:00.830
That's a good question.

00:53:00.830 --> 00:53:02.170
What shall I do?

00:53:02.170 --> 00:53:07.330
I would like to know the
new u's, u, v from the old.

00:53:07.330 --> 00:53:10.720
What'll I do?

00:53:10.720 --> 00:53:22.610
Bring stuff onto, a u_(n+1)
on its side and n on its side.

00:53:22.610 --> 00:53:25.050
This guy I want
to get over here.

00:53:25.050 --> 00:53:29.300
Can I do that with erasing?

00:53:29.300 --> 00:53:40.620
So it's going to come
over with a plus sign.

00:53:40.620 --> 00:53:44.730
So I guess I see here an
implicit matrix acting

00:53:44.730 --> 00:53:48.710
on the left and an explicit
matrix acting on the right.

00:53:48.710 --> 00:53:52.350
So I see a [u n, v n].

00:53:52.350 --> 00:53:54.580
And I see my explicit matrix.

00:53:54.580 --> 00:53:56.730
Shall I call it E?

00:53:56.730 --> 00:53:58.580
That's the right sides.

00:53:58.580 --> 00:54:02.560
I see a one and a
one and a delta t.

00:54:02.560 --> 00:54:09.610
And now my left side of my
equation, the n+1 stuff.

00:54:09.610 --> 00:54:14.170
What's my implicit matrix on
the left sides of the equation?

00:54:14.170 --> 00:54:23.600
Well, a one and a one and a
plus delta t is here, right?

00:54:23.600 --> 00:54:31.080
And let's call that
I for implicit.

00:54:31.080 --> 00:54:34.040
Are we close?

00:54:34.040 --> 00:54:36.110
I think that looks pretty good.

00:54:36.110 --> 00:54:38.550
What's G?

00:54:38.550 --> 00:54:40.980
What's the matrix G now?

00:54:40.980 --> 00:54:44.480
You just have to begin
to develop a little faith

00:54:44.480 --> 00:54:46.600
that yeah, I can
deal with matrices,

00:54:46.600 --> 00:54:51.660
I can move them around,
they're under my control.

00:54:51.660 --> 00:54:55.140
I wanted this picture.

00:54:55.140 --> 00:54:58.940
I want to move
everything to the right.

00:54:58.940 --> 00:55:03.480
What do I do to move everything
to the right-hand side?

00:55:03.480 --> 00:55:06.040
I want that to be over there.

00:55:06.040 --> 00:55:07.570
It's an inverse.

00:55:07.570 --> 00:55:08.840
It's the inverse.

00:55:08.840 --> 00:55:14.720
So G, the matrix G there
is, I bring I over here.

00:55:14.720 --> 00:55:22.040
It's the inverse
of I times the E.

00:55:22.040 --> 00:55:25.360
And I can figure out
what that matrix is.

00:55:25.360 --> 00:55:28.110
And I can find its eigenvalues.

00:55:28.110 --> 00:55:31.370
And it'll be interesting.

00:55:31.370 --> 00:55:33.590
So actually that's
the perfect problem.

00:55:33.590 --> 00:55:37.010
I mean, if you want to
see what's going on,

00:55:37.010 --> 00:55:40.580
well the book will be
a good help I think,

00:55:40.580 --> 00:55:45.670
but that's the growth
matrix for leapfrog.

00:55:45.670 --> 00:55:53.210
And I'll tell you the
result. The eigenvalues are

00:55:53.210 --> 00:55:56.890
right of magnitude
one, as you hope, up

00:55:56.890 --> 00:55:58.840
to a certain value of delta t.

00:55:58.840 --> 00:56:01.350
And then when delta t
passes that stability

00:56:01.350 --> 00:56:04.710
limit the eigenvalues take off.

00:56:04.710 --> 00:56:08.800
So that this method
is great provided

00:56:08.800 --> 00:56:15.410
you're not too ambitious and
take too large a delta t.

00:56:15.410 --> 00:56:18.340
Thanks for that last
question, thanks for coming.