WEBVTT

00:00:00.000 --> 00:00:01.470
NARRATOR: The
following content is

00:00:01.470 --> 00:00:04.690
provided by MIT OpenCourseWare
under a Creative Commons

00:00:04.690 --> 00:00:06.090
license.

00:00:06.090 --> 00:00:08.230
Additional information
about our license

00:00:08.230 --> 00:00:10.490
and MIT OpenCourseWare
in general

00:00:10.490 --> 00:00:14.380
is available at ocw.mit.edu.

00:00:14.380 --> 00:00:23.700
PROFESSOR: Ready to go on
lecture five, I guess this is.

00:00:23.700 --> 00:00:29.480
So this -- we've done the
one-way wave equation,

00:00:29.480 --> 00:00:34.600
first-order equation and now
it's just natural to see what

00:00:34.600 --> 00:00:43.970
about the ordinary, second-order
wave equation and on this

00:00:43.970 --> 00:00:47.120
board, I've written it two ways.

00:00:47.120 --> 00:00:51.460
I've written it as a
second-order equation,

00:00:51.460 --> 00:00:54.210
so second time
derivative appears.

00:00:54.210 --> 00:00:57.860
That's going to make a change.

00:00:57.860 --> 00:01:01.420
It will have second
differences in time,

00:01:01.420 --> 00:01:04.730
so we're going to
have more steps,

00:01:04.730 --> 00:01:12.320
and of the matching second
difference in space.

00:01:12.320 --> 00:01:13.870
That's one way.

00:01:13.870 --> 00:01:18.440
Then this is another
important way

00:01:18.440 --> 00:01:23.280
to write the same equation
as a first-order system.

00:01:23.280 --> 00:01:28.090
So I can get back to first-order
systems and I can use all those

00:01:28.090 --> 00:01:32.940
methods -- Friedrichs,
Lax-Friedrichs for example,

00:01:32.940 --> 00:01:39.740
Lax-Wendroff, whatever
improvements we think of --

00:01:39.740 --> 00:01:45.170
on this first order system, d
by dt of a vector is a matrix

00:01:45.170 --> 00:01:47.090
times d by dx of a vector.

00:01:47.090 --> 00:01:52.030
So that's -- you really
have a choice here.

00:01:52.030 --> 00:01:54.640
Written this way, well,
notice a little bit

00:01:54.640 --> 00:01:59.280
of a good thing,
one good thing here.

00:01:59.280 --> 00:02:03.100
The matrix that shows
up is symmetric.

00:02:03.100 --> 00:02:08.140
That was by the careful choice
of putting a c in there.

00:02:08.140 --> 00:02:13.840
Then you see that the first
equation in this system is u_tt

00:02:13.840 --> 00:02:16.330
is c time c*u_xx.

00:02:19.370 --> 00:02:22.010
So the first equation
is the wave equation.

00:02:22.010 --> 00:02:23.850
And what about the
second equation?

00:02:23.850 --> 00:02:26.240
This is typical, when
you reduce things

00:02:26.240 --> 00:02:30.460
to a lower-order system,
that you get an equation here

00:02:30.460 --> 00:02:32.360
which is just an identity.

00:02:32.360 --> 00:02:36.210
The derivative of c -- the
time -- this is c*u_xt --

00:02:36.210 --> 00:02:41.280
it's the derivative in
x and t from there --

00:02:41.280 --> 00:02:44.520
and we have c times the
x derivative of u_t,

00:02:44.520 --> 00:02:45.900
the cross derivative.

00:02:45.900 --> 00:02:51.980
So that is an identity because
u_tx is the same as u_xt.

00:02:51.980 --> 00:02:56.100
We can take time and x and t
derivatives in either order,

00:02:56.100 --> 00:02:58.890
for a function of x and t.

00:02:58.890 --> 00:03:00.470
So we'll see that.

00:03:03.200 --> 00:03:06.900
I guess what I want to
do in the lecture is not

00:03:06.900 --> 00:03:13.640
to repeat Lax-Friedrichs or
Lax-Wendroff for this system.

00:03:13.640 --> 00:03:18.450
That would be unexciting.

00:03:18.450 --> 00:03:22.650
Let me just mention, what are
the eigenvalues of that matrix?

00:03:22.650 --> 00:03:26.020
So the eigenvalues
-- for a system,

00:03:26.020 --> 00:03:32.450
it's the eigenvalues of the
matrix that tell us what waves

00:03:32.450 --> 00:03:38.010
we've got, what speeds they go,
where it -- when it was 1 by 1,

00:03:38.010 --> 00:03:40.620
of course, it was just
that single number c,

00:03:40.620 --> 00:03:43.560
but what are the
eigenvalues of that matrix?

00:03:43.560 --> 00:03:47.380
Now, having made it
a symmetric matrix,

00:03:47.380 --> 00:03:50.430
we know right away it
has real eigenvalues,

00:03:50.430 --> 00:03:53.900
and so it's a wave problem.

00:03:53.900 --> 00:03:58.880
For a heat equation, we would
see something different,

00:03:58.880 --> 00:04:02.990
but this'll be a wave equation
and this has two eigenvalues

00:04:02.990 --> 00:04:08.000
and they are c and minus c.

00:04:08.000 --> 00:04:11.130
You could quickly check
that that 2 by 2 matrix

00:04:11.130 --> 00:04:14.630
has eigenvalues c and minus c.

00:04:14.630 --> 00:04:18.020
They add up to 0,
which is the trace.

00:04:18.020 --> 00:04:22.870
They multiply -- c times
minus c is minus c squared,

00:04:22.870 --> 00:04:24.080
which is the determinant.

00:04:24.080 --> 00:04:26.800
So that's -- they're
the right eigenvalues.

00:04:26.800 --> 00:04:32.190
So that's going to tell us
what we'll find every way,

00:04:32.190 --> 00:04:36.710
that the speeds of the waves
are c and minus c, which

00:04:36.710 --> 00:04:39.690
means a wave going
one way with speed c

00:04:39.690 --> 00:04:43.960
and a wave going the
other way with speed c.

00:04:43.960 --> 00:04:46.230
So it's a two-way wave equation.

00:04:46.230 --> 00:04:51.710
And this is the equation of
real -- that really happens,

00:04:51.710 --> 00:04:54.120
and I wanted to say just
a little bit about it --

00:04:54.120 --> 00:04:57.260
just two words
about real problems,

00:04:57.260 --> 00:05:01.660
because we can't,
in these first days,

00:05:01.660 --> 00:05:07.630
tackle the difficult
problems of electromagnetism,

00:05:07.630 --> 00:05:16.280
antenna design, all
kinds of wave problems.

00:05:16.280 --> 00:05:20.040
I guess I'm hoping some of
you may be meeting real wave

00:05:20.040 --> 00:05:29.750
problems in other courses and
would make a project that tries

00:05:29.750 --> 00:05:32.170
our methods on real problems.

00:05:32.170 --> 00:05:35.010
I just wanted to
write down here one

00:05:35.010 --> 00:05:37.390
sort of typical real problem.

00:05:37.390 --> 00:05:43.620
So in a real problem, we have
a variable coefficient x,

00:05:43.620 --> 00:05:47.140
because maybe our material
is not homogeneous,

00:05:47.140 --> 00:05:53.150
it's not uniform, and we
have a forcing term --

00:05:53.150 --> 00:05:57.100
I just put F for the amplitude
to emphasize that's forcing

00:05:57.100 --> 00:06:01.700
term, so F standing for forcing,
but it's an oscillating forcing

00:06:01.700 --> 00:06:05.120
term, it's a -- this is
what you're going to have.

00:06:05.120 --> 00:06:08.190
In electromagnetism,
the frequency

00:06:08.190 --> 00:06:09.690
is going to be very, very high.

00:06:12.200 --> 00:06:17.170
So this is a problem that's
not easy numerically.

00:06:17.170 --> 00:06:20.880
Very, very high
frequencies would normally

00:06:20.880 --> 00:06:24.010
require very, very small
wavelengths, very, very

00:06:24.010 --> 00:06:26.640
small delta x,
because you remember,

00:06:26.640 --> 00:06:30.520
there'll be a k
delta x in the error.

00:06:30.520 --> 00:06:35.730
So we took a big delta x or
even an ordinary size delta

00:06:35.730 --> 00:06:39.830
x and let the frequency go way,
way up, high, high frequency

00:06:39.830 --> 00:06:43.540
oscillation, our k
delta x would be big

00:06:43.540 --> 00:06:47.980
and the accuracy would be
poor and the results useless.

00:06:47.980 --> 00:06:53.190
So a lot of -- I'm really --
guess I'm thinking here about

00:06:53.190 --> 00:06:58.620
a course on wave propagation
would study this as a first

00:06:58.620 --> 00:07:06.340
model problem, do some analysis
and then go into 2-D and 3-D.

00:07:06.340 --> 00:07:11.110
That's the reality
of wave theory,

00:07:11.110 --> 00:07:15.350
is you can get asymptotic
results for k going

00:07:15.350 --> 00:07:16.700
to infinity.

00:07:16.700 --> 00:07:23.290
You get things -- you're
looking in matching powers of k,

00:07:23.290 --> 00:07:24.110
so to speak.

00:07:24.110 --> 00:07:29.450
You're getting plane waves
and interesting stuff

00:07:29.450 --> 00:07:33.810
that we can't do
already, right away here.

00:07:33.810 --> 00:07:37.280
So I'm going back to the
ordinary wave equation,

00:07:37.280 --> 00:07:40.910
either second or --
start with second order,

00:07:40.910 --> 00:07:43.100
u_tt is c squared u_xx.

00:07:43.100 --> 00:07:46.460
That's our goal.

00:07:46.460 --> 00:07:49.260
As I said, we don't want to see
Lax-Friedrichs and Lax-Wendroff

00:07:49.260 --> 00:07:49.760
again.

00:07:49.760 --> 00:07:52.830
We know those.

00:07:52.830 --> 00:08:00.320
It's rather -- so one new method
is going to show up and it's --

00:08:00.320 --> 00:08:04.420
leapfrog is the right name,
the natural name to give it.

00:08:04.420 --> 00:08:09.230
Leapfrog because in
the time direction,

00:08:09.230 --> 00:08:13.250
we have time n minus
1, n and n plus 1.

00:08:13.250 --> 00:08:19.980
There's a leap there, but let
me start with semidiscrete.

00:08:19.980 --> 00:08:24.790
We haven't done
this until today.

00:08:24.790 --> 00:08:30.850
Semidiscrete means, as you
see, that the time variable

00:08:30.850 --> 00:08:33.990
stays continuous.

00:08:33.990 --> 00:08:39.310
We have ordinary
differential equations in t,

00:08:39.310 --> 00:08:42.990
but the space variable is
what's getting discrete.

00:08:42.990 --> 00:08:47.730
so the problem is like half
discrete -- discrete in x,

00:08:47.730 --> 00:08:52.770
there's a delta x, but
there's no delta t yet.

00:08:52.770 --> 00:08:59.260
So it's natural to
analyze this problem.

00:08:59.260 --> 00:09:00.730
So what do we have, really?

00:09:00.730 --> 00:09:06.240
In the x direction, we have
a mesh of width delta x.

00:09:06.240 --> 00:09:08.370
So we have unknowns.

00:09:08.370 --> 00:09:17.510
If that's 0, j is measuring
-- so j delta x is the typical

00:09:17.510 --> 00:09:22.260
point, point number
j along there.

00:09:22.260 --> 00:09:26.950
And then in the time direction,
we're going continuously.

00:09:26.950 --> 00:09:32.150
So I don't have discrete
steps, so it's called --

00:09:32.150 --> 00:09:36.230
because those are lines in
the time direction, this is --

00:09:36.230 --> 00:09:41.370
semidiscrete is also referred
to as the method of lines.

00:09:41.370 --> 00:09:44.980
So the method of lines is what
we're doing here and it's --

00:09:44.980 --> 00:09:51.260
all I want to do is
what I always do.

00:09:51.260 --> 00:09:57.400
Take exponentials, look
at their growth factors,

00:09:57.400 --> 00:09:59.110
understand the equation.

00:09:59.110 --> 00:10:02.330
Actually, I better do it first
with a wave equation itself.

00:10:02.330 --> 00:10:06.780
So I guess my
organization for today is,

00:10:06.780 --> 00:10:12.500
first step is follow e to the
i*k*x for the wave equation.

00:10:12.500 --> 00:10:14.650
So I'll do that here.

00:10:14.650 --> 00:10:24.010
u_tt equals c squared u_xx,
and I'm going to look at u

00:10:24.010 --> 00:10:28.410
proportional to -- and I'll
call this factor G again --

00:10:28.410 --> 00:10:31.890
G of t and times
the frequency i*k*x.

00:10:35.000 --> 00:10:40.660
So I'm going to look
for pure exponentials

00:10:40.660 --> 00:10:42.600
and we'll quickly find them.

00:10:42.600 --> 00:10:45.690
And then I'm going to do
the same for semidiscrete,

00:10:45.690 --> 00:10:51.850
where that x becomes j
delta x and I'm at point j.

00:10:51.850 --> 00:11:00.450
And then I'm going to eventually
look at the discrete, now fully

00:11:00.450 --> 00:11:07.050
discrete, discrete in time
and discrete in space,

00:11:07.050 --> 00:11:12.940
and the question of
stability arises.

00:11:12.940 --> 00:11:15.380
Accuracy we can --
you pretty much --

00:11:15.380 --> 00:11:19.700
we pretty much know the
accuracy for second differences,

00:11:19.700 --> 00:11:23.700
that's a second-order accurate
thing because it's centered,

00:11:23.700 --> 00:11:25.580
but stability is
going to come in.

00:11:32.380 --> 00:11:34.610
So that's -- this
is our first step.

00:11:37.510 --> 00:11:40.540
Then I'll just mention
what other point

00:11:40.540 --> 00:11:45.630
remains in this wave
equation, is to look

00:11:45.630 --> 00:11:47.930
at the first-order system.

00:11:50.560 --> 00:11:56.980
How does that look
in space and time?

00:11:56.980 --> 00:12:01.390
As I said, the
obvious thing to do

00:12:01.390 --> 00:12:04.370
would be Lax-Friedrichs
or Lax-Wendroff,

00:12:04.370 --> 00:12:14.210
but there's another idea and
it brings in a staggered grid.

00:12:14.210 --> 00:12:16.890
You'll see it.

00:12:16.890 --> 00:12:20.310
Somehow that staggered grid
is really an important idea

00:12:20.310 --> 00:12:22.030
that we haven't met yet.

00:12:22.030 --> 00:12:28.780
That some unknowns are on
the standard grid, U_(j, n),

00:12:28.780 --> 00:12:36.935
but the other unknowns are on
a grid that's half a delta x

00:12:36.935 --> 00:12:40.950
and half a delta t different.

00:12:40.950 --> 00:12:42.710
It's just right, actually.

00:12:42.710 --> 00:12:47.870
So that's a premier method
in electromagnetism.

00:12:47.870 --> 00:12:50.790
So that's what's
coming, but let's start

00:12:50.790 --> 00:12:52.970
with the second-order
method, because we haven't

00:12:52.970 --> 00:12:55.600
seen the second-order method.

00:12:55.600 --> 00:13:00.530
Second-order equation --
plug in G. So I have --

00:13:00.530 --> 00:13:06.130
the second time derivative
gives me G double prime times e

00:13:06.130 --> 00:13:09.750
to the i*k*x -- I'm separating
variables, of course;

00:13:09.750 --> 00:13:12.460
t here and x there.

00:13:12.460 --> 00:13:15.030
On the other side,
I have c squared.

00:13:15.030 --> 00:13:19.600
Now I have the x variable,
so that brings down an i*k --

00:13:19.600 --> 00:13:27.620
so that's i*k squared
times G e to the i*k*x.

00:13:27.620 --> 00:13:30.120
Good.

00:13:30.120 --> 00:13:39.480
So simple, but substituting this
is just a natural first step

00:13:39.480 --> 00:13:40.840
to see what's happening.

00:13:40.840 --> 00:13:44.860
Then, of course, canceling e
to the i*k*x leaves us with

00:13:44.860 --> 00:13:50.790
the equation for the
G. G double prime is --

00:13:50.790 --> 00:13:57.940
I'll make that i squared minus
-- minus c squared k squared G.

00:13:57.940 --> 00:14:03.100
Of course, the new aspect
is it's second order.

00:14:03.100 --> 00:14:06.890
So it's got two solutions
instead of just one.

00:14:06.890 --> 00:14:09.920
It's constant
coefficients, of course,

00:14:09.920 --> 00:14:13.840
and so we look for exponentials.

00:14:13.840 --> 00:14:22.800
And the solution then would be
-- two solutions are some --

00:14:22.800 --> 00:14:28.410
there's an e to the i -- I
guess I'm bringing back the i --

00:14:28.410 --> 00:14:44.100
e to the i*c*k*t e to the i*k*x
and e to the minus i*c*k*t e

00:14:44.100 --> 00:14:46.540
to the i*k*x.

00:14:46.540 --> 00:14:49.550
Those are the two possible G's.

00:14:49.550 --> 00:14:57.280
Those are the -- if we take
their second time derivative,

00:14:57.280 --> 00:15:02.690
we get the same as taking
the second x derivative.

00:15:02.690 --> 00:15:07.010
We get the factor c
is in the right place.

00:15:07.010 --> 00:15:08.200
You'll see it.

00:15:08.200 --> 00:15:11.300
The second time derivative
brings this factor down,

00:15:11.300 --> 00:15:16.910
just as we wanted, but the point
is that there are two of them.

00:15:16.910 --> 00:15:25.270
So this I can write as
e to the i*k x plus ct.

00:15:25.270 --> 00:15:27.650
That's our old friend.

00:15:27.650 --> 00:15:34.650
This one I can write as
e to the i*k x minus ct,

00:15:34.650 --> 00:15:37.920
which is our new
friend, the new wave.

00:15:37.920 --> 00:15:39.660
The wave that's
going to the right.

00:15:39.660 --> 00:15:45.600
So this x plus c*t follows
the characteristic lines

00:15:45.600 --> 00:15:52.000
to the left, just the way we had
in the one-way wave equation.

00:15:52.000 --> 00:15:59.910
This x minus c*t stays constant
on characteristic lines going

00:15:59.910 --> 00:16:10.580
up to the right; it travels with
speed c and the signal travels

00:16:10.580 --> 00:16:14.270
along those characteristics
with speed c, so that a --

00:16:14.270 --> 00:16:23.910
an initial value, now -- maybe
I draw a picture over here --

00:16:23.910 --> 00:16:27.620
so here is t equals --
this is x as always.

00:16:27.620 --> 00:16:29.320
This is t equals 0.

00:16:29.320 --> 00:16:33.630
I have some initial
value u at (0, 0),

00:16:33.630 --> 00:16:39.400
and I also have an initial
velocity, because I'm in --

00:16:39.400 --> 00:16:44.010
got a second-order equation,
but information somehow,

00:16:44.010 --> 00:16:49.270
pure exponential information
travels along characteristics

00:16:49.270 --> 00:16:51.880
this way -- that's
the new one --

00:16:51.880 --> 00:16:55.370
and characteristics this
way -- that's the old one.

00:16:55.370 --> 00:16:58.790
This is time, space.

00:16:58.790 --> 00:17:02.490
I'm graphing the two
characteristic lines now.

00:17:02.490 --> 00:17:08.520
x minus c*t equals --
if it starts from 0,

00:17:08.520 --> 00:17:10.520
then it would be 0.

00:17:10.520 --> 00:17:15.670
This is the x plus c*t equals
0, the one we had before.

00:17:15.670 --> 00:17:17.090
The two characteristic lines.

00:17:19.790 --> 00:17:24.540
Waves are going
both ways, right?

00:17:24.540 --> 00:17:29.205
Now, what we were able to do
with the first-order equation

00:17:29.205 --> 00:17:37.400
-- we even got a completely
explicit solution

00:17:37.400 --> 00:17:40.120
to the one-way wave equation
and we can do the same

00:17:40.120 --> 00:17:44.480
for the two-way wave equation,
so I better write it down.

00:17:44.480 --> 00:17:47.730
I better write
down the solution.

00:17:47.730 --> 00:17:52.130
So let me just continue
this same idea.

00:17:52.130 --> 00:18:01.730
The general, the complete
solution will be u of x and t

00:18:01.730 --> 00:18:10.820
is some function of x minus
c*t and some function of --

00:18:10.820 --> 00:18:16.860
call that f_2 -- of x plus c*t.

00:18:16.860 --> 00:18:22.500
Now I'm taking the jump, the
jump from one exponential,

00:18:22.500 --> 00:18:30.430
a particular k that gave
me these particular guys,

00:18:30.430 --> 00:18:35.360
to all exponentials and
assembling all exponentials

00:18:35.360 --> 00:18:36.350
into functions.

00:18:36.350 --> 00:18:37.830
So why is that OK?

00:18:37.830 --> 00:18:42.070
It's only OK in this because
of this very special situation

00:18:42.070 --> 00:18:45.620
that all frequencies are
behaving the same here.

00:18:45.620 --> 00:18:50.830
All frequencies -- I
have no dispersion.

00:18:50.830 --> 00:18:54.490
Dispersion is going to
be different behavior

00:18:54.490 --> 00:18:58.580
of different frequencies,
so that's an important fact,

00:18:58.580 --> 00:19:01.500
which we don't face here.

00:19:01.500 --> 00:19:06.330
There will be dispersion
in the discrete methods,

00:19:06.330 --> 00:19:09.890
the semidiscrete and
the discrete method.

00:19:09.890 --> 00:19:13.210
Different frequencies will
travel at different speeds

00:19:13.210 --> 00:19:17.400
and that's what produces
the oscillating error.

00:19:17.400 --> 00:19:22.830
Whatever shape the error has is
because different k's are doing

00:19:22.830 --> 00:19:25.300
slightly different
things, as we'll see

00:19:25.300 --> 00:19:28.680
when we do the discrete ones.

00:19:28.680 --> 00:19:33.560
But in the continuous case,
every k, we have the same --

00:19:33.560 --> 00:19:38.200
traveling either with speed
c or minus c and therefore,

00:19:38.200 --> 00:19:41.570
we put them all together and we
have a whole function traveling

00:19:41.570 --> 00:19:44.450
with speed c or minus c.

00:19:44.450 --> 00:19:48.280
Now we've got two
functions and we

00:19:48.280 --> 00:19:51.440
have to do we have to match
two initial conditions.

00:19:51.440 --> 00:19:59.540
We have to match a u of x
and 0 and the time derivative

00:19:59.540 --> 00:20:03.080
has to match a u_t
of x and 0, so these

00:20:03.080 --> 00:20:05.850
are the initial conditions.

00:20:10.010 --> 00:20:12.690
You just match them up
and you find the answer.

00:20:12.690 --> 00:20:15.990
So you discover what these
functions really are.

00:20:15.990 --> 00:20:19.190
It turns out that, I think,
we had -- you remember before,

00:20:19.190 --> 00:20:26.740
we had a u of x plus c*t and 0?

00:20:26.740 --> 00:20:30.380
That was everything in the
solution to the one-way wave

00:20:30.380 --> 00:20:31.400
equation.

00:20:31.400 --> 00:20:44.990
Now we will have u of x minus
c*t, 0 and this divided by 2 --

00:20:44.990 --> 00:20:51.270
so there, you see, a wave's
going each way and the division

00:20:51.270 --> 00:20:58.660
by 2 makes us -- now we're
matching the initial condition,

00:20:58.660 --> 00:21:04.740
so that would be the total
answer if the equation,

00:21:04.740 --> 00:21:08.940
if the body starts from
rest with zero velocity,

00:21:08.940 --> 00:21:14.760
but I haven't matched -- so I've
only matched du/dt equals 0 --

00:21:14.760 --> 00:21:18.040
think the time derivative
of that would be 0.

00:21:18.040 --> 00:21:20.570
Yeah, because the time
derivative of this would bring

00:21:20.570 --> 00:21:25.740
out a c, this would bring out
a minus c and a t equals 0,

00:21:25.740 --> 00:21:26.940
they'd cancelled.

00:21:26.940 --> 00:21:34.200
So I need another term
and it turns out to be --

00:21:34.200 --> 00:21:35.680
I'll just write it down.

00:21:35.680 --> 00:21:41.360
It's got to depend on x
minus c*t and x plus c*t

00:21:41.360 --> 00:21:50.500
and it's this -- it's the
integral of this velocity dx.

00:21:50.500 --> 00:21:55.840
I won't -- there's no reason
to take time to derive that.

00:21:55.840 --> 00:21:59.190
I think it's right
and could check.

00:21:59.190 --> 00:22:00.290
Right.

00:22:00.290 --> 00:22:09.510
So what this means is that
the initial velocity is --

00:22:09.510 --> 00:22:12.560
it's entering,
somehow, all along --

00:22:12.560 --> 00:22:23.600
somehow the initial velocity
is affecting things within this

00:22:23.600 --> 00:22:31.520
cone, this characteristic
cone that's defined

00:22:31.520 --> 00:22:34.480
by the characteristic lines.

00:22:34.480 --> 00:22:37.880
In two dimensions, that cone
will really look like a cone.

00:22:37.880 --> 00:22:40.300
It'll look like an
ice cream cone --

00:22:40.300 --> 00:22:41.950
or maybe that's in
three dimensions.

00:22:44.670 --> 00:22:45.170
Whatever.

00:22:48.560 --> 00:22:51.600
In other words, if
the initial condition

00:22:51.600 --> 00:22:54.760
was a delta function
at the origin,

00:22:54.760 --> 00:23:01.130
you could quickly see what
the solution would be,

00:23:01.130 --> 00:23:03.330
and if the delta, if
the initial condition

00:23:03.330 --> 00:23:06.830
was a step function at the
origin, what would happen then?

00:23:06.830 --> 00:23:10.810
Suppose I started with this
step function at the origin.

00:23:10.810 --> 00:23:14.910
So, like, a wall of water
and suppose it's at rest.

00:23:14.910 --> 00:23:19.060
So nothing -- at
moment t equals 0,

00:23:19.060 --> 00:23:26.200
I remove the dam and the water
starts -- the water flows.

00:23:26.200 --> 00:23:32.110
Then this term is 0 because
there was no initial velocity

00:23:32.110 --> 00:23:35.780
and this term is just half
of that wall goes one way

00:23:35.780 --> 00:23:38.560
and half goes the other way.

00:23:38.560 --> 00:23:46.670
The notes draw a picture of
that, so that -- so that's --

00:23:46.670 --> 00:23:52.712
I've kind of quickly disposed
of the solution of the wave

00:23:52.712 --> 00:23:58.270
equation and of course,
that's too easy.

00:23:58.270 --> 00:24:07.010
This is -- I mean, that's good
to know and good to compare

00:24:07.010 --> 00:24:12.340
when we meet real problems
where c depends on x,

00:24:12.340 --> 00:24:15.520
where there's a forcing
term, where there's a --

00:24:15.520 --> 00:24:18.840
real complications.

00:24:18.840 --> 00:24:22.580
But it just pays to stay
with the model problems

00:24:22.580 --> 00:24:23.950
at the beginning.

00:24:23.950 --> 00:24:28.850
So, I'm going to stay with
the model problem and move

00:24:28.850 --> 00:24:36.470
on to discrete, so
try to understand --

00:24:36.470 --> 00:24:42.930
let me try to understand what
happens if I make the space

00:24:42.930 --> 00:24:45.670
variable discrete, right?

00:24:49.260 --> 00:24:54.270
I guess I should say,
another step toward reality

00:24:54.270 --> 00:24:58.540
would be, have some boundaries.

00:24:58.540 --> 00:25:01.990
Here, this is on the whole
line, x from minus infinity

00:25:01.990 --> 00:25:06.640
to infinity, so reality would
be that there would be --

00:25:06.640 --> 00:25:14.290
this picture would have some
boundary, maybe there at, say,

00:25:14.290 --> 00:25:22.430
minus L and L, and some
boundary conditions there,

00:25:22.430 --> 00:25:25.180
on that boundary.

00:25:25.180 --> 00:25:32.000
And that -- so now we
have a finite problem.

00:25:32.000 --> 00:25:34.750
That means the
calculations are fine,

00:25:34.750 --> 00:25:37.470
but it means some new
effects are coming in.

00:25:37.470 --> 00:25:43.230
Waves can bounce back
off the boundary, partly.

00:25:43.230 --> 00:25:50.120
They can go out,
be lost, go beyond

00:25:50.120 --> 00:25:54.840
or disappear, depending what
the boundary conditions are.

00:25:54.840 --> 00:25:57.130
So that's another
part of reality,

00:25:57.130 --> 00:26:00.290
is boundary conditions.

00:26:00.290 --> 00:26:06.720
I'm probably suggesting,
then, some more realistic

00:26:06.720 --> 00:26:08.330
numerical experiments.

00:26:08.330 --> 00:26:10.060
So a realistic
numerical experiment

00:26:10.060 --> 00:26:14.140
would be, put in
some boundaries,

00:26:14.140 --> 00:26:17.040
make this a finite system.

00:26:17.040 --> 00:26:24.910
So if that's 0, let's just have
a finite number, stop there.

00:26:24.910 --> 00:26:27.260
This would be one boundary,
this would be the other.

00:26:27.260 --> 00:26:33.120
Then I have just seven
unknowns in that problem.

00:26:33.120 --> 00:26:36.840
That'd be a seven by
seven matrix over there

00:26:36.840 --> 00:26:38.580
and it would be the
second difference

00:26:38.580 --> 00:26:49.810
matrix that is so fundamental
in all of scientific computing.

00:26:49.810 --> 00:26:52.180
So we have here a second
difference matrix,

00:26:52.180 --> 00:26:54.420
but it's infinite
because I haven't

00:26:54.420 --> 00:26:56.410
got a boundary right now.

00:26:56.410 --> 00:26:59.130
So the fact of not
having a boundary

00:26:59.130 --> 00:27:02.540
means Fourier is ready to go.

00:27:02.540 --> 00:27:08.870
So I'm going to plug in --
again, I'm going to try U.

00:27:08.870 --> 00:27:12.840
This is capital U now, because
I've discretized something.

00:27:17.010 --> 00:27:21.470
I better write this in a
form where we see the j,

00:27:21.470 --> 00:27:28.400
so can I write this equation,
just again for U number j --

00:27:28.400 --> 00:27:32.353
so tracking up this line,
for example, or this one.

00:27:32.353 --> 00:27:38.550
So I'm tracking up this line
-- do you see that U is now

00:27:38.550 --> 00:27:39.370
a system?

00:27:39.370 --> 00:27:43.310
In this case -- let's see.

00:27:43.310 --> 00:27:46.240
I shouldn't have put this one in
so that I'd have 1, 2, 3, 4, 5,

00:27:46.240 --> 00:27:47.560
6, 7 -- that's good.

00:27:51.650 --> 00:27:58.020
So my unknowns are U_j
tracking up that line.

00:27:58.020 --> 00:28:03.930
Each U_j is going in
the time direction,

00:28:03.930 --> 00:28:09.960
so this equation is really
the time derivative.

00:28:09.960 --> 00:28:12.640
It's an ordinary derivative.

00:28:12.640 --> 00:28:15.710
I can write d and not
partial derivative,

00:28:15.710 --> 00:28:21.450
because the only derivatives
here are in time of U_j --

00:28:21.450 --> 00:28:31.700
is c squared over delta x
squared times U_(j+1) minus

00:28:31.700 --> 00:28:37.700
2*U_j plus U_(j-1).

00:28:37.700 --> 00:28:40.410
That's my equation.

00:28:40.410 --> 00:28:42.340
My system of equations, sorry.

00:28:42.340 --> 00:28:45.140
My system of equations.

00:28:45.140 --> 00:28:48.530
For the moment, I'm thinking
j goes from minus infinity

00:28:48.530 --> 00:28:49.280
to infinity.

00:28:49.280 --> 00:28:53.860
I'm not going to put in a
boundary, but what I will do,

00:28:53.860 --> 00:29:05.150
of course, is try U_j is
some growth factor that --

00:29:05.150 --> 00:29:09.160
j is a space, is
counting space steps,

00:29:09.160 --> 00:29:14.400
so the growth factor is in time
and it's continuous in time,

00:29:14.400 --> 00:29:22.800
because time's continuous,
but it's always e to the i*k*j

00:29:22.800 --> 00:29:28.250
delta x.

00:29:28.250 --> 00:29:30.070
That's the right
thing to plug in.

00:29:30.070 --> 00:29:36.870
I mean, I guess what we're
-- what I'm really --

00:29:36.870 --> 00:29:42.490
the reason for really doing this
is just to reinforce the idea

00:29:42.490 --> 00:29:47.410
that trying a pure exponential
is a good thing to do.

00:29:47.410 --> 00:29:51.270
It's even a good thing to do
with variable coefficients

00:29:51.270 --> 00:29:54.450
and real problems.

00:29:54.450 --> 00:29:59.100
It's absolutely a good thing to
do with these model problems.

00:29:59.100 --> 00:30:02.970
Plug it in and what happens?

00:30:02.970 --> 00:30:07.830
So I get G double prime
times the exponential,

00:30:07.830 --> 00:30:10.190
but of course you
know in advance,

00:30:10.190 --> 00:30:12.390
I'm going to cancel
that exponential --

00:30:12.390 --> 00:30:18.230
is c squared over delta
x squared times --

00:30:18.230 --> 00:30:19.450
what goes there?

00:30:19.450 --> 00:30:23.320
What will cancel
the exponential --

00:30:23.320 --> 00:30:27.180
so I'm imagining that
exponential as far out,

00:30:27.180 --> 00:30:29.340
but here it is at j plus 1.

00:30:29.340 --> 00:30:35.845
So I've incremented j by 1, so
that is going to give me an e

00:30:35.845 --> 00:30:39.670
to the i*k delta x, right?

00:30:39.670 --> 00:30:44.080
Here I haven't incremented it
and here I've incremented it

00:30:44.080 --> 00:30:51.180
by minus 1, so that will give me
an e to the minus i*k delta x,

00:30:51.180 --> 00:30:55.780
all times the same exponential
which appeared there

00:30:55.780 --> 00:30:58.820
and appeared there
and got cancelled.

00:30:58.820 --> 00:31:00.870
So that's it there.

00:31:00.870 --> 00:31:07.890
G double prime -- oh there's
got to be a G -- right,

00:31:07.890 --> 00:31:15.924
there's a G. Right.

00:31:15.924 --> 00:31:17.590
When I plugged in on
the right-hand side

00:31:17.590 --> 00:31:21.230
I got a G that was so
uninteresting I lost it.

00:31:23.890 --> 00:31:28.330
What does -- what's G there?

00:31:31.200 --> 00:31:41.660
I guess the main point to see
is, this quantity, which is --

00:31:41.660 --> 00:31:48.930
divided by delta x squared,
which is coming because we have

00:31:48.930 --> 00:31:50.940
differences instead
of derivatives.

00:31:50.940 --> 00:31:55.790
When we had derivatives, that
quantity was c squared i*k

00:31:55.790 --> 00:31:56.290
squared.

00:31:59.650 --> 00:32:02.560
Or, in other words, minus
c squared k squared.

00:32:05.230 --> 00:32:18.300
This was the correct factor and
this one is the discrete factor

00:32:18.300 --> 00:32:21.380
and it's worth just paying
a moment of attention

00:32:21.380 --> 00:32:23.860
to compare the two.

00:32:27.500 --> 00:32:30.320
Where am I going to
write that comparison?

00:32:30.320 --> 00:32:33.560
I guess that's going to be
on the board that's hidden,

00:32:33.560 --> 00:32:37.990
so I'm going to -- can
you try to remember that?

00:32:37.990 --> 00:32:41.830
Let me focus just on this
quantity for a minute, or even

00:32:41.830 --> 00:32:47.490
just on this one, just because
we see it so many times,

00:32:47.490 --> 00:32:50.860
because it's coming directly
from second differences.

00:32:50.860 --> 00:32:53.350
For the moment, let
me take k delta x.

00:32:53.350 --> 00:32:54.600
I'll just call it theta.

00:32:54.600 --> 00:32:56.420
It's some angle.

00:32:56.420 --> 00:33:03.180
So can I just do a little
bit of trig with this factor?

00:33:03.180 --> 00:33:07.890
2 minus 2 cos theta.

00:33:07.890 --> 00:33:09.490
Let's see.

00:33:09.490 --> 00:33:12.760
I'm going to, I'm going
to bring out a minus sign.

00:33:12.760 --> 00:33:15.600
So I'm going to put
plus signs on those

00:33:15.600 --> 00:33:18.500
and minus signs on those.

00:33:18.500 --> 00:33:22.100
You see the main
point of course,

00:33:22.100 --> 00:33:26.990
that e to the plus
something, e to the i theta

00:33:26.990 --> 00:33:33.370
and e to the minus i theta
combine to give 2 cos theta.

00:33:33.370 --> 00:33:35.550
Right, so that's the key
simplification that's

00:33:35.550 --> 00:33:38.260
going to make this much neater.

00:33:38.260 --> 00:33:41.000
So I have 2 cos theta minus 2.

00:33:41.000 --> 00:33:47.230
I have 2 cos theta minus 2, and
if I bring out a minus sign,

00:33:47.230 --> 00:33:49.540
I'll have 2 minus 2
cos theta and that's

00:33:49.540 --> 00:33:50.670
what I want to write.

00:33:50.670 --> 00:33:52.560
I want to write 2
minus 2 cos theta.

00:33:59.450 --> 00:34:02.690
I want to see what
that expression is.

00:34:02.690 --> 00:34:05.325
Right, so that brought
out a minus sign just

00:34:05.325 --> 00:34:13.430
to match that minus sign
and the c squareds match,

00:34:13.430 --> 00:34:17.570
but what's different is
this k squared is now

00:34:17.570 --> 00:34:25.570
gone into this 2 minus 2
cos k delta x I'll write it,

00:34:25.570 --> 00:34:29.120
divided by delta x squared.

00:34:29.120 --> 00:34:33.710
You see that this is
-- that's the change.

00:34:33.710 --> 00:34:36.790
k squared, which is
a positive quantity

00:34:36.790 --> 00:34:41.720
became this, which is also a
positive quantity, 2 minus 2

00:34:41.720 --> 00:34:46.370
cos theta, but it's
not a pure k squared.

00:34:46.370 --> 00:34:49.670
We are getting dispersion.

00:34:49.670 --> 00:34:54.070
Different frequencies are
showing up inside the cosine

00:34:54.070 --> 00:34:57.210
and that's not a
linear function.

00:34:57.210 --> 00:35:01.150
So we're seeing
different frequencies

00:35:01.150 --> 00:35:10.160
going their own way in a more
interesting way then just what

00:35:10.160 --> 00:35:12.970
we saw here with k squared.

00:35:12.970 --> 00:35:17.580
Of course, when we take the
square root, as we did here,

00:35:17.580 --> 00:35:24.280
that produced linear in k and
no dispersion and something

00:35:24.280 --> 00:35:28.200
simple, but here, when we
take the square root --

00:35:28.200 --> 00:35:29.954
let's get ready to
take the square root.

00:35:29.954 --> 00:35:31.620
How can we take the
square root of that?

00:35:36.100 --> 00:35:37.520
By writing it as a square.

00:35:40.200 --> 00:35:44.170
It's never negative, and if I
use a little trigonometry --

00:35:44.170 --> 00:35:45.840
so I'm just going
to write it down.

00:35:45.840 --> 00:35:52.960
This is 4 -- I think it's
sine squared of theta over 2.

00:35:55.600 --> 00:35:59.170
That's just a handy fact.

00:35:59.170 --> 00:36:04.500
It's handy because I can take
its square root and really see

00:36:04.500 --> 00:36:10.060
what -- so theta -- remember
this theta is standing for k

00:36:10.060 --> 00:36:12.420
delta x.

00:36:12.420 --> 00:36:15.580
So then, I want to divided
it by delta x squared.

00:36:15.580 --> 00:36:19.290
Can I bring down that quantity
just so you see it again?

00:36:19.290 --> 00:36:25.130
So this was the 2 minus 2 cos
theta with the minus sign,

00:36:25.130 --> 00:36:29.470
and dividing by delta
x squared and that's --

00:36:29.470 --> 00:36:32.680
so it was G double prime
-- let's just write it.

00:36:32.680 --> 00:36:37.850
So I have G -- I'm now
going to copy what --

00:36:37.850 --> 00:36:42.670
G double prime was a minus sign
times the c squared times this

00:36:42.670 --> 00:36:52.330
-- 4 sine squared of k delta
x on 2 divided by delta x

00:36:52.330 --> 00:36:53.490
squared.

00:36:53.490 --> 00:36:56.789
Maybe I'll put the delta
x squared over there,

00:36:56.789 --> 00:36:57.830
where it kind of belongs.

00:37:03.970 --> 00:37:16.130
Times G, always
forgetting G. So we're

00:37:16.130 --> 00:37:19.840
just following the
golden way here,

00:37:19.840 --> 00:37:23.130
plugging in an exponential
and seeing what happens,

00:37:23.130 --> 00:37:27.240
and what happens is pretty nice.

00:37:27.240 --> 00:37:29.300
We now know what
the solutions are.

00:37:29.300 --> 00:37:31.000
There'll be two solutions.

00:37:31.000 --> 00:37:33.670
It's a linear problem,
so the solutions

00:37:33.670 --> 00:37:35.730
will be exponential in t.

00:37:38.840 --> 00:37:42.080
The solutions will
have a plus or minus i,

00:37:42.080 --> 00:37:44.280
because it's a minus sign.

00:37:44.280 --> 00:37:46.960
So G -- can I write it this way?

00:37:46.960 --> 00:37:52.940
G of -- the solution to this,
or the two exponential solutions

00:37:52.940 --> 00:37:57.930
will be e to the
plus or minus --

00:37:57.930 --> 00:38:00.520
now I'm going to take
this square root --

00:38:00.520 --> 00:38:06.810
i times c times the
square root of this.

00:38:06.810 --> 00:38:08.480
Actually, that's not so hard.

00:38:08.480 --> 00:38:11.440
2 -- that was our
point, wasn't it?

00:38:11.440 --> 00:38:18.960
Sorry, I forgot about that --
sine k delta x over 2 divided

00:38:18.960 --> 00:38:23.550
by delta x -- and look,
here's something nice.

00:38:23.550 --> 00:38:25.780
Bring the 2 down there.

00:38:28.570 --> 00:38:31.060
Make it 1/2 of the denominator.

00:38:31.060 --> 00:38:35.100
Do you see what
this expression is?

00:38:35.100 --> 00:38:38.920
Actually, do you know its name?

00:38:38.920 --> 00:38:42.310
It's the sinc function.

00:38:42.310 --> 00:38:45.040
It's the sinc function, right?

00:38:45.040 --> 00:38:52.060
And for very small delta
x -- oh, times t, right?

00:38:52.060 --> 00:38:55.000
It just -- we just
have an exponential.

00:38:55.000 --> 00:38:56.500
Of course we do.

00:38:56.500 --> 00:39:00.410
This was a constant
coefficient problem in t,

00:39:00.410 --> 00:39:04.940
and a second order, so
I had two exponentials,

00:39:04.940 --> 00:39:08.290
and I just took the square
root of that coefficient,

00:39:08.290 --> 00:39:10.410
put it there, times t.

00:39:10.410 --> 00:39:11.950
Absolutely straightforward.

00:39:16.750 --> 00:39:20.050
This quantity is
the key one and this

00:39:20.050 --> 00:39:28.970
is the quantity which, for
small k or small delta x,

00:39:28.970 --> 00:39:32.060
is approximately what?

00:39:32.060 --> 00:39:37.165
So if k and delta x are
small, or if even just delta x

00:39:37.165 --> 00:39:40.560
is small, what does this
sinc function look like?

00:39:40.560 --> 00:39:48.030
What is that ratio
approximately, when k is small?

00:39:48.030 --> 00:39:51.400
What does the sine of
theta look like when

00:39:51.400 --> 00:39:54.280
theta is a small angle?

00:39:54.280 --> 00:39:57.460
Looks like theta, right?

00:39:57.460 --> 00:40:00.200
Sine theta is about theta.

00:40:00.200 --> 00:40:04.070
So this thing is about k delta
x over 2 divided by delta --

00:40:04.070 --> 00:40:15.650
it's k, so it's approximately
k for small delta x, let's say.

00:40:15.650 --> 00:40:18.550
Delta x is small.

00:40:18.550 --> 00:40:23.370
That's the key thing to know
about the sinc function,

00:40:23.370 --> 00:40:27.730
that it begins by approximating
the sine function,

00:40:27.730 --> 00:40:32.390
but then of course, when k delta
x gets large, it wanders away.

00:40:32.390 --> 00:40:33.850
It's not linear in k.

00:40:33.850 --> 00:40:37.620
See, it starts out
practically linear in k,

00:40:37.620 --> 00:40:40.480
and that k is
exactly the right k.

00:40:40.480 --> 00:40:42.220
That's the right factor.

00:40:42.220 --> 00:40:43.400
That's the k here.

00:40:47.680 --> 00:40:49.280
But in the
differential equation,

00:40:49.280 --> 00:40:53.930
it stayed k and in the
difference equation,

00:40:53.930 --> 00:41:02.790
for k delta x moving away,
it changes and that's why --

00:41:02.790 --> 00:41:06.380
of course, that's the
source of the error.

00:41:06.380 --> 00:41:09.790
We're seeing now why
the method is probably

00:41:09.790 --> 00:41:11.720
second-order accuracy.

00:41:11.720 --> 00:41:16.140
We know that these second
differences are second --

00:41:16.140 --> 00:41:18.130
give second-order accuracy.

00:41:18.130 --> 00:41:21.050
This would be -- if I
looked at the next term,

00:41:21.050 --> 00:41:23.650
what's the next
term in sine theta?

00:41:23.650 --> 00:41:26.750
Sine theta starts
out theta and then,

00:41:26.750 --> 00:41:28.440
what's the term after that?

00:41:31.810 --> 00:41:38.480
Everybody's Taylor series or --
[UNINTELLIGIBLE] theta cubed,

00:41:38.480 --> 00:41:40.880
it's a theta cubed term.

00:41:40.880 --> 00:41:45.490
Exactly, it's a minus theta
cubed over 6, three factorial,

00:41:45.490 --> 00:41:47.700
but it's a theta cubed term.

00:41:47.700 --> 00:41:53.110
And so the theta gave
us the right thing

00:41:53.110 --> 00:41:55.580
and then two more
powers of theta

00:41:55.580 --> 00:41:58.070
will give us a
second-order error, right?

00:42:00.880 --> 00:42:08.600
I better move since -- so that's
the story for semidiscrete.

00:42:08.600 --> 00:42:12.620
Semidiscrete produced
a pure exponential,

00:42:12.620 --> 00:42:21.360
but with a phase
factor, you could say,

00:42:21.360 --> 00:42:23.990
that wasn't linear in k
where the real one was.

00:42:26.590 --> 00:42:33.350
Now, what about -- let me
move up to that board above,

00:42:33.350 --> 00:42:38.970
where now we're going to have
-- we have it's discrete in time

00:42:38.970 --> 00:42:43.394
as well, so we're going
to have single steps.

00:42:43.394 --> 00:42:44.810
What's going to
be the difference?

00:42:47.580 --> 00:42:50.530
Again, I'm going
to try -- you know,

00:42:50.530 --> 00:42:56.920
I only have one idea here
-- U_(j, n) will be some G,

00:42:56.920 --> 00:43:04.750
some growth factor, times
e to the i*j*k delta x.

00:43:04.750 --> 00:43:09.740
The same -- I'm going to
try an e to the i*k*x,

00:43:09.740 --> 00:43:14.830
and in the space variable, it
will be G. And after n steps,

00:43:14.830 --> 00:43:17.730
it'll be G n times.

00:43:17.730 --> 00:43:19.910
So this is the discrete, right?

00:43:19.910 --> 00:43:25.400
This is the ansatz,
to use a fancy word.

00:43:25.400 --> 00:43:26.590
This is what you plug in.

00:43:29.550 --> 00:43:31.800
Little crazy to use
the word ansatz, which

00:43:31.800 --> 00:43:36.110
sounds fancy and the word
plug, which is far from fancy.

00:43:36.110 --> 00:43:40.460
I should say substitute.

00:43:40.460 --> 00:43:41.560
Substitute in it.

00:43:41.560 --> 00:43:43.710
All right.

00:43:43.710 --> 00:43:46.990
Do we know what the
process is going to do?

00:43:46.990 --> 00:43:51.900
When I plug it in -- sorry,
substitute it in on the left,

00:43:51.900 --> 00:43:59.710
we get -- and I'm going to
cancel this from every term --

00:43:59.710 --> 00:44:03.090
so all I'm interested
in is the --

00:44:03.090 --> 00:44:05.780
maybe I'll cancel
G to the n minus 1.

00:44:05.780 --> 00:44:08.090
So let me write down what I get.

00:44:08.090 --> 00:44:10.580
This is going to give me
-- in the time direction,

00:44:10.580 --> 00:44:19.080
I'll have a G squared minus a 2G
plus a 1 over delta t squared,

00:44:19.080 --> 00:44:23.650
and in the space direction,
which is at the centered time,

00:44:23.650 --> 00:44:28.330
so it's going to multiply a
G, it's going to be my same,

00:44:28.330 --> 00:44:29.620
my very same thing.

00:44:29.620 --> 00:44:33.260
I could maybe give
it a name here.

00:44:33.260 --> 00:44:35.960
I don't know whether --
should I give it a name?

00:44:35.960 --> 00:44:37.770
I know what it is
anyway, because it's

00:44:37.770 --> 00:44:42.510
the same thing that I had
in the semidiscrete method.

00:44:42.510 --> 00:44:49.130
It's this -- let's see
what it looked like.

00:44:49.130 --> 00:44:57.980
At this point, it was --
look, let's do one thing.

00:44:57.980 --> 00:45:02.010
Let me get this delta t squared
up there times the c squared

00:45:02.010 --> 00:45:03.670
divided by the delta x squared.

00:45:03.670 --> 00:45:08.810
Let me just clean
up those constants,

00:45:08.810 --> 00:45:13.250
so that when I multiply up
by the delta t squared times

00:45:13.250 --> 00:45:18.640
the c squared divided by the
delta x squared, what's that?

00:45:18.640 --> 00:45:24.030
c delta t over delta x squared
is my old ratio, the Courant

00:45:24.030 --> 00:45:31.020
number r, squared, and
then it's this times G.

00:45:31.020 --> 00:45:33.980
So this will all be
just exactly the same

00:45:33.980 --> 00:45:38.380
and that's what I
simplified here.

00:45:38.380 --> 00:45:43.030
Let me just leave it
as -- with a minus.

00:45:43.030 --> 00:45:48.370
Let me remember that I did take
a minus so that I could write

00:45:48.370 --> 00:45:58.400
it as 2 minus 2 cosine of k
delta x times G. Is that --

00:45:58.400 --> 00:46:01.950
I really think I have kept
track of everything here.

00:46:01.950 --> 00:46:07.640
The r squared coming from
all this stuff, the minus 2

00:46:07.640 --> 00:46:11.560
coming here and the plus 2
cosine coming from there.

00:46:11.560 --> 00:46:12.370
You OK with that?

00:46:16.670 --> 00:46:20.510
But there's one new
ingredient here.

00:46:20.510 --> 00:46:27.240
Again, G to the n -- I cancelled
G to the n minus 1 times this

00:46:27.240 --> 00:46:30.340
from every term.

00:46:30.340 --> 00:46:33.850
So the new ingredient, that we
just have five minutes to deal

00:46:33.850 --> 00:46:39.530
with, is the fact
that we have second --

00:46:39.530 --> 00:46:42.760
G squared just showed up.

00:46:42.760 --> 00:46:44.330
So why did G squared show up?

00:46:44.330 --> 00:46:52.000
Because it's a multistep
method and therefore,

00:46:52.000 --> 00:46:53.240
I've got two G's.

00:46:53.240 --> 00:46:54.320
Of course.

00:46:54.320 --> 00:46:57.690
I had two G's in all
these other cases

00:46:57.690 --> 00:46:59.440
because I had second
derivatives and now I

00:46:59.440 --> 00:47:01.160
have second differences.

00:47:01.160 --> 00:47:04.180
So I have two G's, so I
have to solve for G --

00:47:04.180 --> 00:47:07.220
and what is stability
going to depend on?

00:47:07.220 --> 00:47:11.760
Stability is going
to be whether G --

00:47:11.760 --> 00:47:14.090
both G's, because there
are two of them now --

00:47:14.090 --> 00:47:15.750
are less than or equal to 1.

00:47:15.750 --> 00:47:18.510
That's what I have to check
and that's the equation.

00:47:22.490 --> 00:47:24.610
What do we figure?

00:47:24.610 --> 00:47:30.160
We figure that if r is pretty
big -- if r is big, no way.

00:47:30.160 --> 00:47:34.770
If r is big, the
Courant test will fail

00:47:34.770 --> 00:47:37.040
and stability will fail.

00:47:37.040 --> 00:47:40.050
But if r is small,
then I expect --

00:47:40.050 --> 00:47:42.590
I have a right to
hope for stability.

00:47:42.590 --> 00:47:45.500
So it's going to
be the size of r.

00:47:45.500 --> 00:47:48.370
So I just have to -- I've
got this quadratic equation.

00:47:48.370 --> 00:47:50.530
I'm going to bring
this thing over here.

00:47:50.530 --> 00:47:56.520
I'm going to write this as
G squared minus 2a*G plus 1

00:47:56.520 --> 00:48:01.860
equals 0, where a is this
quantity -- So I had minus 2a,

00:48:01.860 --> 00:48:08.240
so a is a 1 from there, and when
I bring this over to the other

00:48:08.240 --> 00:48:13.810
side, it's going to be a plus
r squared -- factoring out --

00:48:13.810 --> 00:48:16.000
notice the 2 is everywhere.

00:48:16.000 --> 00:48:19.190
So I put the 2 here.

00:48:19.190 --> 00:48:23.460
The a comes from the 1
there and from this times

00:48:23.460 --> 00:48:30.670
the r squared 1 plus r squared
minus r squared cos k delta x.

00:48:39.380 --> 00:48:45.560
I'm just doing algebra and
it's coming out nicely.

00:48:45.560 --> 00:48:47.510
It's coming out
to a nice equation

00:48:47.510 --> 00:48:51.080
here with a slightly
messy expression for a,

00:48:51.080 --> 00:48:57.730
but now that I've named this
quantity a, I can solve this.

00:48:57.730 --> 00:48:59.120
So what's the solution?

00:48:59.120 --> 00:49:07.430
I remember the quadratic formula
and I get G as 1, I think,

00:49:07.430 --> 00:49:13.450
plus or minus the square
root of 1 minus a squared.

00:49:16.010 --> 00:49:24.280
That's G. Oh, maybe this
is an a; probably is.

00:49:24.280 --> 00:49:31.450
I guess the quadratic equation
takes a little memorizing,

00:49:31.450 --> 00:49:34.780
but I guess the first point
is that that coefficient shows

00:49:34.780 --> 00:49:38.940
up there and then the
square root that we know.

00:49:41.550 --> 00:49:42.380
So what's up?

00:49:47.440 --> 00:49:50.030
Again, none of this is deep.

00:49:50.030 --> 00:49:56.330
I'm just following
my one-way path.

00:49:56.330 --> 00:49:58.290
Check stability.

00:49:58.290 --> 00:50:02.140
Check the size of G.
Get an equation for G.

00:50:02.140 --> 00:50:06.970
Get a formula for
G and look at it.

00:50:06.970 --> 00:50:12.010
So a is some positive
number and the key

00:50:12.010 --> 00:50:15.790
is going to be whether
a is bigger than 1

00:50:15.790 --> 00:50:17.950
or smaller than 1.

00:50:17.950 --> 00:50:25.160
If a is -- is that right, 1
minus a squared or should that

00:50:25.160 --> 00:50:28.760
be a squared minus 1?

00:50:28.760 --> 00:50:30.150
Is it a squared minus 1?

00:50:32.780 --> 00:50:36.080
Professors are not responsible
for the quadratic formula

00:50:36.080 --> 00:50:41.450
because we proved that we
could do it in third grade

00:50:41.450 --> 00:50:44.110
and lost it since.

00:50:44.110 --> 00:50:46.370
I guess it's right.

00:50:46.370 --> 00:50:49.050
Is that right?

00:50:49.050 --> 00:50:52.150
Because look, here's the story.

00:50:52.150 --> 00:50:55.350
Suppose a is bigger than 1.

00:50:55.350 --> 00:50:59.440
Suppose -- I'm really looking
at the roots of this equation.

00:50:59.440 --> 00:51:01.810
Notice, by the way, the
roots of that equation

00:51:01.810 --> 00:51:04.020
multiply to give 1.

00:51:04.020 --> 00:51:07.240
So I'm on the edge here.

00:51:07.240 --> 00:51:14.220
Either both roots have size 1 or
one of those roots is too big.

00:51:14.220 --> 00:51:17.650
The test is going to be, is
a greater than 1? a greater

00:51:17.650 --> 00:51:28.020
than 1 will be unstable. a
less than 1 will be stable

00:51:28.020 --> 00:51:35.420
and I'll connect a less
than 1 to r less than 1.

00:51:35.420 --> 00:51:39.330
That will give me r less than 1.

00:51:39.330 --> 00:51:39.830
All right.

00:51:39.830 --> 00:51:44.990
I've given away the result
because time is pressing.

00:51:44.990 --> 00:51:49.760
Let me just take the
remaining time to see this.

00:51:49.760 --> 00:51:53.300
Suppose a is bigger than 1.

00:51:53.300 --> 00:51:55.520
I'm just looking at the
roots of this equation

00:51:55.520 --> 00:51:56.820
and here they are.

00:51:56.820 --> 00:52:03.190
If a is bigger than 1, like 2,
I have 2 plus square root of 3,

00:52:03.190 --> 00:52:05.470
I'm way up, right?

00:52:05.470 --> 00:52:07.990
I'm bigger than 1, no question.

00:52:07.990 --> 00:52:11.550
Suppose a is less than 1.

00:52:11.550 --> 00:52:14.420
Suppose a is 1/2.

00:52:14.420 --> 00:52:19.880
Then I have 1/2 plus or minus
the square root of -- what?

00:52:19.880 --> 00:52:21.280
What's up here?

00:52:21.280 --> 00:52:28.440
If a is smaller than 1, this is
negative and if it's negative,

00:52:28.440 --> 00:52:31.800
its square root is imaginary.

00:52:31.800 --> 00:52:33.510
So this is good.

00:52:33.510 --> 00:52:39.200
I have a real part and
then an imaginary part

00:52:39.200 --> 00:52:43.070
and then on some magic
little bit of board,

00:52:43.070 --> 00:52:44.650
I'm going to add their squares.

00:52:44.650 --> 00:52:50.240
So I just want to take the real
parts squared and the imaginary

00:52:50.240 --> 00:52:54.230
part squared -- now the
imaginary part is going to be 1

00:52:54.230 --> 00:53:00.090
minus a squared because
when I bring out an i,

00:53:00.090 --> 00:53:04.310
then I have a 1 minus a squared
there and when I add them,

00:53:04.310 --> 00:53:06.850
I get 1.

00:53:06.850 --> 00:53:09.810
So let me just say
again what it is.

00:53:09.810 --> 00:53:11.880
I just figured out
what is absolute value

00:53:11.880 --> 00:53:16.010
of G squared as
real part squared

00:53:16.010 --> 00:53:19.420
and imaginary part squared
and I got the answer 1.

00:53:19.420 --> 00:53:25.620
So the conclusion is, the roots
are stable when a is below 1

00:53:25.620 --> 00:53:30.120
and I have instability
when a is above 1.

00:53:30.120 --> 00:53:34.620
Then if I track that down,
that reduces to the tests --

00:53:34.620 --> 00:53:37.700
it just happens to be
the same test on r,

00:53:37.700 --> 00:53:41.810
whether r is below 1, which
is the Courant-Friedrichs-Lewy

00:53:41.810 --> 00:53:46.120
condition, that I'm staying
inside the characteristics,

00:53:46.120 --> 00:53:50.920
or r is bigger than 1 and
I'm taking a delta t that

00:53:50.920 --> 00:53:53.540
isn't stable.

00:53:53.540 --> 00:53:56.530
I'm sorry to go
slightly over the time.

00:53:56.530 --> 00:53:58.240
Thanks for staying with me.

00:53:58.240 --> 00:54:03.130
I'll begin next time
with this staggered grid.

00:54:03.130 --> 00:54:05.470
That won't take
the whole lecture,

00:54:05.470 --> 00:54:10.680
but it's worth knowing because
we see staggered grids in many

00:54:10.680 --> 00:54:13.210
of the best methods.

00:54:13.210 --> 00:54:13.760
Thanks.

00:54:13.760 --> 00:54:17.510
Have a good weekend and I guess
it's Tuesday rather than Monday

00:54:17.510 --> 00:54:19.940
that I see you next.