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:10.050
continue to offer high-quality
educational resources for free.

00:00:10.050 --> 00:00:12.530
To make a donation, or to
view additional materials

00:00:12.530 --> 00:00:16.880
from hundreds of MIT courses,
visit MIT OpenCourseWare

00:00:16.880 --> 00:00:19.390
at ocw.mit.edu.

00:00:19.390 --> 00:00:21.770
PROFESSOR STRANG: So.

00:00:21.770 --> 00:00:27.370
Today's lecture is partly
cleaning up some pieces

00:00:27.370 --> 00:00:31.530
left from 1-D problems.

00:00:31.530 --> 00:00:35.270
3.1 was second
order equations, 3.2

00:00:35.270 --> 00:00:38.280
was fourth order
equations for beams.

00:00:38.280 --> 00:00:41.800
And just a few more
comments to make.

00:00:41.800 --> 00:00:51.370
But then I do want to say
something about splines.

00:00:51.370 --> 00:00:54.610
And I included a
homework question that

00:00:54.610 --> 00:00:59.910
asked you to use the spline
command and get a result.

00:00:59.910 --> 00:01:07.460
I'm not planning to make that
a serious topic in the course.

00:01:07.460 --> 00:01:09.290
In other words,
you're not like going

00:01:09.290 --> 00:01:14.040
to be responsible on an exam
for a discussion of splines.

00:01:14.040 --> 00:01:22.640
But it's such a major event, and
major requirement in scientific

00:01:22.640 --> 00:01:24.900
computing -- if you're
given some values,

00:01:24.900 --> 00:01:28.491
put a curve through them -- that
I have to say something about

00:01:28.491 --> 00:01:28.990
that.

00:01:28.990 --> 00:01:31.720
So that's interpolation.

00:01:31.720 --> 00:01:34.380
Because you'll have
this all the time.

00:01:34.380 --> 00:01:39.490
If your experiment
produces some values

00:01:39.490 --> 00:01:44.550
at specific times or a
finite number of values,

00:01:44.550 --> 00:01:46.990
and you want to fit a
curve through those points.

00:01:46.990 --> 00:01:48.320
How do you do it?

00:01:48.320 --> 00:01:51.970
So splines give a
very, very good answer.

00:01:51.970 --> 00:02:02.540
And then, the next and
big topic of the course

00:02:02.540 --> 00:02:04.700
we'll make a beginning on.

00:02:04.700 --> 00:02:09.170
Which is gradient, divergence,
leading to Laplace's equation.

00:02:09.170 --> 00:02:14.430
Problems in 2-D. So partial
differential equations

00:02:14.430 --> 00:02:15.600
are going to show up.

00:02:15.600 --> 00:02:19.000
OK.

00:02:19.000 --> 00:02:20.860
Some small points.

00:02:20.860 --> 00:02:27.490
First point, about the
MATLAB homework for Monday.

00:02:27.490 --> 00:02:34.880
A question came by email.

00:02:34.880 --> 00:02:43.960
I put the spike and also the
jump in c, in the coefficient,

00:02:43.960 --> 00:02:45.910
not at mesh point.

00:02:45.910 --> 00:02:47.570
If you've started
on that problem,

00:02:47.570 --> 00:02:55.100
you probably noticed that,
and maybe a little swearing

00:02:55.100 --> 00:03:01.350
went on. [LAUGHTER] Because
it makes it not so easy.

00:03:01.350 --> 00:03:05.160
And then the question
came, did I really

00:03:05.160 --> 00:03:10.020
expect you to compute,
use the exact position

00:03:10.020 --> 00:03:15.720
and figure out-- When you
have some integrals to do,

00:03:15.720 --> 00:03:20.120
they'll change at the place
where c changes values.

00:03:20.120 --> 00:03:24.570
Where we have integrals of c,
if c has one of those jumps,

00:03:24.570 --> 00:03:28.030
on the quiz the jump came
right at a neat point,

00:03:28.030 --> 00:03:32.690
so it was clear. c was one on
one side and two on the other.

00:03:32.690 --> 00:03:36.600
Now the jump is going to
come at an in-between point.

00:03:36.600 --> 00:03:42.170
So the answer is yes.

00:03:42.170 --> 00:03:45.100
I had a nice email this
morning from somebody who

00:03:45.100 --> 00:03:48.280
has done that MATLAB homework.

00:03:48.280 --> 00:03:55.130
And he said, quote,
it's a good problem.

00:03:55.130 --> 00:03:59.070
I learned more from it than
I did from the other problems

00:03:59.070 --> 00:04:00.390
in the pset.

00:04:00.390 --> 00:04:06.240
So I'll blame it on him.

00:04:06.240 --> 00:04:08.340
I'll stay with that
problem, and ask

00:04:08.340 --> 00:04:14.700
you to do your best to
deal with the calculation.

00:04:14.700 --> 00:04:17.370
It's second order and
I used linear elements.

00:04:17.370 --> 00:04:20.610
I didn't want to push you
up to these cubic elements,

00:04:20.610 --> 00:04:24.790
even though those would
give much better accuracy.

00:04:24.790 --> 00:04:29.950
One reason I didn't put the
spike and the jump right

00:04:29.950 --> 00:04:36.710
at the node is that, if I did,
the finite element solution

00:04:36.710 --> 00:04:38.390
would be exactly right.

00:04:38.390 --> 00:04:43.180
Because the correct solution is
going to be piecewise linear.

00:04:43.180 --> 00:04:49.890
And if I put the breaks between
pieces right at node points,

00:04:49.890 --> 00:04:53.540
well, then I have a function
that's in my finite element

00:04:53.540 --> 00:04:55.360
space, in my linear space.

00:04:55.360 --> 00:04:57.410
So it'll come out exactly.

00:04:57.410 --> 00:05:00.940
So I thought well, let's
at least have some chance

00:05:00.940 --> 00:05:05.550
to see the error between
the finite element

00:05:05.550 --> 00:05:07.120
solution and the exact one.

00:05:07.120 --> 00:05:08.730
You see what I'm saying?

00:05:08.730 --> 00:05:13.690
I'm just anticipating,
that the exact solution

00:05:13.690 --> 00:05:14.850
will-- Let's see.

00:05:14.850 --> 00:05:18.820
Something happened at 1/3 and
something happened at 2/3.

00:05:18.820 --> 00:05:21.460
I'm afraid I don't remember
the boundary conditions.

00:05:21.460 --> 00:05:24.780
Does anybody remember what I
took for boundary conditions?

00:05:24.780 --> 00:05:27.620
Probably free-fixed,
or something.

00:05:27.620 --> 00:05:33.220
So maybe, if it was free-fixed,
probably the solution

00:05:33.220 --> 00:05:35.710
would be maybe
something like that.

00:05:35.710 --> 00:05:36.520
I don't know.

00:05:36.520 --> 00:05:38.010
Whatever.

00:05:38.010 --> 00:05:42.530
Piecewise linear with breaks
where there's a jump in c,

00:05:42.530 --> 00:05:46.380
or where the point
load is hitting.

00:05:46.380 --> 00:05:48.110
Yeah.

00:05:48.110 --> 00:05:50.800
I don't know if that
picture is accurate.

00:05:50.800 --> 00:05:56.990
But my point was, if I chose
those points to be also mesh

00:05:56.990 --> 00:06:00.380
points, then the finite element
solution would be exact,

00:06:00.380 --> 00:06:03.610
and we wouldn't learn
anything about accuracy.

00:06:03.610 --> 00:06:04.210
OK.

00:06:04.210 --> 00:06:06.670
So anyway, for that
MATLAB problem,

00:06:06.670 --> 00:06:13.610
I'm hoping you can do
the integrals, which

00:06:13.610 --> 00:06:20.300
will mean noticing which
integral-- If that doesn't

00:06:20.300 --> 00:06:25.870
fall, so if the mesh
points are like this,

00:06:25.870 --> 00:06:30.230
in the finite element
integral over that mesh,

00:06:30.230 --> 00:06:32.530
over that interval,
you're going to have

00:06:32.530 --> 00:06:34.900
to split it into two pieces.

00:06:34.900 --> 00:06:36.600
That's it.

00:06:36.600 --> 00:06:41.080
So see if you can do that split,
do the split into two pieces.

00:06:41.080 --> 00:06:41.810
OK.

00:06:41.810 --> 00:06:46.040
So that's a comment
on that homework.

00:06:46.040 --> 00:06:47.480
OK.

00:06:47.480 --> 00:06:49.740
What else do I need
to comment on, when

00:06:49.740 --> 00:06:51.310
I'm sort of catching up here?

00:06:51.310 --> 00:06:55.050
Oh, about boundary conditions.

00:06:55.050 --> 00:06:57.130
I thought I would
just repeat clearly

00:06:57.130 --> 00:07:04.870
on the board the rules
about and the difference

00:07:04.870 --> 00:07:13.250
between fixed and free when
we're doing this weak form

00:07:13.250 --> 00:07:17.580
approach to the problem.

00:07:17.580 --> 00:07:21.800
And then I gave the other
names: a fixed condition,

00:07:21.800 --> 00:07:25.300
in this theory it's often
called an essential boundary

00:07:25.300 --> 00:07:29.070
condition, but many
people just name

00:07:29.070 --> 00:07:33.280
Dirichlet as the person's
name that's associated

00:07:33.280 --> 00:07:34.700
with such conditions.

00:07:34.700 --> 00:07:37.770
Like u(0)=0.

00:07:37.770 --> 00:07:39.020
Right, fixed.

00:07:39.020 --> 00:07:43.360
And then free conditions
are natural conditions

00:07:43.360 --> 00:07:45.850
in the finite element
method, and that

00:07:45.850 --> 00:07:48.550
means that we don't
have to impose them.

00:07:48.550 --> 00:07:49.600
Right.

00:07:49.600 --> 00:07:51.770
I discussed this in
the earlier lecture.

00:07:51.770 --> 00:07:54.180
I just thought I'd
bring it back here,

00:07:54.180 --> 00:07:59.920
because it's easy to
describe in one line.

00:07:59.920 --> 00:08:09.160
Now somebody asked, on
Wednesday, a good question.

00:08:09.160 --> 00:08:17.650
Suppose u' is given,
but not given as zero.

00:08:17.650 --> 00:08:28.490
So suppose we have a condition
like u'=A, let's say.

00:08:28.490 --> 00:08:30.080
What to do?

00:08:30.080 --> 00:08:32.320
So I'll just put question mark.

00:08:32.320 --> 00:08:36.360
How do I deal with-- How do I?

00:08:36.360 --> 00:08:40.890
How does the weak form approach
and the Galerkin approach

00:08:40.890 --> 00:08:47.840
deal with a non-zero,
natural condition?

00:08:47.840 --> 00:08:52.760
A non-zero Neumann condition,
that'd be the right word.

00:08:52.760 --> 00:08:56.230
So this would be, in a
second order problem,

00:08:56.230 --> 00:08:59.680
this would be a
Neumann condition.

00:08:59.680 --> 00:09:02.780
And I'm thinking, what do
you do if A isn't zero.

00:09:02.780 --> 00:09:06.810
Somehow that has to show up in
your finite element equations,

00:09:06.810 --> 00:09:07.850
right?

00:09:07.850 --> 00:09:10.770
So I guess the right
way is to go back

00:09:10.770 --> 00:09:12.320
to the way they came from.

00:09:12.320 --> 00:09:15.140
So you remember how
the weak form came?

00:09:15.140 --> 00:09:18.060
I took the
differential equation,

00:09:18.060 --> 00:09:20.320
I multiplied by
any test function,

00:09:20.320 --> 00:09:23.070
and I integrated by parts.

00:09:23.070 --> 00:09:25.460
That's where the
weak form started.

00:09:25.460 --> 00:09:28.680
So the integration
by parts gave me

00:09:28.680 --> 00:09:38.250
this nice symmetric integral.

00:09:38.250 --> 00:09:41.010
It's symmetric in
u and v. It only

00:09:41.010 --> 00:09:44.760
requires one derivative
of u, so that I'm

00:09:44.760 --> 00:09:48.720
allowed to use hat functions.

00:09:48.720 --> 00:09:51.910
And I'm allowed to use
hat functions for v,

00:09:51.910 --> 00:09:54.650
because their derivatives
have just a jump,

00:09:54.650 --> 00:09:58.890
and a jump function I can
integrate, no problem.

00:09:58.890 --> 00:10:04.110
Now what about this u'=A?

00:10:04.110 --> 00:10:08.640
And I guess we're
seeing it there.

00:10:08.640 --> 00:10:13.380
If u' was zero, if we
had a totally free end,

00:10:13.380 --> 00:10:16.540
u' was zero, nothing
happening there,

00:10:16.540 --> 00:10:21.690
then that term would drop out
of the integration by parts.

00:10:21.690 --> 00:10:24.460
And you see why I don't
have to impose anything

00:10:24.460 --> 00:10:27.960
on v, because that term
is already accounted

00:10:27.960 --> 00:10:31.120
for by the u' going away.

00:10:31.120 --> 00:10:38.330
Now, what about if u' is
given, but not given zero?

00:10:38.330 --> 00:10:41.500
Suppose it's given the
value A. All I want to say

00:10:41.500 --> 00:10:51.070
is, then this term has to stay.

00:10:51.070 --> 00:10:52.690
I have to pay attention to it.

00:10:52.690 --> 00:10:56.530
What happens when
Galerkin takes over?

00:10:56.530 --> 00:11:02.600
Galerkin will put in one
of his test functions.

00:11:02.600 --> 00:11:06.880
Maybe I just indicate that
by changing the v to a cap V.

00:11:06.880 --> 00:11:08.120
It'll be one of them.

00:11:08.120 --> 00:11:11.780
There'll be n of them.

00:11:11.780 --> 00:11:16.060
Each V_i, each test guy,
gives me an equation.

00:11:16.060 --> 00:11:22.140
And of course u is now going
to-- The Galerkin idea is that

00:11:22.140 --> 00:11:25.870
instead of any u, I
only have capital U's.

00:11:25.870 --> 00:11:32.130
Combinations of these phis.

00:11:32.130 --> 00:11:37.550
I'm not going to say anything
very big here, or very clear.

00:11:37.550 --> 00:11:46.800
All I want to say is that if u
prime is given at an end point,

00:11:46.800 --> 00:11:56.290
and given by A, then this whole
stuff is equaling something

00:11:56.290 --> 00:11:57.980
with an f, right?

00:11:57.980 --> 00:12:00.460
f*V_i*dx.

00:12:00.460 --> 00:12:03.520
I should remember the
other side of the equation.

00:12:03.520 --> 00:12:07.610
If u' is given, then
c at that end point,

00:12:07.610 --> 00:12:14.120
times the given value of
A, times the V will be --

00:12:14.120 --> 00:12:22.610
whatever value of V that is
-- will show up in equation i.

00:12:22.610 --> 00:12:25.180
That will be a term that
goes on the right-hand side.

00:12:25.180 --> 00:12:29.730
That's all I'm saying,
and all you would expect.

00:12:29.730 --> 00:12:35.740
That any time I'm
given some data,

00:12:35.740 --> 00:12:39.030
I'm given some non-zero
boundary conditions,

00:12:39.030 --> 00:12:42.530
or I'm given some
non-zero f in the inside,

00:12:42.530 --> 00:12:49.080
that stuff is going to show
up on the right-hand side.

00:12:49.080 --> 00:12:58.650
It'll show up as part of
the F. The vector of these.

00:12:58.650 --> 00:13:03.430
So up to now, F has just come
from little f(x), integrated

00:13:03.430 --> 00:13:07.820
against V. And all I'm
saying is that if we

00:13:07.820 --> 00:13:13.690
had one of these guys, then
that would contribute to big F,

00:13:13.690 --> 00:13:16.010
also.

00:13:16.010 --> 00:13:17.140
Yeah.

00:13:17.140 --> 00:13:22.580
You can see, it's not beautiful.

00:13:22.580 --> 00:13:25.590
But we have to realize
what we would do.

00:13:25.590 --> 00:13:28.520
OK, that's not my
favorite topic.

00:13:28.520 --> 00:13:32.420
But I'll just say
quit on that one.

00:13:32.420 --> 00:13:39.280
I'm not expecting you to do
problems or anything that

00:13:39.280 --> 00:13:40.900
involved that possibility.

00:13:40.900 --> 00:13:42.960
Just to see that
it could happen.

00:13:42.960 --> 00:13:44.250
OK.

00:13:44.250 --> 00:13:45.220
Quit.

00:13:45.220 --> 00:13:47.770
Now, interpolation.

00:13:47.770 --> 00:13:49.840
All right.

00:13:49.840 --> 00:13:54.030
So I guess if I had
to list problems

00:13:54.030 --> 00:13:59.725
that people face all the time
and need numerical guidance on,

00:13:59.725 --> 00:14:01.950
this is one of them.

00:14:01.950 --> 00:14:07.950
And so let's say we're in 1-D
-- 1-D is certainly a lot easier

00:14:07.950 --> 00:14:11.370
-- so, suppose I have this.

00:14:11.370 --> 00:14:15.390
I'll call this x, just to
have a name for the variable.

00:14:15.390 --> 00:14:21.360
Suppose I have some values.

00:14:21.360 --> 00:14:28.520
Say six values.

00:14:28.520 --> 00:14:30.720
And I've measured
them, I've worked hard

00:14:30.720 --> 00:14:32.660
to find those six values.

00:14:32.660 --> 00:14:37.310
But now you may say,
well I'm thinking

00:14:37.310 --> 00:14:43.320
I have some function F(x) here.

00:14:43.320 --> 00:14:45.770
But right now I don't
have a function.

00:14:45.770 --> 00:14:48.390
Right now I just have six
values of that function.

00:14:48.390 --> 00:14:55.030
You know, what is the stretching
constant, what is the c(x).

00:14:57.650 --> 00:15:05.760
If you had a physical experiment
with an actual spring,

00:15:05.760 --> 00:15:09.630
you might measure, you might
put on different forces

00:15:09.630 --> 00:15:15.260
and measure the stretching,
and have six values of that.

00:15:15.260 --> 00:15:18.980
How do I fit those with a curve?

00:15:18.980 --> 00:15:23.720
In other words, how do I know--
Interpolation means, inter-

00:15:23.720 --> 00:15:29.440
means asking, what about
between the points?

00:15:29.440 --> 00:15:32.440
What value should it have there?

00:15:32.440 --> 00:15:37.100
OK, well there's one
simple rule would be,

00:15:37.100 --> 00:15:43.050
just interpolate
linearly between.

00:15:43.050 --> 00:15:46.970
OK.

00:15:46.970 --> 00:15:49.100
That's certainly pretty stable.

00:15:49.100 --> 00:15:51.880
It will not get out of control.

00:15:51.880 --> 00:16:00.590
But it's not very accurate.

00:16:00.590 --> 00:16:03.850
For the function that's
probably lying behind this,

00:16:03.850 --> 00:16:07.230
this isn't that great
of a representation.

00:16:07.230 --> 00:16:10.490
OK, you say, I want
something smoother.

00:16:10.490 --> 00:16:14.990
Well another idea that
naturally comes up

00:16:14.990 --> 00:16:24.910
is, the other extreme would be--
So that was completely local.

00:16:24.910 --> 00:16:28.700
Just, every two values
determine the broken line.

00:16:28.700 --> 00:16:30.930
The second idea that's
completely natural

00:16:30.930 --> 00:16:34.390
would be, fit a polynomial.

00:16:34.390 --> 00:16:36.270
Fit a polynomial
through those points,

00:16:36.270 --> 00:16:39.950
and then you have a nice,
totally simple function.

00:16:39.950 --> 00:16:41.370
Nice curve.

00:16:41.370 --> 00:16:46.410
And so what degree polynomial
would we be looking for here?

00:16:46.410 --> 00:16:53.460
If I have six points, I could
fit a polynomial of degree--

00:16:53.460 --> 00:16:54.830
What do you think?

00:16:54.830 --> 00:16:58.120
I want to have six
coefficients, so I

00:16:58.120 --> 00:17:02.100
can get six equations to
make the polynomial go

00:17:02.100 --> 00:17:03.660
through those six points.

00:17:03.660 --> 00:17:08.080
So my polynomial
P(x), which actually

00:17:08.080 --> 00:17:11.620
goes through those points, would
be some polynomial of the form,

00:17:11.620 --> 00:17:15.830
it's got some constant term,
and it's got some linear term.

00:17:15.830 --> 00:17:19.070
And how far am I going to go?

00:17:19.070 --> 00:17:19.920
Fifth, right.

00:17:19.920 --> 00:17:22.020
That'll give me
six coefficients.

00:17:22.020 --> 00:17:22.970
OK.

00:17:22.970 --> 00:17:26.740
So I could put a fifth
degree polynomial, that

00:17:26.740 --> 00:17:29.360
gives me a_0, a_1, up to a_5.

00:17:29.360 --> 00:17:33.620
Six coefficients
through six points.

00:17:33.620 --> 00:17:36.700
Well, six isn't too bad.

00:17:36.700 --> 00:17:44.080
But if six became
60, don't do it.

00:17:44.080 --> 00:17:45.040
That's the message.

00:17:45.040 --> 00:17:47.970
Don't do it.

00:17:47.970 --> 00:17:55.960
If I'm going on up to, say I
have an a_59 x to the 59th,

00:17:55.960 --> 00:17:58.070
And that fits my 60 points.

00:17:58.070 --> 00:18:01.030
And you say, well look,
I've got 60 values,

00:18:01.030 --> 00:18:04.570
that should be way better
than having only six.

00:18:04.570 --> 00:18:08.920
But the polynomial that
would come out of that,

00:18:08.920 --> 00:18:13.180
even if these values
were pretty smooth,

00:18:13.180 --> 00:18:17.460
the polynomial that fits -- well
I'd have to put in a whole lot

00:18:17.460 --> 00:18:20.070
more to get 60,
and I won't try --

00:18:20.070 --> 00:18:26.170
the polynomial would go crazy.

00:18:26.170 --> 00:18:28.950
Can I just draw something crazy?

00:18:28.950 --> 00:18:31.840
I mean, whatever.

00:18:31.840 --> 00:18:34.350
It's unstable.

00:18:34.350 --> 00:18:37.430
And there are classical
examples of that.

00:18:37.430 --> 00:18:41.290
In fact, the famous example
is the function one over one

00:18:41.290 --> 00:18:44.560
plus x squared.

00:18:44.560 --> 00:18:48.530
And later, there's a figure
in the book, I think it's

00:18:48.530 --> 00:18:56.780
in section 5.4, which
shows the result.

00:18:56.780 --> 00:19:00.770
That's a terrific function.

00:19:00.770 --> 00:19:04.090
It's infinitely differentiable.

00:19:04.090 --> 00:19:06.530
I would even call it
an analytic function.

00:19:06.530 --> 00:19:07.660
It's great.

00:19:07.660 --> 00:19:13.170
But if I tried to fit it
with a high-degree polynomial

00:19:13.170 --> 00:19:18.360
at points, that polynomial
gets out of hand.

00:19:18.360 --> 00:19:22.690
And a figure is in--
the figure there.

00:19:22.690 --> 00:19:34.220
So, MATLAB or any
computing system

00:19:34.220 --> 00:19:39.590
would have a subroutine
that does interpolation.

00:19:39.590 --> 00:19:43.450
And this is named
after Lagrange.

00:19:43.450 --> 00:19:46.100
So this is called
Lagrange interpolation,

00:19:46.100 --> 00:19:48.410
fitting a polynomial.

00:19:48.410 --> 00:19:53.260
And if the degree is small,
and maybe degree five

00:19:53.260 --> 00:19:58.620
would be okay, then
that's an important thing

00:19:58.620 --> 00:20:02.010
to be able to do.

00:20:02.010 --> 00:20:05.270
In other words, you're
finding these six coefficients

00:20:05.270 --> 00:20:06.520
from these six heights.

00:20:06.520 --> 00:20:10.210
You've got some six by six
matrix that connects the six

00:20:10.210 --> 00:20:13.700
heights to the six a's.

00:20:13.700 --> 00:20:18.760
But when you get up to 60, that
matrix stops behaving well.

00:20:18.760 --> 00:20:23.550
It becomes very ill conditioned,
and your coefficients

00:20:23.550 --> 00:20:25.100
go all over the place.

00:20:25.100 --> 00:20:29.440
OK, so my question
is, what do you do?

00:20:29.440 --> 00:20:34.850
And one answer, one good
answer is fit those points

00:20:34.850 --> 00:20:39.490
not with straight lines,
that's too crude; not

00:20:39.490 --> 00:20:43.640
with a single polynomial,
that's too unstable;

00:20:43.640 --> 00:20:45.790
but fit it with splines.

00:20:45.790 --> 00:20:50.030
So interpolation by splines.

00:20:50.030 --> 00:20:51.040
OK.

00:20:51.040 --> 00:20:57.440
So it's just sort of
appearing in this section

00:20:57.440 --> 00:21:07.470
3.2-- I mean by that,
and people often do mean,

00:21:07.470 --> 00:21:13.510
when they say spline,
they mean cubic spline.

00:21:13.510 --> 00:21:18.190
So you could have
splines of other degrees.

00:21:18.190 --> 00:21:22.290
But often, sort of the
natural choice is the cubic.

00:21:22.290 --> 00:21:27.800
So can I just briefly
describe what that does.

00:21:27.800 --> 00:21:32.020
What the cubic
spline would be like.

00:21:32.020 --> 00:21:35.490
So let me draw in
again these six points

00:21:35.490 --> 00:21:38.120
that I'm going to fit.

00:21:38.120 --> 00:21:46.000
And just say, for these few
minutes, what's a cubic spline.

00:21:46.000 --> 00:21:48.680
I touched on that
Wednesday, and now

00:21:48.680 --> 00:21:51.060
I just want to say
a little bit more.

00:21:51.060 --> 00:21:56.940
And then the homework
asked you to actually do it

00:21:56.940 --> 00:22:02.600
with values of a
particular function.

00:22:02.600 --> 00:22:05.540
And see how close does
the cubic spline come

00:22:05.540 --> 00:22:09.440
to the given function.

00:22:09.440 --> 00:22:12.260
OK, so what's a cubic spline?

00:22:12.260 --> 00:22:14.090
What does that
word, spline, what

00:22:14.090 --> 00:22:16.110
should that mean in your mind?

00:22:16.110 --> 00:22:22.020
So a cubic spline is
a cubic in each piece.

00:22:22.020 --> 00:22:24.800
A cubic in each piece.

00:22:24.800 --> 00:22:29.700
Now we've met cubics in each
piece as finite elements.

00:22:29.700 --> 00:22:32.950
And part of this
short discussion

00:22:32.950 --> 00:22:39.860
is to keep those two slightly
different ideas separate.

00:22:39.860 --> 00:22:47.030
The finite element idea
was also piecewise cubic.

00:22:47.030 --> 00:22:50.930
But it used values and slopes.

00:22:50.930 --> 00:22:52.560
So it was completely local.

00:22:52.560 --> 00:22:56.500
If I had a value, as I
have here, six values,

00:22:56.500 --> 00:23:02.540
and if I also had six slopes,
if I knew the slopes, then

00:23:02.540 --> 00:23:06.430
I would use those
cubic elements.

00:23:06.430 --> 00:23:12.980
And I would fit a-- If I knew
the height and slope there,

00:23:12.980 --> 00:23:14.770
and I knew the height
and slope there,

00:23:14.770 --> 00:23:16.560
there would be
exactly one cubic.

00:23:16.560 --> 00:23:19.340
Because I would have
four conditions,

00:23:19.340 --> 00:23:21.660
two conditions there,
two conditions there,

00:23:21.660 --> 00:23:22.470
would be four.

00:23:22.470 --> 00:23:25.990
I could fit a cubic between,
another cubic there,

00:23:25.990 --> 00:23:27.550
another cubic there.

00:23:27.550 --> 00:23:32.380
And because I'm using the
same slope from the left

00:23:32.380 --> 00:23:35.930
and from the right, the
slope would be good.

00:23:35.930 --> 00:23:37.830
It would be continuous.

00:23:37.830 --> 00:23:42.030
The second derivative,
the curvature,

00:23:42.030 --> 00:23:46.180
would not be continuous
with those cubic elements.

00:23:46.180 --> 00:23:47.570
And that's the difference.

00:23:47.570 --> 00:23:53.230
So the difference is,
splines have continuous,

00:23:53.230 --> 00:23:56.160
no jump in-- Let me
just put it this way.

00:23:56.160 --> 00:24:03.160
No jump in the function.

00:24:03.160 --> 00:24:05.930
I'll use S, maybe, for spline.

00:24:05.930 --> 00:24:09.070
No jump in its slope.

00:24:09.070 --> 00:24:12.490
And no jump in the
second derivative.

00:24:12.490 --> 00:24:14.460
So that's the difference.

00:24:14.460 --> 00:24:20.560
That the spline
functions, the only

00:24:20.560 --> 00:24:26.880
jumps you see for those are
jumps in the third derivative.

00:24:26.880 --> 00:24:29.820
So that makes this
extremely smooth.

00:24:29.820 --> 00:24:33.240
So if I just try to draw
now what a spline would do,

00:24:33.240 --> 00:24:37.330
it'll go through those points,
coming out of the spline fit

00:24:37.330 --> 00:24:39.000
MATLAB command.

00:24:39.000 --> 00:24:45.570
And it'll be as
smooth as I drew it.

00:24:45.570 --> 00:24:53.140
There is a change in the third
derivative at these points.

00:24:53.140 --> 00:24:58.230
Actually, have you ever seen
this word, "spline," before?

00:24:58.230 --> 00:25:05.730
It came out of
naval engineering.

00:25:05.730 --> 00:25:15.460
When people were designing
the shape of the ship.

00:25:15.460 --> 00:25:22.930
A naval architect is fitting
the proposed shape of a ship--

00:25:22.930 --> 00:25:30.340
this was before MATLAB,
yeah, before life started.

00:25:30.340 --> 00:25:37.610
[LAUGHTER] They had
little physical, slightly

00:25:37.610 --> 00:25:43.310
bendable-- I'll
call them splines.

00:25:43.310 --> 00:25:44.677
I guess that's what they were.

00:25:44.677 --> 00:25:46.010
That's where the word came from.

00:25:46.010 --> 00:25:50.070
Some physical thing which was
like a curve that you use-- I

00:25:50.070 --> 00:25:54.950
don't know if you guys ever
did mechanical drawing.

00:25:54.950 --> 00:25:58.070
That was a freshman
subject when I came to MIT.

00:25:58.070 --> 00:25:59.120
Mechanical drawing.

00:25:59.120 --> 00:26:04.960
I was terrible, terrible,
at mechanical drawing.

00:26:04.960 --> 00:26:06.570
I don't know.

00:26:06.570 --> 00:26:13.040
I had a friend who helped.
l probably helped him

00:26:13.040 --> 00:26:14.480
in some other course.

00:26:14.480 --> 00:26:16.730
Anyway, whatever.

00:26:16.730 --> 00:26:20.010
So there were physical things,
curves you used to use.

00:26:20.010 --> 00:26:22.450
And these spline
curves were used,

00:26:22.450 --> 00:26:27.700
and maybe still are
used, by naval architects

00:26:27.700 --> 00:26:29.740
in creating a drawing.

00:26:29.740 --> 00:26:33.120
But I'm assuming that
those things are now

00:26:33.120 --> 00:26:37.510
all computerized, and the
spline command is used.

00:26:37.510 --> 00:26:39.320
Anyway, the result is that.

00:26:39.320 --> 00:26:42.860
Now, I have to draw one
picture of a spline.

00:26:42.860 --> 00:26:44.470
Of the most important spline.

00:26:44.470 --> 00:26:48.960
And then I'm done with splines.

00:26:48.960 --> 00:26:56.320
So, what I'm going to
draw is now a B-spline.

00:26:56.320 --> 00:27:02.850
And that's a basic spline.

00:27:02.850 --> 00:27:04.810
It could be one
of our functions,

00:27:04.810 --> 00:27:09.710
it could be one of
our functions phi(x).

00:27:09.710 --> 00:27:12.430
One of our trial functions.

00:27:12.430 --> 00:27:15.170
It could be, and let
me comment on that.

00:27:15.170 --> 00:27:22.600
So let me remind myself,
good or bad, with a question.

00:27:22.600 --> 00:27:24.170
And let me try to answer that.

00:27:24.170 --> 00:27:27.140
But let me first
draw the B-spline.

00:27:27.140 --> 00:27:32.070
OK, so it's like a hat function.

00:27:32.070 --> 00:27:38.330
Actually a hat function
is a linear spline.

00:27:38.330 --> 00:27:42.450
A hat function is
that low level spline

00:27:42.450 --> 00:27:44.870
that's linear between pieces.

00:27:44.870 --> 00:27:53.940
Now the B-spline is going
to have the value one there.

00:27:53.940 --> 00:27:57.340
It's going to have no
jump in the function.

00:27:57.340 --> 00:27:59.730
So the function will
go through there.

00:27:59.730 --> 00:28:01.420
No jump in the slope.

00:28:01.420 --> 00:28:04.370
No jump in the
second derivative.

00:28:04.370 --> 00:28:07.180
And I want to get down to zero.

00:28:07.180 --> 00:28:13.660
I want to get down to zero.

00:28:13.660 --> 00:28:16.840
I want it to be as
local as I can make it.

00:28:16.840 --> 00:28:22.750
So I want it to get to zero.

00:28:22.750 --> 00:28:27.280
Here's the point.

00:28:27.280 --> 00:28:31.070
With those cubic
finite elements,

00:28:31.070 --> 00:28:33.110
I got them down to zero.

00:28:33.110 --> 00:28:35.830
They came in here
with zero slope,

00:28:35.830 --> 00:28:42.340
and then they continued
as zero, no problem.

00:28:42.340 --> 00:28:50.390
If I'm wanting the
second derivative also

00:28:50.390 --> 00:28:53.560
to be zero, to be
continuous, I won't be

00:28:53.560 --> 00:28:55.360
able to do it in one interval.

00:28:55.360 --> 00:28:59.310
It's going to take me a
total of four intervals.

00:28:59.310 --> 00:29:01.870
This one can come
down to some point,

00:29:01.870 --> 00:29:07.770
here, where another
cubic starts.

00:29:07.770 --> 00:29:10.130
Maybe I should do the one here.

00:29:10.130 --> 00:29:14.450
Going up, you remember
the allowed cubic spline

00:29:14.450 --> 00:29:21.680
would be an x cubed over six,
some multiple of x cubed.

00:29:21.680 --> 00:29:24.980
I don't know what multiple it'll
take, maybe x cubed over six

00:29:24.980 --> 00:29:25.570
is right.

00:29:25.570 --> 00:29:28.310
It'll come up to
some point here.

00:29:28.310 --> 00:29:36.990
Now I've got to get it
beginning to curve downwards.

00:29:36.990 --> 00:29:40.780
So I'm going to have to
change the third derivative.

00:29:40.780 --> 00:29:45.730
Change to another cubic
there, change to another cubic

00:29:45.730 --> 00:29:49.420
there, and a final cubic here.

00:29:49.420 --> 00:29:52.250
So there's a picture
of a B-spline.

00:29:52.250 --> 00:29:59.500
And we could figure out, by
requiring all these continuity

00:29:59.500 --> 00:30:03.470
conditions, we could figure
out the formula for the cubic

00:30:03.470 --> 00:30:05.130
in these four pieces.

00:30:05.130 --> 00:30:07.350
And it would be
symmetric, of course,

00:30:07.350 --> 00:30:09.200
across that center point.

00:30:09.200 --> 00:30:13.980
But I think I
won't try to do it.

00:30:13.980 --> 00:30:18.580
I'll just leave that idea, then.

00:30:18.580 --> 00:30:20.080
There's a figure
in the book showing

00:30:20.080 --> 00:30:24.910
a picture of the B-spline.

00:30:24.910 --> 00:30:28.880
So those are functions,
extremely valuable

00:30:28.880 --> 00:30:32.010
in this interpolation problem.

00:30:32.010 --> 00:30:35.620
Because all splines are
combinations of B-splines.

00:30:35.620 --> 00:30:38.570
Yeah, now let me pull
this topic together.

00:30:38.570 --> 00:30:44.260
Every spline, every
spline function,

00:30:44.260 --> 00:30:52.700
is combination of
these B-splines.

00:30:52.700 --> 00:30:58.810
Let B_i(x) be the one
centered on node i.

00:30:58.810 --> 00:31:03.450
And then there's a neighbor
centered on node i+1.

00:31:03.450 --> 00:31:07.200
And a neighbor to the
left centered on node i-1.

00:31:07.200 --> 00:31:09.220
What's the point?

00:31:09.220 --> 00:31:19.280
The point is that, at
a typical node, i+1,

00:31:19.280 --> 00:31:23.030
three of these functions
will be non-zero.

00:31:23.030 --> 00:31:28.110
With these very local hat
functions at that node,

00:31:28.110 --> 00:31:31.240
the only one of the phi
functions that wasn't zero

00:31:31.240 --> 00:31:32.950
is the one I've drawn.

00:31:32.950 --> 00:31:35.770
All the others were
zero there, right?

00:31:35.770 --> 00:31:38.650
All the other hats were zero.

00:31:38.650 --> 00:31:40.200
There was just the one.

00:31:40.200 --> 00:31:44.100
But now there'll be a
B-spline starting from here,

00:31:44.100 --> 00:31:47.780
going up to here,
coming down from here.

00:31:47.780 --> 00:31:51.390
There'll be the B-spline
starting from here, going up

00:31:51.390 --> 00:31:54.540
to here, up, down, so on.

00:31:54.540 --> 00:31:57.880
So at a typical
node, I'm getting

00:31:57.880 --> 00:32:01.700
the one centered at
that node, and also

00:32:01.700 --> 00:32:05.440
the one to the left,
which is on its way down,

00:32:05.440 --> 00:32:08.500
and also the one to the
right, which is on its way up.

00:32:08.500 --> 00:32:12.460
In other words,
it's not as local

00:32:12.460 --> 00:32:17.880
as the other construction.

00:32:17.880 --> 00:32:26.090
So I would say good,
because it's smooth, but bad

00:32:26.090 --> 00:32:30.020
because it's not fully local.

00:32:30.020 --> 00:32:32.420
Not completely local.

00:32:32.420 --> 00:32:35.230
It's reasonably local,
in that there are only

00:32:35.230 --> 00:32:39.400
three functions that are
affecting these points.

00:32:39.400 --> 00:32:44.090
If I use those polynomials,
they weren't local at all.

00:32:44.090 --> 00:32:50.630
All the points, it was--
A typical x to the fifth

00:32:50.630 --> 00:32:52.970
is not zero at
any of the points.

00:32:52.970 --> 00:32:56.220
These B-splines are
zero at a lot of points,

00:32:56.220 --> 00:32:59.940
but three of them,
one, two, and three,

00:32:59.940 --> 00:33:03.170
will be non-zero at
a typical mesh point.

00:33:03.170 --> 00:33:13.550
OK, so they're not popular, as
a result, for finite elements.

00:33:13.550 --> 00:33:16.750
I'm just wanting to be sure
you make the distinction.

00:33:16.750 --> 00:33:20.900
They're very popular for
the interpolation job.

00:33:20.900 --> 00:33:24.750
They're very popular for
the interpolation job.

00:33:24.750 --> 00:33:30.680
I've got some combination
of these at particular mesh

00:33:30.680 --> 00:33:31.210
points.

00:33:31.210 --> 00:33:36.470
It's supposed to agree with
F at those mesh points.

00:33:36.470 --> 00:33:38.450
This is my system to solve.

00:33:38.450 --> 00:33:41.880
I create these functions,
these B-splines.

00:33:41.880 --> 00:33:45.290
I'm given F at typical points.

00:33:45.290 --> 00:33:51.640
And I choose a combination
which matches F at those points.

00:33:51.640 --> 00:33:54.550
Yeah, OK.

00:33:54.550 --> 00:34:00.990
Is there a question
or discussion on this?

00:34:00.990 --> 00:34:05.550
I don't like to not say anything
about such an important problem

00:34:05.550 --> 00:34:09.380
as putting curves
through points.

00:34:09.380 --> 00:34:16.121
But I don't want to make
it a course on splines.

00:34:16.121 --> 00:34:16.620
Yes?

00:34:16.620 --> 00:34:18.620
AUDIENCE: [UNINTELLIGIBLE]

00:34:18.620 --> 00:34:24.720
PROFESSOR STRANG: I don't
know that I'll-- Oh, OK, yes.

00:34:24.720 --> 00:34:25.730
All right.

00:34:25.730 --> 00:34:30.010
Two or three comments, and
that suggests a good question,

00:34:30.010 --> 00:34:32.700
a very good question.

00:34:32.700 --> 00:34:36.240
Can I make a separate
comment that if I

00:34:36.240 --> 00:34:40.910
go into two dimensions,
this gets much tougher.

00:34:40.910 --> 00:34:44.160
What happens if I had
a function of x and y?

00:34:44.160 --> 00:34:46.940
So that I've got
points on a surface,

00:34:46.940 --> 00:34:49.930
and I'm trying to
fit a surface to it.

00:34:49.930 --> 00:34:55.630
Just one message first:
that's not as easy.

00:34:55.630 --> 00:35:00.970
It's pretty easy if those points
are on a rectangular grid.

00:35:00.970 --> 00:35:04.650
So this is like typical.

00:35:04.650 --> 00:35:06.830
And then I'll come to
your Nyquist question,

00:35:06.830 --> 00:35:09.400
which is a very good one.

00:35:09.400 --> 00:35:14.350
Can I just-- because we're
coming in to 2-D now.

00:35:14.350 --> 00:35:17.310
Suppose I-- There's
two dimensions.

00:35:17.310 --> 00:35:18.830
I have a grid.

00:35:18.830 --> 00:35:20.890
Let's suppose it's a nice grid.

00:35:20.890 --> 00:35:27.080
And at every point, at every
grid point, I have a height.

00:35:27.080 --> 00:35:28.620
And I'm fitting a surface.

00:35:28.620 --> 00:35:30.310
Right?

00:35:30.310 --> 00:35:38.480
My function is now a function of
x and y. x is here, y is here,

00:35:38.480 --> 00:35:44.400
F is the surface coming out of
board, in the third dimension.

00:35:44.400 --> 00:35:48.300
And fitting those points,
if they're regularly spaced

00:35:48.300 --> 00:35:50.660
like that, my life would be OK.

00:35:50.660 --> 00:35:56.080
I could use sort of
products of splines in 1-D.

00:35:56.080 --> 00:36:04.880
I could use products
of basis-- of splines

00:36:04.880 --> 00:36:09.270
in the x-direction times
splines in the y-direction.

00:36:09.270 --> 00:36:13.260
And it would be
pretty successful.

00:36:13.260 --> 00:36:18.680
It would be, not quite
as nice, but almost OK.

00:36:18.680 --> 00:36:28.650
But if I had irregularly spaced
points from a general grid,

00:36:28.650 --> 00:36:30.220
it's not as easy.

00:36:30.220 --> 00:36:33.880
And I won't-- People have
obviously had to figure out how

00:36:33.880 --> 00:36:38.480
to do it, and to repeat again,
that's what the CAD/CAM world

00:36:38.480 --> 00:36:42.010
is having to do all the
time, is fit a curve,

00:36:42.010 --> 00:36:44.190
fit a surface through points.

00:36:44.190 --> 00:36:45.950
It's significant.

00:36:45.950 --> 00:36:49.250
Now, you asked about Nyquist.

00:36:49.250 --> 00:36:51.420
So that's a good question.

00:36:51.420 --> 00:36:59.150
Can I just say, I
have to say what-- So

00:36:59.150 --> 00:37:00.830
what's a function called?

00:37:00.830 --> 00:37:04.210
Band-limited.

00:37:04.210 --> 00:37:07.330
How many have heard
Nyquist's name?

00:37:07.330 --> 00:37:10.900
Okay, some of you may know
a lot more than I about it.

00:37:10.900 --> 00:37:18.140
But let me just get some context
for band-limited functions.

00:37:18.140 --> 00:37:21.010
Okay.

00:37:21.010 --> 00:37:23.180
This is actually
a topic that will

00:37:23.180 --> 00:37:27.180
belong in the third part of our
course, in the Fourier part.

00:37:27.180 --> 00:37:35.240
So this is a Fourier idea.

00:37:35.240 --> 00:37:38.930
So I'll come back
to it, actually.

00:37:38.930 --> 00:37:47.740
So right here I'm just
going to say, very briefly,

00:37:47.740 --> 00:37:51.890
how it might connect us
to what I've said today.

00:37:51.890 --> 00:37:57.340
But then let's make
a plan to, when

00:37:57.340 --> 00:38:04.560
we've got the idea of
Fourier coefficients.

00:38:04.560 --> 00:38:11.770
What is a band-limited function?

00:38:11.770 --> 00:38:16.920
You know the Fourier
idea is to take F(x),

00:38:16.920 --> 00:38:23.970
and write it as some combination
of pure frequencies. e^(i*K*x),

00:38:23.970 --> 00:38:27.420
let me say. e^(i*K*x).

00:38:27.420 --> 00:38:30.570
So this is Fourier
that's coming.

00:38:30.570 --> 00:38:33.300
I take the function
F(x), and I write it--

00:38:33.300 --> 00:38:36.160
I could think of
it as a combination

00:38:36.160 --> 00:38:41.390
of pure exponentials,
pure frequencies.

00:38:41.390 --> 00:38:44.210
That would be a Fourier series.

00:38:44.210 --> 00:38:47.660
So that's a Fourier
series because I'm

00:38:47.660 --> 00:38:50.590
using-- K has integer values.

00:38:50.590 --> 00:38:55.110
The frequencies are zero,
one, two, three, whatever.

00:38:55.110 --> 00:39:01.820
Now that we'll use,
so that Fourier series

00:39:01.820 --> 00:39:05.030
comes for functions
that are periodic.

00:39:05.030 --> 00:39:06.640
They repeat every 2pi.

00:39:06.640 --> 00:39:10.410
Because those functions,
if I increase x by 2pi,

00:39:10.410 --> 00:39:11.650
don't change.

00:39:11.650 --> 00:39:13.970
So I'm repeating every 2pi.

00:39:13.970 --> 00:39:21.920
Now I have to say a word about
the other possibility, which

00:39:21.920 --> 00:39:26.150
would be to have
all frequencies.

00:39:26.150 --> 00:39:27.950
I'll integrate now, dK.

00:39:27.950 --> 00:39:32.150
Instead of summing on
K, I'll integrate on K.

00:39:32.150 --> 00:39:35.010
What does band-limited mean?

00:39:35.010 --> 00:39:41.770
Band-limited means that only
frequencies in a certain range,

00:39:41.770 --> 00:39:44.970
say a range around
zero, are included.

00:39:44.970 --> 00:39:49.560
So a band-limited function would
be a function whose frequencies

00:39:49.560 --> 00:39:55.490
go from some value, say
minus omega to omega,

00:39:55.490 --> 00:39:58.380
instead of going from
minus infinity to infinity.

00:39:58.380 --> 00:40:05.760
This would be
band-limited frequencies

00:40:05.760 --> 00:40:12.280
between minus omega and omega.

00:40:12.280 --> 00:40:18.730
So that's another kind
of smooth function.

00:40:18.730 --> 00:40:22.910
That's another
way-- Functions that

00:40:22.910 --> 00:40:27.790
have only low frequencies are
associated with smoothness.

00:40:27.790 --> 00:40:31.660
High frequencies are associated
with fast oscillations.

00:40:31.660 --> 00:40:36.160
So the class of
band-limited functions

00:40:36.160 --> 00:40:41.750
gives me another, a Fourier
way, to talk about smoothness.

00:40:41.750 --> 00:40:45.180
So for us, smoothness was
something about how many

00:40:45.180 --> 00:40:47.760
derivatives were continuous.

00:40:47.760 --> 00:40:50.900
That's the sort of
smoothness in the x domain.

00:40:50.900 --> 00:40:53.040
How many derivatives.

00:40:53.040 --> 00:40:55.320
Smoothness in the
frequency domain

00:40:55.320 --> 00:40:59.260
is, how fast do the
frequencies drop off.

00:40:59.260 --> 00:41:03.200
And here, band-limited
means they drop like a shot.

00:41:03.200 --> 00:41:09.270
Band-limited means that the
frequencies in the function,

00:41:09.270 --> 00:41:13.660
that these e^(i*K*x)'s are not
there for high frequencies.

00:41:13.660 --> 00:41:18.400
High frequencies are out
for a band-limited function.

00:41:18.400 --> 00:41:26.070
And then Shannon has a
formula for the natural way

00:41:26.070 --> 00:41:32.300
to fit-- So our same
interpolation problem.

00:41:32.300 --> 00:41:36.210
So now, completing the
answer to your question.

00:41:36.210 --> 00:41:38.820
So I have these points.

00:41:38.820 --> 00:41:45.400
So Shannon could fit a function,
and it would look smooth,

00:41:45.400 --> 00:41:47.590
through those points.

00:41:47.590 --> 00:41:53.010
And his function
would be band-limited.

00:41:53.010 --> 00:41:55.340
So it would be smooth again.

00:41:55.340 --> 00:42:02.430
It would be-- yeah,
it would be smooth.

00:42:02.430 --> 00:42:06.250
In some way, this Shannon
band-limited stuff

00:42:06.250 --> 00:42:12.180
is the limit of splines as
the spline degree goes way up.

00:42:12.180 --> 00:42:16.480
So we did hat functions,
degree one splines.

00:42:16.480 --> 00:42:23.740
Cubic splines I recommended as
a pretty reliable construction.

00:42:23.740 --> 00:42:26.820
But you could do fifth degrees
splines, seventh degree

00:42:26.820 --> 00:42:29.320
splines, you could keep going.

00:42:29.320 --> 00:42:32.120
And in the limit,
you would get this.

00:42:32.120 --> 00:42:36.030
So maybe that's
some partial answer

00:42:36.030 --> 00:42:42.350
to the connection between
splines and this Fourier world.

00:42:42.350 --> 00:42:43.690
OK.

00:42:43.690 --> 00:42:45.090
Thanks.

00:42:45.090 --> 00:42:48.640
So these are topics now--
Wow, today's lecture

00:42:48.640 --> 00:42:52.850
is kind of-- Can I do one
really important thing now

00:42:52.850 --> 00:42:54.330
in today's lecture?

00:42:54.330 --> 00:42:56.290
For you to remember?

00:42:56.290 --> 00:42:58.050
Gradient and divergence?

00:42:58.050 --> 00:42:59.700
I don't want you to
spend the weekend

00:42:59.700 --> 00:43:10.660
without thinking about gradient
and divergence. [LAUGHTER] OK.

00:43:10.660 --> 00:43:14.410
Here's the idea.

00:43:14.410 --> 00:43:19.500
For lots and lots of
applications, for a region,

00:43:19.500 --> 00:43:29.370
let's say, in the plane,
I have the same-- What

00:43:29.370 --> 00:43:31.960
physical example
shall I pick now?

00:43:31.960 --> 00:43:35.530
Maybe I'll let u
be the temperature.

00:43:35.530 --> 00:43:37.420
So instead of
being displacement,

00:43:37.420 --> 00:43:41.400
let me make it temperature. u.

00:43:41.400 --> 00:43:42.830
OK.

00:43:42.830 --> 00:43:46.310
Then I have a
temperature gradient.

00:43:46.310 --> 00:43:47.290
A slope.

00:43:47.290 --> 00:43:51.480
But now, the whole point is,
that's a function of x and y.

00:43:51.480 --> 00:43:55.600
Then I have a
temperature gradient.

00:43:55.600 --> 00:43:59.010
And if I'm consistent with the
notation, that'll be e(x,y).

00:44:01.860 --> 00:44:08.440
And then you'll expect
that there's some c(x,y).

00:44:08.440 --> 00:44:13.640
Some operator c that tells
me how much heat flows.

00:44:13.640 --> 00:44:17.100
This will tell me
something about the the,

00:44:17.100 --> 00:44:18.960
the thermal conductivity.

00:44:18.960 --> 00:44:20.180
Right?

00:44:20.180 --> 00:44:27.300
Really, as I speak
about this framework,

00:44:27.300 --> 00:44:31.470
I'm just uttering
the correct words.

00:44:31.470 --> 00:44:34.260
Having started with
temperature, this thing

00:44:34.260 --> 00:44:36.180
should be a
temperature gradient.

00:44:36.180 --> 00:44:39.360
Then I should have some
physical thermal conductivity,

00:44:39.360 --> 00:44:43.110
different for different
metals or different materials.

00:44:43.110 --> 00:44:48.560
And I'll have a
heat flow, w(x,y).

00:44:48.560 --> 00:44:53.150
And everybody knows that
w will be c times e.

00:44:53.150 --> 00:44:57.610
And then there will
be some A transpose.

00:44:57.610 --> 00:45:01.860
Of course, there will be
some A transpose here,

00:45:01.860 --> 00:45:03.920
and some A here.

00:45:03.920 --> 00:45:07.740
And up here I'll have
a balance equation.

00:45:07.740 --> 00:45:13.730
OK.

00:45:13.730 --> 00:45:20.650
I just want to think,
what's the operator A?

00:45:20.650 --> 00:45:24.190
If we can focus
on that question,

00:45:24.190 --> 00:45:28.340
then that's what's going
to occupy us for, certainly

00:45:28.340 --> 00:45:31.010
the whole of next week.

00:45:31.010 --> 00:45:35.960
So I've actually used
the word gradient.

00:45:35.960 --> 00:45:39.280
We have functions
of two variables.

00:45:39.280 --> 00:45:42.730
We're looking for the
change, the rate of change,

00:45:42.730 --> 00:45:44.890
the steepness of
those functions.

00:45:44.890 --> 00:45:52.640
So this A, Au, is going to
give me two derivatives.

00:45:52.640 --> 00:45:56.650
I've got two variables, there
are two first derivatives.

00:45:56.650 --> 00:46:01.160
Both of them are important.

00:46:01.160 --> 00:46:03.500
That's what the A is.

00:46:03.500 --> 00:46:09.000
For the next big
example in the course.

00:46:09.000 --> 00:46:11.300
The final major
example of the course

00:46:11.300 --> 00:46:15.800
is, when A acts on a
function of two variables,

00:46:15.800 --> 00:46:19.420
because I'm in a
region in the plane,

00:46:19.420 --> 00:46:23.450
to find its rate of change.

00:46:23.450 --> 00:46:26.730
And this is called the gradient.

00:46:26.730 --> 00:46:34.030
The shorthand is
the gradient of u.

00:46:34.030 --> 00:46:37.720
So we have to understand that.

00:46:37.720 --> 00:46:41.870
We have to understand
what the gradient is.

00:46:41.870 --> 00:46:45.460
And, of course, we want
to know its transpose.

00:46:45.460 --> 00:46:48.900
So can I just think,
what should be

00:46:48.900 --> 00:46:54.410
the transpose of the gradient?

00:46:54.410 --> 00:46:55.000
OK.

00:46:55.000 --> 00:46:57.510
I'll take that picture out.

00:46:57.510 --> 00:46:58.470
OK.

00:46:58.470 --> 00:47:03.740
Thinking now about the
transpose of the gradient.

00:47:03.740 --> 00:47:06.070
OK.

00:47:06.070 --> 00:47:14.560
So A itself is, you could
say, is d/dx and d/dy.

00:47:14.560 --> 00:47:20.000
You notice how I'm
separating out A from Au.

00:47:20.000 --> 00:47:22.030
When this acts on
a function, this

00:47:22.030 --> 00:47:26.040
is the gradient operator
that acts on a function, u,

00:47:26.040 --> 00:47:29.700
to produce du/dx and du/dy.

00:47:29.700 --> 00:47:30.510
OK.

00:47:30.510 --> 00:47:33.670
Now what's the
transpose of this?

00:47:33.670 --> 00:47:35.480
OK.

00:47:35.480 --> 00:47:38.000
You can guess what it
should be, and then we'll

00:47:38.000 --> 00:47:40.960
see that yes, that
guess is correct.

00:47:40.960 --> 00:47:44.860
So what should A
transpose look like?

00:47:44.860 --> 00:47:54.540
If there's any justice, A
transpose should be-- OK,

00:47:54.540 --> 00:47:58.560
this is two by one.

00:47:58.560 --> 00:48:06.310
The transpose you would expect
to be a row, a row vector.

00:48:06.310 --> 00:48:08.930
I should have the
transpose of that there.

00:48:08.930 --> 00:48:11.160
And what is the
transpose of that?

00:48:11.160 --> 00:48:13.660
Just tell me.

00:48:13.660 --> 00:48:15.370
Because we have an idea.

00:48:15.370 --> 00:48:19.790
What should be the
transpose of d/dx?

00:48:19.790 --> 00:48:20.650
Negative d/dx.

00:48:24.040 --> 00:48:26.710
And what should be
the transpose of d/dy?

00:48:26.710 --> 00:48:28.690
It should be negative d/dy.

00:48:28.690 --> 00:48:30.550
Those are two different pieces.

00:48:30.550 --> 00:48:32.460
This is not run together.

00:48:32.460 --> 00:48:35.020
There's a big space in there.

00:48:35.020 --> 00:48:37.750
That's two pieces.

00:48:37.750 --> 00:48:44.810
So what is A transpose applied
to a-- So, heat flow w.

00:48:44.810 --> 00:48:50.840
I want to say, what is A
transpose applied to w?

00:48:50.840 --> 00:48:54.900
You're going to see this
again, but we'll just

00:48:54.900 --> 00:48:58.210
take these minutes to show
it for the first time.

00:48:58.210 --> 00:49:03.030
So A transpose-- Wait a minute.

00:49:03.030 --> 00:49:08.090
Is w a function,
or is it a vector?

00:49:08.090 --> 00:49:11.540
Yeah we've got to get that
straight before we start.

00:49:11.540 --> 00:49:14.220
Here's an ordinary
function, a scalar function.

00:49:14.220 --> 00:49:18.330
Just whatever, x
squared plus y squared.

00:49:18.330 --> 00:49:21.520
What is e?

00:49:21.520 --> 00:49:25.660
Suppose this is x
squared plus y squared.

00:49:25.660 --> 00:49:27.750
Let's have a specific example.

00:49:27.750 --> 00:49:31.590
What would e then be?

00:49:31.590 --> 00:49:33.630
It's got two components, right?

00:49:33.630 --> 00:49:38.910
It's got an x derivative and
a y derivative. e is a vector,

00:49:38.910 --> 00:49:41.870
[2x, 2y].

00:49:41.870 --> 00:49:44.270
Then I multiply by c.

00:49:44.270 --> 00:49:46.730
So this w has two components.

00:49:46.730 --> 00:49:50.870
This has got a
w_1(x,y), w_2(x,y).

00:49:53.910 --> 00:49:56.670
So just keep things straight.

00:49:56.670 --> 00:50:00.340
So it's that that I want
to apply A transpose to.

00:50:00.340 --> 00:50:08.550
So A transpose w is
minus d/dx, minus d/dy.

00:50:08.550 --> 00:50:10.210
And everything's
coming out right

00:50:10.210 --> 00:50:14.450
because it's applied to
a function w_1 and w_2.

00:50:14.450 --> 00:50:17.740
w is a vector field.

00:50:17.740 --> 00:50:20.350
It's not a scalar field,
it's a vector field.

00:50:20.350 --> 00:50:24.050
And the result is just
what it should be:

00:50:24.050 --> 00:50:31.290
minus dw_1/dx minus dw_2/dy.

00:50:31.290 --> 00:50:37.580
OK, good.

00:50:37.580 --> 00:50:40.620
This has got to come out of
integration by parts, right?

00:50:40.620 --> 00:50:43.290
So we'll have to think: what
does integration by parts

00:50:43.290 --> 00:50:45.910
mean in two variables?

00:50:45.910 --> 00:50:50.570
And it's a famous formula
named after Gauss and Green.

00:50:50.570 --> 00:50:52.330
The Green's formula, often.

00:50:52.330 --> 00:50:56.520
But do you recognize
what I'm looking at here?

00:50:56.520 --> 00:51:01.180
This is so important
it has a name.

00:51:01.180 --> 00:51:02.650
And what's the name?

00:51:02.650 --> 00:51:04.260
And then we're ready to go.

00:51:04.260 --> 00:51:09.470
What's the name of, if I take
a vector field, like [2x, 2y].

00:51:09.470 --> 00:51:11.840
Let me take [2x, 2y].

00:51:11.840 --> 00:51:17.570
as a specific example.

00:51:17.570 --> 00:51:21.480
Suppose w is [2x,2y].

00:51:21.480 --> 00:51:26.150
That was multiplied by,
let me take c to be one.

00:51:26.150 --> 00:51:33.140
Then what is A transpose w?

00:51:33.140 --> 00:51:34.800
Specifically.

00:51:34.800 --> 00:51:39.010
What am I getting out of it?

00:51:39.010 --> 00:51:43.860
What do I get from here?

00:51:43.860 --> 00:51:48.060
That's minus the x
derivative of the first guy,

00:51:48.060 --> 00:51:50.060
and the x derivative
of that guy is two,

00:51:50.060 --> 00:51:52.830
so I'm getting a minus two.

00:51:52.830 --> 00:51:58.650
And this is minus the y
derivative of the second guy,

00:51:58.650 --> 00:52:00.970
so that's another minus two.

00:52:00.970 --> 00:52:02.250
So I'm getting a number.

00:52:02.250 --> 00:52:03.990
It happens to be a number here.

00:52:03.990 --> 00:52:09.340
I chose such a simple function
it came out to be a number.

00:52:09.340 --> 00:52:11.100
And what's the name?

00:52:11.100 --> 00:52:15.550
So this is minus the what of w?

00:52:15.550 --> 00:52:20.470
Just tell me, what's
the name everybody uses

00:52:20.470 --> 00:52:22.890
for that operation?

00:52:22.890 --> 00:52:24.770
The divergence.

00:52:24.770 --> 00:52:28.040
Minus the divergence of w.

00:52:28.040 --> 00:52:37.950
So I what I'm saying
here is that this-- I'm

00:52:37.950 --> 00:52:41.240
saying it because
somehow I remember

00:52:41.240 --> 00:52:43.470
studying vector calculus.

00:52:43.470 --> 00:52:48.070
And in that process, I
learned about the gradient,

00:52:48.070 --> 00:52:51.360
and I learned about
the divergence.

00:52:51.360 --> 00:52:56.120
But I never learned that one
was the transpose of the other.

00:52:56.120 --> 00:53:03.420
I think, looking back,
that was criminal.

00:53:03.420 --> 00:53:07.500
To describe those-- With
a minus sign, of course.

00:53:07.500 --> 00:53:16.230
I learned Green's formula, but
now we'll see what it means.

00:53:16.230 --> 00:53:17.880
OK, that's next week's job.

00:53:17.880 --> 00:53:20.501
Have a great weekend
and see you Monday.